diff options
Diffstat (limited to 'arch/arm/mach-davinci/board-dm644x-evm.c')
-rw-r--r-- | arch/arm/mach-davinci/board-dm644x-evm.c | 135 |
1 files changed, 121 insertions, 14 deletions
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c index 1247ecdcf752..3683306e0245 100644 --- a/arch/arm/mach-davinci/board-dm644x-evm.c +++ b/arch/arm/mach-davinci/board-dm644x-evm.c | |||
@@ -30,7 +30,6 @@ | |||
30 | #include <asm/mach-types.h> | 30 | #include <asm/mach-types.h> |
31 | #include <asm/mach/arch.h> | 31 | #include <asm/mach/arch.h> |
32 | 32 | ||
33 | #include <mach/dm644x.h> | ||
34 | #include <mach/common.h> | 33 | #include <mach/common.h> |
35 | #include <mach/i2c.h> | 34 | #include <mach/i2c.h> |
36 | #include <mach/serial.h> | 35 | #include <mach/serial.h> |
@@ -40,6 +39,8 @@ | |||
40 | #include <mach/usb.h> | 39 | #include <mach/usb.h> |
41 | #include <mach/aemif.h> | 40 | #include <mach/aemif.h> |
42 | 41 | ||
42 | #include "davinci.h" | ||
43 | |||
43 | #define DM644X_EVM_PHY_ID "davinci_mdio-0:01" | 44 | #define DM644X_EVM_PHY_ID "davinci_mdio-0:01" |
44 | #define LXT971_PHY_ID (0x001378e2) | 45 | #define LXT971_PHY_ID (0x001378e2) |
45 | #define LXT971_PHY_MASK (0xfffffff0) | 46 | #define LXT971_PHY_MASK (0xfffffff0) |
@@ -189,7 +190,7 @@ static struct platform_device davinci_fb_device = { | |||
189 | .num_resources = 0, | 190 | .num_resources = 0, |
190 | }; | 191 | }; |
191 | 192 | ||
192 | static struct tvp514x_platform_data tvp5146_pdata = { | 193 | static struct tvp514x_platform_data dm644xevm_tvp5146_pdata = { |
193 | .clk_polarity = 0, | 194 | .clk_polarity = 0, |
194 | .hs_polarity = 1, | 195 | .hs_polarity = 1, |
195 | .vs_polarity = 1 | 196 | .vs_polarity = 1 |
@@ -197,7 +198,7 @@ static struct tvp514x_platform_data tvp5146_pdata = { | |||
197 | 198 | ||
198 | #define TVP514X_STD_ALL (V4L2_STD_NTSC | V4L2_STD_PAL) | 199 | #define TVP514X_STD_ALL (V4L2_STD_NTSC | V4L2_STD_PAL) |
199 | /* Inputs available at the TVP5146 */ | 200 | /* Inputs available at the TVP5146 */ |
200 | static struct v4l2_input tvp5146_inputs[] = { | 201 | static struct v4l2_input dm644xevm_tvp5146_inputs[] = { |
201 | { | 202 | { |
202 | .index = 0, | 203 | .index = 0, |
203 | .name = "Composite", | 204 | .name = "Composite", |
@@ -217,7 +218,7 @@ static struct v4l2_input tvp5146_inputs[] = { | |||
217 | * ouput that goes to vpfe. There is a one to one correspondence | 218 | * ouput that goes to vpfe. There is a one to one correspondence |
218 | * with tvp5146_inputs | 219 | * with tvp5146_inputs |
219 | */ | 220 | */ |
220 | static struct vpfe_route tvp5146_routes[] = { | 221 | static struct vpfe_route dm644xevm_tvp5146_routes[] = { |
221 | { | 222 | { |
222 | .input = INPUT_CVBS_VI2B, | 223 | .input = INPUT_CVBS_VI2B, |
223 | .output = OUTPUT_10BIT_422_EMBEDDED_SYNC, | 224 | .output = OUTPUT_10BIT_422_EMBEDDED_SYNC, |
@@ -228,13 +229,13 @@ static struct vpfe_route tvp5146_routes[] = { | |||
228 | }, | 229 | }, |
229 | }; | 230 | }; |
230 | 231 | ||
231 | static struct vpfe_subdev_info vpfe_sub_devs[] = { | 232 | static struct vpfe_subdev_info dm644xevm_vpfe_sub_devs[] = { |
232 | { | 233 | { |
233 | .name = "tvp5146", | 234 | .name = "tvp5146", |
234 | .grp_id = 0, | 235 | .grp_id = 0, |
235 | .num_inputs = ARRAY_SIZE(tvp5146_inputs), | 236 | .num_inputs = ARRAY_SIZE(dm644xevm_tvp5146_inputs), |
236 | .inputs = tvp5146_inputs, | 237 | .inputs = dm644xevm_tvp5146_inputs, |
237 | .routes = tvp5146_routes, | 238 | .routes = dm644xevm_tvp5146_routes, |
238 | .can_route = 1, | 239 | .can_route = 1, |
239 | .ccdc_if_params = { | 240 | .ccdc_if_params = { |
240 | .if_type = VPFE_BT656, | 241 | .if_type = VPFE_BT656, |
@@ -243,15 +244,15 @@ static struct vpfe_subdev_info vpfe_sub_devs[] = { | |||
243 | }, | 244 | }, |
244 | .board_info = { | 245 | .board_info = { |
245 | I2C_BOARD_INFO("tvp5146", 0x5d), | 246 | I2C_BOARD_INFO("tvp5146", 0x5d), |
246 | .platform_data = &tvp5146_pdata, | 247 | .platform_data = &dm644xevm_tvp5146_pdata, |
247 | }, | 248 | }, |
248 | }, | 249 | }, |
249 | }; | 250 | }; |
250 | 251 | ||
251 | static struct vpfe_config vpfe_cfg = { | 252 | static struct vpfe_config dm644xevm_capture_cfg = { |
252 | .num_subdevs = ARRAY_SIZE(vpfe_sub_devs), | 253 | .num_subdevs = ARRAY_SIZE(dm644xevm_vpfe_sub_devs), |
253 | .i2c_adapter_id = 1, | 254 | .i2c_adapter_id = 1, |
254 | .sub_devs = vpfe_sub_devs, | 255 | .sub_devs = dm644xevm_vpfe_sub_devs, |
255 | .card_name = "DM6446 EVM", | 256 | .card_name = "DM6446 EVM", |
256 | .ccdc = "DM6446 CCDC", | 257 | .ccdc = "DM6446 CCDC", |
257 | }; | 258 | }; |
@@ -612,6 +613,113 @@ static void __init evm_init_i2c(void) | |||
612 | i2c_register_board_info(1, i2c_info, ARRAY_SIZE(i2c_info)); | 613 | i2c_register_board_info(1, i2c_info, ARRAY_SIZE(i2c_info)); |
613 | } | 614 | } |
614 | 615 | ||
616 | #define VENC_STD_ALL (V4L2_STD_NTSC | V4L2_STD_PAL) | ||
617 | |||
618 | /* venc standard timings */ | ||
619 | static struct vpbe_enc_mode_info dm644xevm_enc_std_timing[] = { | ||
620 | { | ||
621 | .name = "ntsc", | ||
622 | .timings_type = VPBE_ENC_STD, | ||
623 | .timings = {V4L2_STD_525_60}, | ||
624 | .interlaced = 1, | ||
625 | .xres = 720, | ||
626 | .yres = 480, | ||
627 | .aspect = {11, 10}, | ||
628 | .fps = {30000, 1001}, | ||
629 | .left_margin = 0x79, | ||
630 | .upper_margin = 0x10, | ||
631 | }, | ||
632 | { | ||
633 | .name = "pal", | ||
634 | .timings_type = VPBE_ENC_STD, | ||
635 | .timings = {V4L2_STD_625_50}, | ||
636 | .interlaced = 1, | ||
637 | .xres = 720, | ||
638 | .yres = 576, | ||
639 | .aspect = {54, 59}, | ||
640 | .fps = {25, 1}, | ||
641 | .left_margin = 0x7e, | ||
642 | .upper_margin = 0x16, | ||
643 | }, | ||
644 | }; | ||
645 | |||
646 | /* venc dv preset timings */ | ||
647 | static struct vpbe_enc_mode_info dm644xevm_enc_preset_timing[] = { | ||
648 | { | ||
649 | .name = "480p59_94", | ||
650 | .timings_type = VPBE_ENC_DV_PRESET, | ||
651 | .timings = {V4L2_DV_480P59_94}, | ||
652 | .interlaced = 0, | ||
653 | .xres = 720, | ||
654 | .yres = 480, | ||
655 | .aspect = {1, 1}, | ||
656 | .fps = {5994, 100}, | ||
657 | .left_margin = 0x80, | ||
658 | .upper_margin = 0x20, | ||
659 | }, | ||
660 | { | ||
661 | .name = "576p50", | ||
662 | .timings_type = VPBE_ENC_DV_PRESET, | ||
663 | .timings = {V4L2_DV_576P50}, | ||
664 | .interlaced = 0, | ||
665 | .xres = 720, | ||
666 | .yres = 576, | ||
667 | .aspect = {1, 1}, | ||
668 | .fps = {50, 1}, | ||
669 | .left_margin = 0x7e, | ||
670 | .upper_margin = 0x30, | ||
671 | }, | ||
672 | }; | ||
673 | |||
674 | /* | ||
675 | * The outputs available from VPBE + encoders. Keep the order same | ||
676 | * as that of encoders. First those from venc followed by that from | ||
677 | * encoders. Index in the output refers to index on a particular encoder. | ||
678 | * Driver uses this index to pass it to encoder when it supports more | ||
679 | * than one output. Userspace applications use index of the array to | ||
680 | * set an output. | ||
681 | */ | ||
682 | static struct vpbe_output dm644xevm_vpbe_outputs[] = { | ||
683 | { | ||
684 | .output = { | ||
685 | .index = 0, | ||
686 | .name = "Composite", | ||
687 | .type = V4L2_OUTPUT_TYPE_ANALOG, | ||
688 | .std = VENC_STD_ALL, | ||
689 | .capabilities = V4L2_OUT_CAP_STD, | ||
690 | }, | ||
691 | .subdev_name = VPBE_VENC_SUBDEV_NAME, | ||
692 | .default_mode = "ntsc", | ||
693 | .num_modes = ARRAY_SIZE(dm644xevm_enc_std_timing), | ||
694 | .modes = dm644xevm_enc_std_timing, | ||
695 | }, | ||
696 | { | ||
697 | .output = { | ||
698 | .index = 1, | ||
699 | .name = "Component", | ||
700 | .type = V4L2_OUTPUT_TYPE_ANALOG, | ||
701 | .capabilities = V4L2_OUT_CAP_PRESETS, | ||
702 | }, | ||
703 | .subdev_name = VPBE_VENC_SUBDEV_NAME, | ||
704 | .default_mode = "480p59_94", | ||
705 | .num_modes = ARRAY_SIZE(dm644xevm_enc_preset_timing), | ||
706 | .modes = dm644xevm_enc_preset_timing, | ||
707 | }, | ||
708 | }; | ||
709 | |||
710 | static struct vpbe_config dm644xevm_display_cfg = { | ||
711 | .module_name = "dm644x-vpbe-display", | ||
712 | .i2c_adapter_id = 1, | ||
713 | .osd = { | ||
714 | .module_name = VPBE_OSD_SUBDEV_NAME, | ||
715 | }, | ||
716 | .venc = { | ||
717 | .module_name = VPBE_VENC_SUBDEV_NAME, | ||
718 | }, | ||
719 | .num_outputs = ARRAY_SIZE(dm644xevm_vpbe_outputs), | ||
720 | .outputs = dm644xevm_vpbe_outputs, | ||
721 | }; | ||
722 | |||
615 | static struct platform_device *davinci_evm_devices[] __initdata = { | 723 | static struct platform_device *davinci_evm_devices[] __initdata = { |
616 | &davinci_fb_device, | 724 | &davinci_fb_device, |
617 | &rtc_dev, | 725 | &rtc_dev, |
@@ -624,8 +732,6 @@ static struct davinci_uart_config uart_config __initdata = { | |||
624 | static void __init | 732 | static void __init |
625 | davinci_evm_map_io(void) | 733 | davinci_evm_map_io(void) |
626 | { | 734 | { |
627 | /* setup input configuration for VPFE input devices */ | ||
628 | dm644x_set_vpfe_config(&vpfe_cfg); | ||
629 | dm644x_init(); | 735 | dm644x_init(); |
630 | } | 736 | } |
631 | 737 | ||
@@ -697,6 +803,7 @@ static __init void davinci_evm_init(void) | |||
697 | evm_init_i2c(); | 803 | evm_init_i2c(); |
698 | 804 | ||
699 | davinci_setup_mmc(0, &dm6446evm_mmc_config); | 805 | davinci_setup_mmc(0, &dm6446evm_mmc_config); |
806 | dm644x_init_video(&dm644xevm_capture_cfg, &dm644xevm_display_cfg); | ||
700 | 807 | ||
701 | davinci_serial_init(&uart_config); | 808 | davinci_serial_init(&uart_config); |
702 | dm644x_init_asp(&dm644x_evm_snd_data); | 809 | dm644x_init_asp(&dm644x_evm_snd_data); |