aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa
diff options
context:
space:
mode:
authorHaojian Zhuang <haojian.zhuang@linaro.org>2013-04-07 04:44:33 -0400
committerHaojian Zhuang <haojian.zhuang@linaro.org>2013-04-10 21:59:23 -0400
commit2cab0292285ce3180224c130d2fb1104aee44ff1 (patch)
treea3f8bea618053618e7e1461b743ac7cb6e444454 /arch/arm/mach-pxa
parent31880c37c11e28cb81c70757e38392b42e695dc6 (diff)
ARM: pxa: remove cpu_is_xxx in gpio driver
Avoid to use cpu_is_xxx() in pxa gpio driver. Use platform_device_id to identify the difference. Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org> Acked-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/arm/mach-pxa')
-rw-r--r--arch/arm/mach-pxa/devices.c29
-rw-r--r--arch/arm/mach-pxa/devices.h6
-rw-r--r--arch/arm/mach-pxa/pxa25x.c8
-rw-r--r--arch/arm/mach-pxa/pxa27x.c4
-rw-r--r--arch/arm/mach-pxa/pxa3xx.c14
-rw-r--r--arch/arm/mach-pxa/pxa930.c5
6 files changed, 55 insertions, 11 deletions
diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c
index daa86d39ed9e..666094315ab1 100644
--- a/arch/arm/mach-pxa/devices.c
+++ b/arch/arm/mach-pxa/devices.c
@@ -1107,8 +1107,33 @@ struct resource pxa_resource_gpio[] = {
1107 }, 1107 },
1108}; 1108};
1109 1109
1110struct platform_device pxa_device_gpio = { 1110struct platform_device pxa25x_device_gpio = {
1111 .name = "pxa-gpio", 1111#ifdef CONFIG_CPU_PXA26x
1112 .name = "pxa26x-gpio",
1113#else
1114 .name = "pxa25x-gpio",
1115#endif
1116 .id = -1,
1117 .num_resources = ARRAY_SIZE(pxa_resource_gpio),
1118 .resource = pxa_resource_gpio,
1119};
1120
1121struct platform_device pxa27x_device_gpio = {
1122 .name = "pxa27x-gpio",
1123 .id = -1,
1124 .num_resources = ARRAY_SIZE(pxa_resource_gpio),
1125 .resource = pxa_resource_gpio,
1126};
1127
1128struct platform_device pxa3xx_device_gpio = {
1129 .name = "pxa3xx-gpio",
1130 .id = -1,
1131 .num_resources = ARRAY_SIZE(pxa_resource_gpio),
1132 .resource = pxa_resource_gpio,
1133};
1134
1135struct platform_device pxa93x_device_gpio = {
1136 .name = "pxa93x-gpio",
1112 .id = -1, 1137 .id = -1,
1113 .num_resources = ARRAY_SIZE(pxa_resource_gpio), 1138 .num_resources = ARRAY_SIZE(pxa_resource_gpio),
1114 .resource = pxa_resource_gpio, 1139 .resource = pxa_resource_gpio,
diff --git a/arch/arm/mach-pxa/devices.h b/arch/arm/mach-pxa/devices.h
index 1475db107254..0f3fd0d65b12 100644
--- a/arch/arm/mach-pxa/devices.h
+++ b/arch/arm/mach-pxa/devices.h
@@ -16,7 +16,6 @@ extern struct platform_device pxa_device_ficp;
16extern struct platform_device sa1100_device_rtc; 16extern struct platform_device sa1100_device_rtc;
17extern struct platform_device pxa_device_rtc; 17extern struct platform_device pxa_device_rtc;
18extern struct platform_device pxa_device_ac97; 18extern struct platform_device pxa_device_ac97;
19extern struct platform_device pxa_device_gpio;
20 19
21extern struct platform_device pxa27x_device_i2c_power; 20extern struct platform_device pxa27x_device_i2c_power;
22extern struct platform_device pxa27x_device_ohci; 21extern struct platform_device pxa27x_device_ohci;
@@ -46,4 +45,9 @@ extern struct platform_device pxa_device_asoc_ssp2;
46extern struct platform_device pxa_device_asoc_ssp3; 45extern struct platform_device pxa_device_asoc_ssp3;
47extern struct platform_device pxa_device_asoc_ssp4; 46extern struct platform_device pxa_device_asoc_ssp4;
48 47
48extern struct platform_device pxa25x_device_gpio;
49extern struct platform_device pxa27x_device_gpio;
50extern struct platform_device pxa3xx_device_gpio;
51extern struct platform_device pxa93x_device_gpio;
52
49void __init pxa_register_device(struct platform_device *dev, void *data); 53void __init pxa_register_device(struct platform_device *dev, void *data);
diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c
index 3f5171eaf67b..e31a8812cf0d 100644
--- a/arch/arm/mach-pxa/pxa25x.c
+++ b/arch/arm/mach-pxa/pxa25x.c
@@ -208,7 +208,11 @@ static struct clk_lookup pxa25x_clkregs[] = {
208 INIT_CLKREG(&clk_pxa25x_gpio11, NULL, "GPIO11_CLK"), 208 INIT_CLKREG(&clk_pxa25x_gpio11, NULL, "GPIO11_CLK"),
209 INIT_CLKREG(&clk_pxa25x_gpio12, NULL, "GPIO12_CLK"), 209 INIT_CLKREG(&clk_pxa25x_gpio12, NULL, "GPIO12_CLK"),
210 INIT_CLKREG(&clk_pxa25x_mem, "pxa2xx-pcmcia", NULL), 210 INIT_CLKREG(&clk_pxa25x_mem, "pxa2xx-pcmcia", NULL),
211 INIT_CLKREG(&clk_dummy, "pxa-gpio", NULL), 211#ifdef CONFIG_CPU_PXA26x
212 INIT_CLKREG(&clk_dummy, "pxa26x-gpio", NULL),
213#else
214 INIT_CLKREG(&clk_dummy, "pxa25x-gpio", NULL),
215#endif
212 INIT_CLKREG(&clk_dummy, "sa1100-rtc", NULL), 216 INIT_CLKREG(&clk_dummy, "sa1100-rtc", NULL),
213}; 217};
214 218
@@ -375,7 +379,7 @@ static int __init pxa25x_init(void)
375 register_syscore_ops(&pxa2xx_mfp_syscore_ops); 379 register_syscore_ops(&pxa2xx_mfp_syscore_ops);
376 register_syscore_ops(&pxa2xx_clock_syscore_ops); 380 register_syscore_ops(&pxa2xx_clock_syscore_ops);
377 381
378 pxa_register_device(&pxa_device_gpio, &pxa25x_gpio_info); 382 pxa_register_device(&pxa25x_device_gpio, &pxa25x_gpio_info);
379 ret = platform_add_devices(pxa25x_devices, 383 ret = platform_add_devices(pxa25x_devices,
380 ARRAY_SIZE(pxa25x_devices)); 384 ARRAY_SIZE(pxa25x_devices));
381 if (ret) 385 if (ret)
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index 3203a9f5b4a2..7635ec5c9a1d 100644
--- a/arch/arm/mach-pxa/pxa27x.c
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -237,7 +237,7 @@ static struct clk_lookup pxa27x_clkregs[] = {
237 INIT_CLKREG(&clk_pxa27x_im, NULL, "IMCLK"), 237 INIT_CLKREG(&clk_pxa27x_im, NULL, "IMCLK"),
238 INIT_CLKREG(&clk_pxa27x_memc, NULL, "MEMCLK"), 238 INIT_CLKREG(&clk_pxa27x_memc, NULL, "MEMCLK"),
239 INIT_CLKREG(&clk_pxa27x_mem, "pxa2xx-pcmcia", NULL), 239 INIT_CLKREG(&clk_pxa27x_mem, "pxa2xx-pcmcia", NULL),
240 INIT_CLKREG(&clk_dummy, "pxa-gpio", NULL), 240 INIT_CLKREG(&clk_dummy, "pxa27x-gpio", NULL),
241 INIT_CLKREG(&clk_dummy, "sa1100-rtc", NULL), 241 INIT_CLKREG(&clk_dummy, "sa1100-rtc", NULL),
242}; 242};
243 243
@@ -470,7 +470,7 @@ static int __init pxa27x_init(void)
470 register_syscore_ops(&pxa2xx_mfp_syscore_ops); 470 register_syscore_ops(&pxa2xx_mfp_syscore_ops);
471 register_syscore_ops(&pxa2xx_clock_syscore_ops); 471 register_syscore_ops(&pxa2xx_clock_syscore_ops);
472 472
473 pxa_register_device(&pxa_device_gpio, &pxa27x_gpio_info); 473 pxa_register_device(&pxa27x_device_gpio, &pxa27x_gpio_info);
474 ret = platform_add_devices(devices, ARRAY_SIZE(devices)); 474 ret = platform_add_devices(devices, ARRAY_SIZE(devices));
475 } 475 }
476 476
diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c
index 656a1bb16d14..572666a1e4a8 100644
--- a/arch/arm/mach-pxa/pxa3xx.c
+++ b/arch/arm/mach-pxa/pxa3xx.c
@@ -92,7 +92,8 @@ static struct clk_lookup pxa3xx_clkregs[] = {
92 INIT_CLKREG(&clk_pxa3xx_mmc1, "pxa2xx-mci.0", NULL), 92 INIT_CLKREG(&clk_pxa3xx_mmc1, "pxa2xx-mci.0", NULL),
93 INIT_CLKREG(&clk_pxa3xx_mmc2, "pxa2xx-mci.1", NULL), 93 INIT_CLKREG(&clk_pxa3xx_mmc2, "pxa2xx-mci.1", NULL),
94 INIT_CLKREG(&clk_pxa3xx_smemc, "pxa2xx-pcmcia", NULL), 94 INIT_CLKREG(&clk_pxa3xx_smemc, "pxa2xx-pcmcia", NULL),
95 INIT_CLKREG(&clk_pxa3xx_gpio, "pxa-gpio", NULL), 95 INIT_CLKREG(&clk_pxa3xx_gpio, "pxa3xx-gpio", NULL),
96 INIT_CLKREG(&clk_pxa3xx_gpio, "pxa93x-gpio", NULL),
96 INIT_CLKREG(&clk_dummy, "sa1100-rtc", NULL), 97 INIT_CLKREG(&clk_dummy, "sa1100-rtc", NULL),
97}; 98};
98 99
@@ -436,7 +437,6 @@ void __init pxa3xx_set_i2c_power_info(struct i2c_pxa_platform_data *info)
436} 437}
437 438
438static struct platform_device *devices[] __initdata = { 439static struct platform_device *devices[] __initdata = {
439 &pxa_device_gpio,
440 &pxa27x_device_udc, 440 &pxa27x_device_udc,
441 &pxa_device_pmu, 441 &pxa_device_pmu,
442 &pxa_device_i2s, 442 &pxa_device_i2s,
@@ -482,8 +482,14 @@ static int __init pxa3xx_init(void)
482 register_syscore_ops(&pxa3xx_mfp_syscore_ops); 482 register_syscore_ops(&pxa3xx_mfp_syscore_ops);
483 register_syscore_ops(&pxa3xx_clock_syscore_ops); 483 register_syscore_ops(&pxa3xx_clock_syscore_ops);
484 484
485 if (!of_have_populated_dt()) 485 if (of_have_populated_dt())
486 ret = platform_add_devices(devices, ARRAY_SIZE(devices)); 486 return 0;
487
488 ret = platform_add_devices(devices, ARRAY_SIZE(devices));
489 if (ret)
490 return ret;
491 if (cpu_is_pxa300() || cpu_is_pxa310() || cpu_is_pxa320())
492 ret = platform_device_register(&pxa3xx_device_gpio);
487 } 493 }
488 494
489 return ret; 495 return ret;
diff --git a/arch/arm/mach-pxa/pxa930.c b/arch/arm/mach-pxa/pxa930.c
index 8aeacf908784..4693a78948aa 100644
--- a/arch/arm/mach-pxa/pxa930.c
+++ b/arch/arm/mach-pxa/pxa930.c
@@ -18,6 +18,8 @@
18 18
19#include <mach/pxa930.h> 19#include <mach/pxa930.h>
20 20
21#include "devices.h"
22
21static struct mfp_addr_map pxa930_mfp_addr_map[] __initdata = { 23static struct mfp_addr_map pxa930_mfp_addr_map[] __initdata = {
22 24
23 MFP_ADDR(GPIO0, 0x02e0), 25 MFP_ADDR(GPIO0, 0x02e0),
@@ -192,9 +194,12 @@ static struct mfp_addr_map pxa935_mfp_addr_map[] __initdata = {
192 194
193static int __init pxa930_init(void) 195static int __init pxa930_init(void)
194{ 196{
197 int ret = 0;
198
195 if (cpu_is_pxa93x()) { 199 if (cpu_is_pxa93x()) {
196 mfp_init_base(io_p2v(MFPR_BASE)); 200 mfp_init_base(io_p2v(MFPR_BASE));
197 mfp_init_addr(pxa930_mfp_addr_map); 201 mfp_init_addr(pxa930_mfp_addr_map);
202 ret = platform_device_register(&pxa93x_device_gpio);
198 } 203 }
199 204
200 if (cpu_is_pxa935()) 205 if (cpu_is_pxa935())