From ec9286995af97f987332ce09baf26d7495191df9 Mon Sep 17 00:00:00 2001 From: cwz Date: Tue, 26 Apr 2011 19:41:29 -0700 Subject: [PATCH] pm.c: add dump gpio pull state before suspend, maybe it will help us to cost the power. --- arch/arm/mach-rk29/pm.c | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-rk29/pm.c b/arch/arm/mach-rk29/pm.c index 39d947eeeddf..1d8958fae63c 100755 --- a/arch/arm/mach-rk29/pm.c +++ b/arch/arm/mach-rk29/pm.c @@ -27,6 +27,11 @@ #include #include +#include + + +#define grf_readl(offset) readl(RK29_GRF_BASE + offset) +#define grf_writel(v, offset) do { writel(v, RK29_GRF_BASE + offset); readl(RK29_GRF_BASE + offset); } while (0) static unsigned long save_sp; @@ -347,11 +352,31 @@ static void dump_inten(void) DUMP_GPIO_INTEN(6); } + + +#define DUMP_GPIO_PULL(ID) \ +do { \ + u32 state = readl(RK29_GRF_BASE + GRF_GPIO0_PULL + (ID<<2)); \ + printascii("GPIO" #ID "_PULL: "); \ + printhex(state); \ + printch('\n'); \ +} while (0) + +static void dump_io_pull(void) +{ + DUMP_GPIO_PULL(0); + DUMP_GPIO_PULL(1); + DUMP_GPIO_PULL(2); + DUMP_GPIO_PULL(3); + DUMP_GPIO_PULL(4); + DUMP_GPIO_PULL(5); + DUMP_GPIO_PULL(6); +} + static int rk29_pm_enter(suspend_state_t state) { u32 apll, cpll, gpll, mode, clksel0; u32 clkgate[4]; - u32 gpio0_pull,gpio1_pull,gpio2_pull,gpio3_pull,gpio4_pull,gpio5_pull,gpio6_pull; // memory teseter if (ddr_debug == 3) @@ -359,7 +384,9 @@ static int rk29_pm_enter(suspend_state_t state) // dump GPIO INTEN for debug dump_inten(); - + // dump GPIO PULL state for debug + dump_io_pull(); + printch('0'); #ifdef CONFIG_RK29_PWM_REGULATOR -- 2.34.1