aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-nomadik.c
diff options
context:
space:
mode:
authorRabin Vincent <rabin.vincent@stericsson.com>2011-04-25 23:33:27 -0400
committerLinus Walleij <linus.walleij@linaro.org>2012-04-23 05:04:49 -0400
commitb982ff0e9a52553db246f7e171c03e7e0efedbe5 (patch)
tree5f7085bec7bc00b2b386143775fe7a43e01d675d /drivers/gpio/gpio-nomadik.c
parent66f75a5d028beaf67c931435fdc3e7823125730c (diff)
gpio/nomadik: don't set SLPM to 1 for non-wakeup pins
Setting GPIOs' SLPM value to 1 (WAKEUP_DISABLE) is seen to cause increased power consumption in sleep/deep-sleep. So remove the code which disables SLPM based on the wakeup settings and only ensure it is on as needed. Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com> Reviewed-by: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-nomadik.c')
-rw-r--r--drivers/gpio/gpio-nomadik.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/drivers/gpio/gpio-nomadik.c b/drivers/gpio/gpio-nomadik.c
index 839624f9fe6a..f1ebd05a9c50 100644
--- a/drivers/gpio/gpio-nomadik.c
+++ b/drivers/gpio/gpio-nomadik.c
@@ -58,7 +58,6 @@ struct nmk_gpio_chip {
58 u32 real_wake; 58 u32 real_wake;
59 u32 rwimsc; 59 u32 rwimsc;
60 u32 fwimsc; 60 u32 fwimsc;
61 u32 slpm;
62 u32 pull_up; 61 u32 pull_up;
63}; 62};
64 63
@@ -583,10 +582,14 @@ static void __nmk_gpio_irq_modify(struct nmk_gpio_chip *nmk_chip,
583static void __nmk_gpio_set_wake(struct nmk_gpio_chip *nmk_chip, 582static void __nmk_gpio_set_wake(struct nmk_gpio_chip *nmk_chip,
584 int gpio, bool on) 583 int gpio, bool on)
585{ 584{
586 if (nmk_chip->sleepmode) { 585 /*
586 * Ensure WAKEUP_ENABLE is on. No need to disable it if wakeup is
587 * disabled, since setting SLPM to 1 increases power consumption, and
588 * wakeup is anyhow controlled by the RIMSC and FIMSC registers.
589 */
590 if (nmk_chip->sleepmode && on) {
587 __nmk_gpio_set_slpm(nmk_chip, gpio - nmk_chip->chip.base, 591 __nmk_gpio_set_slpm(nmk_chip, gpio - nmk_chip->chip.base,
588 on ? NMK_GPIO_SLPM_WAKEUP_ENABLE 592 NMK_GPIO_SLPM_WAKEUP_ENABLE);
589 : NMK_GPIO_SLPM_WAKEUP_DISABLE);
590 } 593 }
591 594
592 __nmk_gpio_irq_modify(nmk_chip, gpio, WAKE, on); 595 __nmk_gpio_irq_modify(nmk_chip, gpio, WAKE, on);
@@ -1016,13 +1019,6 @@ void nmk_gpio_wakeups_suspend(void)
1016 writel(chip->fwimsc & chip->real_wake, 1019 writel(chip->fwimsc & chip->real_wake,
1017 chip->addr + NMK_GPIO_FWIMSC); 1020 chip->addr + NMK_GPIO_FWIMSC);
1018 1021
1019 if (chip->sleepmode) {
1020 chip->slpm = readl(chip->addr + NMK_GPIO_SLPC);
1021
1022 /* 0 -> wakeup enable */
1023 writel(~chip->real_wake, chip->addr + NMK_GPIO_SLPC);
1024 }
1025
1026 clk_disable(chip->clk); 1022 clk_disable(chip->clk);
1027 } 1023 }
1028} 1024}
@@ -1042,9 +1038,6 @@ void nmk_gpio_wakeups_resume(void)
1042 writel(chip->rwimsc, chip->addr + NMK_GPIO_RWIMSC); 1038 writel(chip->rwimsc, chip->addr + NMK_GPIO_RWIMSC);
1043 writel(chip->fwimsc, chip->addr + NMK_GPIO_FWIMSC); 1039 writel(chip->fwimsc, chip->addr + NMK_GPIO_FWIMSC);
1044 1040
1045 if (chip->sleepmode)
1046 writel(chip->slpm, chip->addr + NMK_GPIO_SLPC);
1047
1048 clk_disable(chip->clk); 1041 clk_disable(chip->clk);
1049 } 1042 }
1050} 1043}