aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-02-26 20:16:20 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-02-26 20:16:20 -0500
commit2b8c70b2174402ca3dec13310ce56597233392d7 (patch)
tree0aed464521a2a671cbb7b4302b55fe72abc95d3d /arch
parent29e1fa3565a7951cc415c634eb2b78dbdbee151d (diff)
parent3621263a4d9679726b7bc1e2546c1c03941a59b4 (diff)
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (362 commits) V4L-DVB: cx88-dvb: remove extra attribution for core V4L/DVB: v4l: soc_camera: fix bound checking of mbus_fmt[] index V4L/DVB: Add support for SMT7020 to cx88 V4L/DVB: radio-si470x: Use UTF-8 encoding on a comment V4L/DVB: MAINTAINERS: Telegent tlg2300 section fix V4L/DVB: gspca_stv06xx: Add support for camera button V4L/DVB: gspca_ov519: add support for the button on ov511 based cams V4L/DVB: gspca_ov519: Add support for the button on ov518 based cams V4L/DVB: gspca_ov519: add support for the button on ov519 based cams V4L/DVB: gspca_main: Fix a compile error when CONFIG_INPUT is not set V4L/DVB: gspca_main: some input error handling fixes V4L/DVB: gspca_main: Allow use of input device creation code for non int. inputs V4L/DVB: gspca_pac7302: much improved exposure control V4L/DVB: gspca_sonixb: Make sonixb driver handle pas106 and pas202 cameras V4L/DVB: gspca_sonixb: pas106: fixup bright ctrl and add gain and exposure ctrls V4L/DVB: Documentation: gspca.txt: update known mr97310a cams V4L/DVB: gspca_mr97310a: add support for the Sakar 1638x CyberPix V4L/DVB: gscpa_sonixb: limit ov7630 max framerate at 640x480 V4L/DVB: gspca_sonixb: pas202: fixup brightness ctrl and add gain and exposure ctrls V4L/DVB: gscpa_sonixb: Differentiate between sensors with a coarse and fine expo ctrl ...
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-davinci/board-dm365-evm.c71
-rw-r--r--arch/arm/mach-davinci/dm355.c43
-rw-r--r--arch/arm/mach-davinci/dm365.c102
-rw-r--r--arch/arm/mach-davinci/dm644x.c21
-rw-r--r--arch/arm/mach-davinci/include/mach/dm365.h2
-rw-r--r--arch/arm/mach-pxa/include/mach/camera.h2
-rw-r--r--arch/sh/boards/mach-ap325rxa/setup.c4
-rw-r--r--arch/sh/boards/mach-migor/setup.c2
8 files changed, 227 insertions, 20 deletions
diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c
index b476395d2cd..38e9033d2e8 100644
--- a/arch/arm/mach-davinci/board-dm365-evm.c
+++ b/arch/arm/mach-davinci/board-dm365-evm.c
@@ -37,6 +37,8 @@
37#include <mach/nand.h> 37#include <mach/nand.h>
38#include <mach/keyscan.h> 38#include <mach/keyscan.h>
39 39
40#include <media/tvp514x.h>
41
40static inline int have_imager(void) 42static inline int have_imager(void)
41{ 43{
42 /* REVISIT when it's supported, trigger via Kconfig */ 44 /* REVISIT when it's supported, trigger via Kconfig */
@@ -306,6 +308,73 @@ static void dm365evm_mmc_configure(void)
306 davinci_cfg_reg(DM365_SD1_DATA0); 308 davinci_cfg_reg(DM365_SD1_DATA0);
307} 309}
308 310
311static struct tvp514x_platform_data tvp5146_pdata = {
312 .clk_polarity = 0,
313 .hs_polarity = 1,
314 .vs_polarity = 1
315};
316
317#define TVP514X_STD_ALL (V4L2_STD_NTSC | V4L2_STD_PAL)
318/* Inputs available at the TVP5146 */
319static struct v4l2_input tvp5146_inputs[] = {
320 {
321 .index = 0,
322 .name = "Composite",
323 .type = V4L2_INPUT_TYPE_CAMERA,
324 .std = TVP514X_STD_ALL,
325 },
326 {
327 .index = 1,
328 .name = "S-Video",
329 .type = V4L2_INPUT_TYPE_CAMERA,
330 .std = TVP514X_STD_ALL,
331 },
332};
333
334/*
335 * this is the route info for connecting each input to decoder
336 * ouput that goes to vpfe. There is a one to one correspondence
337 * with tvp5146_inputs
338 */
339static struct vpfe_route tvp5146_routes[] = {
340 {
341 .input = INPUT_CVBS_VI2B,
342 .output = OUTPUT_10BIT_422_EMBEDDED_SYNC,
343 },
344{
345 .input = INPUT_SVIDEO_VI2C_VI1C,
346 .output = OUTPUT_10BIT_422_EMBEDDED_SYNC,
347 },
348};
349
350static struct vpfe_subdev_info vpfe_sub_devs[] = {
351 {
352 .name = "tvp5146",
353 .grp_id = 0,
354 .num_inputs = ARRAY_SIZE(tvp5146_inputs),
355 .inputs = tvp5146_inputs,
356 .routes = tvp5146_routes,
357 .can_route = 1,
358 .ccdc_if_params = {
359 .if_type = VPFE_BT656,
360 .hdpol = VPFE_PINPOL_POSITIVE,
361 .vdpol = VPFE_PINPOL_POSITIVE,
362 },
363 .board_info = {
364 I2C_BOARD_INFO("tvp5146", 0x5d),
365 .platform_data = &tvp5146_pdata,
366 },
367 },
368};
369
370static struct vpfe_config vpfe_cfg = {
371 .num_subdevs = ARRAY_SIZE(vpfe_sub_devs),
372 .sub_devs = vpfe_sub_devs,
373 .i2c_adapter_id = 1,
374 .card_name = "DM365 EVM",
375 .ccdc = "ISIF",
376};
377
309static void __init evm_init_i2c(void) 378static void __init evm_init_i2c(void)
310{ 379{
311 davinci_init_i2c(&i2c_pdata); 380 davinci_init_i2c(&i2c_pdata);
@@ -497,6 +566,8 @@ static struct davinci_uart_config uart_config __initdata = {
497 566
498static void __init dm365_evm_map_io(void) 567static void __init dm365_evm_map_io(void)
499{ 568{
569 /* setup input configuration for VPFE input devices */
570 dm365_set_vpfe_config(&vpfe_cfg);
500 dm365_init(); 571 dm365_init();
501} 572}
502 573
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c
index dedf4d4f3a2..d84e85414d2 100644
--- a/arch/arm/mach-davinci/dm355.c
+++ b/arch/arm/mach-davinci/dm355.c
@@ -125,7 +125,6 @@ static struct clk vpss_slave_clk = {
125 .lpsc = DAVINCI_LPSC_VPSSSLV, 125 .lpsc = DAVINCI_LPSC_VPSSSLV,
126}; 126};
127 127
128
129static struct clk clkout1_clk = { 128static struct clk clkout1_clk = {
130 .name = "clkout1", 129 .name = "clkout1",
131 .parent = &pll1_aux_clk, 130 .parent = &pll1_aux_clk,
@@ -665,6 +664,17 @@ static struct platform_device dm355_asp1_device = {
665 .resource = dm355_asp1_resources, 664 .resource = dm355_asp1_resources,
666}; 665};
667 666
667static void dm355_ccdc_setup_pinmux(void)
668{
669 davinci_cfg_reg(DM355_VIN_PCLK);
670 davinci_cfg_reg(DM355_VIN_CAM_WEN);
671 davinci_cfg_reg(DM355_VIN_CAM_VD);
672 davinci_cfg_reg(DM355_VIN_CAM_HD);
673 davinci_cfg_reg(DM355_VIN_YIN_EN);
674 davinci_cfg_reg(DM355_VIN_CINL_EN);
675 davinci_cfg_reg(DM355_VIN_CINH_EN);
676}
677
668static struct resource dm355_vpss_resources[] = { 678static struct resource dm355_vpss_resources[] = {
669 { 679 {
670 /* VPSS BL Base address */ 680 /* VPSS BL Base address */
@@ -701,6 +711,10 @@ static struct resource vpfe_resources[] = {
701 .end = IRQ_VDINT1, 711 .end = IRQ_VDINT1,
702 .flags = IORESOURCE_IRQ, 712 .flags = IORESOURCE_IRQ,
703 }, 713 },
714};
715
716static u64 vpfe_capture_dma_mask = DMA_BIT_MASK(32);
717static struct resource dm355_ccdc_resource[] = {
704 /* CCDC Base address */ 718 /* CCDC Base address */
705 { 719 {
706 .flags = IORESOURCE_MEM, 720 .flags = IORESOURCE_MEM,
@@ -708,8 +722,18 @@ static struct resource vpfe_resources[] = {
708 .end = 0x01c70600 + 0x1ff, 722 .end = 0x01c70600 + 0x1ff,
709 }, 723 },
710}; 724};
725static struct platform_device dm355_ccdc_dev = {
726 .name = "dm355_ccdc",
727 .id = -1,
728 .num_resources = ARRAY_SIZE(dm355_ccdc_resource),
729 .resource = dm355_ccdc_resource,
730 .dev = {
731 .dma_mask = &vpfe_capture_dma_mask,
732 .coherent_dma_mask = DMA_BIT_MASK(32),
733 .platform_data = dm355_ccdc_setup_pinmux,
734 },
735};
711 736
712static u64 vpfe_capture_dma_mask = DMA_BIT_MASK(32);
713static struct platform_device vpfe_capture_dev = { 737static struct platform_device vpfe_capture_dev = {
714 .name = CAPTURE_DRV_NAME, 738 .name = CAPTURE_DRV_NAME,
715 .id = -1, 739 .id = -1,
@@ -857,20 +881,13 @@ static int __init dm355_init_devices(void)
857 if (!cpu_is_davinci_dm355()) 881 if (!cpu_is_davinci_dm355())
858 return 0; 882 return 0;
859 883
884 /* Add ccdc clock aliases */
885 clk_add_alias("master", dm355_ccdc_dev.name, "vpss_master", NULL);
886 clk_add_alias("slave", dm355_ccdc_dev.name, "vpss_master", NULL);
860 davinci_cfg_reg(DM355_INT_EDMA_CC); 887 davinci_cfg_reg(DM355_INT_EDMA_CC);
861 platform_device_register(&dm355_edma_device); 888 platform_device_register(&dm355_edma_device);
862 platform_device_register(&dm355_vpss_device); 889 platform_device_register(&dm355_vpss_device);
863 /* 890 platform_device_register(&dm355_ccdc_dev);
864 * setup Mux configuration for vpfe input and register
865 * vpfe capture platform device
866 */
867 davinci_cfg_reg(DM355_VIN_PCLK);
868 davinci_cfg_reg(DM355_VIN_CAM_WEN);
869 davinci_cfg_reg(DM355_VIN_CAM_VD);
870 davinci_cfg_reg(DM355_VIN_CAM_HD);
871 davinci_cfg_reg(DM355_VIN_YIN_EN);
872 davinci_cfg_reg(DM355_VIN_CINL_EN);
873 davinci_cfg_reg(DM355_VIN_CINH_EN);
874 platform_device_register(&vpfe_capture_dev); 891 platform_device_register(&vpfe_capture_dev);
875 892
876 return 0; 893 return 0;
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
index f53735cb922..ce9da43a628 100644
--- a/arch/arm/mach-davinci/dm365.c
+++ b/arch/arm/mach-davinci/dm365.c
@@ -1008,6 +1008,97 @@ void __init dm365_init(void)
1008 davinci_common_init(&davinci_soc_info_dm365); 1008 davinci_common_init(&davinci_soc_info_dm365);
1009} 1009}
1010 1010
1011static struct resource dm365_vpss_resources[] = {
1012 {
1013 /* VPSS ISP5 Base address */
1014 .name = "isp5",
1015 .start = 0x01c70000,
1016 .end = 0x01c70000 + 0xff,
1017 .flags = IORESOURCE_MEM,
1018 },
1019 {
1020 /* VPSS CLK Base address */
1021 .name = "vpss",
1022 .start = 0x01c70200,
1023 .end = 0x01c70200 + 0xff,
1024 .flags = IORESOURCE_MEM,
1025 },
1026};
1027
1028static struct platform_device dm365_vpss_device = {
1029 .name = "vpss",
1030 .id = -1,
1031 .dev.platform_data = "dm365_vpss",
1032 .num_resources = ARRAY_SIZE(dm365_vpss_resources),
1033 .resource = dm365_vpss_resources,
1034};
1035
1036static struct resource vpfe_resources[] = {
1037 {
1038 .start = IRQ_VDINT0,
1039 .end = IRQ_VDINT0,
1040 .flags = IORESOURCE_IRQ,
1041 },
1042 {
1043 .start = IRQ_VDINT1,
1044 .end = IRQ_VDINT1,
1045 .flags = IORESOURCE_IRQ,
1046 },
1047};
1048
1049static u64 vpfe_capture_dma_mask = DMA_BIT_MASK(32);
1050static struct platform_device vpfe_capture_dev = {
1051 .name = CAPTURE_DRV_NAME,
1052 .id = -1,
1053 .num_resources = ARRAY_SIZE(vpfe_resources),
1054 .resource = vpfe_resources,
1055 .dev = {
1056 .dma_mask = &vpfe_capture_dma_mask,
1057 .coherent_dma_mask = DMA_BIT_MASK(32),
1058 },
1059};
1060
1061static void dm365_isif_setup_pinmux(void)
1062{
1063 davinci_cfg_reg(DM365_VIN_CAM_WEN);
1064 davinci_cfg_reg(DM365_VIN_CAM_VD);
1065 davinci_cfg_reg(DM365_VIN_CAM_HD);
1066 davinci_cfg_reg(DM365_VIN_YIN4_7_EN);
1067 davinci_cfg_reg(DM365_VIN_YIN0_3_EN);
1068}
1069
1070static struct resource isif_resource[] = {
1071 /* ISIF Base address */
1072 {
1073 .start = 0x01c71000,
1074 .end = 0x01c71000 + 0x1ff,
1075 .flags = IORESOURCE_MEM,
1076 },
1077 /* ISIF Linearization table 0 */
1078 {
1079 .start = 0x1C7C000,
1080 .end = 0x1C7C000 + 0x2ff,
1081 .flags = IORESOURCE_MEM,
1082 },
1083 /* ISIF Linearization table 1 */
1084 {
1085 .start = 0x1C7C400,
1086 .end = 0x1C7C400 + 0x2ff,
1087 .flags = IORESOURCE_MEM,
1088 },
1089};
1090static struct platform_device dm365_isif_dev = {
1091 .name = "isif",
1092 .id = -1,
1093 .num_resources = ARRAY_SIZE(isif_resource),
1094 .resource = isif_resource,
1095 .dev = {
1096 .dma_mask = &vpfe_capture_dma_mask,
1097 .coherent_dma_mask = DMA_BIT_MASK(32),
1098 .platform_data = dm365_isif_setup_pinmux,
1099 },
1100};
1101
1011static int __init dm365_init_devices(void) 1102static int __init dm365_init_devices(void)
1012{ 1103{
1013 if (!cpu_is_davinci_dm365()) 1104 if (!cpu_is_davinci_dm365())
@@ -1016,7 +1107,16 @@ static int __init dm365_init_devices(void)
1016 davinci_cfg_reg(DM365_INT_EDMA_CC); 1107 davinci_cfg_reg(DM365_INT_EDMA_CC);
1017 platform_device_register(&dm365_edma_device); 1108 platform_device_register(&dm365_edma_device);
1018 platform_device_register(&dm365_emac_device); 1109 platform_device_register(&dm365_emac_device);
1019 1110 /* Add isif clock alias */
1111 clk_add_alias("master", dm365_isif_dev.name, "vpss_master", NULL);
1112 platform_device_register(&dm365_vpss_device);
1113 platform_device_register(&dm365_isif_dev);
1114 platform_device_register(&vpfe_capture_dev);
1020 return 0; 1115 return 0;
1021} 1116}
1022postcore_initcall(dm365_init_devices); 1117postcore_initcall(dm365_init_devices);
1118
1119void dm365_set_vpfe_config(struct vpfe_config *cfg)
1120{
1121 vpfe_capture_dev.dev.platform_data = cfg;
1122}
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index 2cd008156de..92aeb560068 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -612,6 +612,11 @@ static struct resource vpfe_resources[] = {
612 .end = IRQ_VDINT1, 612 .end = IRQ_VDINT1,
613 .flags = IORESOURCE_IRQ, 613 .flags = IORESOURCE_IRQ,
614 }, 614 },
615};
616
617static u64 vpfe_capture_dma_mask = DMA_BIT_MASK(32);
618static struct resource dm644x_ccdc_resource[] = {
619 /* CCDC Base address */
615 { 620 {
616 .start = 0x01c70400, 621 .start = 0x01c70400,
617 .end = 0x01c70400 + 0xff, 622 .end = 0x01c70400 + 0xff,
@@ -619,7 +624,17 @@ static struct resource vpfe_resources[] = {
619 }, 624 },
620}; 625};
621 626
622static u64 vpfe_capture_dma_mask = DMA_BIT_MASK(32); 627static struct platform_device dm644x_ccdc_dev = {
628 .name = "dm644x_ccdc",
629 .id = -1,
630 .num_resources = ARRAY_SIZE(dm644x_ccdc_resource),
631 .resource = dm644x_ccdc_resource,
632 .dev = {
633 .dma_mask = &vpfe_capture_dma_mask,
634 .coherent_dma_mask = DMA_BIT_MASK(32),
635 },
636};
637
623static struct platform_device vpfe_capture_dev = { 638static struct platform_device vpfe_capture_dev = {
624 .name = CAPTURE_DRV_NAME, 639 .name = CAPTURE_DRV_NAME,
625 .id = -1, 640 .id = -1,
@@ -769,9 +784,13 @@ static int __init dm644x_init_devices(void)
769 if (!cpu_is_davinci_dm644x()) 784 if (!cpu_is_davinci_dm644x())
770 return 0; 785 return 0;
771 786
787 /* Add ccdc clock aliases */
788 clk_add_alias("master", dm644x_ccdc_dev.name, "vpss_master", NULL);
789 clk_add_alias("slave", dm644x_ccdc_dev.name, "vpss_slave", NULL);
772 platform_device_register(&dm644x_edma_device); 790 platform_device_register(&dm644x_edma_device);
773 platform_device_register(&dm644x_emac_device); 791 platform_device_register(&dm644x_emac_device);
774 platform_device_register(&dm644x_vpss_device); 792 platform_device_register(&dm644x_vpss_device);
793 platform_device_register(&dm644x_ccdc_dev);
775 platform_device_register(&vpfe_capture_dev); 794 platform_device_register(&vpfe_capture_dev);
776 795
777 return 0; 796 return 0;
diff --git a/arch/arm/mach-davinci/include/mach/dm365.h b/arch/arm/mach-davinci/include/mach/dm365.h
index f1710a30e7b..9fc5a64a536 100644
--- a/arch/arm/mach-davinci/include/mach/dm365.h
+++ b/arch/arm/mach-davinci/include/mach/dm365.h
@@ -18,6 +18,7 @@
18#include <mach/emac.h> 18#include <mach/emac.h>
19#include <mach/asp.h> 19#include <mach/asp.h>
20#include <mach/keyscan.h> 20#include <mach/keyscan.h>
21#include <media/davinci/vpfe_capture.h>
21 22
22#define DM365_EMAC_BASE (0x01D07000) 23#define DM365_EMAC_BASE (0x01D07000)
23#define DM365_EMAC_CNTRL_OFFSET (0x0000) 24#define DM365_EMAC_CNTRL_OFFSET (0x0000)
@@ -36,4 +37,5 @@ void __init dm365_init_asp(struct snd_platform_data *pdata);
36void __init dm365_init_ks(struct davinci_ks_platform_data *pdata); 37void __init dm365_init_ks(struct davinci_ks_platform_data *pdata);
37void __init dm365_init_rtc(void); 38void __init dm365_init_rtc(void);
38 39
40void dm365_set_vpfe_config(struct vpfe_config *cfg);
39#endif /* __ASM_ARCH_DM365_H */ 41#endif /* __ASM_ARCH_DM365_H */
diff --git a/arch/arm/mach-pxa/include/mach/camera.h b/arch/arm/mach-pxa/include/mach/camera.h
index 31abe6d514b..6709b1cd7c7 100644
--- a/arch/arm/mach-pxa/include/mach/camera.h
+++ b/arch/arm/mach-pxa/include/mach/camera.h
@@ -35,8 +35,6 @@
35#define PXA_CAMERA_VSP 0x400 35#define PXA_CAMERA_VSP 0x400
36 36
37struct pxacamera_platform_data { 37struct pxacamera_platform_data {
38 int (*init)(struct device *);
39
40 unsigned long flags; 38 unsigned long flags;
41 unsigned long mclk_10khz; 39 unsigned long mclk_10khz;
42}; 40};
diff --git a/arch/sh/boards/mach-ap325rxa/setup.c b/arch/sh/boards/mach-ap325rxa/setup.c
index b5980696abb..57e37e28420 100644
--- a/arch/sh/boards/mach-ap325rxa/setup.c
+++ b/arch/sh/boards/mach-ap325rxa/setup.c
@@ -471,8 +471,8 @@ static struct i2c_board_info ap325rxa_i2c_camera[] = {
471}; 471};
472 472
473static struct ov772x_camera_info ov7725_info = { 473static struct ov772x_camera_info ov7725_info = {
474 .buswidth = SOCAM_DATAWIDTH_8, 474 .flags = OV772X_FLAG_VFLIP | OV772X_FLAG_HFLIP | \
475 .flags = OV772X_FLAG_VFLIP | OV772X_FLAG_HFLIP, 475 OV772X_FLAG_8BIT,
476 .edgectrl = OV772X_AUTO_EDGECTRL(0xf, 0), 476 .edgectrl = OV772X_AUTO_EDGECTRL(0xf, 0),
477}; 477};
478 478
diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c
index e08d5132bb1..be300aaca6f 100644
--- a/arch/sh/boards/mach-migor/setup.c
+++ b/arch/sh/boards/mach-migor/setup.c
@@ -431,7 +431,7 @@ static struct i2c_board_info migor_i2c_camera[] = {
431}; 431};
432 432
433static struct ov772x_camera_info ov7725_info = { 433static struct ov772x_camera_info ov7725_info = {
434 .buswidth = SOCAM_DATAWIDTH_8, 434 .flags = OV772X_FLAG_8BIT,
435}; 435};
436 436
437static struct soc_camera_link ov7725_link = { 437static struct soc_camera_link ov7725_link = {