diff options
author | Vladimir Barinov <vladimir.barinov@cogentembedded.com> | 2013-08-22 16:23:13 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2013-08-25 06:33:29 -0400 |
commit | 4714a0255eee45b87634ab28f8a7e66038f645ba (patch) | |
tree | a6c926508ede803325ac8c3ed78c272964779fa1 /arch/arm/mach-shmobile/setup-r8a7779.c | |
parent | 04e40bdd67afc5ab94d983417f18bb1f20b08eac (diff) |
[media] ARM: shmobile: r8a7779: add VIN support
Add VIN clocks and platform devices for R8A7779 SoC; add function to register
the VIN platform devices.
[Sergei: added 'id' parameter check to r8a7779_add_vin_device(), used '*pdata'
in *sizeof* operator there, renamed some variables, annotated vin[0-3]_resources
[] and 'vin[0-3]_info' as '__initdata'.]
Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'arch/arm/mach-shmobile/setup-r8a7779.c')
-rw-r--r-- | arch/arm/mach-shmobile/setup-r8a7779.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c index 398687761f50..3d8928895503 100644 --- a/arch/arm/mach-shmobile/setup-r8a7779.c +++ b/arch/arm/mach-shmobile/setup-r8a7779.c | |||
@@ -559,6 +559,33 @@ static struct resource ether_resources[] = { | |||
559 | }, | 559 | }, |
560 | }; | 560 | }; |
561 | 561 | ||
562 | #define R8A7779_VIN(idx) \ | ||
563 | static struct resource vin##idx##_resources[] __initdata = { \ | ||
564 | DEFINE_RES_MEM(0xffc50000 + 0x1000 * (idx), 0x1000), \ | ||
565 | DEFINE_RES_IRQ(gic_iid(0x5f + (idx))), \ | ||
566 | }; \ | ||
567 | \ | ||
568 | static struct platform_device_info vin##idx##_info __initdata = { \ | ||
569 | .parent = &platform_bus, \ | ||
570 | .name = "r8a7779-vin", \ | ||
571 | .id = idx, \ | ||
572 | .res = vin##idx##_resources, \ | ||
573 | .num_res = ARRAY_SIZE(vin##idx##_resources), \ | ||
574 | .dma_mask = DMA_BIT_MASK(32), \ | ||
575 | } | ||
576 | |||
577 | R8A7779_VIN(0); | ||
578 | R8A7779_VIN(1); | ||
579 | R8A7779_VIN(2); | ||
580 | R8A7779_VIN(3); | ||
581 | |||
582 | static struct platform_device_info *vin_info_table[] __initdata = { | ||
583 | &vin0_info, | ||
584 | &vin1_info, | ||
585 | &vin2_info, | ||
586 | &vin3_info, | ||
587 | }; | ||
588 | |||
562 | static struct platform_device *r8a7779_devices_dt[] __initdata = { | 589 | static struct platform_device *r8a7779_devices_dt[] __initdata = { |
563 | &scif0_device, | 590 | &scif0_device, |
564 | &scif1_device, | 591 | &scif1_device, |
@@ -610,6 +637,16 @@ void __init r8a7779_add_usb_phy_device(struct rcar_phy_platform_data *pdata) | |||
610 | pdata, sizeof(*pdata)); | 637 | pdata, sizeof(*pdata)); |
611 | } | 638 | } |
612 | 639 | ||
640 | void __init r8a7779_add_vin_device(int id, struct rcar_vin_platform_data *pdata) | ||
641 | { | ||
642 | BUG_ON(id < 0 || id > 3); | ||
643 | |||
644 | vin_info_table[id]->data = pdata; | ||
645 | vin_info_table[id]->size_data = sizeof(*pdata); | ||
646 | |||
647 | platform_device_register_full(vin_info_table[id]); | ||
648 | } | ||
649 | |||
613 | /* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */ | 650 | /* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */ |
614 | void __init __weak r8a7779_register_twd(void) { } | 651 | void __init __weak r8a7779_register_twd(void) { } |
615 | 652 | ||