aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2014-02-26 11:55:35 -0500
committerArnd Bergmann <arnd@arndb.de>2014-03-21 13:26:20 -0400
commit0443a653982942da4237b8344027bbb86e4b83a1 (patch)
tree4591fd96af266d97671a491a5677be857838a6ac /arch/arm
parent943fa72629d9f5e8d3df5fc39351fe3360ff03cb (diff)
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: Arnd Bergmann <arnd@arndb.de> Acked-by: Kukjin Kim <kgene.kim@samsung.com> Cc: Tomasz Figa <tomasz.figa@gmail.com> Cc: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-s3c64xx/irq-pm.c12
-rw-r--r--arch/arm/mach-s5p64x0/irq-pm.c6
-rw-r--r--arch/arm/plat-samsung/init.c4
3 files changed, 19 insertions, 3 deletions
diff --git a/arch/arm/mach-s3c64xx/irq-pm.c b/arch/arm/mach-s3c64xx/irq-pm.c
index 1649c0d1c1b8..ddf65583a5d8 100644
--- a/arch/arm/mach-s3c64xx/irq-pm.c
+++ b/arch/arm/mach-s3c64xx/irq-pm.c
@@ -55,7 +55,13 @@ static struct irq_grp_save {
55 u32 mask; 55 u32 mask;
56} eint_grp_save[5]; 56} eint_grp_save[5];
57 57
58static u32 irq_uart_mask[CONFIG_SERIAL_SAMSUNG_UARTS]; 58#ifndef CONFIG_SERIAL_SAMSUNG_UARTS
59#define SERIAL_SAMSUNG_UARTS 0
60#else
61#define SERIAL_SAMSUNG_UARTS CONFIG_SERIAL_SAMSUNG_UARTS
62#endif
63
64static u32 irq_uart_mask[SERIAL_SAMSUNG_UARTS];
59 65
60static int s3c64xx_irq_pm_suspend(void) 66static int s3c64xx_irq_pm_suspend(void)
61{ 67{
@@ -66,7 +72,7 @@ static int s3c64xx_irq_pm_suspend(void)
66 72
67 s3c_pm_do_save(irq_save, ARRAY_SIZE(irq_save)); 73 s3c_pm_do_save(irq_save, ARRAY_SIZE(irq_save));
68 74
69 for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++) 75 for (i = 0; i < SERIAL_SAMSUNG_UARTS; i++)
70 irq_uart_mask[i] = __raw_readl(S3C_VA_UARTx(i) + S3C64XX_UINTM); 76 irq_uart_mask[i] = __raw_readl(S3C_VA_UARTx(i) + S3C64XX_UINTM);
71 77
72 for (i = 0; i < ARRAY_SIZE(eint_grp_save); i++, grp++) { 78 for (i = 0; i < ARRAY_SIZE(eint_grp_save); i++, grp++) {
@@ -87,7 +93,7 @@ static void s3c64xx_irq_pm_resume(void)
87 93
88 s3c_pm_do_restore(irq_save, ARRAY_SIZE(irq_save)); 94 s3c_pm_do_restore(irq_save, ARRAY_SIZE(irq_save));
89 95
90 for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++) 96 for (i = 0; i < SERIAL_SAMSUNG_UARTS; i++)
91 __raw_writel(irq_uart_mask[i], S3C_VA_UARTx(i) + S3C64XX_UINTM); 97 __raw_writel(irq_uart_mask[i], S3C_VA_UARTx(i) + S3C64XX_UINTM);
92 98
93 for (i = 0; i < ARRAY_SIZE(eint_grp_save); i++, grp++) { 99 for (i = 0; i < ARRAY_SIZE(eint_grp_save); i++, grp++) {
diff --git a/arch/arm/mach-s5p64x0/irq-pm.c b/arch/arm/mach-s5p64x0/irq-pm.c
index 3e6f2456ee9d..d5f0fd66b635 100644
--- a/arch/arm/mach-s5p64x0/irq-pm.c
+++ b/arch/arm/mach-s5p64x0/irq-pm.c
@@ -34,7 +34,9 @@ static struct irq_grp_save {
34 u32 mask; 34 u32 mask;
35} eint_grp_save[4]; 35} eint_grp_save[4];
36 36
37#ifdef CONFIG_SERIAL_SAMSUNG
37static u32 irq_uart_mask[CONFIG_SERIAL_SAMSUNG_UARTS]; 38static u32 irq_uart_mask[CONFIG_SERIAL_SAMSUNG_UARTS];
39#endif
38 40
39static int s5p64x0_irq_pm_suspend(void) 41static int s5p64x0_irq_pm_suspend(void)
40{ 42{
@@ -45,8 +47,10 @@ static int s5p64x0_irq_pm_suspend(void)
45 47
46 s3c_pm_do_save(irq_save, ARRAY_SIZE(irq_save)); 48 s3c_pm_do_save(irq_save, ARRAY_SIZE(irq_save));
47 49
50#ifdef CONFIG_SERIAL_SAMSUNG
48 for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++) 51 for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++)
49 irq_uart_mask[i] = __raw_readl(S3C_VA_UARTx(i) + S3C64XX_UINTM); 52 irq_uart_mask[i] = __raw_readl(S3C_VA_UARTx(i) + S3C64XX_UINTM);
53#endif
50 54
51 for (i = 0; i < ARRAY_SIZE(eint_grp_save); i++, grp++) { 55 for (i = 0; i < ARRAY_SIZE(eint_grp_save); i++, grp++) {
52 grp->con = __raw_readl(S5P64X0_EINT12CON + (i * 4)); 56 grp->con = __raw_readl(S5P64X0_EINT12CON + (i * 4));
@@ -66,8 +70,10 @@ static void s5p64x0_irq_pm_resume(void)
66 70
67 s3c_pm_do_restore(irq_save, ARRAY_SIZE(irq_save)); 71 s3c_pm_do_restore(irq_save, ARRAY_SIZE(irq_save));
68 72
73#ifdef CONFIG_SERIAL_SAMSUNG
69 for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++) 74 for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++)
70 __raw_writel(irq_uart_mask[i], S3C_VA_UARTx(i) + S3C64XX_UINTM); 75 __raw_writel(irq_uart_mask[i], S3C_VA_UARTx(i) + S3C64XX_UINTM);
76#endif
71 77
72 for (i = 0; i < ARRAY_SIZE(eint_grp_save); i++, grp++) { 78 for (i = 0; i < ARRAY_SIZE(eint_grp_save); i++, grp++) {
73 __raw_writel(grp->con, S5P64X0_EINT12CON + (i * 4)); 79 __raw_writel(grp->con, S5P64X0_EINT12CON + (i * 4));
diff --git a/arch/arm/plat-samsung/init.c b/arch/arm/plat-samsung/init.c
index aa9511b6914a..a30df396ca34 100644
--- a/arch/arm/plat-samsung/init.c
+++ b/arch/arm/plat-samsung/init.c
@@ -97,7 +97,9 @@ void __init s3c24xx_init_clocks(int xtal)
97#if IS_ENABLED(CONFIG_SAMSUNG_ATAGS) 97#if IS_ENABLED(CONFIG_SAMSUNG_ATAGS)
98static int nr_uarts __initdata = 0; 98static int nr_uarts __initdata = 0;
99 99
100#ifdef CONFIG_SERIAL_SAMSUNG_UARTS
100static struct s3c2410_uartcfg uart_cfgs[CONFIG_SERIAL_SAMSUNG_UARTS]; 101static struct s3c2410_uartcfg uart_cfgs[CONFIG_SERIAL_SAMSUNG_UARTS];
102#endif
101 103
102/* s3c24xx_init_uartdevs 104/* s3c24xx_init_uartdevs
103 * 105 *
@@ -112,6 +114,7 @@ void __init s3c24xx_init_uartdevs(char *name,
112 struct s3c24xx_uart_resources *res, 114 struct s3c24xx_uart_resources *res,
113 struct s3c2410_uartcfg *cfg, int no) 115 struct s3c2410_uartcfg *cfg, int no)
114{ 116{
117#ifdef CONFIG_SERIAL_SAMSUNG_UARTS
115 struct platform_device *platdev; 118 struct platform_device *platdev;
116 struct s3c2410_uartcfg *cfgptr = uart_cfgs; 119 struct s3c2410_uartcfg *cfgptr = uart_cfgs;
117 struct s3c24xx_uart_resources *resp; 120 struct s3c24xx_uart_resources *resp;
@@ -134,6 +137,7 @@ void __init s3c24xx_init_uartdevs(char *name,
134 } 137 }
135 138
136 nr_uarts = no; 139 nr_uarts = no;
140#endif
137} 141}
138 142
139void __init s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no) 143void __init s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no)