diff options
author | Tarun Kanti DebBarma <tarun.kanti@ti.com> | 2012-04-27 10:13:32 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@ti.com> | 2012-05-11 20:08:39 -0400 |
commit | c6f31c9ec264233cb6a28053a1739425b18fd581 (patch) | |
tree | ea13e28e94b655f13191fce1da5c185951e42877 /drivers/gpio/gpio-omap.c | |
parent | d13710a7e6241f1725da34004928b93a71b05508 (diff) |
gpio/omap: remove saved_fallingdetect, saved_risingdetect
Since we already have context.fallingdetect and context.risingdetect
there is no more need to have these additional fields. Also, getting
rid of extra reads associated with them.
Cc: Kevin Hilman <khilman@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: Cousson, Benoit <b-cousson@ti.com>
Cc: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Tarun Kanti DebBarma <tarun.kanti@ti.com>
Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Tested-by: Govindraj.R <govindraj.raja@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'drivers/gpio/gpio-omap.c')
-rw-r--r-- | drivers/gpio/gpio-omap.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index 4461540653a8..7d47c6e76d74 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c | |||
@@ -63,8 +63,6 @@ struct gpio_bank { | |||
63 | u32 enabled_non_wakeup_gpios; | 63 | u32 enabled_non_wakeup_gpios; |
64 | struct gpio_regs context; | 64 | struct gpio_regs context; |
65 | u32 saved_datain; | 65 | u32 saved_datain; |
66 | u32 saved_fallingdetect; | ||
67 | u32 saved_risingdetect; | ||
68 | u32 level_mask; | 66 | u32 level_mask; |
69 | u32 toggle_mask; | 67 | u32 toggle_mask; |
70 | spinlock_t lock; | 68 | spinlock_t lock; |
@@ -1244,11 +1242,9 @@ static int omap_gpio_runtime_suspend(struct device *dev) | |||
1244 | */ | 1242 | */ |
1245 | bank->saved_datain = __raw_readl(bank->base + | 1243 | bank->saved_datain = __raw_readl(bank->base + |
1246 | bank->regs->datain); | 1244 | bank->regs->datain); |
1247 | l1 = __raw_readl(bank->base + bank->regs->fallingdetect); | 1245 | l1 = bank->context.fallingdetect; |
1248 | l2 = __raw_readl(bank->base + bank->regs->risingdetect); | 1246 | l2 = bank->context.risingdetect; |
1249 | 1247 | ||
1250 | bank->saved_fallingdetect = l1; | ||
1251 | bank->saved_risingdetect = l2; | ||
1252 | l1 &= ~bank->enabled_non_wakeup_gpios; | 1248 | l1 &= ~bank->enabled_non_wakeup_gpios; |
1253 | l2 &= ~bank->enabled_non_wakeup_gpios; | 1249 | l2 &= ~bank->enabled_non_wakeup_gpios; |
1254 | 1250 | ||
@@ -1307,9 +1303,9 @@ static int omap_gpio_runtime_resume(struct device *dev) | |||
1307 | } | 1303 | } |
1308 | } | 1304 | } |
1309 | 1305 | ||
1310 | __raw_writel(bank->saved_fallingdetect, | 1306 | __raw_writel(bank->context.fallingdetect, |
1311 | bank->base + bank->regs->fallingdetect); | 1307 | bank->base + bank->regs->fallingdetect); |
1312 | __raw_writel(bank->saved_risingdetect, | 1308 | __raw_writel(bank->context.risingdetect, |
1313 | bank->base + bank->regs->risingdetect); | 1309 | bank->base + bank->regs->risingdetect); |
1314 | l = __raw_readl(bank->base + bank->regs->datain); | 1310 | l = __raw_readl(bank->base + bank->regs->datain); |
1315 | 1311 | ||
@@ -1326,14 +1322,15 @@ static int omap_gpio_runtime_resume(struct device *dev) | |||
1326 | * No need to generate IRQs for the rising edge for gpio IRQs | 1322 | * No need to generate IRQs for the rising edge for gpio IRQs |
1327 | * configured with falling edge only; and vice versa. | 1323 | * configured with falling edge only; and vice versa. |
1328 | */ | 1324 | */ |
1329 | gen0 = l & bank->saved_fallingdetect; | 1325 | gen0 = l & bank->context.fallingdetect; |
1330 | gen0 &= bank->saved_datain; | 1326 | gen0 &= bank->saved_datain; |
1331 | 1327 | ||
1332 | gen1 = l & bank->saved_risingdetect; | 1328 | gen1 = l & bank->context.risingdetect; |
1333 | gen1 &= ~(bank->saved_datain); | 1329 | gen1 &= ~(bank->saved_datain); |
1334 | 1330 | ||
1335 | /* FIXME: Consider GPIO IRQs with level detections properly! */ | 1331 | /* FIXME: Consider GPIO IRQs with level detections properly! */ |
1336 | gen = l & (~(bank->saved_fallingdetect) & ~(bank->saved_risingdetect)); | 1332 | gen = l & (~(bank->context.fallingdetect) & |
1333 | ~(bank->context.risingdetect)); | ||
1337 | /* Consider all GPIO IRQs needed to be updated */ | 1334 | /* Consider all GPIO IRQs needed to be updated */ |
1338 | gen |= gen0 | gen1; | 1335 | gen |= gen0 | gen1; |
1339 | 1336 | ||