Ben Dooks | d87964c | 2008-12-12 00:24:30 +0000 | [diff] [blame] | 1 | |
| 2 | /* linux/arch/arm/plat-s3c/pm-gpio.c |
| 3 | * |
| 4 | * Copyright 2008 Openmoko, Inc. |
| 5 | * Copyright 2008 Simtec Electronics |
| 6 | * Ben Dooks <ben@simtec.co.uk> |
| 7 | * http://armlinux.simtec.co.uk/ |
| 8 | * |
| 9 | * S3C series GPIO PM code |
| 10 | * |
| 11 | * This program is free software; you can redistribute it and/or modify |
| 12 | * it under the terms of the GNU General Public License version 2 as |
| 13 | * published by the Free Software Foundation. |
| 14 | */ |
| 15 | |
| 16 | #include <linux/kernel.h> |
Kay Sievers | edbaa60 | 2011-12-21 16:26:03 -0800 | [diff] [blame] | 17 | #include <linux/device.h> |
Ben Dooks | d87964c | 2008-12-12 00:24:30 +0000 | [diff] [blame] | 18 | #include <linux/init.h> |
| 19 | #include <linux/io.h> |
| 20 | #include <linux/gpio.h> |
| 21 | |
Linus Walleij | b0161ca | 2014-01-14 14:24:24 +0100 | [diff] [blame] | 22 | #include <mach/gpio-samsung.h> |
Sachin Kamat | 785acec | 2014-01-15 14:31:29 +0530 | [diff] [blame] | 23 | |
Ben Dooks | e856bb1 | 2010-01-19 17:14:46 +0900 | [diff] [blame] | 24 | #include <plat/gpio-core.h> |
Ben Dooks | d87964c | 2008-12-12 00:24:30 +0000 | [diff] [blame] | 25 | #include <plat/pm.h> |
| 26 | |
| 27 | /* PM GPIO helpers */ |
| 28 | |
| 29 | #define OFFS_CON (0x00) |
| 30 | #define OFFS_DAT (0x04) |
| 31 | #define OFFS_UP (0x08) |
| 32 | |
Kukjin Kim | 782d8a3 | 2011-08-30 20:47:32 +0900 | [diff] [blame] | 33 | static void samsung_gpio_pm_1bit_save(struct samsung_gpio_chip *chip) |
Ben Dooks | d87964c | 2008-12-12 00:24:30 +0000 | [diff] [blame] | 34 | { |
| 35 | chip->pm_save[0] = __raw_readl(chip->base + OFFS_CON); |
| 36 | chip->pm_save[1] = __raw_readl(chip->base + OFFS_DAT); |
| 37 | } |
| 38 | |
Kukjin Kim | 782d8a3 | 2011-08-30 20:47:32 +0900 | [diff] [blame] | 39 | static void samsung_gpio_pm_1bit_resume(struct samsung_gpio_chip *chip) |
Ben Dooks | d87964c | 2008-12-12 00:24:30 +0000 | [diff] [blame] | 40 | { |
| 41 | void __iomem *base = chip->base; |
| 42 | u32 old_gpcon = __raw_readl(base + OFFS_CON); |
| 43 | u32 old_gpdat = __raw_readl(base + OFFS_DAT); |
| 44 | u32 gps_gpcon = chip->pm_save[0]; |
| 45 | u32 gps_gpdat = chip->pm_save[1]; |
| 46 | u32 gpcon; |
| 47 | |
| 48 | /* GPACON only has one bit per control / data and no PULLUPs. |
| 49 | * GPACON[x] = 0 => Output, 1 => SFN */ |
| 50 | |
| 51 | /* first set all SFN bits to SFN */ |
| 52 | |
| 53 | gpcon = old_gpcon | gps_gpcon; |
| 54 | __raw_writel(gpcon, base + OFFS_CON); |
| 55 | |
| 56 | /* now set all the other bits */ |
| 57 | |
| 58 | __raw_writel(gps_gpdat, base + OFFS_DAT); |
| 59 | __raw_writel(gps_gpcon, base + OFFS_CON); |
| 60 | |
| 61 | S3C_PMDBG("%s: CON %08x => %08x, DAT %08x => %08x\n", |
| 62 | chip->chip.label, old_gpcon, gps_gpcon, old_gpdat, gps_gpdat); |
| 63 | } |
| 64 | |
Kukjin Kim | 782d8a3 | 2011-08-30 20:47:32 +0900 | [diff] [blame] | 65 | struct samsung_gpio_pm samsung_gpio_pm_1bit = { |
| 66 | .save = samsung_gpio_pm_1bit_save, |
| 67 | .resume = samsung_gpio_pm_1bit_resume, |
Ben Dooks | d87964c | 2008-12-12 00:24:30 +0000 | [diff] [blame] | 68 | }; |
| 69 | |
Kukjin Kim | 782d8a3 | 2011-08-30 20:47:32 +0900 | [diff] [blame] | 70 | static void samsung_gpio_pm_2bit_save(struct samsung_gpio_chip *chip) |
Ben Dooks | d87964c | 2008-12-12 00:24:30 +0000 | [diff] [blame] | 71 | { |
| 72 | chip->pm_save[0] = __raw_readl(chip->base + OFFS_CON); |
| 73 | chip->pm_save[1] = __raw_readl(chip->base + OFFS_DAT); |
| 74 | chip->pm_save[2] = __raw_readl(chip->base + OFFS_UP); |
| 75 | } |
| 76 | |
| 77 | /* Test whether the given masked+shifted bits of an GPIO configuration |
| 78 | * are one of the SFN (special function) modes. */ |
| 79 | |
| 80 | static inline int is_sfn(unsigned long con) |
| 81 | { |
| 82 | return con >= 2; |
| 83 | } |
| 84 | |
| 85 | /* Test if the given masked+shifted GPIO configuration is an input */ |
| 86 | |
| 87 | static inline int is_in(unsigned long con) |
| 88 | { |
| 89 | return con == 0; |
| 90 | } |
| 91 | |
| 92 | /* Test if the given masked+shifted GPIO configuration is an output */ |
| 93 | |
| 94 | static inline int is_out(unsigned long con) |
| 95 | { |
| 96 | return con == 1; |
| 97 | } |
| 98 | |
| 99 | /** |
Kukjin Kim | 782d8a3 | 2011-08-30 20:47:32 +0900 | [diff] [blame] | 100 | * samsung_gpio_pm_2bit_resume() - restore the given GPIO bank |
Ben Dooks | d87964c | 2008-12-12 00:24:30 +0000 | [diff] [blame] | 101 | * @chip: The chip information to resume. |
| 102 | * |
| 103 | * Restore one of the GPIO banks that was saved during suspend. This is |
| 104 | * not as simple as once thought, due to the possibility of glitches |
| 105 | * from the order that the CON and DAT registers are set in. |
| 106 | * |
| 107 | * The three states the pin can be are {IN,OUT,SFN} which gives us 9 |
| 108 | * combinations of changes to check. Three of these, if the pin stays |
| 109 | * in the same configuration can be discounted. This leaves us with |
| 110 | * the following: |
| 111 | * |
| 112 | * { IN => OUT } Change DAT first |
| 113 | * { IN => SFN } Change CON first |
| 114 | * { OUT => SFN } Change CON first, so new data will not glitch |
| 115 | * { OUT => IN } Change CON first, so new data will not glitch |
| 116 | * { SFN => IN } Change CON first |
| 117 | * { SFN => OUT } Change DAT first, so new data will not glitch [1] |
| 118 | * |
| 119 | * We do not currently deal with the UP registers as these control |
| 120 | * weak resistors, so a small delay in change should not need to bring |
| 121 | * these into the calculations. |
| 122 | * |
| 123 | * [1] this assumes that writing to a pin DAT whilst in SFN will set the |
| 124 | * state for when it is next output. |
| 125 | */ |
Kukjin Kim | 782d8a3 | 2011-08-30 20:47:32 +0900 | [diff] [blame] | 126 | static void samsung_gpio_pm_2bit_resume(struct samsung_gpio_chip *chip) |
Ben Dooks | d87964c | 2008-12-12 00:24:30 +0000 | [diff] [blame] | 127 | { |
| 128 | void __iomem *base = chip->base; |
| 129 | u32 old_gpcon = __raw_readl(base + OFFS_CON); |
| 130 | u32 old_gpdat = __raw_readl(base + OFFS_DAT); |
| 131 | u32 gps_gpcon = chip->pm_save[0]; |
| 132 | u32 gps_gpdat = chip->pm_save[1]; |
| 133 | u32 gpcon, old, new, mask; |
| 134 | u32 change_mask = 0x0; |
| 135 | int nr; |
| 136 | |
| 137 | /* restore GPIO pull-up settings */ |
| 138 | __raw_writel(chip->pm_save[2], base + OFFS_UP); |
| 139 | |
| 140 | /* Create a change_mask of all the items that need to have |
| 141 | * their CON value changed before their DAT value, so that |
| 142 | * we minimise the work between the two settings. |
| 143 | */ |
| 144 | |
| 145 | for (nr = 0, mask = 0x03; nr < 32; nr += 2, mask <<= 2) { |
| 146 | old = (old_gpcon & mask) >> nr; |
| 147 | new = (gps_gpcon & mask) >> nr; |
| 148 | |
| 149 | /* If there is no change, then skip */ |
| 150 | |
| 151 | if (old == new) |
| 152 | continue; |
| 153 | |
| 154 | /* If both are special function, then skip */ |
| 155 | |
| 156 | if (is_sfn(old) && is_sfn(new)) |
| 157 | continue; |
| 158 | |
| 159 | /* Change is IN => OUT, do not change now */ |
| 160 | |
| 161 | if (is_in(old) && is_out(new)) |
| 162 | continue; |
| 163 | |
| 164 | /* Change is SFN => OUT, do not change now */ |
| 165 | |
| 166 | if (is_sfn(old) && is_out(new)) |
| 167 | continue; |
| 168 | |
| 169 | /* We should now be at the case of IN=>SFN, |
| 170 | * OUT=>SFN, OUT=>IN, SFN=>IN. */ |
| 171 | |
| 172 | change_mask |= mask; |
| 173 | } |
| 174 | |
| 175 | |
| 176 | /* Write the new CON settings */ |
| 177 | |
| 178 | gpcon = old_gpcon & ~change_mask; |
| 179 | gpcon |= gps_gpcon & change_mask; |
| 180 | |
| 181 | __raw_writel(gpcon, base + OFFS_CON); |
| 182 | |
| 183 | /* Now change any items that require DAT,CON */ |
| 184 | |
| 185 | __raw_writel(gps_gpdat, base + OFFS_DAT); |
| 186 | __raw_writel(gps_gpcon, base + OFFS_CON); |
| 187 | |
| 188 | S3C_PMDBG("%s: CON %08x => %08x, DAT %08x => %08x\n", |
| 189 | chip->chip.label, old_gpcon, gps_gpcon, old_gpdat, gps_gpdat); |
| 190 | } |
| 191 | |
Kukjin Kim | 782d8a3 | 2011-08-30 20:47:32 +0900 | [diff] [blame] | 192 | struct samsung_gpio_pm samsung_gpio_pm_2bit = { |
| 193 | .save = samsung_gpio_pm_2bit_save, |
| 194 | .resume = samsung_gpio_pm_2bit_resume, |
Ben Dooks | d87964c | 2008-12-12 00:24:30 +0000 | [diff] [blame] | 195 | }; |
| 196 | |
Tomasz Figa | d78c16c | 2014-07-02 19:40:44 +0200 | [diff] [blame] | 197 | #if defined(CONFIG_ARCH_S3C64XX) |
Kukjin Kim | 782d8a3 | 2011-08-30 20:47:32 +0900 | [diff] [blame] | 198 | static void samsung_gpio_pm_4bit_save(struct samsung_gpio_chip *chip) |
Ben Dooks | d87964c | 2008-12-12 00:24:30 +0000 | [diff] [blame] | 199 | { |
| 200 | chip->pm_save[1] = __raw_readl(chip->base + OFFS_CON); |
| 201 | chip->pm_save[2] = __raw_readl(chip->base + OFFS_DAT); |
| 202 | chip->pm_save[3] = __raw_readl(chip->base + OFFS_UP); |
| 203 | |
| 204 | if (chip->chip.ngpio > 8) |
| 205 | chip->pm_save[0] = __raw_readl(chip->base - 4); |
| 206 | } |
| 207 | |
Kukjin Kim | 782d8a3 | 2011-08-30 20:47:32 +0900 | [diff] [blame] | 208 | static u32 samsung_gpio_pm_4bit_mask(u32 old_gpcon, u32 gps_gpcon) |
Ben Dooks | d87964c | 2008-12-12 00:24:30 +0000 | [diff] [blame] | 209 | { |
| 210 | u32 old, new, mask; |
| 211 | u32 change_mask = 0x0; |
| 212 | int nr; |
| 213 | |
| 214 | for (nr = 0, mask = 0x0f; nr < 16; nr += 4, mask <<= 4) { |
| 215 | old = (old_gpcon & mask) >> nr; |
| 216 | new = (gps_gpcon & mask) >> nr; |
| 217 | |
| 218 | /* If there is no change, then skip */ |
| 219 | |
| 220 | if (old == new) |
| 221 | continue; |
| 222 | |
| 223 | /* If both are special function, then skip */ |
| 224 | |
| 225 | if (is_sfn(old) && is_sfn(new)) |
| 226 | continue; |
| 227 | |
| 228 | /* Change is IN => OUT, do not change now */ |
| 229 | |
| 230 | if (is_in(old) && is_out(new)) |
| 231 | continue; |
| 232 | |
| 233 | /* Change is SFN => OUT, do not change now */ |
| 234 | |
| 235 | if (is_sfn(old) && is_out(new)) |
| 236 | continue; |
| 237 | |
| 238 | /* We should now be at the case of IN=>SFN, |
| 239 | * OUT=>SFN, OUT=>IN, SFN=>IN. */ |
| 240 | |
| 241 | change_mask |= mask; |
| 242 | } |
| 243 | |
| 244 | return change_mask; |
| 245 | } |
| 246 | |
Kukjin Kim | 782d8a3 | 2011-08-30 20:47:32 +0900 | [diff] [blame] | 247 | static void samsung_gpio_pm_4bit_con(struct samsung_gpio_chip *chip, int index) |
Ben Dooks | d87964c | 2008-12-12 00:24:30 +0000 | [diff] [blame] | 248 | { |
| 249 | void __iomem *con = chip->base + (index * 4); |
| 250 | u32 old_gpcon = __raw_readl(con); |
| 251 | u32 gps_gpcon = chip->pm_save[index + 1]; |
| 252 | u32 gpcon, mask; |
| 253 | |
Kukjin Kim | 782d8a3 | 2011-08-30 20:47:32 +0900 | [diff] [blame] | 254 | mask = samsung_gpio_pm_4bit_mask(old_gpcon, gps_gpcon); |
Ben Dooks | d87964c | 2008-12-12 00:24:30 +0000 | [diff] [blame] | 255 | |
| 256 | gpcon = old_gpcon & ~mask; |
| 257 | gpcon |= gps_gpcon & mask; |
| 258 | |
| 259 | __raw_writel(gpcon, con); |
| 260 | } |
| 261 | |
Kukjin Kim | 782d8a3 | 2011-08-30 20:47:32 +0900 | [diff] [blame] | 262 | static void samsung_gpio_pm_4bit_resume(struct samsung_gpio_chip *chip) |
Ben Dooks | d87964c | 2008-12-12 00:24:30 +0000 | [diff] [blame] | 263 | { |
| 264 | void __iomem *base = chip->base; |
| 265 | u32 old_gpcon[2]; |
| 266 | u32 old_gpdat = __raw_readl(base + OFFS_DAT); |
| 267 | u32 gps_gpdat = chip->pm_save[2]; |
| 268 | |
| 269 | /* First, modify the CON settings */ |
| 270 | |
| 271 | old_gpcon[0] = 0; |
| 272 | old_gpcon[1] = __raw_readl(base + OFFS_CON); |
| 273 | |
Kukjin Kim | 782d8a3 | 2011-08-30 20:47:32 +0900 | [diff] [blame] | 274 | samsung_gpio_pm_4bit_con(chip, 0); |
Ben Dooks | d87964c | 2008-12-12 00:24:30 +0000 | [diff] [blame] | 275 | if (chip->chip.ngpio > 8) { |
| 276 | old_gpcon[0] = __raw_readl(base - 4); |
Kukjin Kim | 782d8a3 | 2011-08-30 20:47:32 +0900 | [diff] [blame] | 277 | samsung_gpio_pm_4bit_con(chip, -1); |
Ben Dooks | d87964c | 2008-12-12 00:24:30 +0000 | [diff] [blame] | 278 | } |
| 279 | |
| 280 | /* Now change the configurations that require DAT,CON */ |
| 281 | |
| 282 | __raw_writel(chip->pm_save[2], base + OFFS_DAT); |
| 283 | __raw_writel(chip->pm_save[1], base + OFFS_CON); |
| 284 | if (chip->chip.ngpio > 8) |
| 285 | __raw_writel(chip->pm_save[0], base - 4); |
| 286 | |
| 287 | __raw_writel(chip->pm_save[2], base + OFFS_DAT); |
| 288 | __raw_writel(chip->pm_save[3], base + OFFS_UP); |
| 289 | |
| 290 | if (chip->chip.ngpio > 8) { |
| 291 | S3C_PMDBG("%s: CON4 %08x,%08x => %08x,%08x, DAT %08x => %08x\n", |
| 292 | chip->chip.label, old_gpcon[0], old_gpcon[1], |
| 293 | __raw_readl(base - 4), |
| 294 | __raw_readl(base + OFFS_CON), |
| 295 | old_gpdat, gps_gpdat); |
| 296 | } else |
| 297 | S3C_PMDBG("%s: CON4 %08x => %08x, DAT %08x => %08x\n", |
| 298 | chip->chip.label, old_gpcon[1], |
| 299 | __raw_readl(base + OFFS_CON), |
| 300 | old_gpdat, gps_gpdat); |
| 301 | } |
| 302 | |
Kukjin Kim | 782d8a3 | 2011-08-30 20:47:32 +0900 | [diff] [blame] | 303 | struct samsung_gpio_pm samsung_gpio_pm_4bit = { |
| 304 | .save = samsung_gpio_pm_4bit_save, |
| 305 | .resume = samsung_gpio_pm_4bit_resume, |
Ben Dooks | d87964c | 2008-12-12 00:24:30 +0000 | [diff] [blame] | 306 | }; |
Tomasz Figa | d78c16c | 2014-07-02 19:40:44 +0200 | [diff] [blame] | 307 | #endif /* CONFIG_ARCH_S3C64XX */ |
Ben Dooks | d87964c | 2008-12-12 00:24:30 +0000 | [diff] [blame] | 308 | |
| 309 | /** |
Kukjin Kim | 782d8a3 | 2011-08-30 20:47:32 +0900 | [diff] [blame] | 310 | * samsung_pm_save_gpio() - save gpio chip data for suspend |
Ben Dooks | d87964c | 2008-12-12 00:24:30 +0000 | [diff] [blame] | 311 | * @ourchip: The chip for suspend. |
| 312 | */ |
Kukjin Kim | 782d8a3 | 2011-08-30 20:47:32 +0900 | [diff] [blame] | 313 | static void samsung_pm_save_gpio(struct samsung_gpio_chip *ourchip) |
Ben Dooks | d87964c | 2008-12-12 00:24:30 +0000 | [diff] [blame] | 314 | { |
Kukjin Kim | 782d8a3 | 2011-08-30 20:47:32 +0900 | [diff] [blame] | 315 | struct samsung_gpio_pm *pm = ourchip->pm; |
Ben Dooks | d87964c | 2008-12-12 00:24:30 +0000 | [diff] [blame] | 316 | |
| 317 | if (pm == NULL || pm->save == NULL) |
| 318 | S3C_PMDBG("%s: no pm for %s\n", __func__, ourchip->chip.label); |
| 319 | else |
| 320 | pm->save(ourchip); |
| 321 | } |
| 322 | |
| 323 | /** |
Kukjin Kim | 782d8a3 | 2011-08-30 20:47:32 +0900 | [diff] [blame] | 324 | * samsung_pm_save_gpios() - Save the state of the GPIO banks. |
Ben Dooks | d87964c | 2008-12-12 00:24:30 +0000 | [diff] [blame] | 325 | * |
| 326 | * For all the GPIO banks, save the state of each one ready for going |
| 327 | * into a suspend mode. |
| 328 | */ |
Kukjin Kim | 782d8a3 | 2011-08-30 20:47:32 +0900 | [diff] [blame] | 329 | void samsung_pm_save_gpios(void) |
Ben Dooks | d87964c | 2008-12-12 00:24:30 +0000 | [diff] [blame] | 330 | { |
Kukjin Kim | 782d8a3 | 2011-08-30 20:47:32 +0900 | [diff] [blame] | 331 | struct samsung_gpio_chip *ourchip; |
Ben Dooks | d87964c | 2008-12-12 00:24:30 +0000 | [diff] [blame] | 332 | unsigned int gpio_nr; |
| 333 | |
Ben Dooks | 32b6cb3 | 2010-05-18 19:07:05 +0900 | [diff] [blame] | 334 | for (gpio_nr = 0; gpio_nr < S3C_GPIO_END;) { |
Kukjin Kim | 782d8a3 | 2011-08-30 20:47:32 +0900 | [diff] [blame] | 335 | ourchip = samsung_gpiolib_getchip(gpio_nr); |
Pinkava J | 91dc74e | 2010-05-23 06:42:26 +0200 | [diff] [blame] | 336 | if (!ourchip) { |
| 337 | gpio_nr++; |
Ben Dooks | d87964c | 2008-12-12 00:24:30 +0000 | [diff] [blame] | 338 | continue; |
Pinkava J | 91dc74e | 2010-05-23 06:42:26 +0200 | [diff] [blame] | 339 | } |
Ben Dooks | d87964c | 2008-12-12 00:24:30 +0000 | [diff] [blame] | 340 | |
Kukjin Kim | 782d8a3 | 2011-08-30 20:47:32 +0900 | [diff] [blame] | 341 | samsung_pm_save_gpio(ourchip); |
Ben Dooks | d87964c | 2008-12-12 00:24:30 +0000 | [diff] [blame] | 342 | |
| 343 | S3C_PMDBG("%s: save %08x,%08x,%08x,%08x\n", |
| 344 | ourchip->chip.label, |
| 345 | ourchip->pm_save[0], |
| 346 | ourchip->pm_save[1], |
| 347 | ourchip->pm_save[2], |
| 348 | ourchip->pm_save[3]); |
| 349 | |
| 350 | gpio_nr += ourchip->chip.ngpio; |
| 351 | gpio_nr += CONFIG_S3C_GPIO_SPACE; |
| 352 | } |
| 353 | } |
| 354 | |
| 355 | /** |
Kukjin Kim | 782d8a3 | 2011-08-30 20:47:32 +0900 | [diff] [blame] | 356 | * samsung_pm_resume_gpio() - restore gpio chip data after suspend |
Ben Dooks | d87964c | 2008-12-12 00:24:30 +0000 | [diff] [blame] | 357 | * @ourchip: The suspended chip. |
| 358 | */ |
Kukjin Kim | 782d8a3 | 2011-08-30 20:47:32 +0900 | [diff] [blame] | 359 | static void samsung_pm_resume_gpio(struct samsung_gpio_chip *ourchip) |
Ben Dooks | d87964c | 2008-12-12 00:24:30 +0000 | [diff] [blame] | 360 | { |
Kukjin Kim | 782d8a3 | 2011-08-30 20:47:32 +0900 | [diff] [blame] | 361 | struct samsung_gpio_pm *pm = ourchip->pm; |
Ben Dooks | d87964c | 2008-12-12 00:24:30 +0000 | [diff] [blame] | 362 | |
| 363 | if (pm == NULL || pm->resume == NULL) |
| 364 | S3C_PMDBG("%s: no pm for %s\n", __func__, ourchip->chip.label); |
| 365 | else |
| 366 | pm->resume(ourchip); |
| 367 | } |
| 368 | |
Kukjin Kim | 782d8a3 | 2011-08-30 20:47:32 +0900 | [diff] [blame] | 369 | void samsung_pm_restore_gpios(void) |
Ben Dooks | d87964c | 2008-12-12 00:24:30 +0000 | [diff] [blame] | 370 | { |
Kukjin Kim | 782d8a3 | 2011-08-30 20:47:32 +0900 | [diff] [blame] | 371 | struct samsung_gpio_chip *ourchip; |
Ben Dooks | d87964c | 2008-12-12 00:24:30 +0000 | [diff] [blame] | 372 | unsigned int gpio_nr; |
| 373 | |
Ben Dooks | 32b6cb3 | 2010-05-18 19:07:05 +0900 | [diff] [blame] | 374 | for (gpio_nr = 0; gpio_nr < S3C_GPIO_END;) { |
Kukjin Kim | 782d8a3 | 2011-08-30 20:47:32 +0900 | [diff] [blame] | 375 | ourchip = samsung_gpiolib_getchip(gpio_nr); |
Pinkava J | 91dc74e | 2010-05-23 06:42:26 +0200 | [diff] [blame] | 376 | if (!ourchip) { |
| 377 | gpio_nr++; |
Ben Dooks | d87964c | 2008-12-12 00:24:30 +0000 | [diff] [blame] | 378 | continue; |
Pinkava J | 91dc74e | 2010-05-23 06:42:26 +0200 | [diff] [blame] | 379 | } |
Ben Dooks | d87964c | 2008-12-12 00:24:30 +0000 | [diff] [blame] | 380 | |
Kukjin Kim | 782d8a3 | 2011-08-30 20:47:32 +0900 | [diff] [blame] | 381 | samsung_pm_resume_gpio(ourchip); |
Ben Dooks | d87964c | 2008-12-12 00:24:30 +0000 | [diff] [blame] | 382 | |
| 383 | gpio_nr += ourchip->chip.ngpio; |
| 384 | gpio_nr += CONFIG_S3C_GPIO_SPACE; |
| 385 | } |
| 386 | } |