aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2013-10-14 22:45:36 -0400
committerSimon Horman <horms+renesas@verge.net.au>2013-11-24 01:14:30 -0500
commit4bd4c5b32b851b07d81209e1dc0c8b20b283f2e2 (patch)
treecf5428f80e21e23e573fa292b4800363246e1607
parent22e247ef146b9a13c836a005e04ce909e3e16966 (diff)
ARM: shmobile: r8a7779: cleanup registration of VIN
VIN driver which needs platform data at the time of registration is used from Marzen only. Now, ARM/shmobile aims to support DT, and the C code base board support will be removed if DT support is completed. Current driver registration method which needs platform data and which is not shared complicates codes. This means legacy C code cleanup after DT supporting will be more complicated This patch registers it on board code as cleanup C code Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Magnus Damm <damm@opensource.se> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
-rw-r--r--arch/arm/mach-shmobile/board-marzen.c24
-rw-r--r--arch/arm/mach-shmobile/include/mach/r8a7779.h2
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7779.c37
3 files changed, 22 insertions, 41 deletions
diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
index da1352f5f71b..fa102f7d149c 100644
--- a/arch/arm/mach-shmobile/board-marzen.c
+++ b/arch/arm/mach-shmobile/board-marzen.c
@@ -259,10 +259,30 @@ static struct platform_device leds_device = {
259 }, 259 },
260}; 260};
261 261
262/* VIN */
262static struct rcar_vin_platform_data vin_platform_data __initdata = { 263static struct rcar_vin_platform_data vin_platform_data __initdata = {
263 .flags = RCAR_VIN_BT656, 264 .flags = RCAR_VIN_BT656,
264}; 265};
265 266
267#define MARZEN_VIN(idx) \
268static struct resource vin##idx##_resources[] __initdata = { \
269 DEFINE_RES_MEM(0xffc50000 + 0x1000 * (idx), 0x1000), \
270 DEFINE_RES_IRQ(gic_iid(0x5f + (idx))), \
271}; \
272 \
273static struct platform_device_info vin##idx##_info __initdata = { \
274 .parent = &platform_bus, \
275 .name = "r8a7779-vin", \
276 .id = idx, \
277 .res = vin##idx##_resources, \
278 .num_res = ARRAY_SIZE(vin##idx##_resources), \
279 .dma_mask = DMA_BIT_MASK(32), \
280 .data = &vin_platform_data, \
281 .size_data = sizeof(vin_platform_data), \
282}
283MARZEN_VIN(1);
284MARZEN_VIN(3);
285
266#define MARZEN_CAMERA(idx) \ 286#define MARZEN_CAMERA(idx) \
267static struct i2c_board_info camera##idx##_info = { \ 287static struct i2c_board_info camera##idx##_info = { \
268 I2C_BOARD_INFO("adv7180", 0x20 + (idx)), \ 288 I2C_BOARD_INFO("adv7180", 0x20 + (idx)), \
@@ -367,8 +387,8 @@ static void __init marzen_init(void)
367 r8a7779_init_irq_extpin(1); /* IRQ1 as individual interrupt */ 387 r8a7779_init_irq_extpin(1); /* IRQ1 as individual interrupt */
368 388
369 r8a7779_add_standard_devices(); 389 r8a7779_add_standard_devices();
370 r8a7779_add_vin_device(1, &vin_platform_data); 390 platform_device_register_full(&vin1_info);
371 r8a7779_add_vin_device(3, &vin_platform_data); 391 platform_device_register_full(&vin3_info);
372 platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices)); 392 platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices));
373 marzen_add_du_device(); 393 marzen_add_du_device();
374} 394}
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7779.h b/arch/arm/mach-shmobile/include/mach/r8a7779.h
index 17af34ed89c8..905420a2f11f 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7779.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7779.h
@@ -41,8 +41,6 @@ extern void r8a7779_add_early_devices(void);
41extern void r8a7779_add_standard_devices(void); 41extern void r8a7779_add_standard_devices(void);
42extern void r8a7779_add_standard_devices_dt(void); 42extern void r8a7779_add_standard_devices_dt(void);
43extern void r8a7779_add_ether_device(struct sh_eth_plat_data *pdata); 43extern void r8a7779_add_ether_device(struct sh_eth_plat_data *pdata);
44extern void r8a7779_add_vin_device(int idx,
45 struct rcar_vin_platform_data *pdata);
46extern void r8a7779_init_late(void); 44extern void r8a7779_init_late(void);
47extern void r8a7779_clock_init(void); 45extern void r8a7779_clock_init(void);
48extern void r8a7779_pinmux_init(void); 46extern void r8a7779_pinmux_init(void);
diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c
index 13049e9d691c..51a43c52c611 100644
--- a/arch/arm/mach-shmobile/setup-r8a7779.c
+++ b/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -610,33 +610,6 @@ static struct resource ether_resources[] __initdata = {
610 }, 610 },
611}; 611};
612 612
613#define R8A7779_VIN(idx) \
614static struct resource vin##idx##_resources[] __initdata = { \
615 DEFINE_RES_MEM(0xffc50000 + 0x1000 * (idx), 0x1000), \
616 DEFINE_RES_IRQ(gic_iid(0x5f + (idx))), \
617}; \
618 \
619static struct platform_device_info vin##idx##_info __initdata = { \
620 .parent = &platform_bus, \
621 .name = "r8a7779-vin", \
622 .id = idx, \
623 .res = vin##idx##_resources, \
624 .num_res = ARRAY_SIZE(vin##idx##_resources), \
625 .dma_mask = DMA_BIT_MASK(32), \
626}
627
628R8A7779_VIN(0);
629R8A7779_VIN(1);
630R8A7779_VIN(2);
631R8A7779_VIN(3);
632
633static struct platform_device_info *vin_info_table[] __initdata = {
634 &vin0_info,
635 &vin1_info,
636 &vin2_info,
637 &vin3_info,
638};
639
640/* HPB-DMA */ 613/* HPB-DMA */
641 614
642/* Asynchronous mode register bits */ 615/* Asynchronous mode register bits */
@@ -833,16 +806,6 @@ void __init r8a7779_add_ether_device(struct sh_eth_plat_data *pdata)
833 pdata, sizeof(*pdata)); 806 pdata, sizeof(*pdata));
834} 807}
835 808
836void __init r8a7779_add_vin_device(int id, struct rcar_vin_platform_data *pdata)
837{
838 BUG_ON(id < 0 || id > 3);
839
840 vin_info_table[id]->data = pdata;
841 vin_info_table[id]->size_data = sizeof(*pdata);
842
843 platform_device_register_full(vin_info_table[id]);
844}
845
846/* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */ 809/* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */
847void __init __weak r8a7779_register_twd(void) { } 810void __init __weak r8a7779_register_twd(void) { }
848 811