All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] ARM: davinci: da850: add/enable video capture
@ 2016-12-07 19:31 Kevin Hilman
  2016-12-07 19:31 ` [PATCH v2 1/4] ARM: dts: davinci: da850: VPIF: add node and muxing Kevin Hilman
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Kevin Hilman @ 2016-12-07 19:31 UTC (permalink / raw)
  To: linux-arm-kernel

Add support for VPIF video capture using DT (partially.)

The main VPIF device, and its pin muxing are using DT, but legacy
platform_data is still required for the vpif_capture driver.  Passing
legacy platform_data is required until the V4L2 framework, and
subdevice drivers (such as the tvp514x) grow a way of selecting input
and output routing (c.f. V4L2 s_routing API)

Dependencies:
- VPIF driver changes:
  [PATCH v6 0/5] davinci: VPIF: add DT support
  https://marc.info/?l=linux-arm-kernel&m=148113556200610

Kevin Hilman (4):
  ARM: dts: davinci: da850: VPIF: add node and muxing
  ARM: davinci_all_defconfig: enable video capture as modules
  ARM: davinci: da8xx: add pdata-quirks, use for VPIF capture
  ARM: davinci: board-da850-evm: add I2C ID for VPIF

 arch/arm/boot/dts/da850-evm.dts             |   6 ++
 arch/arm/boot/dts/da850-lcdk.dts            |   6 ++
 arch/arm/boot/dts/da850.dtsi                |  38 ++++++-
 arch/arm/configs/davinci_all_defconfig      |   6 ++
 arch/arm/mach-davinci/Makefile              |   2 +-
 arch/arm/mach-davinci/board-da850-evm.c     |   1 +
 arch/arm/mach-davinci/da8xx-dt.c            |   2 +
 arch/arm/mach-davinci/include/mach/common.h |   4 +
 arch/arm/mach-davinci/pdata-quirks.c        | 155 ++++++++++++++++++++++++++++
 9 files changed, 218 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/mach-davinci/pdata-quirks.c

-- 
2.9.3

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH v2 1/4] ARM: dts: davinci: da850: VPIF: add node and muxing
  2016-12-07 19:31 [PATCH v2 0/4] ARM: davinci: da850: add/enable video capture Kevin Hilman
@ 2016-12-07 19:31 ` Kevin Hilman
  2016-12-07 19:34   ` Laurent Pinchart
  2016-12-08  0:14   ` [PATCH v2.1 " Kevin Hilman
  2016-12-07 19:31 ` [PATCH v2 2/4] ARM: davinci_all_defconfig: enable video capture as modules Kevin Hilman
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 13+ messages in thread
From: Kevin Hilman @ 2016-12-07 19:31 UTC (permalink / raw)
  To: linux-arm-kernel

Add VPIF node an pins to da850 and enable on boards.  VPIF has two input
channels described using the standard DT ports and enpoints.

Signed-off-by: Kevin Hilman <khilman@baylibre.com>
---
 arch/arm/boot/dts/da850-evm.dts  |  6 ++++++
 arch/arm/boot/dts/da850-lcdk.dts |  6 ++++++
 arch/arm/boot/dts/da850.dtsi     | 38 +++++++++++++++++++++++++++++++++++++-
 3 files changed, 49 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/da850-evm.dts b/arch/arm/boot/dts/da850-evm.dts
index 41de15fe15a2..212b50d4f84b 100644
--- a/arch/arm/boot/dts/da850-evm.dts
+++ b/arch/arm/boot/dts/da850-evm.dts
@@ -289,3 +289,9 @@
 		};
 	};
 };
+
+&vpif {
+       pinctrl-names = "default";
+       pinctrl-0 = <&vpif_capture_pins>;
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/da850-lcdk.dts b/arch/arm/boot/dts/da850-lcdk.dts
index 7b8ab21fed6c..67f846f5bb35 100644
--- a/arch/arm/boot/dts/da850-lcdk.dts
+++ b/arch/arm/boot/dts/da850-lcdk.dts
@@ -219,3 +219,9 @@
 		};
 	};
 };
+
+&vpif {
+       pinctrl-names = "default";
+       pinctrl-0 = <&vpif_capture_pins>;
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
index f79e1b91c680..dd2a13ed106e 100644
--- a/arch/arm/boot/dts/da850.dtsi
+++ b/arch/arm/boot/dts/da850.dtsi
@@ -186,7 +186,18 @@
 					0xc 0x88888888 0xffffffff
 				>;
 			};
-
+			vpif_capture_pins: vpif_capture_pins {
+				pinctrl-single,bits = <
+					/* VP_DIN[2..7], VP_CLKIN1, VP_CLKIN0 */
+					0x38 0x11111111 0xffffffff
+					/* VP_DIN[10..15,0..1] */
+					0x3c 0x11111111 0xffffffff
+					/* VP_DIN[8..9] */
+					0x40 0x00000011 0x000000ff
+					/* VP_CLKIN3, VP_CLKIN2 */
+					0x4c 0x00010100 0x000f0f00
+				>;
+			};
 		};
 		edma0: edma at 0 {
 			compatible = "ti,edma3-tpcc";
@@ -399,7 +410,32 @@
 				<&edma0 0 1>;
 			dma-names = "tx", "rx";
 		};
+
+		vpif: video at 217000 {
+			compatible = "ti,da850-vpif";
+			reg = <0x217000 0x1000>;
+			interrupts = <92>;
+			status = "disabled";
+
+			/* VPIF capture: input channels */
+			port {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				vpif_ch0: endpoint at 0 {
+					  reg = <0>;
+					  bus-width = <8>;
+				};
+
+				vpif_ch1: endpoint at 1 {
+					  reg = <1>;
+					  bus-width = <8>;
+					  data-shift = <8>;
+				};
+			};
+		};
 	};
+
 	aemif: aemif at 68000000 {
 		compatible = "ti,da850-aemif";
 		#address-cells = <2>;
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v2 2/4] ARM: davinci_all_defconfig: enable video capture as modules
  2016-12-07 19:31 [PATCH v2 0/4] ARM: davinci: da850: add/enable video capture Kevin Hilman
  2016-12-07 19:31 ` [PATCH v2 1/4] ARM: dts: davinci: da850: VPIF: add node and muxing Kevin Hilman
@ 2016-12-07 19:31 ` Kevin Hilman
  2017-01-03  5:51   ` Sekhar Nori
  2016-12-07 19:31 ` [PATCH v2 3/4] ARM: davinci: da8xx: add pdata-quirks, use for VPIF capture Kevin Hilman
  2016-12-07 19:31 ` [PATCH v2 4/4] ARM: davinci: board-da850-evm: add I2C ID for VPIF Kevin Hilman
  3 siblings, 1 reply; 13+ messages in thread
From: Kevin Hilman @ 2016-12-07 19:31 UTC (permalink / raw)
  To: linux-arm-kernel

Enable media support and V4L2 capture, along with video decoders used
on da850 platforms.

Tested on da850-lcdk.

Signed-off-by: Kevin Hilman <khilman@baylibre.com>
---
 arch/arm/configs/davinci_all_defconfig | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/configs/davinci_all_defconfig b/arch/arm/configs/davinci_all_defconfig
index 5e5dd6bc5ed9..fd05bc35fb36 100644
--- a/arch/arm/configs/davinci_all_defconfig
+++ b/arch/arm/configs/davinci_all_defconfig
@@ -123,6 +123,12 @@ CONFIG_TPS6507X=y
 CONFIG_REGULATOR=y
 CONFIG_REGULATOR_FIXED_VOLTAGE=y
 CONFIG_REGULATOR_TPS6507X=y
+CONFIG_MEDIA_SUPPORT=m
+CONFIG_MEDIA_CAMERA_SUPPORT=y
+CONFIG_V4L_PLATFORM_DRIVERS=y
+CONFIG_VIDEO_DAVINCI_VPIF_CAPTURE=m
+# CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set
+CONFIG_VIDEO_TVP514X=m
 CONFIG_FB=y
 CONFIG_FIRMWARE_EDID=y
 CONFIG_FB_DA8XX=y
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v2 3/4] ARM: davinci: da8xx: add pdata-quirks, use for VPIF capture
  2016-12-07 19:31 [PATCH v2 0/4] ARM: davinci: da850: add/enable video capture Kevin Hilman
  2016-12-07 19:31 ` [PATCH v2 1/4] ARM: dts: davinci: da850: VPIF: add node and muxing Kevin Hilman
  2016-12-07 19:31 ` [PATCH v2 2/4] ARM: davinci_all_defconfig: enable video capture as modules Kevin Hilman
@ 2016-12-07 19:31 ` Kevin Hilman
  2017-01-03  8:56   ` Sekhar Nori
  2016-12-07 19:31 ` [PATCH v2 4/4] ARM: davinci: board-da850-evm: add I2C ID for VPIF Kevin Hilman
  3 siblings, 1 reply; 13+ messages in thread
From: Kevin Hilman @ 2016-12-07 19:31 UTC (permalink / raw)
  To: linux-arm-kernel

Add pdata-quirks for da8xx DT platforms, which adds the legacy platform
data for vpif_capture driver.

Passing legacy platform_data is required until the V4L2 framework, and
subdevice drivers (such as the tvp514x) grow a way of selecting input
and output routing  (c.f. V4L2 s_routing API)

Signed-off-by: Kevin Hilman <khilman@baylibre.com>
---
 arch/arm/mach-davinci/Makefile              |   2 +-
 arch/arm/mach-davinci/da8xx-dt.c            |   2 +
 arch/arm/mach-davinci/include/mach/common.h |   4 +
 arch/arm/mach-davinci/pdata-quirks.c        | 155 ++++++++++++++++++++++++++++
 4 files changed, 162 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/mach-davinci/pdata-quirks.c

diff --git a/arch/arm/mach-davinci/Makefile b/arch/arm/mach-davinci/Makefile
index da4c336b4637..90d2e6e4d913 100644
--- a/arch/arm/mach-davinci/Makefile
+++ b/arch/arm/mach-davinci/Makefile
@@ -21,7 +21,7 @@ obj-$(CONFIG_AINTC)			+= irq.o
 obj-$(CONFIG_CP_INTC)			+= cp_intc.o
 
 # Board specific
-obj-$(CONFIG_MACH_DA8XX_DT)		+= da8xx-dt.o
+obj-$(CONFIG_MACH_DA8XX_DT)		+= da8xx-dt.o pdata-quirks.o
 obj-$(CONFIG_MACH_DAVINCI_EVM)  	+= board-dm644x-evm.o
 obj-$(CONFIG_MACH_SFFSDR)		+= board-sffsdr.o
 obj-$(CONFIG_MACH_NEUROS_OSD2)		+= board-neuros-osd2.o
diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c
index c9f7e9274aa8..69c8099de9f5 100644
--- a/arch/arm/mach-davinci/da8xx-dt.c
+++ b/arch/arm/mach-davinci/da8xx-dt.c
@@ -38,6 +38,7 @@ static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
 		       NULL),
 	OF_DEV_AUXDATA("ti,da830-mcasp-audio", 0x01d00000, "davinci-mcasp.0", NULL),
 	OF_DEV_AUXDATA("ti,da850-aemif", 0x68000000, "ti-aemif", NULL),
+	OF_DEV_AUXDATA("ti,da850-vpif", 0x01e17000, "vpif", NULL),
 	{}
 };
 
@@ -46,6 +47,7 @@ static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
 static void __init da850_init_machine(void)
 {
 	of_platform_default_populate(NULL, da850_auxdata_lookup, NULL);
+	pdata_quirks_init();
 }
 
 static const char *const da850_boards_compat[] __initconst = {
diff --git a/arch/arm/mach-davinci/include/mach/common.h b/arch/arm/mach-davinci/include/mach/common.h
index 0b3c169758ed..1fd4cd2d1c23 100644
--- a/arch/arm/mach-davinci/include/mach/common.h
+++ b/arch/arm/mach-davinci/include/mach/common.h
@@ -102,6 +102,10 @@ int davinci_pm_init(void);
 static inline int davinci_pm_init(void) { return 0; }
 #endif
 
+#ifdef CONFIG_MACH_DA8XX_DT
+extern void __init pdata_quirks_init(void);
+#endif
+
 #define SRAM_SIZE	SZ_128K
 
 #endif /* __ARCH_ARM_MACH_DAVINCI_COMMON_H */
diff --git a/arch/arm/mach-davinci/pdata-quirks.c b/arch/arm/mach-davinci/pdata-quirks.c
new file mode 100644
index 000000000000..a186513edf7e
--- /dev/null
+++ b/arch/arm/mach-davinci/pdata-quirks.c
@@ -0,0 +1,155 @@
+/*
+ * Legacy platform_data quirks
+ *
+ * Copyright (C) 2016 BayLibre, Inc
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include <linux/kernel.h>
+#include <linux/of_platform.h>
+
+#include <media/i2c/tvp514x.h>
+
+#include <mach/common.h>
+#include <mach/da8xx.h>
+#include <mach/mux.h>
+
+struct pdata_init {
+	const char *compatible;
+	void (*fn)(void);
+};
+
+#if IS_ENABLED(CONFIG_VIDEO_DAVINCI_VPIF_CAPTURE)
+
+#define TVP5147_CH0		"tvp514x-0"
+#define TVP5147_CH1		"tvp514x-1"
+
+/* VPIF capture configuration */
+static struct tvp514x_platform_data tvp5146_pdata = {
+		.clk_polarity = 0,
+		.hs_polarity  = 1,
+		.vs_polarity  = 1,
+};
+
+#define TVP514X_STD_ALL (V4L2_STD_NTSC | V4L2_STD_PAL)
+
+static const struct vpif_input da850_ch0_inputs[] = {
+	{
+		.input = {
+			.index = 0,
+			.name  = "Composite",
+			.type  = V4L2_INPUT_TYPE_CAMERA,
+			.capabilities = V4L2_IN_CAP_STD,
+			.std   = TVP514X_STD_ALL,
+		},
+		.input_route = INPUT_CVBS_VI2B,
+		.output_route = OUTPUT_10BIT_422_EMBEDDED_SYNC,
+		.subdev_name = TVP5147_CH0,
+	},
+};
+
+static const struct vpif_input da850_ch1_inputs[] = {
+	{
+		.input = {
+			.index = 0,
+			.name  = "S-Video",
+			.type  = V4L2_INPUT_TYPE_CAMERA,
+			.capabilities = V4L2_IN_CAP_STD,
+			.std   = TVP514X_STD_ALL,
+		},
+		.input_route = INPUT_SVIDEO_VI2C_VI1C,
+		.output_route = OUTPUT_10BIT_422_EMBEDDED_SYNC,
+		.subdev_name = TVP5147_CH1,
+	},
+};
+
+static struct vpif_subdev_info da850_vpif_capture_sdev_info[] = {
+	{
+		.name = TVP5147_CH0,
+		.board_info = {
+			I2C_BOARD_INFO("tvp5146", 0x5d),
+			.platform_data = &tvp5146_pdata,
+		},
+	},
+	{
+		.name = TVP5147_CH1,
+		.board_info = {
+			I2C_BOARD_INFO("tvp5146", 0x5c),
+			.platform_data = &tvp5146_pdata,
+		},
+	},
+};
+
+static struct vpif_capture_config da850_vpif_capture_config = {
+	.subdev_info = da850_vpif_capture_sdev_info,
+	.subdev_count = ARRAY_SIZE(da850_vpif_capture_sdev_info),
+	.chan_config[0] = {
+		.inputs = da850_ch0_inputs,
+		.input_count = ARRAY_SIZE(da850_ch0_inputs),
+		.vpif_if = {
+			.if_type = VPIF_IF_BT656,
+			.hd_pol  = 1,
+			.vd_pol  = 1,
+			.fid_pol = 0,
+		},
+	},
+	.chan_config[1] = {
+		.inputs = da850_ch1_inputs,
+		.input_count = ARRAY_SIZE(da850_ch1_inputs),
+		.vpif_if = {
+			.if_type = VPIF_IF_BT656,
+			.hd_pol  = 1,
+			.vd_pol  = 1,
+			.fid_pol = 0,
+		},
+	},
+	.card_name = "DA850/OMAP-L138 Video Capture",
+};
+
+static void __init da850_vpif_legacy_init(void)
+{
+	int ret;
+	
+	/* LCDK doesn't have the 2nd TVP514x on CH1 */
+	if (of_machine_is_compatible("ti,da850-lcdk"))
+		da850_vpif_capture_config.subdev_count = 1;
+
+	/* EVM (UI card) uses i2c adapter 1 (not default: zero) */
+	if (of_machine_is_compatible("ti,da850-evm"))
+		da850_vpif_capture_config.i2c_adapter_id = 1;
+
+	ret = da850_register_vpif_capture(&da850_vpif_capture_config);
+	if (ret)
+		pr_warn("%s: VPIF capture setup failed: %d\n",
+			__func__, ret);
+}
+#endif
+
+static void pdata_quirks_check(struct pdata_init *quirks)
+{
+	while (quirks->compatible) {
+		if (of_machine_is_compatible(quirks->compatible)) {
+			if (quirks->fn)
+				quirks->fn();
+			break;
+		}
+		quirks++;
+	}
+}
+
+static struct pdata_init pdata_quirks[] __initdata = {
+#if IS_ENABLED(CONFIG_VIDEO_DAVINCI_VPIF_CAPTURE)
+	{ "ti,da850-lcdk", da850_vpif_legacy_init, },
+#if defined(CONFIG_DA850_UI_SD_VIDEO_PORT)
+	{ "ti,da850-evm", da850_vpif_legacy_init, },
+#endif
+#endif
+	{ /* sentinel */ },
+};
+
+void __init pdata_quirks_init(void)
+{
+	pdata_quirks_check(pdata_quirks);
+}
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v2 4/4] ARM: davinci: board-da850-evm: add I2C ID for VPIF
  2016-12-07 19:31 [PATCH v2 0/4] ARM: davinci: da850: add/enable video capture Kevin Hilman
                   ` (2 preceding siblings ...)
  2016-12-07 19:31 ` [PATCH v2 3/4] ARM: davinci: da8xx: add pdata-quirks, use for VPIF capture Kevin Hilman
@ 2016-12-07 19:31 ` Kevin Hilman
  3 siblings, 0 replies; 13+ messages in thread
From: Kevin Hilman @ 2016-12-07 19:31 UTC (permalink / raw)
  To: linux-arm-kernel

VPIF capture driver now has a way to specific I2C adapter ID (was
previously hard-coded.)  Use the new interface.

Signed-off-by: Kevin Hilman <khilman@baylibre.com>
---
 arch/arm/mach-davinci/board-da850-evm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index 8e4539f69fdc..60f15f276ab7 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -1229,6 +1229,7 @@ static struct vpif_subdev_info da850_vpif_capture_sdev_info[] = {
 static struct vpif_capture_config da850_vpif_capture_config = {
 	.subdev_info = da850_vpif_capture_sdev_info,
 	.subdev_count = ARRAY_SIZE(da850_vpif_capture_sdev_info),
+	.i2c_adapter_id = 1,
 	.chan_config[0] = {
 		.inputs = da850_ch0_inputs,
 		.input_count = ARRAY_SIZE(da850_ch0_inputs),
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v2 1/4] ARM: dts: davinci: da850: VPIF: add node and muxing
  2016-12-07 19:31 ` [PATCH v2 1/4] ARM: dts: davinci: da850: VPIF: add node and muxing Kevin Hilman
@ 2016-12-07 19:34   ` Laurent Pinchart
  2016-12-07 23:15     ` Kevin Hilman
  2016-12-08  0:14   ` [PATCH v2.1 " Kevin Hilman
  1 sibling, 1 reply; 13+ messages in thread
From: Laurent Pinchart @ 2016-12-07 19:34 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Kevin,

Thank you for the patch.

On Wednesday 07 Dec 2016 11:31:34 Kevin Hilman wrote:
> Add VPIF node an pins to da850 and enable on boards.  VPIF has two input
> channels described using the standard DT ports and enpoints.
> 
> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
> ---
>  arch/arm/boot/dts/da850-evm.dts  |  6 ++++++
>  arch/arm/boot/dts/da850-lcdk.dts |  6 ++++++
>  arch/arm/boot/dts/da850.dtsi     | 38 +++++++++++++++++++++++++++++++++++-
>  3 files changed, 49 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/boot/dts/da850-evm.dts
> b/arch/arm/boot/dts/da850-evm.dts index 41de15fe15a2..212b50d4f84b 100644
> --- a/arch/arm/boot/dts/da850-evm.dts
> +++ b/arch/arm/boot/dts/da850-evm.dts
> @@ -289,3 +289,9 @@
>  		};
>  	};
>  };
> +
> +&vpif {
> +       pinctrl-names = "default";
> +       pinctrl-0 = <&vpif_capture_pins>;
> +       status = "okay";
> +};
> diff --git a/arch/arm/boot/dts/da850-lcdk.dts
> b/arch/arm/boot/dts/da850-lcdk.dts index 7b8ab21fed6c..67f846f5bb35 100644
> --- a/arch/arm/boot/dts/da850-lcdk.dts
> +++ b/arch/arm/boot/dts/da850-lcdk.dts
> @@ -219,3 +219,9 @@
>  		};
>  	};
>  };
> +
> +&vpif {
> +       pinctrl-names = "default";
> +       pinctrl-0 = <&vpif_capture_pins>;
> +       status = "okay";
> +};
> diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
> index f79e1b91c680..dd2a13ed106e 100644
> --- a/arch/arm/boot/dts/da850.dtsi
> +++ b/arch/arm/boot/dts/da850.dtsi
> @@ -186,7 +186,18 @@
>  					0xc 0x88888888 0xffffffff
> 
>  				>;
> 
>  			};
> -
> +			vpif_capture_pins: vpif_capture_pins {
> +				pinctrl-single,bits = <
> +					/* VP_DIN[2..7], VP_CLKIN1, VP_CLKIN0 
*/
> +					0x38 0x11111111 0xffffffff
> +					/* VP_DIN[10..15,0..1] */
> +					0x3c 0x11111111 0xffffffff
> +					/* VP_DIN[8..9] */
> +					0x40 0x00000011 0x000000ff
> +					/* VP_CLKIN3, VP_CLKIN2 */
> +					0x4c 0x00010100 0x000f0f00
> +				>;
> +			};
>  		};
>  		edma0: edma at 0 {
>  			compatible = "ti,edma3-tpcc";
> @@ -399,7 +410,32 @@
>  				<&edma0 0 1>;
>  			dma-names = "tx", "rx";
>  		};
> +
> +		vpif: video at 217000 {
> +			compatible = "ti,da850-vpif";
> +			reg = <0x217000 0x1000>;
> +			interrupts = <92>;
> +			status = "disabled";
> +
> +			/* VPIF capture: input channels */
> +			port {
> +				#address-cells = <1>;
> +				#size-cells = <0>;
> +
> +				vpif_ch0: endpoint at 0 {
> +					  reg = <0>;
> +					  bus-width = <8>;
> +				};
> +
> +				vpif_ch1: endpoint at 1 {
> +					  reg = <1>;
> +					  bus-width = <8>;
> +					  data-shift = <8>;
> +				};

Given that the VPIF can also accept a single 16-bit input, I'd move the 
endpoints to board files.

> +			};
> +		};
>  	};
> +
>  	aemif: aemif at 68000000 {
>  		compatible = "ti,da850-aemif";
>  		#address-cells = <2>;

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH v2 1/4] ARM: dts: davinci: da850: VPIF: add node and muxing
  2016-12-07 19:34   ` Laurent Pinchart
@ 2016-12-07 23:15     ` Kevin Hilman
  0 siblings, 0 replies; 13+ messages in thread
From: Kevin Hilman @ 2016-12-07 23:15 UTC (permalink / raw)
  To: linux-arm-kernel

Laurent Pinchart <laurent.pinchart@ideasonboard.com> writes:

> Hi Kevin,
>
> Thank you for the patch.
>
> On Wednesday 07 Dec 2016 11:31:34 Kevin Hilman wrote:
>> Add VPIF node an pins to da850 and enable on boards.  VPIF has two input
>> channels described using the standard DT ports and enpoints.
>> 
>> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
>> ---
>>  arch/arm/boot/dts/da850-evm.dts  |  6 ++++++
>>  arch/arm/boot/dts/da850-lcdk.dts |  6 ++++++
>>  arch/arm/boot/dts/da850.dtsi     | 38 +++++++++++++++++++++++++++++++++++-
>>  3 files changed, 49 insertions(+), 1 deletion(-)
>> 
>> diff --git a/arch/arm/boot/dts/da850-evm.dts
>> b/arch/arm/boot/dts/da850-evm.dts index 41de15fe15a2..212b50d4f84b 100644
>> --- a/arch/arm/boot/dts/da850-evm.dts
>> +++ b/arch/arm/boot/dts/da850-evm.dts
>> @@ -289,3 +289,9 @@
>>  		};
>>  	};
>>  };
>> +
>> +&vpif {
>> +       pinctrl-names = "default";
>> +       pinctrl-0 = <&vpif_capture_pins>;
>> +       status = "okay";
>> +};
>> diff --git a/arch/arm/boot/dts/da850-lcdk.dts
>> b/arch/arm/boot/dts/da850-lcdk.dts index 7b8ab21fed6c..67f846f5bb35 100644
>> --- a/arch/arm/boot/dts/da850-lcdk.dts
>> +++ b/arch/arm/boot/dts/da850-lcdk.dts
>> @@ -219,3 +219,9 @@
>>  		};
>>  	};
>>  };
>> +
>> +&vpif {
>> +       pinctrl-names = "default";
>> +       pinctrl-0 = <&vpif_capture_pins>;
>> +       status = "okay";
>> +};
>> diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
>> index f79e1b91c680..dd2a13ed106e 100644
>> --- a/arch/arm/boot/dts/da850.dtsi
>> +++ b/arch/arm/boot/dts/da850.dtsi
>> @@ -186,7 +186,18 @@
>>  					0xc 0x88888888 0xffffffff
>> 
>>  				>;
>> 
>>  			};
>> -
>> +			vpif_capture_pins: vpif_capture_pins {
>> +				pinctrl-single,bits = <
>> +					/* VP_DIN[2..7], VP_CLKIN1, VP_CLKIN0 
> */
>> +					0x38 0x11111111 0xffffffff
>> +					/* VP_DIN[10..15,0..1] */
>> +					0x3c 0x11111111 0xffffffff
>> +					/* VP_DIN[8..9] */
>> +					0x40 0x00000011 0x000000ff
>> +					/* VP_CLKIN3, VP_CLKIN2 */
>> +					0x4c 0x00010100 0x000f0f00
>> +				>;
>> +			};
>>  		};
>>  		edma0: edma at 0 {
>>  			compatible = "ti,edma3-tpcc";
>> @@ -399,7 +410,32 @@
>>  				<&edma0 0 1>;
>>  			dma-names = "tx", "rx";
>>  		};
>> +
>> +		vpif: video at 217000 {
>> +			compatible = "ti,da850-vpif";
>> +			reg = <0x217000 0x1000>;
>> +			interrupts = <92>;
>> +			status = "disabled";
>> +
>> +			/* VPIF capture: input channels */
>> +			port {
>> +				#address-cells = <1>;
>> +				#size-cells = <0>;
>> +
>> +				vpif_ch0: endpoint at 0 {
>> +					  reg = <0>;
>> +					  bus-width = <8>;
>> +				};
>> +
>> +				vpif_ch1: endpoint at 1 {
>> +					  reg = <1>;
>> +					  bus-width = <8>;
>> +					  data-shift = <8>;
>> +				};
>
> Given that the VPIF can also accept a single 16-bit input, I'd move the 
> endpoints to board files.
>

Yes, good point.  Will move them.

Kevin

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH v2.1 1/4] ARM: dts: davinci: da850: VPIF: add node and muxing
  2016-12-07 19:31 ` [PATCH v2 1/4] ARM: dts: davinci: da850: VPIF: add node and muxing Kevin Hilman
  2016-12-07 19:34   ` Laurent Pinchart
@ 2016-12-08  0:14   ` Kevin Hilman
  2016-12-08 13:51     ` Laurent Pinchart
  2017-01-03  5:35     ` Sekhar Nori
  1 sibling, 2 replies; 13+ messages in thread
From: Kevin Hilman @ 2016-12-08  0:14 UTC (permalink / raw)
  To: linux-arm-kernel

Add VPIF node an pins to da850 and enable on boards.  VPIF has two input
channels described using the standard DT ports and enpoints.

Signed-off-by: Kevin Hilman <khilman@baylibre.com>
---
v2 -> v2.1: moved ports from SoC .dtsi to board .dts files.

 arch/arm/boot/dts/da850-evm.dts  | 20 ++++++++++++++++++++
 arch/arm/boot/dts/da850-lcdk.dts | 13 +++++++++++++
 arch/arm/boot/dts/da850.dtsi     | 27 ++++++++++++++++++++++++++-
 3 files changed, 59 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/da850-evm.dts b/arch/arm/boot/dts/da850-evm.dts
index 41de15fe15a2..cea36ee6fd07 100644
--- a/arch/arm/boot/dts/da850-evm.dts
+++ b/arch/arm/boot/dts/da850-evm.dts
@@ -289,3 +289,23 @@
 		};
 	};
 };
+
+&vpif {
+	pinctrl-names = "default";
+	pinctrl-0 = <&vpif_capture_pins>;
+	status = "okay";
+
+	/* VPIF capture port */
+	port {
+		vpif_ch0: endpoint at 0 {
+			  reg = <0>;
+			  bus-width = <8>;
+		};
+
+		vpif_ch1: endpoint at 1 {
+			  reg = <1>;
+			  bus-width = <8>;
+			  data-shift = <8>;
+		};
+	};
+};
diff --git a/arch/arm/boot/dts/da850-lcdk.dts b/arch/arm/boot/dts/da850-lcdk.dts
index 7b8ab21fed6c..5fc21528e0ba 100644
--- a/arch/arm/boot/dts/da850-lcdk.dts
+++ b/arch/arm/boot/dts/da850-lcdk.dts
@@ -219,3 +219,16 @@
 		};
 	};
 };
+
+&vpif {
+	pinctrl-names = "default";
+	pinctrl-0 = <&vpif_capture_pins>;
+	status = "okay";
+
+	/* VPIF capture port */
+	port {
+		vpif_ch0: endpoint {
+			  bus-width = <8>;
+		};
+	};
+};
diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
index f79e1b91c680..5f0b40510b2b 100644
--- a/arch/arm/boot/dts/da850.dtsi
+++ b/arch/arm/boot/dts/da850.dtsi
@@ -186,7 +186,18 @@
 					0xc 0x88888888 0xffffffff
 				>;
 			};
-
+			vpif_capture_pins: vpif_capture_pins {
+				pinctrl-single,bits = <
+					/* VP_DIN[2..7], VP_CLKIN1, VP_CLKIN0 */
+					0x38 0x11111111 0xffffffff
+					/* VP_DIN[10..15,0..1] */
+					0x3c 0x11111111 0xffffffff
+					/* VP_DIN[8..9] */
+					0x40 0x00000011 0x000000ff
+					/* VP_CLKIN3, VP_CLKIN2 */
+					0x4c 0x00010100 0x000f0f00
+				>;
+			};
 		};
 		edma0: edma at 0 {
 			compatible = "ti,edma3-tpcc";
@@ -399,7 +410,21 @@
 				<&edma0 0 1>;
 			dma-names = "tx", "rx";
 		};
+
+		vpif: video at 217000 {
+			compatible = "ti,da850-vpif";
+			reg = <0x217000 0x1000>;
+			interrupts = <92>;
+			status = "disabled";
+
+			/* VPIF capture port */
+			port {
+				#address-cells = <1>;
+				#size-cells = <0>;
+			};
+		};
 	};
+
 	aemif: aemif at 68000000 {
 		compatible = "ti,da850-aemif";
 		#address-cells = <2>;
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v2.1 1/4] ARM: dts: davinci: da850: VPIF: add node and muxing
  2016-12-08  0:14   ` [PATCH v2.1 " Kevin Hilman
@ 2016-12-08 13:51     ` Laurent Pinchart
  2017-01-03  5:35     ` Sekhar Nori
  1 sibling, 0 replies; 13+ messages in thread
From: Laurent Pinchart @ 2016-12-08 13:51 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Kevin,

Thank you for the patch.

On Wednesday 07 Dec 2016 16:14:18 Kevin Hilman wrote:
> Add VPIF node an pins to da850 and enable on boards.  VPIF has two input
> channels described using the standard DT ports and enpoints.
> 
> Signed-off-by: Kevin Hilman <khilman@baylibre.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
> v2 -> v2.1: moved ports from SoC .dtsi to board .dts files.
> 
>  arch/arm/boot/dts/da850-evm.dts  | 20 ++++++++++++++++++++
>  arch/arm/boot/dts/da850-lcdk.dts | 13 +++++++++++++
>  arch/arm/boot/dts/da850.dtsi     | 27 ++++++++++++++++++++++++++-
>  3 files changed, 59 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/boot/dts/da850-evm.dts
> b/arch/arm/boot/dts/da850-evm.dts index 41de15fe15a2..cea36ee6fd07 100644
> --- a/arch/arm/boot/dts/da850-evm.dts
> +++ b/arch/arm/boot/dts/da850-evm.dts
> @@ -289,3 +289,23 @@
>  		};
>  	};
>  };
> +
> +&vpif {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&vpif_capture_pins>;
> +	status = "okay";
> +
> +	/* VPIF capture port */
> +	port {
> +		vpif_ch0: endpoint at 0 {
> +			  reg = <0>;
> +			  bus-width = <8>;
> +		};
> +
> +		vpif_ch1: endpoint at 1 {
> +			  reg = <1>;
> +			  bus-width = <8>;
> +			  data-shift = <8>;
> +		};
> +	};
> +};
> diff --git a/arch/arm/boot/dts/da850-lcdk.dts
> b/arch/arm/boot/dts/da850-lcdk.dts index 7b8ab21fed6c..5fc21528e0ba 100644
> --- a/arch/arm/boot/dts/da850-lcdk.dts
> +++ b/arch/arm/boot/dts/da850-lcdk.dts
> @@ -219,3 +219,16 @@
>  		};
>  	};
>  };
> +
> +&vpif {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&vpif_capture_pins>;
> +	status = "okay";
> +
> +	/* VPIF capture port */
> +	port {
> +		vpif_ch0: endpoint {
> +			  bus-width = <8>;
> +		};
> +	};
> +};
> diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
> index f79e1b91c680..5f0b40510b2b 100644
> --- a/arch/arm/boot/dts/da850.dtsi
> +++ b/arch/arm/boot/dts/da850.dtsi
> @@ -186,7 +186,18 @@
>  					0xc 0x88888888 0xffffffff
> 
>  				>;
> 
>  			};
> -
> +			vpif_capture_pins: vpif_capture_pins {
> +				pinctrl-single,bits = <
> +					/* VP_DIN[2..7], VP_CLKIN1, VP_CLKIN0 
*/
> +					0x38 0x11111111 0xffffffff
> +					/* VP_DIN[10..15,0..1] */
> +					0x3c 0x11111111 0xffffffff
> +					/* VP_DIN[8..9] */
> +					0x40 0x00000011 0x000000ff
> +					/* VP_CLKIN3, VP_CLKIN2 */
> +					0x4c 0x00010100 0x000f0f00
> +				>;
> +			};
>  		};
>  		edma0: edma at 0 {
>  			compatible = "ti,edma3-tpcc";
> @@ -399,7 +410,21 @@
>  				<&edma0 0 1>;
>  			dma-names = "tx", "rx";
>  		};
> +
> +		vpif: video at 217000 {
> +			compatible = "ti,da850-vpif";
> +			reg = <0x217000 0x1000>;
> +			interrupts = <92>;
> +			status = "disabled";
> +
> +			/* VPIF capture port */
> +			port {
> +				#address-cells = <1>;
> +				#size-cells = <0>;
> +			};
> +		};
>  	};
> +
>  	aemif: aemif at 68000000 {
>  		compatible = "ti,da850-aemif";
>  		#address-cells = <2>;

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH v2.1 1/4] ARM: dts: davinci: da850: VPIF: add node and muxing
  2016-12-08  0:14   ` [PATCH v2.1 " Kevin Hilman
  2016-12-08 13:51     ` Laurent Pinchart
@ 2017-01-03  5:35     ` Sekhar Nori
  2017-01-09 19:32       ` Kevin Hilman
  1 sibling, 1 reply; 13+ messages in thread
From: Sekhar Nori @ 2017-01-03  5:35 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Kevin,

On Thursday 08 December 2016 05:44 AM, Kevin Hilman wrote:
> Add VPIF node an pins to da850 and enable on boards.  VPIF has two input
> channels described using the standard DT ports and enpoints.
> 
> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
> ---
> v2 -> v2.1: moved ports from SoC .dtsi to board .dts files.
> 
>  arch/arm/boot/dts/da850-evm.dts  | 20 ++++++++++++++++++++
>  arch/arm/boot/dts/da850-lcdk.dts | 13 +++++++++++++
>  arch/arm/boot/dts/da850.dtsi     | 27 ++++++++++++++++++++++++++-
>  3 files changed, 59 insertions(+), 1 deletion(-)

Can you split this patch to keep the SoC addition separate from board
updates. Separating support addition for EVM and LCDK will be good also.

> diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
> index f79e1b91c680..5f0b40510b2b 100644
> --- a/arch/arm/boot/dts/da850.dtsi
> +++ b/arch/arm/boot/dts/da850.dtsi

> @@ -399,7 +410,21 @@
>  				<&edma0 0 1>;
>  			dma-names = "tx", "rx";
>  		};
> +
> +		vpif: video at 217000 {
> +			compatible = "ti,da850-vpif";
> +			reg = <0x217000 0x1000>;
> +			interrupts = <92>;
> +			status = "disabled";
> +
> +			/* VPIF capture port */
> +			port {
> +				#address-cells = <1>;
> +				#size-cells = <0>;
> +			};
> +		};

Can you add this node just above mmc1? I am trying to keep the nodes
sorted in the order of unit address instead of new ones getting added at
the end. Unfortunately, it was not strictly enforced and we have many
breakages. But lets add the new ones where they will eventually end up.

Thanks,
Sekhar

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH v2 2/4] ARM: davinci_all_defconfig: enable video capture as modules
  2016-12-07 19:31 ` [PATCH v2 2/4] ARM: davinci_all_defconfig: enable video capture as modules Kevin Hilman
@ 2017-01-03  5:51   ` Sekhar Nori
  0 siblings, 0 replies; 13+ messages in thread
From: Sekhar Nori @ 2017-01-03  5:51 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday 08 December 2016 01:01 AM, Kevin Hilman wrote:
> Enable media support and V4L2 capture, along with video decoders used
> on da850 platforms.
> 
> Tested on da850-lcdk.
> 
> Signed-off-by: Kevin Hilman <khilman@baylibre.com>

Applied to v4.11/defconfig

Thanks,
Sekhar

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH v2 3/4] ARM: davinci: da8xx: add pdata-quirks, use for VPIF capture
  2016-12-07 19:31 ` [PATCH v2 3/4] ARM: davinci: da8xx: add pdata-quirks, use for VPIF capture Kevin Hilman
@ 2017-01-03  8:56   ` Sekhar Nori
  0 siblings, 0 replies; 13+ messages in thread
From: Sekhar Nori @ 2017-01-03  8:56 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Kevin,

On Thursday 08 December 2016 01:01 AM, Kevin Hilman wrote:
> Add pdata-quirks for da8xx DT platforms, which adds the legacy platform
> data for vpif_capture driver.
> 
> Passing legacy platform_data is required until the V4L2 framework, and
> subdevice drivers (such as the tvp514x) grow a way of selecting input
> and output routing  (c.f. V4L2 s_routing API)
> 
> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
> ---
>  arch/arm/mach-davinci/Makefile              |   2 +-
>  arch/arm/mach-davinci/da8xx-dt.c            |   2 +
>  arch/arm/mach-davinci/include/mach/common.h |   4 +
>  arch/arm/mach-davinci/pdata-quirks.c        | 155 ++++++++++++++++++++++++++++
>  4 files changed, 162 insertions(+), 1 deletion(-)
>  create mode 100644 arch/arm/mach-davinci/pdata-quirks.c

Can you please split this to separate addition of pdata quirks from
adding vpif capture support. I think it is fine to have a pre-patch
adding support for pdata quirks with just the sentinel included.

> 
> diff --git a/arch/arm/mach-davinci/Makefile b/arch/arm/mach-davinci/Makefile
> index da4c336b4637..90d2e6e4d913 100644
> --- a/arch/arm/mach-davinci/Makefile
> +++ b/arch/arm/mach-davinci/Makefile
> @@ -21,7 +21,7 @@ obj-$(CONFIG_AINTC)			+= irq.o
>  obj-$(CONFIG_CP_INTC)			+= cp_intc.o
>  
>  # Board specific
> -obj-$(CONFIG_MACH_DA8XX_DT)		+= da8xx-dt.o
> +obj-$(CONFIG_MACH_DA8XX_DT)		+= da8xx-dt.o pdata-quirks.o
>  obj-$(CONFIG_MACH_DAVINCI_EVM)  	+= board-dm644x-evm.o
>  obj-$(CONFIG_MACH_SFFSDR)		+= board-sffsdr.o
>  obj-$(CONFIG_MACH_NEUROS_OSD2)		+= board-neuros-osd2.o
> diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c
> index c9f7e9274aa8..69c8099de9f5 100644
> --- a/arch/arm/mach-davinci/da8xx-dt.c
> +++ b/arch/arm/mach-davinci/da8xx-dt.c
> @@ -38,6 +38,7 @@ static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
>  		       NULL),
>  	OF_DEV_AUXDATA("ti,da830-mcasp-audio", 0x01d00000, "davinci-mcasp.0", NULL),
>  	OF_DEV_AUXDATA("ti,da850-aemif", 0x68000000, "ti-aemif", NULL),
> +	OF_DEV_AUXDATA("ti,da850-vpif", 0x01e17000, "vpif", NULL),
>  	{}
>  };
>  
> @@ -46,6 +47,7 @@ static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
>  static void __init da850_init_machine(void)
>  {
>  	of_platform_default_populate(NULL, da850_auxdata_lookup, NULL);
> +	pdata_quirks_init();
>  }
>  
>  static const char *const da850_boards_compat[] __initconst = {
> diff --git a/arch/arm/mach-davinci/include/mach/common.h b/arch/arm/mach-davinci/include/mach/common.h
> index 0b3c169758ed..1fd4cd2d1c23 100644
> --- a/arch/arm/mach-davinci/include/mach/common.h
> +++ b/arch/arm/mach-davinci/include/mach/common.h
> @@ -102,6 +102,10 @@ int davinci_pm_init(void);
>  static inline int davinci_pm_init(void) { return 0; }
>  #endif
>  
> +#ifdef CONFIG_MACH_DA8XX_DT
> +extern void __init pdata_quirks_init(void);

I noticed that checkpatch complains about the extern (with strict
warnings turned on). I think its better to drop it. I know you probably
added it to be consistent with other declarations in the file.

> +#endif
> +
>  #define SRAM_SIZE	SZ_128K
>  
>  #endif /* __ARCH_ARM_MACH_DAVINCI_COMMON_H */
> diff --git a/arch/arm/mach-davinci/pdata-quirks.c b/arch/arm/mach-davinci/pdata-quirks.c
> new file mode 100644
> index 000000000000..a186513edf7e
> --- /dev/null
> +++ b/arch/arm/mach-davinci/pdata-quirks.c
> @@ -0,0 +1,155 @@
> +/*
> + * Legacy platform_data quirks
> + *
> + * Copyright (C) 2016 BayLibre, Inc
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +#include <linux/kernel.h>
> +#include <linux/of_platform.h>
> +
> +#include <media/i2c/tvp514x.h>
> +
> +#include <mach/common.h>
> +#include <mach/da8xx.h>
> +#include <mach/mux.h>

The mux.h include can be dropped after you dropped the muxing from this
patch.

> +
> +struct pdata_init {
> +	const char *compatible;
> +	void (*fn)(void);
> +};
> +
> +#if IS_ENABLED(CONFIG_VIDEO_DAVINCI_VPIF_CAPTURE)
> +
> +#define TVP5147_CH0		"tvp514x-0"
> +#define TVP5147_CH1		"tvp514x-1"
> +
> +/* VPIF capture configuration */
> +static struct tvp514x_platform_data tvp5146_pdata = {
> +		.clk_polarity = 0,
> +		.hs_polarity  = 1,
> +		.vs_polarity  = 1,
> +};
> +
> +#define TVP514X_STD_ALL (V4L2_STD_NTSC | V4L2_STD_PAL)
> +
> +static const struct vpif_input da850_ch0_inputs[] = {
> +	{
> +		.input = {
> +			.index = 0,
> +			.name  = "Composite",
> +			.type  = V4L2_INPUT_TYPE_CAMERA,
> +			.capabilities = V4L2_IN_CAP_STD,
> +			.std   = TVP514X_STD_ALL,
> +		},
> +		.input_route = INPUT_CVBS_VI2B,
> +		.output_route = OUTPUT_10BIT_422_EMBEDDED_SYNC,
> +		.subdev_name = TVP5147_CH0,
> +	},
> +};
> +
> +static const struct vpif_input da850_ch1_inputs[] = {
> +	{
> +		.input = {
> +			.index = 0,
> +			.name  = "S-Video",
> +			.type  = V4L2_INPUT_TYPE_CAMERA,
> +			.capabilities = V4L2_IN_CAP_STD,
> +			.std   = TVP514X_STD_ALL,
> +		},
> +		.input_route = INPUT_SVIDEO_VI2C_VI1C,
> +		.output_route = OUTPUT_10BIT_422_EMBEDDED_SYNC,
> +		.subdev_name = TVP5147_CH1,
> +	},
> +};
> +
> +static struct vpif_subdev_info da850_vpif_capture_sdev_info[] = {
> +	{
> +		.name = TVP5147_CH0,
> +		.board_info = {
> +			I2C_BOARD_INFO("tvp5146", 0x5d),
> +			.platform_data = &tvp5146_pdata,
> +		},
> +	},
> +	{
> +		.name = TVP5147_CH1,
> +		.board_info = {
> +			I2C_BOARD_INFO("tvp5146", 0x5c),
> +			.platform_data = &tvp5146_pdata,
> +		},
> +	},
> +};
> +
> +static struct vpif_capture_config da850_vpif_capture_config = {
> +	.subdev_info = da850_vpif_capture_sdev_info,
> +	.subdev_count = ARRAY_SIZE(da850_vpif_capture_sdev_info),
> +	.chan_config[0] = {
> +		.inputs = da850_ch0_inputs,
> +		.input_count = ARRAY_SIZE(da850_ch0_inputs),
> +		.vpif_if = {
> +			.if_type = VPIF_IF_BT656,
> +			.hd_pol  = 1,
> +			.vd_pol  = 1,
> +			.fid_pol = 0,
> +		},
> +	},
> +	.chan_config[1] = {
> +		.inputs = da850_ch1_inputs,
> +		.input_count = ARRAY_SIZE(da850_ch1_inputs),
> +		.vpif_if = {
> +			.if_type = VPIF_IF_BT656,
> +			.hd_pol  = 1,
> +			.vd_pol  = 1,
> +			.fid_pol = 0,
> +		},
> +	},
> +	.card_name = "DA850/OMAP-L138 Video Capture",
> +};
> +
> +static void __init da850_vpif_legacy_init(void)
> +{
> +	int ret;
> +	
> +	/* LCDK doesn't have the 2nd TVP514x on CH1 */
> +	if (of_machine_is_compatible("ti,da850-lcdk"))
> +		da850_vpif_capture_config.subdev_count = 1;
> +
> +	/* EVM (UI card) uses i2c adapter 1 (not default: zero) */
> +	if (of_machine_is_compatible("ti,da850-evm"))
> +		da850_vpif_capture_config.i2c_adapter_id = 1;
> +
> +	ret = da850_register_vpif_capture(&da850_vpif_capture_config);
> +	if (ret)
> +		pr_warn("%s: VPIF capture setup failed: %d\n",
> +			__func__, ret);
> +}
> +#endif
> +
> +static void pdata_quirks_check(struct pdata_init *quirks)

This function can be marked __init too.

Thanks,
Sekhar

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH v2.1 1/4] ARM: dts: davinci: da850: VPIF: add node and muxing
  2017-01-03  5:35     ` Sekhar Nori
@ 2017-01-09 19:32       ` Kevin Hilman
  0 siblings, 0 replies; 13+ messages in thread
From: Kevin Hilman @ 2017-01-09 19:32 UTC (permalink / raw)
  To: linux-arm-kernel

Sekhar Nori <nsekhar@ti.com> writes:

> Hi Kevin,
>
> On Thursday 08 December 2016 05:44 AM, Kevin Hilman wrote:
>> Add VPIF node an pins to da850 and enable on boards.  VPIF has two input
>> channels described using the standard DT ports and enpoints.
>> 
>> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
>> ---
>> v2 -> v2.1: moved ports from SoC .dtsi to board .dts files.
>> 
>>  arch/arm/boot/dts/da850-evm.dts  | 20 ++++++++++++++++++++
>>  arch/arm/boot/dts/da850-lcdk.dts | 13 +++++++++++++
>>  arch/arm/boot/dts/da850.dtsi     | 27 ++++++++++++++++++++++++++-
>>  3 files changed, 59 insertions(+), 1 deletion(-)
>
> Can you split this patch to keep the SoC addition separate from board
> updates. Separating support addition for EVM and LCDK will be good also.

I don't understand why that matters, but OK.

>> diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
>> index f79e1b91c680..5f0b40510b2b 100644
>> --- a/arch/arm/boot/dts/da850.dtsi
>> +++ b/arch/arm/boot/dts/da850.dtsi
>
>> @@ -399,7 +410,21 @@
>>  				<&edma0 0 1>;
>>  			dma-names = "tx", "rx";
>>  		};
>> +
>> +		vpif: video at 217000 {
>> +			compatible = "ti,da850-vpif";
>> +			reg = <0x217000 0x1000>;
>> +			interrupts = <92>;
>> +			status = "disabled";
>> +
>> +			/* VPIF capture port */
>> +			port {
>> +				#address-cells = <1>;
>> +				#size-cells = <0>;
>> +			};
>> +		};
>
> Can you add this node just above mmc1? I am trying to keep the nodes
> sorted in the order of unit address instead of new ones getting added at
> the end. Unfortunately, it was not strictly enforced and we have many
> breakages. But lets add the new ones where they will eventually end up.

OK.

Kevin

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2017-01-09 19:32 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-07 19:31 [PATCH v2 0/4] ARM: davinci: da850: add/enable video capture Kevin Hilman
2016-12-07 19:31 ` [PATCH v2 1/4] ARM: dts: davinci: da850: VPIF: add node and muxing Kevin Hilman
2016-12-07 19:34   ` Laurent Pinchart
2016-12-07 23:15     ` Kevin Hilman
2016-12-08  0:14   ` [PATCH v2.1 " Kevin Hilman
2016-12-08 13:51     ` Laurent Pinchart
2017-01-03  5:35     ` Sekhar Nori
2017-01-09 19:32       ` Kevin Hilman
2016-12-07 19:31 ` [PATCH v2 2/4] ARM: davinci_all_defconfig: enable video capture as modules Kevin Hilman
2017-01-03  5:51   ` Sekhar Nori
2016-12-07 19:31 ` [PATCH v2 3/4] ARM: davinci: da8xx: add pdata-quirks, use for VPIF capture Kevin Hilman
2017-01-03  8:56   ` Sekhar Nori
2016-12-07 19:31 ` [PATCH v2 4/4] ARM: davinci: board-da850-evm: add I2C ID for VPIF Kevin Hilman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.