diff options
Diffstat (limited to 'arch/arm/mach-s3c64xx/pm.c')
-rw-r--r-- | arch/arm/mach-s3c64xx/pm.c | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/arch/arm/mach-s3c64xx/pm.c b/arch/arm/mach-s3c64xx/pm.c index 79412f735a8d..bc1c470b7de6 100644 --- a/arch/arm/mach-s3c64xx/pm.c +++ b/arch/arm/mach-s3c64xx/pm.c | |||
@@ -30,26 +30,18 @@ | |||
30 | #include <mach/regs-gpio-memport.h> | 30 | #include <mach/regs-gpio-memport.h> |
31 | 31 | ||
32 | #ifdef CONFIG_S3C_PM_DEBUG_LED_SMDK | 32 | #ifdef CONFIG_S3C_PM_DEBUG_LED_SMDK |
33 | #include <mach/gpio-bank-n.h> | ||
34 | |||
35 | void s3c_pm_debug_smdkled(u32 set, u32 clear) | 33 | void s3c_pm_debug_smdkled(u32 set, u32 clear) |
36 | { | 34 | { |
37 | unsigned long flags; | 35 | unsigned long flags; |
38 | u32 reg; | 36 | int i; |
39 | 37 | ||
40 | local_irq_save(flags); | 38 | local_irq_save(flags); |
41 | reg = __raw_readl(S3C64XX_GPNCON); | 39 | for (i = 0; i < 4; i++) { |
42 | reg &= ~(S3C64XX_GPN_CONMASK(12) | S3C64XX_GPN_CONMASK(13) | | 40 | if (clear & (1 << i)) |
43 | S3C64XX_GPN_CONMASK(14) | S3C64XX_GPN_CONMASK(15)); | 41 | gpio_set_value(S3C64XX_GPN(12 + i), 0); |
44 | reg |= S3C64XX_GPN_OUTPUT(12) | S3C64XX_GPN_OUTPUT(13) | | 42 | if (set & (1 << i)) |
45 | S3C64XX_GPN_OUTPUT(14) | S3C64XX_GPN_OUTPUT(15); | 43 | gpio_set_value(S3C64XX_GPN(12 + i), 1); |
46 | __raw_writel(reg, S3C64XX_GPNCON); | 44 | } |
47 | |||
48 | reg = __raw_readl(S3C64XX_GPNDAT); | ||
49 | reg &= ~(clear << 12); | ||
50 | reg |= set << 12; | ||
51 | __raw_writel(reg, S3C64XX_GPNDAT); | ||
52 | |||
53 | local_irq_restore(flags); | 45 | local_irq_restore(flags); |
54 | } | 46 | } |
55 | #endif | 47 | #endif |
@@ -187,6 +179,18 @@ static int s3c64xx_pm_init(void) | |||
187 | pm_cpu_prep = s3c64xx_pm_prepare; | 179 | pm_cpu_prep = s3c64xx_pm_prepare; |
188 | pm_cpu_sleep = s3c64xx_cpu_suspend; | 180 | pm_cpu_sleep = s3c64xx_cpu_suspend; |
189 | pm_uart_udivslot = 1; | 181 | pm_uart_udivslot = 1; |
182 | |||
183 | #ifdef CONFIG_S3C_PM_DEBUG_LED_SMDK | ||
184 | gpio_request(S3C64XX_GPN(12), "DEBUG_LED0"); | ||
185 | gpio_request(S3C64XX_GPN(13), "DEBUG_LED1"); | ||
186 | gpio_request(S3C64XX_GPN(14), "DEBUG_LED2"); | ||
187 | gpio_request(S3C64XX_GPN(15), "DEBUG_LED3"); | ||
188 | gpio_direction_output(S3C64XX_GPN(12), 0); | ||
189 | gpio_direction_output(S3C64XX_GPN(13), 0); | ||
190 | gpio_direction_output(S3C64XX_GPN(14), 0); | ||
191 | gpio_direction_output(S3C64XX_GPN(15), 0); | ||
192 | #endif | ||
193 | |||
190 | return 0; | 194 | return 0; |
191 | } | 195 | } |
192 | 196 | ||