aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-nomadik
diff options
context:
space:
mode:
authorRabin Vincent <rabin.vincent@stericsson.com>2011-02-09 22:59:53 -0500
committerLinus Walleij <linus.walleij@linaro.org>2011-03-14 09:05:16 -0400
commit5317e4d11d1ce4db949f207aaebe09b7d0d76b5f (patch)
tree7399532e48f9dc4060b6cc1f60dbb76f0bc9788a /arch/arm/plat-nomadik
parent8b40eeeadc5837c2c01329aa1294e4bef3b35429 (diff)
plat-nomadik: get rid of unused GPIO PM code
The NOMADIK_GPIO_PM config option is disabled by default, not user visible, and never selected by any other option: the code is therefore unused. The GPIO registers need not be saved and restored since their values are preserved when vAPE (on DB8500) is powered down. Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com> Reviewed-by: Jonas Aberg <jonas.aberg@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/arm/plat-nomadik')
-rw-r--r--arch/arm/plat-nomadik/Kconfig6
-rw-r--r--arch/arm/plat-nomadik/gpio.c76
2 files changed, 3 insertions, 79 deletions
diff --git a/arch/arm/plat-nomadik/Kconfig b/arch/arm/plat-nomadik/Kconfig
index ad25c963d437..187f4e84bb22 100644
--- a/arch/arm/plat-nomadik/Kconfig
+++ b/arch/arm/plat-nomadik/Kconfig
@@ -25,10 +25,4 @@ config NOMADIK_GPIO
25 help 25 help
26 Support for the Nomadik GPIO controller. 26 Support for the Nomadik GPIO controller.
27 27
28config NOMADIK_GPIO_PM
29 bool
30 depends on NOMADIK_GPIO && PM
31 help
32 Support PM for the Nomadik GPIO controller.
33
34endif 28endif
diff --git a/arch/arm/plat-nomadik/gpio.c b/arch/arm/plat-nomadik/gpio.c
index acc9de213246..5e6653f63286 100644
--- a/arch/arm/plat-nomadik/gpio.c
+++ b/arch/arm/plat-nomadik/gpio.c
@@ -35,18 +35,6 @@
35 * Symbols in this file are called "nmk_gpio" for "nomadik gpio" 35 * Symbols in this file are called "nmk_gpio" for "nomadik gpio"
36 */ 36 */
37 37
38static const u32 backup_regs[] = {
39 NMK_GPIO_PDIS,
40 NMK_GPIO_DIR,
41 NMK_GPIO_AFSLA,
42 NMK_GPIO_AFSLB,
43 NMK_GPIO_SLPC,
44 NMK_GPIO_RIMSC,
45 NMK_GPIO_FIMSC,
46 NMK_GPIO_RWIMSC,
47 NMK_GPIO_FWIMSC,
48};
49
50#define NMK_GPIO_PER_CHIP 32 38#define NMK_GPIO_PER_CHIP 32
51 39
52struct nmk_gpio_chip { 40struct nmk_gpio_chip {
@@ -62,9 +50,6 @@ struct nmk_gpio_chip {
62 /* Keep track of configured edges */ 50 /* Keep track of configured edges */
63 u32 edge_rising; 51 u32 edge_rising;
64 u32 edge_falling; 52 u32 edge_falling;
65 u32 backup[ARRAY_SIZE(backup_regs)];
66 /* Bitmap, 1 = pull up, 0 = pull down */
67 u32 pull;
68}; 53};
69 54
70static struct nmk_gpio_chip * 55static struct nmk_gpio_chip *
@@ -117,13 +102,10 @@ static void __nmk_gpio_set_pull(struct nmk_gpio_chip *nmk_chip,
117 pdis &= ~bit; 102 pdis &= ~bit;
118 writel(pdis, nmk_chip->addr + NMK_GPIO_PDIS); 103 writel(pdis, nmk_chip->addr + NMK_GPIO_PDIS);
119 104
120 if (pull == NMK_GPIO_PULL_UP) { 105 if (pull == NMK_GPIO_PULL_UP)
121 nmk_chip->pull |= bit;
122 writel(bit, nmk_chip->addr + NMK_GPIO_DATS); 106 writel(bit, nmk_chip->addr + NMK_GPIO_DATS);
123 } else if (pull == NMK_GPIO_PULL_DOWN) { 107 else if (pull == NMK_GPIO_PULL_DOWN)
124 nmk_chip->pull &= ~bit;
125 writel(bit, nmk_chip->addr + NMK_GPIO_DATC); 108 writel(bit, nmk_chip->addr + NMK_GPIO_DATC);
126 }
127} 109}
128 110
129static void __nmk_gpio_make_input(struct nmk_gpio_chip *nmk_chip, 111static void __nmk_gpio_make_input(struct nmk_gpio_chip *nmk_chip,
@@ -991,64 +973,12 @@ out:
991 return ret; 973 return ret;
992} 974}
993 975
994#ifdef CONFIG_NOMADIK_GPIO_PM
995static int nmk_gpio_pm(struct platform_device *dev, bool suspend)
996{
997 struct nmk_gpio_chip *nmk_chip = platform_get_drvdata(dev);
998 int i;
999 u32 dir;
1000 u32 dat;
1001
1002 for (i = 0; i < ARRAY_SIZE(backup_regs); i++) {
1003 if (suspend)
1004 nmk_chip->backup[i] = readl(nmk_chip->addr +
1005 backup_regs[i]);
1006 else
1007 writel(nmk_chip->backup[i],
1008 nmk_chip->addr + backup_regs[i]);
1009 }
1010
1011 if (!suspend) {
1012 /*
1013 * Restore pull-up and pull-down on inputs and
1014 * outputs.
1015 */
1016 dir = readl(nmk_chip->addr + NMK_GPIO_DIR);
1017 dat = readl(nmk_chip->addr + NMK_GPIO_DAT);
1018
1019 writel((nmk_chip->pull & ~dir) |
1020 (dat & dir),
1021 nmk_chip->addr + NMK_GPIO_DATS);
1022
1023 writel((~nmk_chip->pull & ~dir) |
1024 (~dat & dir),
1025 nmk_chip->addr + NMK_GPIO_DATC);
1026 }
1027 return 0;
1028}
1029
1030static int nmk_gpio_suspend(struct platform_device *dev, pm_message_t state)
1031{
1032 return nmk_gpio_pm(dev, true);
1033}
1034
1035static int nmk_gpio_resume(struct platform_device *dev)
1036{
1037 return nmk_gpio_pm(dev, false);
1038}
1039#else
1040#define nmk_gpio_suspend NULL
1041#define nmk_gpio_resume NULL
1042#endif
1043
1044static struct platform_driver nmk_gpio_driver = { 976static struct platform_driver nmk_gpio_driver = {
1045 .driver = { 977 .driver = {
1046 .owner = THIS_MODULE, 978 .owner = THIS_MODULE,
1047 .name = "gpio", 979 .name = "gpio",
1048 }, 980 },
1049 .probe = nmk_gpio_probe, 981 .probe = nmk_gpio_probe,
1050 .suspend = nmk_gpio_suspend,
1051 .resume = nmk_gpio_resume,
1052}; 982};
1053 983
1054static int __init nmk_gpio_init(void) 984static int __init nmk_gpio_init(void)