summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleksandr Kozaruk <oleksandr.kozaruk@globallogic.com>2015-06-30 20:59:02 -0700
committermattis fjallstrom <mattis@acm.org>2015-07-01 11:22:11 -0700
commitc7af39b2e75c11486218b31ed0fc66386d126c8c (patch)
treeec1a48a390dde076f56cbd0faa3bb860f2c9c9ac
parent8fdc80c21f34a2171495e0714dbda57e7a29da47 (diff)
downloadolio-linux-3.10-c7af39b2e75c11486218b31ed0fc66386d126c8c.tar.xz
olio-linux-3.10-c7af39b2e75c11486218b31ed0fc66386d126c8c.zip
Cherry-picked from globallogic_suspend. Adds wake-up register settings to trace log and enables PMICs 32k clock even during suspend.
Change-Id: I4f02cab5f67d09f8a4d0b8054d77f158a817f034
-rw-r--r--arch/arm/boot/dts/omap3_h1.dts17
-rw-r--r--arch/arm/mach-omap2/pm34xx.c84
-rw-r--r--drivers/mfd/tps65910.c7
3 files changed, 104 insertions, 4 deletions
diff --git a/arch/arm/boot/dts/omap3_h1.dts b/arch/arm/boot/dts/omap3_h1.dts
index 089b32a375f..e2244dc83d0 100644
--- a/arch/arm/boot/dts/omap3_h1.dts
+++ b/arch/arm/boot/dts/omap3_h1.dts
@@ -76,10 +76,21 @@
/* */
/* off IRQ handle */
ti,pad_irq = <0x16e 90 1>, /* uart3 - serial rx */
- <0x9f6 143 1>, /* mpu6515 irq pin */
+ <0x9f6 143 1>, /* mpu6515 irq pin - is this offset correct? */
<0x9f4 123 1>, /* BT host wake */
<0x1b0 23 1>; /* sys_nirq */
};
+
+ gpio-keys {
+ compatible = "gpio-keys";
+
+ wkup-button {
+ label = "wkup-debug-button";
+ gpios = <&gpio1 31 1>;
+ gpio-key,wakeup;
+ linux,code = <169>;
+ };
+ };
};
&vc {
@@ -148,7 +159,7 @@
0x0f2 0x11c /* CAM_D6, MODE4 | INPUT_PULLUP */
0x5ba 0x004 /* ETK_D7, MODE4 | OUTPUT */
- 0x1b0 0x4100 /* SYS_NIRQ, MODE0 | INPUT | OFFWAKEUP */
+ 0x1b0 0xc100 /* SYS_NIRQ, MODE0 | INPUT | OFFWAKEUP */
0x0dc 0x004 /* CAM_HS, MODE4 | OUTPUT */
/* USB */
@@ -223,7 +234,7 @@
/* 0x024 0x4104 */ /* JTAG_EMU0, OMAP_MUX_MODE4 | OMAP_PIN_INPUT |
OMAP_PIN_OFF_WAKEUPENABLE */
/* Accelerometer interrupt */
- 0x026 0x4104 /* JTAG_EMU1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT |
+ 0x026 0x410c /* JTAG_EMU1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT |
OMAP_PIN_OFF_WAKEUPENABLE */
>;
};
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index bdb2388ef4c..ebe383ded55 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -281,6 +281,86 @@ static int omap34xx_do_sram_idle(unsigned long save_state)
return 0;
}
+static u32 wkup_debug_get_reg(phys_addr_t reg)
+{
+ u32 val;
+ char *baseptr = ioremap(reg, 4);
+
+ val = *(u32 *)baseptr;
+ iounmap(baseptr);
+
+ return val;
+}
+
+struct wkup_debug_t {
+ char name[20];
+ u32 reg;
+};
+
+struct wkup_debug_t wkup_debug_map[] = {
+ {
+ .reg = 0x4831001C,
+ .name = "GPIO_IRQENABLE1",
+ },
+ {
+ .reg = 0x48310020,
+ .name = "GPIO_WAKEUPENABLE",
+ },
+ {
+ .reg = 0x48310010,
+ .name = "GPIO_SYSCONFIG",
+ },
+ {
+ .reg = 0x48310064,
+ .name = "GPIO_SETIRQENABLE1",
+ },
+ {
+ .reg = 0x48310084,
+ .name = "GPIO_SETWKUENA",
+ },
+ {
+ .reg = 0x48310048,
+ .name = "GPIO_RISINGDETECT",
+ },
+ {
+ .reg = 0x4831004C,
+ .name = "GPIO_FALLINGDETECT",
+ },
+ {
+ .reg = 0x4830681C,
+ .name = "PRM_IRQENABLE_MPU",
+ },
+ {
+ .reg = 0x483069C8,
+ .name = "PM_WKDEP_MPU",
+ },
+ {
+ .reg = 0x48306CA4,
+ .name = "PM_MPUGRPSEL_WKUP",
+ },
+ {
+ .reg = 0x48306CA0,
+ .name = "PM_WKEN_WKUP",
+ },
+ {
+ .reg = 0x48306CB0,
+ .name = "PM_WKST_WKUP",
+ },
+};
+
+static void wkup_debug_print_regs(void)
+{
+ int i;
+ u32 val;
+ struct wkup_debug_t *p = wkup_debug_map;
+
+ for (i = 0; i < ARRAY_SIZE(wkup_debug_map); i++) {
+ val = wkup_debug_get_reg(p->reg);
+ trace_printk("%s, 0x%x, val: 0x%x\n", p->name, p->reg, val);
+ p++;
+ }
+}
+
void omap_sram_idle(bool in_suspend)
{
/* Variable to tell what needs to be saved and restored
@@ -360,8 +440,10 @@ void omap_sram_idle(bool in_suspend)
core_next_state == PWRDM_POWER_OFF)
sdrc_pwr = sdrc_read_reg(SDRC_POWER);
- if (suspend_debug)
+ if (suspend_debug) {
pm_dbg_regs_save(1);
+ wkup_debug_print_regs();
+ }
/*
* omap3_arm_context is the location where some ARM context
diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c
index 28219d12a9f..15f2c8dea2f 100644
--- a/drivers/mfd/tps65910.c
+++ b/drivers/mfd/tps65910.c
@@ -353,6 +353,13 @@ static int tps65910_sleepinit(struct tps65910 *tps65910,
goto err_sleep_init;
}
+ ret = tps65910_reg_set_bits(tps65910, TPS65910_SLEEP_KEEP_RES_ON,
+ SLEEP_KEEP_RES_ON_CLKOUT32K_KEEPON_MASK);
+ if (ret < 0) {
+ dev_err(dev, "set sleep_keep_res_on failed: %d\n", ret);
+ goto err_sleep_init;
+ }
+
/* Return if there is no sleep keepon data. */
if (!pmic_pdata->slp_keepon)
return 0;