From de7fe0807c08553b88028d039861a4b8ad04fc62 Mon Sep 17 00:00:00 2001 From: Tomasz Figa Date: Tue, 18 Mar 2014 07:28:09 +0900 Subject: 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 Acked-by: Kyungmin Park Signed-off-by: Kukjin Kim --- arch/arm/plat-samsung/pm.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'arch/arm/plat-samsung/pm.c') 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 @@ #include #include +#include + #ifdef CONFIG_SAMSUNG_ATAGS #include #include @@ -70,17 +72,6 @@ static inline void s3c_pm_debug_init(void) s3c_pm_debug_init_uart(); } -#else -#define s3c_pm_debug_init() do { } while(0) - -#endif /* CONFIG_SAMSUNG_PM_DEBUG */ - -/* Save the UART configurations if we are configured for debug. */ - -unsigned char pm_uart_udivslot; - -#ifdef CONFIG_SAMSUNG_PM_DEBUG - static struct pm_uart_save uart_save; static 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) save->umcon = __raw_readl(regs + S3C2410_UMCON); save->ubrdiv = __raw_readl(regs + S3C2410_UBRDIV); - if (pm_uart_udivslot) + if (!soc_is_s3c2410()) save->udivslot = __raw_readl(regs + S3C2443_DIVSLOT); 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) __raw_writel(save->umcon, regs + S3C2410_UMCON); __raw_writel(save->ubrdiv, regs + S3C2410_UBRDIV); - if (pm_uart_udivslot) + if (!soc_is_s3c2410()) __raw_writel(save->udivslot, regs + S3C2443_DIVSLOT); } @@ -126,6 +117,8 @@ static void s3c_pm_restore_uarts(void) s3c_pm_restore_uart(CONFIG_DEBUG_S3C_UART, &uart_save); } #else +#define s3c_pm_debug_init() do { } while (0) + static void s3c_pm_save_uarts(void) { } static void s3c_pm_restore_uarts(void) { } #endif -- cgit v1.2.2