Commit de7fe080 authored by Tomasz Figa's avatar Tomasz Figa Committed by Kukjin Kim

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: default avatarTomasz Figa <t.figa@samsung.com>
Acked-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarKukjin Kim <kgene.kim@samsung.com>
parent 04241069
...@@ -332,7 +332,6 @@ static __init int s3c64xx_pm_initcall(void) ...@@ -332,7 +332,6 @@ static __init int s3c64xx_pm_initcall(void)
{ {
pm_cpu_prep = s3c64xx_pm_prepare; pm_cpu_prep = s3c64xx_pm_prepare;
pm_cpu_sleep = s3c64xx_cpu_suspend; pm_cpu_sleep = s3c64xx_cpu_suspend;
pm_uart_udivslot = 1;
#ifdef CONFIG_S3C_PM_DEBUG_LED_SMDK #ifdef CONFIG_S3C_PM_DEBUG_LED_SMDK
gpio_request(S3C64XX_GPN(12), "DEBUG_LED0"); gpio_request(S3C64XX_GPN(12), "DEBUG_LED0");
......
...@@ -161,7 +161,6 @@ static int s5p64x0_pm_add(struct device *dev, struct subsys_interface *sif) ...@@ -161,7 +161,6 @@ static int s5p64x0_pm_add(struct device *dev, struct subsys_interface *sif)
{ {
pm_cpu_prep = s5p64x0_pm_prepare; pm_cpu_prep = s5p64x0_pm_prepare;
pm_cpu_sleep = s5p64x0_cpu_suspend; pm_cpu_sleep = s5p64x0_cpu_suspend;
pm_uart_udivslot = 1;
return 0; return 0;
} }
......
...@@ -54,8 +54,6 @@ extern int (*pm_cpu_sleep)(unsigned long); ...@@ -54,8 +54,6 @@ extern int (*pm_cpu_sleep)(unsigned long);
extern unsigned long s3c_pm_flags; extern unsigned long s3c_pm_flags;
extern unsigned char pm_uart_udivslot; /* true to save UART UDIVSLOT */
/* from sleep.S */ /* from sleep.S */
extern int s3c2410_cpu_suspend(unsigned long); extern int s3c2410_cpu_suspend(unsigned long);
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
#include <asm/suspend.h> #include <asm/suspend.h>
#include <plat/cpu.h>
#ifdef CONFIG_SAMSUNG_ATAGS #ifdef CONFIG_SAMSUNG_ATAGS
#include <mach/hardware.h> #include <mach/hardware.h>
#include <mach/map.h> #include <mach/map.h>
...@@ -70,17 +72,6 @@ static inline void s3c_pm_debug_init(void) ...@@ -70,17 +72,6 @@ static inline void s3c_pm_debug_init(void)
s3c_pm_debug_init_uart(); 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 struct pm_uart_save uart_save;
static void s3c_pm_save_uart(unsigned int uart, struct pm_uart_save *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) ...@@ -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->umcon = __raw_readl(regs + S3C2410_UMCON);
save->ubrdiv = __raw_readl(regs + S3C2410_UBRDIV); save->ubrdiv = __raw_readl(regs + S3C2410_UBRDIV);
if (pm_uart_udivslot) if (!soc_is_s3c2410())
save->udivslot = __raw_readl(regs + S3C2443_DIVSLOT); save->udivslot = __raw_readl(regs + S3C2443_DIVSLOT);
S3C_PMDBG("UART[%d]: ULCON=%04x, UCON=%04x, UFCON=%04x, UBRDIV=%04x\n", 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,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->umcon, regs + S3C2410_UMCON);
__raw_writel(save->ubrdiv, regs + S3C2410_UBRDIV); __raw_writel(save->ubrdiv, regs + S3C2410_UBRDIV);
if (pm_uart_udivslot) if (!soc_is_s3c2410())
__raw_writel(save->udivslot, regs + S3C2443_DIVSLOT); __raw_writel(save->udivslot, regs + S3C2443_DIVSLOT);
} }
...@@ -126,6 +117,8 @@ static void s3c_pm_restore_uarts(void) ...@@ -126,6 +117,8 @@ static void s3c_pm_restore_uarts(void)
s3c_pm_restore_uart(CONFIG_DEBUG_S3C_UART, &uart_save); s3c_pm_restore_uart(CONFIG_DEBUG_S3C_UART, &uart_save);
} }
#else #else
#define s3c_pm_debug_init() do { } while (0)
static void s3c_pm_save_uarts(void) { } static void s3c_pm_save_uarts(void) { }
static void s3c_pm_restore_uarts(void) { } static void s3c_pm_restore_uarts(void) { }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment