From c74c101efe579d99edcfa0d78c5504af2790bd2d Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=BB=84=E6=B6=9B?= Date: Mon, 17 Dec 2012 14:19:49 +0800 Subject: [PATCH] rk30: pm: printk while dump gpio inten and refactor rk30_pm_dump_irq --- arch/arm/mach-rk30/pm.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/arch/arm/mach-rk30/pm.c b/arch/arm/mach-rk30/pm.c index 6bd00648f487..e4ae1bf71288 100755 --- a/arch/arm/mach-rk30/pm.c +++ b/arch/arm/mach-rk30/pm.c @@ -174,6 +174,12 @@ static void ddr_testmode(void) static void ddr_testmode(void) {} #endif +#define DUMP_GPIO_INT_STATUS(ID) \ +do { \ + if (irq_gpio & (1 << ID)) \ + printk("wakeup gpio" #ID ": %08x\n", readl_relaxed(RK30_GPIO##ID##_BASE + GPIO_INT_STATUS)); \ +} while (0) + static noinline void rk30_pm_dump_irq(void) { u32 irq_gpio = (readl_relaxed(RK30_GICD_BASE + GIC_DIST_PENDING_SET + 8) >> 22) & 0x7F; @@ -182,19 +188,13 @@ static noinline void rk30_pm_dump_irq(void) readl_relaxed(RK30_GICD_BASE + GIC_DIST_PENDING_SET + 8), readl_relaxed(RK30_GICD_BASE + GIC_DIST_PENDING_SET + 12), readl_relaxed(RK30_GICD_BASE + GIC_DIST_PENDING_SET + 16)); - if (irq_gpio & 1) - printk("wakeup gpio0: %08x\n", readl_relaxed(RK30_GPIO0_BASE + GPIO_INT_STATUS)); - if (irq_gpio & 2) - printk("wakeup gpio1: %08x\n", readl_relaxed(RK30_GPIO1_BASE + GPIO_INT_STATUS)); - if (irq_gpio & 4) - printk("wakeup gpio2: %08x\n", readl_relaxed(RK30_GPIO2_BASE + GPIO_INT_STATUS)); - if (irq_gpio & 8) - printk("wakeup gpio3: %08x\n", readl_relaxed(RK30_GPIO3_BASE + GPIO_INT_STATUS)); + DUMP_GPIO_INT_STATUS(0); + DUMP_GPIO_INT_STATUS(1); + DUMP_GPIO_INT_STATUS(2); + DUMP_GPIO_INT_STATUS(3); #if !defined(CONFIG_ARCH_RK3066B) - if (irq_gpio & 0x10) - printk("wakeup gpio4: %08x\n", readl_relaxed(RK30_GPIO4_BASE + GPIO_INT_STATUS)); - if (irq_gpio & 0x40) - printk("wakeup gpio6: %08x\n", readl_relaxed(RK30_GPIO6_BASE + GPIO_INT_STATUS)); + DUMP_GPIO_INT_STATUS(4); + DUMP_GPIO_INT_STATUS(6); #endif } @@ -205,6 +205,7 @@ do { \ sram_printascii("GPIO" #ID "_INTEN: "); \ sram_printhex(en); \ sram_printch('\n'); \ + printk(KERN_DEBUG "GPIO%d_INTEN: %08x\n", ID, en); \ } \ } while (0) -- 2.34.1