Commit c6f31c9e authored by Tarun Kanti DebBarma's avatar Tarun Kanti DebBarma Committed by Kevin Hilman

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: default avatarTarun Kanti DebBarma <tarun.kanti@ti.com>
Reviewed-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: default avatarFelipe Balbi <balbi@ti.com>
Tested-by: default avatarGovindraj.R <govindraj.raja@ti.com>
Signed-off-by: default avatarKevin Hilman <khilman@ti.com>
parent d13710a7
...@@ -63,8 +63,6 @@ struct gpio_bank { ...@@ -63,8 +63,6 @@ struct gpio_bank {
u32 enabled_non_wakeup_gpios; u32 enabled_non_wakeup_gpios;
struct gpio_regs context; struct gpio_regs context;
u32 saved_datain; u32 saved_datain;
u32 saved_fallingdetect;
u32 saved_risingdetect;
u32 level_mask; u32 level_mask;
u32 toggle_mask; u32 toggle_mask;
spinlock_t lock; spinlock_t lock;
...@@ -1244,11 +1242,9 @@ static int omap_gpio_runtime_suspend(struct device *dev) ...@@ -1244,11 +1242,9 @@ static int omap_gpio_runtime_suspend(struct device *dev)
*/ */
bank->saved_datain = __raw_readl(bank->base + bank->saved_datain = __raw_readl(bank->base +
bank->regs->datain); bank->regs->datain);
l1 = __raw_readl(bank->base + bank->regs->fallingdetect); l1 = bank->context.fallingdetect;
l2 = __raw_readl(bank->base + bank->regs->risingdetect); l2 = bank->context.risingdetect;
bank->saved_fallingdetect = l1;
bank->saved_risingdetect = l2;
l1 &= ~bank->enabled_non_wakeup_gpios; l1 &= ~bank->enabled_non_wakeup_gpios;
l2 &= ~bank->enabled_non_wakeup_gpios; l2 &= ~bank->enabled_non_wakeup_gpios;
...@@ -1307,9 +1303,9 @@ static int omap_gpio_runtime_resume(struct device *dev) ...@@ -1307,9 +1303,9 @@ static int omap_gpio_runtime_resume(struct device *dev)
} }
} }
__raw_writel(bank->saved_fallingdetect, __raw_writel(bank->context.fallingdetect,
bank->base + bank->regs->fallingdetect); bank->base + bank->regs->fallingdetect);
__raw_writel(bank->saved_risingdetect, __raw_writel(bank->context.risingdetect,
bank->base + bank->regs->risingdetect); bank->base + bank->regs->risingdetect);
l = __raw_readl(bank->base + bank->regs->datain); l = __raw_readl(bank->base + bank->regs->datain);
...@@ -1326,14 +1322,15 @@ static int omap_gpio_runtime_resume(struct device *dev) ...@@ -1326,14 +1322,15 @@ static int omap_gpio_runtime_resume(struct device *dev)
* No need to generate IRQs for the rising edge for gpio IRQs * No need to generate IRQs for the rising edge for gpio IRQs
* configured with falling edge only; and vice versa. * configured with falling edge only; and vice versa.
*/ */
gen0 = l & bank->saved_fallingdetect; gen0 = l & bank->context.fallingdetect;
gen0 &= bank->saved_datain; gen0 &= bank->saved_datain;
gen1 = l & bank->saved_risingdetect; gen1 = l & bank->context.risingdetect;
gen1 &= ~(bank->saved_datain); gen1 &= ~(bank->saved_datain);
/* FIXME: Consider GPIO IRQs with level detections properly! */ /* FIXME: Consider GPIO IRQs with level detections properly! */
gen = l & (~(bank->saved_fallingdetect) & ~(bank->saved_risingdetect)); gen = l & (~(bank->context.fallingdetect) &
~(bank->context.risingdetect));
/* Consider all GPIO IRQs needed to be updated */ /* Consider all GPIO IRQs needed to be updated */
gen |= gen0 | gen1; gen |= gen0 | gen1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment