aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-omap2/gpio.c3
-rw-r--r--arch/arm/mach-omap2/pm34xx.c14
-rw-r--r--arch/arm/plat-omap/include/plat/gpio.h5
3 files changed, 5 insertions, 17 deletions
diff --git a/arch/arm/mach-omap2/gpio.c b/arch/arm/mach-omap2/gpio.c
index 076be342ad28..f84db8ff207f 100644
--- a/arch/arm/mach-omap2/gpio.c
+++ b/arch/arm/mach-omap2/gpio.c
@@ -23,6 +23,7 @@
23 23
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#include <plat/omap-pm.h>
26 27
27#include "powerdomain.h" 28#include "powerdomain.h"
28 29
@@ -55,7 +56,7 @@ static int omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
55 pdata->bank_width = dev_attr->bank_width; 56 pdata->bank_width = dev_attr->bank_width;
56 pdata->dbck_flag = dev_attr->dbck_flag; 57 pdata->dbck_flag = dev_attr->dbck_flag;
57 pdata->virtual_irq_start = IH_GPIO_BASE + 32 * (id - 1); 58 pdata->virtual_irq_start = IH_GPIO_BASE + 32 * (id - 1);
58 59 pdata->get_context_loss_count = omap_pm_get_dev_context_loss_count;
59 pdata->regs = kzalloc(sizeof(struct omap_gpio_reg_offs), GFP_KERNEL); 60 pdata->regs = kzalloc(sizeof(struct omap_gpio_reg_offs), GFP_KERNEL);
60 if (!pdata) { 61 if (!pdata) {
61 pr_err("gpio%d: Memory allocation failed\n", id); 62 pr_err("gpio%d: Memory allocation failed\n", id);
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index fc6987578920..59c6dc16dd1d 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -75,16 +75,6 @@ static struct powerdomain *mpu_pwrdm, *neon_pwrdm;
75static struct powerdomain *core_pwrdm, *per_pwrdm; 75static struct powerdomain *core_pwrdm, *per_pwrdm;
76static struct powerdomain *cam_pwrdm; 76static struct powerdomain *cam_pwrdm;
77 77
78static inline void omap3_per_save_context(void)
79{
80 omap_gpio_save_context();
81}
82
83static inline void omap3_per_restore_context(void)
84{
85 omap_gpio_restore_context();
86}
87
88static void omap3_enable_io_chain(void) 78static void omap3_enable_io_chain(void)
89{ 79{
90 int timeout = 0; 80 int timeout = 0;
@@ -332,8 +322,6 @@ void omap_sram_idle(void)
332 if (per_next_state < PWRDM_POWER_ON) { 322 if (per_next_state < PWRDM_POWER_ON) {
333 per_going_off = (per_next_state == PWRDM_POWER_OFF) ? 1 : 0; 323 per_going_off = (per_next_state == PWRDM_POWER_OFF) ? 1 : 0;
334 omap2_gpio_prepare_for_idle(per_going_off); 324 omap2_gpio_prepare_for_idle(per_going_off);
335 if (per_next_state == PWRDM_POWER_OFF)
336 omap3_per_save_context();
337 } 325 }
338 326
339 /* CORE */ 327 /* CORE */
@@ -399,8 +387,6 @@ void omap_sram_idle(void)
399 if (per_next_state < PWRDM_POWER_ON) { 387 if (per_next_state < PWRDM_POWER_ON) {
400 per_prev_state = pwrdm_read_prev_pwrst(per_pwrdm); 388 per_prev_state = pwrdm_read_prev_pwrst(per_pwrdm);
401 omap2_gpio_resume_after_idle(); 389 omap2_gpio_resume_after_idle();
402 if (per_prev_state == PWRDM_POWER_OFF)
403 omap3_per_restore_context();
404 } 390 }
405 391
406 /* Disable IO-PAD and IO-CHAIN wakeup */ 392 /* Disable IO-PAD and IO-CHAIN wakeup */
diff --git a/arch/arm/plat-omap/include/plat/gpio.h b/arch/arm/plat-omap/include/plat/gpio.h
index 6eb035c0cc16..c1ddc5a3de2a 100644
--- a/arch/arm/plat-omap/include/plat/gpio.h
+++ b/arch/arm/plat-omap/include/plat/gpio.h
@@ -201,14 +201,15 @@ struct omap_gpio_platform_data {
201 bool loses_context; /* whether the bank would ever lose context */ 201 bool loses_context; /* whether the bank would ever lose context */
202 202
203 struct omap_gpio_reg_offs *regs; 203 struct omap_gpio_reg_offs *regs;
204
205 /* Return context loss count due to PM states changing */
206 int (*get_context_loss_count)(struct device *dev);
204}; 207};
205 208
206extern void omap2_gpio_prepare_for_idle(int off_mode); 209extern void omap2_gpio_prepare_for_idle(int off_mode);
207extern void omap2_gpio_resume_after_idle(void); 210extern void omap2_gpio_resume_after_idle(void);
208extern void omap_set_gpio_debounce(int gpio, int enable); 211extern void omap_set_gpio_debounce(int gpio, int enable);
209extern void omap_set_gpio_debounce_time(int gpio, int enable); 212extern void omap_set_gpio_debounce_time(int gpio, int enable);
210extern void omap_gpio_save_context(void);
211extern void omap_gpio_restore_context(void);
212/*-------------------------------------------------------------------------*/ 213/*-------------------------------------------------------------------------*/
213 214
214/* Wrappers for "new style" GPIO calls, using the new infrastructure 215/* Wrappers for "new style" GPIO calls, using the new infrastructure