diff options
author | Bob Liu <lliubbo@gmail.com> | 2012-01-05 07:11:20 +0400 |
---|---|---|
committer | Bob Liu <lliubbo@gmail.com> | 2012-01-09 06:26:17 +0400 |
commit | dda6779f04fe7c6b61846b672b438bc08c2e08ac (patch) | |
tree | 40f154e7e05522ef27a1227c136c72a9837898c0 /arch/blackfin/mach-bf561 | |
parent | bd5fd095fb0042614dd0d46e7ef05898121bb5f7 (diff) | |
download | linux-dda6779f04fe7c6b61846b672b438bc08c2e08ac.tar.xz |
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/blackfin/mach-bf561')
-rw-r--r-- | arch/blackfin/mach-bf561/boards/ezkit.c | 95 |
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 = { }, }; +#if defined(CONFIG_VIDEO_BLACKFIN_CAPTURE) \ + || defined(CONFIG_VIDEO_BLACKFIN_CAPTURE_MODULE) +#include <linux/videodev2.h> +#include <media/blackfin/bfin_capture.h> +#include <media/blackfin/ppi.h> + +static const unsigned short ppi_req[] = { + P_PPI0_D0, P_PPI0_D1, P_PPI0_D2, P_PPI0_D3, + P_PPI0_D4, P_PPI0_D5, P_PPI0_D6, P_PPI0_D7, + P_PPI0_CLK, P_PPI0_FS1, P_PPI0_FS2, + 0, +}; + +static const struct ppi_info ppi_info = { + .type = PPI_TYPE_PPI, + .dma_ch = CH_PPI0, + .irq_err = IRQ_PPI1_ERROR, + .base = (void __iomem *)PPI0_CONTROL, + .pin_req = ppi_req, +}; + +#if defined(CONFIG_VIDEO_ADV7183) \ + || defined(CONFIG_VIDEO_ADV7183_MODULE) +#include <media/adv7183.h> +static struct v4l2_input adv7183_inputs[] = { + { + .index = 0, + .name = "Composite", + .type = V4L2_INPUT_TYPE_CAMERA, + .std = V4L2_STD_ALL, + }, + { + .index = 1, + .name = "S-Video", + .type = V4L2_INPUT_TYPE_CAMERA, + .std = V4L2_STD_ALL, + }, + { + .index = 2, + .name = "Component", + .type = V4L2_INPUT_TYPE_CAMERA, + .std = V4L2_STD_ALL, + }, +}; + +static struct bcap_route adv7183_routes[] = { + { + .input = ADV7183_COMPOSITE4, + .output = ADV7183_8BIT_OUT, + }, + { + .input = ADV7183_SVIDEO0, + .output = ADV7183_8BIT_OUT, + }, + { + .input = ADV7183_COMPONENT0, + .output = ADV7183_8BIT_OUT, + }, +}; + + +static const unsigned adv7183_gpio[] = { + GPIO_PF13, /* reset pin */ + GPIO_PF2, /* output enable pin */ +}; + +static struct bfin_capture_config bfin_capture_data = { + .card_name = "BF561", + .inputs = adv7183_inputs, + .num_inputs = ARRAY_SIZE(adv7183_inputs), + .routes = adv7183_routes, + .i2c_adapter_id = 0, + .board_info = { + .type = "adv7183", + .addr = 0x20, + .platform_data = (void *)adv7183_gpio, + }, + .ppi_info = &ppi_info, + .ppi_control = (PACK_EN | DLEN_8 | DMA32 | FLD_SEL), +}; +#endif + +static struct platform_device bfin_capture_device = { + .name = "bfin_capture", + .dev = { + .platform_data = &bfin_capture_data, + }, +}; +#endif + #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) static struct platform_device bfin_i2s = { .name = "bfin-i2s", @@ -494,6 +584,11 @@ static struct platform_device *ezkit_devices[] __initdata = { &ezkit_flash_device, #endif +#if defined(CONFIG_VIDEO_BLACKFIN_CAPTURE) \ + || defined(CONFIG_VIDEO_BLACKFIN_CAPTURE_MODULE) + &bfin_capture_device, +#endif + #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) &bfin_i2s, #endif |