diff options
author | Charulatha V <charu@ti.com> | 2011-05-05 10:45:16 -0400 |
---|---|---|
committer | Tarun Kanti DebBarma <tarun.kanti@ti.com> | 2012-02-06 03:43:40 -0500 |
commit | 0cde8d03dd297fa8e7e88cedeb498d0ed5b7776d (patch) | |
tree | 542a4f06bc659180898d9e9d6bc3e540ddd088f1 /arch/arm/mach-omap2/gpio.c | |
parent | 03e128ca35e5da22e9e65ec8ab158ec0e905fdea (diff) |
gpio/omap: use flag to identify wakeup domain
In omap3, save/restore context is implemented for GPIO banks 2-6 as GPIO bank1
is in wakeup domain. Instead of identifying bank's power domain by bank id,
use 'loses_context' flag which is filled by pwrdm_can_ever_lose_context()
during dev_init.
For getting the powerdomain pointer, omap_hwmod_get_pwrdm() is used.
omap_device_get_pwrdm() could not be used as the pwrdm information needs to be
filled in pdata, whereas omap_device_get_pwrdm() could be used only after
omap_device_build() call.
Signed-off-by: Charulatha V <charu@ti.com>
Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/gpio.c')
-rw-r--r-- | arch/arm/mach-omap2/gpio.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/gpio.c b/arch/arm/mach-omap2/gpio.c index 07ac64850746..076be342ad28 100644 --- a/arch/arm/mach-omap2/gpio.c +++ b/arch/arm/mach-omap2/gpio.c | |||
@@ -24,6 +24,8 @@ | |||
24 | #include <plat/omap_hwmod.h> | 24 | #include <plat/omap_hwmod.h> |
25 | #include <plat/omap_device.h> | 25 | #include <plat/omap_device.h> |
26 | 26 | ||
27 | #include "powerdomain.h" | ||
28 | |||
27 | static int omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused) | 29 | static int omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused) |
28 | { | 30 | { |
29 | struct platform_device *pdev; | 31 | struct platform_device *pdev; |
@@ -31,6 +33,7 @@ static int omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused) | |||
31 | struct omap_gpio_dev_attr *dev_attr; | 33 | struct omap_gpio_dev_attr *dev_attr; |
32 | char *name = "omap_gpio"; | 34 | char *name = "omap_gpio"; |
33 | int id; | 35 | int id; |
36 | struct powerdomain *pwrdm; | ||
34 | 37 | ||
35 | /* | 38 | /* |
36 | * extract the device id from name field available in the | 39 | * extract the device id from name field available in the |
@@ -99,6 +102,9 @@ static int omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused) | |||
99 | return -EINVAL; | 102 | return -EINVAL; |
100 | } | 103 | } |
101 | 104 | ||
105 | pwrdm = omap_hwmod_get_pwrdm(oh); | ||
106 | pdata->loses_context = pwrdm_can_ever_lose_context(pwrdm); | ||
107 | |||
102 | pdev = omap_device_build(name, id - 1, oh, pdata, | 108 | pdev = omap_device_build(name, id - 1, oh, pdata, |
103 | sizeof(*pdata), NULL, 0, false); | 109 | sizeof(*pdata), NULL, 0, false); |
104 | kfree(pdata); | 110 | kfree(pdata); |