aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorBob Liu <lliubbo@gmail.com>2012-01-04 22:11:20 -0500
committerBob Liu <lliubbo@gmail.com>2012-01-08 21:26:17 -0500
commitdda6779f04fe7c6b61846b672b438bc08c2e08ac (patch)
tree40f154e7e05522ef27a1227c136c72a9837898c0 /arch
parentbd5fd095fb0042614dd0d46e7ef05898121bb5f7 (diff)
blackfin: bf561: add adv7183 capture support
Signed-off-by: Scott Jiang <scott.jiang.linux@gmail.com> Signed-off-by: Bob Liu <lliubbo@gmail.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/blackfin/mach-bf561/boards/ezkit.c95
1 files changed, 95 insertions, 0 deletions
diff --git a/arch/blackfin/mach-bf561/boards/ezkit.c b/arch/blackfin/mach-bf561/boards/ezkit.c
index c60638fb2e01..838978808a15 100644
--- a/arch/blackfin/mach-bf561/boards/ezkit.c
+++ b/arch/blackfin/mach-bf561/boards/ezkit.c
@@ -422,6 +422,96 @@ static struct platform_device bfin_dpmc = {
422 }, 422 },
423}; 423};
424 424
425#if defined(CONFIG_VIDEO_BLACKFIN_CAPTURE) \
426 || defined(CONFIG_VIDEO_BLACKFIN_CAPTURE_MODULE)
427#include <linux/videodev2.h>
428#include <media/blackfin/bfin_capture.h>
429#include <media/blackfin/ppi.h>
430
431static const unsigned short ppi_req[] = {
432 P_PPI0_D0, P_PPI0_D1, P_PPI0_D2, P_PPI0_D3,
433 P_PPI0_D4, P_PPI0_D5, P_PPI0_D6, P_PPI0_D7,
434 P_PPI0_CLK, P_PPI0_FS1, P_PPI0_FS2,
435 0,
436};
437
438static const struct ppi_info ppi_info = {
439 .type = PPI_TYPE_PPI,
440 .dma_ch = CH_PPI0,
441 .irq_err = IRQ_PPI1_ERROR,
442 .base = (void __iomem *)PPI0_CONTROL,
443 .pin_req = ppi_req,
444};
445
446#if defined(CONFIG_VIDEO_ADV7183) \
447 || defined(CONFIG_VIDEO_ADV7183_MODULE)
448#include <media/adv7183.h>
449static struct v4l2_input adv7183_inputs[] = {
450 {
451 .index = 0,
452 .name = "Composite",
453 .type = V4L2_INPUT_TYPE_CAMERA,
454 .std = V4L2_STD_ALL,
455 },
456 {
457 .index = 1,
458 .name = "S-Video",
459 .type = V4L2_INPUT_TYPE_CAMERA,
460 .std = V4L2_STD_ALL,
461 },
462 {
463 .index = 2,
464 .name = "Component",
465 .type = V4L2_INPUT_TYPE_CAMERA,
466 .std = V4L2_STD_ALL,
467 },
468};
469
470static struct bcap_route adv7183_routes[] = {
471 {
472 .input = ADV7183_COMPOSITE4,
473 .output = ADV7183_8BIT_OUT,
474 },
475 {
476 .input = ADV7183_SVIDEO0,
477 .output = ADV7183_8BIT_OUT,
478 },
479 {
480 .input = ADV7183_COMPONENT0,
481 .output = ADV7183_8BIT_OUT,
482 },
483};
484
485
486static const unsigned adv7183_gpio[] = {
487 GPIO_PF13, /* reset pin */
488 GPIO_PF2, /* output enable pin */
489};
490
491static struct bfin_capture_config bfin_capture_data = {
492 .card_name = "BF561",
493 .inputs = adv7183_inputs,
494 .num_inputs = ARRAY_SIZE(adv7183_inputs),
495 .routes = adv7183_routes,
496 .i2c_adapter_id = 0,
497 .board_info = {
498 .type = "adv7183",
499 .addr = 0x20,
500 .platform_data = (void *)adv7183_gpio,
501 },
502 .ppi_info = &ppi_info,
503 .ppi_control = (PACK_EN | DLEN_8 | DMA32 | FLD_SEL),
504};
505#endif
506
507static struct platform_device bfin_capture_device = {
508 .name = "bfin_capture",
509 .dev = {
510 .platform_data = &bfin_capture_data,
511 },
512};
513#endif
514
425#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) 515#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
426static struct platform_device bfin_i2s = { 516static struct platform_device bfin_i2s = {
427 .name = "bfin-i2s", 517 .name = "bfin-i2s",
@@ -494,6 +584,11 @@ static struct platform_device *ezkit_devices[] __initdata = {
494 &ezkit_flash_device, 584 &ezkit_flash_device,
495#endif 585#endif
496 586
587#if defined(CONFIG_VIDEO_BLACKFIN_CAPTURE) \
588 || defined(CONFIG_VIDEO_BLACKFIN_CAPTURE_MODULE)
589 &bfin_capture_device,
590#endif
591
497#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) 592#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
498 &bfin_i2s, 593 &bfin_i2s,
499#endif 594#endif