diff options
author | Lad, Prabhakar <prabhakar.lad@ti.com> | 2012-11-20 05:30:36 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-12-21 11:18:50 -0500 |
commit | caff80c35f923806b7e5ef312dce41663b5e99b9 (patch) | |
tree | a7dc2f10963df469808b7a52fd90276701d644f5 /arch/arm/mach-davinci | |
parent | 5a89fac7e90dd75b9783914fa351069d20fd8c54 (diff) |
[media] davinci: vpbe: pass different platform names to handle different ip's
The vpbe driver can handle different platforms DM644X, DM36X and
DM355. To differentiate between this platforms venc_type/vpbe_type
was passed as part of platform data which was incorrect. The correct
way to differentiate to handle this case is by passing different
platform names.
This patch creates platform_device_id[] array supporting different
platforms and assigns id_table to the platform driver, and finally
in the probe gets the actual device by using platform_get_device_id()
and gets the appropriate driver data for that platform.
Taking this approach will also make the DT transition easier.
Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
Acked-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'arch/arm/mach-davinci')
-rw-r--r-- | arch/arm/mach-davinci/board-dm644x-evm.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-davinci/dm644x.c | 10 |
2 files changed, 6 insertions, 12 deletions
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c index f22572cee49d..b00ade498077 100644 --- a/arch/arm/mach-davinci/board-dm644x-evm.c +++ b/arch/arm/mach-davinci/board-dm644x-evm.c | |||
@@ -689,7 +689,7 @@ static struct vpbe_output dm644xevm_vpbe_outputs[] = { | |||
689 | .std = VENC_STD_ALL, | 689 | .std = VENC_STD_ALL, |
690 | .capabilities = V4L2_OUT_CAP_STD, | 690 | .capabilities = V4L2_OUT_CAP_STD, |
691 | }, | 691 | }, |
692 | .subdev_name = VPBE_VENC_SUBDEV_NAME, | 692 | .subdev_name = DM644X_VPBE_VENC_SUBDEV_NAME, |
693 | .default_mode = "ntsc", | 693 | .default_mode = "ntsc", |
694 | .num_modes = ARRAY_SIZE(dm644xevm_enc_std_timing), | 694 | .num_modes = ARRAY_SIZE(dm644xevm_enc_std_timing), |
695 | .modes = dm644xevm_enc_std_timing, | 695 | .modes = dm644xevm_enc_std_timing, |
@@ -701,7 +701,7 @@ static struct vpbe_output dm644xevm_vpbe_outputs[] = { | |||
701 | .type = V4L2_OUTPUT_TYPE_ANALOG, | 701 | .type = V4L2_OUTPUT_TYPE_ANALOG, |
702 | .capabilities = V4L2_OUT_CAP_DV_TIMINGS, | 702 | .capabilities = V4L2_OUT_CAP_DV_TIMINGS, |
703 | }, | 703 | }, |
704 | .subdev_name = VPBE_VENC_SUBDEV_NAME, | 704 | .subdev_name = DM644X_VPBE_VENC_SUBDEV_NAME, |
705 | .default_mode = "480p59_94", | 705 | .default_mode = "480p59_94", |
706 | .num_modes = ARRAY_SIZE(dm644xevm_enc_preset_timing), | 706 | .num_modes = ARRAY_SIZE(dm644xevm_enc_preset_timing), |
707 | .modes = dm644xevm_enc_preset_timing, | 707 | .modes = dm644xevm_enc_preset_timing, |
@@ -712,10 +712,10 @@ static struct vpbe_config dm644xevm_display_cfg = { | |||
712 | .module_name = "dm644x-vpbe-display", | 712 | .module_name = "dm644x-vpbe-display", |
713 | .i2c_adapter_id = 1, | 713 | .i2c_adapter_id = 1, |
714 | .osd = { | 714 | .osd = { |
715 | .module_name = VPBE_OSD_SUBDEV_NAME, | 715 | .module_name = DM644X_VPBE_OSD_SUBDEV_NAME, |
716 | }, | 716 | }, |
717 | .venc = { | 717 | .venc = { |
718 | .module_name = VPBE_VENC_SUBDEV_NAME, | 718 | .module_name = DM644X_VPBE_VENC_SUBDEV_NAME, |
719 | }, | 719 | }, |
720 | .num_outputs = ARRAY_SIZE(dm644xevm_vpbe_outputs), | 720 | .num_outputs = ARRAY_SIZE(dm644xevm_vpbe_outputs), |
721 | .outputs = dm644xevm_vpbe_outputs, | 721 | .outputs = dm644xevm_vpbe_outputs, |
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c index 14e9947bad6e..0849d5768d99 100644 --- a/arch/arm/mach-davinci/dm644x.c +++ b/arch/arm/mach-davinci/dm644x.c | |||
@@ -669,19 +669,14 @@ static struct resource dm644x_osd_resources[] = { | |||
669 | }, | 669 | }, |
670 | }; | 670 | }; |
671 | 671 | ||
672 | static struct osd_platform_data dm644x_osd_data = { | ||
673 | .vpbe_type = VPBE_VERSION_1, | ||
674 | }; | ||
675 | |||
676 | static struct platform_device dm644x_osd_dev = { | 672 | static struct platform_device dm644x_osd_dev = { |
677 | .name = VPBE_OSD_SUBDEV_NAME, | 673 | .name = DM644X_VPBE_OSD_SUBDEV_NAME, |
678 | .id = -1, | 674 | .id = -1, |
679 | .num_resources = ARRAY_SIZE(dm644x_osd_resources), | 675 | .num_resources = ARRAY_SIZE(dm644x_osd_resources), |
680 | .resource = dm644x_osd_resources, | 676 | .resource = dm644x_osd_resources, |
681 | .dev = { | 677 | .dev = { |
682 | .dma_mask = &dm644x_video_dma_mask, | 678 | .dma_mask = &dm644x_video_dma_mask, |
683 | .coherent_dma_mask = DMA_BIT_MASK(32), | 679 | .coherent_dma_mask = DMA_BIT_MASK(32), |
684 | .platform_data = &dm644x_osd_data, | ||
685 | }, | 680 | }, |
686 | }; | 681 | }; |
687 | 682 | ||
@@ -751,12 +746,11 @@ static struct platform_device dm644x_vpbe_display = { | |||
751 | }; | 746 | }; |
752 | 747 | ||
753 | static struct venc_platform_data dm644x_venc_pdata = { | 748 | static struct venc_platform_data dm644x_venc_pdata = { |
754 | .venc_type = VPBE_VERSION_1, | ||
755 | .setup_clock = dm644x_venc_setup_clock, | 749 | .setup_clock = dm644x_venc_setup_clock, |
756 | }; | 750 | }; |
757 | 751 | ||
758 | static struct platform_device dm644x_venc_dev = { | 752 | static struct platform_device dm644x_venc_dev = { |
759 | .name = VPBE_VENC_SUBDEV_NAME, | 753 | .name = DM644X_VPBE_VENC_SUBDEV_NAME, |
760 | .id = -1, | 754 | .id = -1, |
761 | .num_resources = ARRAY_SIZE(dm644x_venc_resources), | 755 | .num_resources = ARRAY_SIZE(dm644x_venc_resources), |
762 | .resource = dm644x_venc_resources, | 756 | .resource = dm644x_venc_resources, |