aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-samsung/pm.c
diff options
context:
space:
mode:
authorTomasz Figa <t.figa@samsung.com>2014-03-17 18:28:09 -0400
committerKukjin Kim <kgene.kim@samsung.com>2014-03-20 15:05:57 -0400
commitde7fe0807c08553b88028d039861a4b8ad04fc62 (patch)
tree9d8258db8bf587fc8280cc0a143518c8b9e8fd16 /arch/arm/plat-samsung/pm.c
parent04241069617d4f0bfd9f4a3aeefae13e1e5b55e1 (diff)
ARM: SAMSUNG: Save UART DIVSLOT register based on SoC type
The only SoC that does not have DIVSLOT register is S3C2410, so instead of exporting a variable for platforms to set if DIVSLOT register should be preserved, it's enough to simply check whether we are running on a S3C2410 instead. Signed-off-by: Tomasz Figa <t.figa@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/plat-samsung/pm.c')
-rw-r--r--arch/arm/plat-samsung/pm.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/arch/arm/plat-samsung/pm.c b/arch/arm/plat-samsung/pm.c
index ae9baa2d6381..3563421d63ab 100644
--- a/arch/arm/plat-samsung/pm.c
+++ b/arch/arm/plat-samsung/pm.c
@@ -24,6 +24,8 @@
24#include <asm/cacheflush.h> 24#include <asm/cacheflush.h>
25#include <asm/suspend.h> 25#include <asm/suspend.h>
26 26
27#include <plat/cpu.h>
28
27#ifdef CONFIG_SAMSUNG_ATAGS 29#ifdef CONFIG_SAMSUNG_ATAGS
28#include <mach/hardware.h> 30#include <mach/hardware.h>
29#include <mach/map.h> 31#include <mach/map.h>
@@ -70,17 +72,6 @@ static inline void s3c_pm_debug_init(void)
70 s3c_pm_debug_init_uart(); 72 s3c_pm_debug_init_uart();
71} 73}
72 74
73#else
74#define s3c_pm_debug_init() do { } while(0)
75
76#endif /* CONFIG_SAMSUNG_PM_DEBUG */
77
78/* Save the UART configurations if we are configured for debug. */
79
80unsigned char pm_uart_udivslot;
81
82#ifdef CONFIG_SAMSUNG_PM_DEBUG
83
84static struct pm_uart_save uart_save; 75static struct pm_uart_save uart_save;
85 76
86static void s3c_pm_save_uart(unsigned int uart, struct pm_uart_save *save) 77static void s3c_pm_save_uart(unsigned int uart, struct pm_uart_save *save)
@@ -93,7 +84,7 @@ static void s3c_pm_save_uart(unsigned int uart, struct pm_uart_save *save)
93 save->umcon = __raw_readl(regs + S3C2410_UMCON); 84 save->umcon = __raw_readl(regs + S3C2410_UMCON);
94 save->ubrdiv = __raw_readl(regs + S3C2410_UBRDIV); 85 save->ubrdiv = __raw_readl(regs + S3C2410_UBRDIV);
95 86
96 if (pm_uart_udivslot) 87 if (!soc_is_s3c2410())
97 save->udivslot = __raw_readl(regs + S3C2443_DIVSLOT); 88 save->udivslot = __raw_readl(regs + S3C2443_DIVSLOT);
98 89
99 S3C_PMDBG("UART[%d]: ULCON=%04x, UCON=%04x, UFCON=%04x, UBRDIV=%04x\n", 90 S3C_PMDBG("UART[%d]: ULCON=%04x, UCON=%04x, UFCON=%04x, UBRDIV=%04x\n",
@@ -117,7 +108,7 @@ static void s3c_pm_restore_uart(unsigned int uart, struct pm_uart_save *save)
117 __raw_writel(save->umcon, regs + S3C2410_UMCON); 108 __raw_writel(save->umcon, regs + S3C2410_UMCON);
118 __raw_writel(save->ubrdiv, regs + S3C2410_UBRDIV); 109 __raw_writel(save->ubrdiv, regs + S3C2410_UBRDIV);
119 110
120 if (pm_uart_udivslot) 111 if (!soc_is_s3c2410())
121 __raw_writel(save->udivslot, regs + S3C2443_DIVSLOT); 112 __raw_writel(save->udivslot, regs + S3C2443_DIVSLOT);
122} 113}
123 114
@@ -126,6 +117,8 @@ static void s3c_pm_restore_uarts(void)
126 s3c_pm_restore_uart(CONFIG_DEBUG_S3C_UART, &uart_save); 117 s3c_pm_restore_uart(CONFIG_DEBUG_S3C_UART, &uart_save);
127} 118}
128#else 119#else
120#define s3c_pm_debug_init() do { } while (0)
121
129static void s3c_pm_save_uarts(void) { } 122static void s3c_pm_save_uarts(void) { }
130static void s3c_pm_restore_uarts(void) { } 123static void s3c_pm_restore_uarts(void) { }
131#endif 124#endif