Commit 0443a653 authored by Arnd Bergmann's avatar Arnd Bergmann

ARM: samsung: allow serial driver to be disabled

If CONFIG_SERIAL_SAMSUNG is disabled, we run into build errors
with some samsung platforms. This adds a couple of #ifdef
statements to hopefully deal with this more gracefully.
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Acked-by: default avatarKukjin Kim <kgene.kim@samsung.com>
Cc: Tomasz Figa <tomasz.figa@gmail.com>
Cc: Ben Dooks <ben-linux@fluff.org>
parent 943fa726
...@@ -55,7 +55,13 @@ static struct irq_grp_save { ...@@ -55,7 +55,13 @@ static struct irq_grp_save {
u32 mask; u32 mask;
} eint_grp_save[5]; } eint_grp_save[5];
static u32 irq_uart_mask[CONFIG_SERIAL_SAMSUNG_UARTS]; #ifndef CONFIG_SERIAL_SAMSUNG_UARTS
#define SERIAL_SAMSUNG_UARTS 0
#else
#define SERIAL_SAMSUNG_UARTS CONFIG_SERIAL_SAMSUNG_UARTS
#endif
static u32 irq_uart_mask[SERIAL_SAMSUNG_UARTS];
static int s3c64xx_irq_pm_suspend(void) static int s3c64xx_irq_pm_suspend(void)
{ {
...@@ -66,7 +72,7 @@ static int s3c64xx_irq_pm_suspend(void) ...@@ -66,7 +72,7 @@ static int s3c64xx_irq_pm_suspend(void)
s3c_pm_do_save(irq_save, ARRAY_SIZE(irq_save)); s3c_pm_do_save(irq_save, ARRAY_SIZE(irq_save));
for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++) for (i = 0; i < SERIAL_SAMSUNG_UARTS; i++)
irq_uart_mask[i] = __raw_readl(S3C_VA_UARTx(i) + S3C64XX_UINTM); irq_uart_mask[i] = __raw_readl(S3C_VA_UARTx(i) + S3C64XX_UINTM);
for (i = 0; i < ARRAY_SIZE(eint_grp_save); i++, grp++) { for (i = 0; i < ARRAY_SIZE(eint_grp_save); i++, grp++) {
...@@ -87,7 +93,7 @@ static void s3c64xx_irq_pm_resume(void) ...@@ -87,7 +93,7 @@ static void s3c64xx_irq_pm_resume(void)
s3c_pm_do_restore(irq_save, ARRAY_SIZE(irq_save)); s3c_pm_do_restore(irq_save, ARRAY_SIZE(irq_save));
for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++) for (i = 0; i < SERIAL_SAMSUNG_UARTS; i++)
__raw_writel(irq_uart_mask[i], S3C_VA_UARTx(i) + S3C64XX_UINTM); __raw_writel(irq_uart_mask[i], S3C_VA_UARTx(i) + S3C64XX_UINTM);
for (i = 0; i < ARRAY_SIZE(eint_grp_save); i++, grp++) { for (i = 0; i < ARRAY_SIZE(eint_grp_save); i++, grp++) {
......
...@@ -34,7 +34,9 @@ static struct irq_grp_save { ...@@ -34,7 +34,9 @@ static struct irq_grp_save {
u32 mask; u32 mask;
} eint_grp_save[4]; } eint_grp_save[4];
#ifdef CONFIG_SERIAL_SAMSUNG
static u32 irq_uart_mask[CONFIG_SERIAL_SAMSUNG_UARTS]; static u32 irq_uart_mask[CONFIG_SERIAL_SAMSUNG_UARTS];
#endif
static int s5p64x0_irq_pm_suspend(void) static int s5p64x0_irq_pm_suspend(void)
{ {
...@@ -45,8 +47,10 @@ static int s5p64x0_irq_pm_suspend(void) ...@@ -45,8 +47,10 @@ static int s5p64x0_irq_pm_suspend(void)
s3c_pm_do_save(irq_save, ARRAY_SIZE(irq_save)); s3c_pm_do_save(irq_save, ARRAY_SIZE(irq_save));
#ifdef CONFIG_SERIAL_SAMSUNG
for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++) for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++)
irq_uart_mask[i] = __raw_readl(S3C_VA_UARTx(i) + S3C64XX_UINTM); irq_uart_mask[i] = __raw_readl(S3C_VA_UARTx(i) + S3C64XX_UINTM);
#endif
for (i = 0; i < ARRAY_SIZE(eint_grp_save); i++, grp++) { for (i = 0; i < ARRAY_SIZE(eint_grp_save); i++, grp++) {
grp->con = __raw_readl(S5P64X0_EINT12CON + (i * 4)); grp->con = __raw_readl(S5P64X0_EINT12CON + (i * 4));
...@@ -66,8 +70,10 @@ static void s5p64x0_irq_pm_resume(void) ...@@ -66,8 +70,10 @@ static void s5p64x0_irq_pm_resume(void)
s3c_pm_do_restore(irq_save, ARRAY_SIZE(irq_save)); s3c_pm_do_restore(irq_save, ARRAY_SIZE(irq_save));
#ifdef CONFIG_SERIAL_SAMSUNG
for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++) for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++)
__raw_writel(irq_uart_mask[i], S3C_VA_UARTx(i) + S3C64XX_UINTM); __raw_writel(irq_uart_mask[i], S3C_VA_UARTx(i) + S3C64XX_UINTM);
#endif
for (i = 0; i < ARRAY_SIZE(eint_grp_save); i++, grp++) { for (i = 0; i < ARRAY_SIZE(eint_grp_save); i++, grp++) {
__raw_writel(grp->con, S5P64X0_EINT12CON + (i * 4)); __raw_writel(grp->con, S5P64X0_EINT12CON + (i * 4));
......
...@@ -97,7 +97,9 @@ void __init s3c24xx_init_clocks(int xtal) ...@@ -97,7 +97,9 @@ void __init s3c24xx_init_clocks(int xtal)
#if IS_ENABLED(CONFIG_SAMSUNG_ATAGS) #if IS_ENABLED(CONFIG_SAMSUNG_ATAGS)
static int nr_uarts __initdata = 0; static int nr_uarts __initdata = 0;
#ifdef CONFIG_SERIAL_SAMSUNG_UARTS
static struct s3c2410_uartcfg uart_cfgs[CONFIG_SERIAL_SAMSUNG_UARTS]; static struct s3c2410_uartcfg uart_cfgs[CONFIG_SERIAL_SAMSUNG_UARTS];
#endif
/* s3c24xx_init_uartdevs /* s3c24xx_init_uartdevs
* *
...@@ -112,6 +114,7 @@ void __init s3c24xx_init_uartdevs(char *name, ...@@ -112,6 +114,7 @@ void __init s3c24xx_init_uartdevs(char *name,
struct s3c24xx_uart_resources *res, struct s3c24xx_uart_resources *res,
struct s3c2410_uartcfg *cfg, int no) struct s3c2410_uartcfg *cfg, int no)
{ {
#ifdef CONFIG_SERIAL_SAMSUNG_UARTS
struct platform_device *platdev; struct platform_device *platdev;
struct s3c2410_uartcfg *cfgptr = uart_cfgs; struct s3c2410_uartcfg *cfgptr = uart_cfgs;
struct s3c24xx_uart_resources *resp; struct s3c24xx_uart_resources *resp;
...@@ -134,6 +137,7 @@ void __init s3c24xx_init_uartdevs(char *name, ...@@ -134,6 +137,7 @@ void __init s3c24xx_init_uartdevs(char *name,
} }
nr_uarts = no; nr_uarts = no;
#endif
} }
void __init s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no) void __init s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no)
......
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