diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2013-10-14 22:45:36 -0400 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2013-11-24 01:14:30 -0500 |
commit | 4bd4c5b32b851b07d81209e1dc0c8b20b283f2e2 (patch) | |
tree | cf5428f80e21e23e573fa292b4800363246e1607 | |
parent | 22e247ef146b9a13c836a005e04ce909e3e16966 (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.c | 24 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/include/mach/r8a7779.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/setup-r8a7779.c | 37 |
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 */ | ||
262 | static struct rcar_vin_platform_data vin_platform_data __initdata = { | 263 | static 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) \ | ||
268 | static struct resource vin##idx##_resources[] __initdata = { \ | ||
269 | DEFINE_RES_MEM(0xffc50000 + 0x1000 * (idx), 0x1000), \ | ||
270 | DEFINE_RES_IRQ(gic_iid(0x5f + (idx))), \ | ||
271 | }; \ | ||
272 | \ | ||
273 | static 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 | } | ||
283 | MARZEN_VIN(1); | ||
284 | MARZEN_VIN(3); | ||
285 | |||
266 | #define MARZEN_CAMERA(idx) \ | 286 | #define MARZEN_CAMERA(idx) \ |
267 | static struct i2c_board_info camera##idx##_info = { \ | 287 | static 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); | |||
41 | extern void r8a7779_add_standard_devices(void); | 41 | extern void r8a7779_add_standard_devices(void); |
42 | extern void r8a7779_add_standard_devices_dt(void); | 42 | extern void r8a7779_add_standard_devices_dt(void); |
43 | extern void r8a7779_add_ether_device(struct sh_eth_plat_data *pdata); | 43 | extern void r8a7779_add_ether_device(struct sh_eth_plat_data *pdata); |
44 | extern void r8a7779_add_vin_device(int idx, | ||
45 | struct rcar_vin_platform_data *pdata); | ||
46 | extern void r8a7779_init_late(void); | 44 | extern void r8a7779_init_late(void); |
47 | extern void r8a7779_clock_init(void); | 45 | extern void r8a7779_clock_init(void); |
48 | extern void r8a7779_pinmux_init(void); | 46 | extern 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) \ | ||
614 | static struct resource vin##idx##_resources[] __initdata = { \ | ||
615 | DEFINE_RES_MEM(0xffc50000 + 0x1000 * (idx), 0x1000), \ | ||
616 | DEFINE_RES_IRQ(gic_iid(0x5f + (idx))), \ | ||
617 | }; \ | ||
618 | \ | ||
619 | static 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 | |||
628 | R8A7779_VIN(0); | ||
629 | R8A7779_VIN(1); | ||
630 | R8A7779_VIN(2); | ||
631 | R8A7779_VIN(3); | ||
632 | |||
633 | static 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 | ||
836 | void __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 */ |
847 | void __init __weak r8a7779_register_twd(void) { } | 810 | void __init __weak r8a7779_register_twd(void) { } |
848 | 811 | ||