diff options
author | Lad, Prabhakar <prabhakar.csengg@gmail.com> | 2013-03-14 03:12:34 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-04-14 19:09:50 -0400 |
commit | 542b5bd226b0f5d5e9190cb96e6d96a912394795 (patch) | |
tree | 156966ffc7bee408039b9c7c49b6160328cba18b /arch | |
parent | 120c66046cc8931259867ac1cdc6de0d0e742fb5 (diff) |
[media] ARM: davinci: dm365 EVM: add support for VPBE display
add support for V4L2 video display to DM365 EVM.
Support for SD and ED modes is provided, along with Composite
and Component outputs.
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-davinci/board-dm365-evm.c | 164 |
1 files changed, 163 insertions, 1 deletions
diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c index cf77c465b98e..0518ce5753fe 100644 --- a/arch/arm/mach-davinci/board-dm365-evm.c +++ b/arch/arm/mach-davinci/board-dm365-evm.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/input.h> | 27 | #include <linux/input.h> |
28 | #include <linux/spi/spi.h> | 28 | #include <linux/spi/spi.h> |
29 | #include <linux/spi/eeprom.h> | 29 | #include <linux/spi/eeprom.h> |
30 | #include <linux/v4l2-dv-timings.h> | ||
30 | 31 | ||
31 | #include <asm/mach-types.h> | 32 | #include <asm/mach-types.h> |
32 | #include <asm/mach/arch.h> | 33 | #include <asm/mach/arch.h> |
@@ -39,6 +40,7 @@ | |||
39 | #include <linux/platform_data/mtd-davinci.h> | 40 | #include <linux/platform_data/mtd-davinci.h> |
40 | #include <linux/platform_data/keyscan-davinci.h> | 41 | #include <linux/platform_data/keyscan-davinci.h> |
41 | 42 | ||
43 | #include <media/ths7303.h> | ||
42 | #include <media/tvp514x.h> | 44 | #include <media/tvp514x.h> |
43 | 45 | ||
44 | #include "davinci.h" | 46 | #include "davinci.h" |
@@ -374,6 +376,166 @@ static struct vpfe_config vpfe_cfg = { | |||
374 | .ccdc = "ISIF", | 376 | .ccdc = "ISIF", |
375 | }; | 377 | }; |
376 | 378 | ||
379 | /* venc standards timings */ | ||
380 | static struct vpbe_enc_mode_info dm365evm_enc_std_timing[] = { | ||
381 | { | ||
382 | .name = "ntsc", | ||
383 | .timings_type = VPBE_ENC_STD, | ||
384 | .std_id = V4L2_STD_525_60, | ||
385 | .interlaced = 1, | ||
386 | .xres = 720, | ||
387 | .yres = 480, | ||
388 | .aspect = {11, 10}, | ||
389 | .fps = {30000, 1001}, | ||
390 | .left_margin = 0x79, | ||
391 | .upper_margin = 0x10, | ||
392 | }, | ||
393 | { | ||
394 | .name = "pal", | ||
395 | .timings_type = VPBE_ENC_STD, | ||
396 | .std_id = V4L2_STD_625_50, | ||
397 | .interlaced = 1, | ||
398 | .xres = 720, | ||
399 | .yres = 576, | ||
400 | .aspect = {54, 59}, | ||
401 | .fps = {25, 1}, | ||
402 | .left_margin = 0x7E, | ||
403 | .upper_margin = 0x16, | ||
404 | }, | ||
405 | }; | ||
406 | |||
407 | /* venc dv timings */ | ||
408 | static struct vpbe_enc_mode_info dm365evm_enc_preset_timing[] = { | ||
409 | { | ||
410 | .name = "480p59_94", | ||
411 | .timings_type = VPBE_ENC_DV_TIMINGS, | ||
412 | .dv_timings = V4L2_DV_BT_CEA_720X480P59_94, | ||
413 | .interlaced = 0, | ||
414 | .xres = 720, | ||
415 | .yres = 480, | ||
416 | .aspect = {1, 1}, | ||
417 | .fps = {5994, 100}, | ||
418 | .left_margin = 0x8F, | ||
419 | .upper_margin = 0x2D, | ||
420 | }, | ||
421 | { | ||
422 | .name = "576p50", | ||
423 | .timings_type = VPBE_ENC_DV_TIMINGS, | ||
424 | .dv_timings = V4L2_DV_BT_CEA_720X576P50, | ||
425 | .interlaced = 0, | ||
426 | .xres = 720, | ||
427 | .yres = 576, | ||
428 | .aspect = {1, 1}, | ||
429 | .fps = {50, 1}, | ||
430 | .left_margin = 0x8C, | ||
431 | .upper_margin = 0x36, | ||
432 | }, | ||
433 | { | ||
434 | .name = "720p60", | ||
435 | .timings_type = VPBE_ENC_DV_TIMINGS, | ||
436 | .dv_timings = V4L2_DV_BT_CEA_1280X720P60, | ||
437 | .interlaced = 0, | ||
438 | .xres = 1280, | ||
439 | .yres = 720, | ||
440 | .aspect = {1, 1}, | ||
441 | .fps = {60, 1}, | ||
442 | .left_margin = 0x117, | ||
443 | .right_margin = 70, | ||
444 | .upper_margin = 38, | ||
445 | .lower_margin = 3, | ||
446 | .hsync_len = 80, | ||
447 | .vsync_len = 5, | ||
448 | }, | ||
449 | { | ||
450 | .name = "1080i60", | ||
451 | .timings_type = VPBE_ENC_DV_TIMINGS, | ||
452 | .dv_timings = V4L2_DV_BT_CEA_1920X1080I60, | ||
453 | .interlaced = 1, | ||
454 | .xres = 1920, | ||
455 | .yres = 1080, | ||
456 | .aspect = {1, 1}, | ||
457 | .fps = {30, 1}, | ||
458 | .left_margin = 0xc9, | ||
459 | .right_margin = 80, | ||
460 | .upper_margin = 30, | ||
461 | .lower_margin = 3, | ||
462 | .hsync_len = 88, | ||
463 | .vsync_len = 5, | ||
464 | }, | ||
465 | }; | ||
466 | |||
467 | #define VENC_STD_ALL (V4L2_STD_NTSC | V4L2_STD_PAL) | ||
468 | |||
469 | /* | ||
470 | * The outputs available from VPBE + ecnoders. Keep the | ||
471 | * the order same as that of encoders. First those from venc followed by that | ||
472 | * from encoders. Index in the output refers to index on a particular | ||
473 | * encoder.Driver uses this index to pass it to encoder when it supports more | ||
474 | * than one output. Application uses index of the array to set an output. | ||
475 | */ | ||
476 | static struct vpbe_output dm365evm_vpbe_outputs[] = { | ||
477 | { | ||
478 | .output = { | ||
479 | .index = 0, | ||
480 | .name = "Composite", | ||
481 | .type = V4L2_OUTPUT_TYPE_ANALOG, | ||
482 | .std = VENC_STD_ALL, | ||
483 | .capabilities = V4L2_OUT_CAP_STD, | ||
484 | }, | ||
485 | .subdev_name = DM365_VPBE_VENC_SUBDEV_NAME, | ||
486 | .default_mode = "ntsc", | ||
487 | .num_modes = ARRAY_SIZE(dm365evm_enc_std_timing), | ||
488 | .modes = dm365evm_enc_std_timing, | ||
489 | .if_params = V4L2_MBUS_FMT_FIXED, | ||
490 | }, | ||
491 | { | ||
492 | .output = { | ||
493 | .index = 1, | ||
494 | .name = "Component", | ||
495 | .type = V4L2_OUTPUT_TYPE_ANALOG, | ||
496 | .capabilities = V4L2_OUT_CAP_DV_TIMINGS, | ||
497 | }, | ||
498 | .subdev_name = DM365_VPBE_VENC_SUBDEV_NAME, | ||
499 | .default_mode = "480p59_94", | ||
500 | .num_modes = ARRAY_SIZE(dm365evm_enc_preset_timing), | ||
501 | .modes = dm365evm_enc_preset_timing, | ||
502 | .if_params = V4L2_MBUS_FMT_FIXED, | ||
503 | }, | ||
504 | }; | ||
505 | |||
506 | /* | ||
507 | * Amplifiers on the board | ||
508 | */ | ||
509 | struct ths7303_platform_data ths7303_pdata = { | ||
510 | .ch_1 = 3, | ||
511 | .ch_2 = 3, | ||
512 | .ch_3 = 3, | ||
513 | .init_enable = 1, | ||
514 | }; | ||
515 | |||
516 | static struct amp_config_info vpbe_amp = { | ||
517 | .module_name = "ths7303", | ||
518 | .is_i2c = 1, | ||
519 | .board_info = { | ||
520 | I2C_BOARD_INFO("ths7303", 0x2c), | ||
521 | .platform_data = &ths7303_pdata, | ||
522 | } | ||
523 | }; | ||
524 | |||
525 | static struct vpbe_config dm365evm_display_cfg = { | ||
526 | .module_name = "dm365-vpbe-display", | ||
527 | .i2c_adapter_id = 1, | ||
528 | .amp = &vpbe_amp, | ||
529 | .osd = { | ||
530 | .module_name = DM365_VPBE_OSD_SUBDEV_NAME, | ||
531 | }, | ||
532 | .venc = { | ||
533 | .module_name = DM365_VPBE_VENC_SUBDEV_NAME, | ||
534 | }, | ||
535 | .num_outputs = ARRAY_SIZE(dm365evm_vpbe_outputs), | ||
536 | .outputs = dm365evm_vpbe_outputs, | ||
537 | }; | ||
538 | |||
377 | static void __init evm_init_i2c(void) | 539 | static void __init evm_init_i2c(void) |
378 | { | 540 | { |
379 | davinci_init_i2c(&i2c_pdata); | 541 | davinci_init_i2c(&i2c_pdata); |
@@ -595,7 +757,7 @@ static __init void dm365_evm_init(void) | |||
595 | 757 | ||
596 | davinci_setup_mmc(0, &dm365evm_mmc_config); | 758 | davinci_setup_mmc(0, &dm365evm_mmc_config); |
597 | 759 | ||
598 | dm365_init_video(&vpfe_cfg, NULL); | 760 | dm365_init_video(&vpfe_cfg, &dm365evm_display_cfg); |
599 | 761 | ||
600 | /* maybe setup mmc1/etc ... _after_ mmc0 */ | 762 | /* maybe setup mmc1/etc ... _after_ mmc0 */ |
601 | evm_init_cpld(); | 763 | evm_init_cpld(); |