All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/6] ARM: davinci: vpif capture & display support
@ 2017-02-22 14:13 ` Bartosz Golaszewski
  0 siblings, 0 replies; 22+ messages in thread
From: Bartosz Golaszewski @ 2017-02-22 14:13 UTC (permalink / raw)
  To: Sekhar Nori, David Lechner, Kevin Hilman, Michael Turquette,
	Patrick Titiano, Laurent Pinchart, Russell King
  Cc: linux-arm-kernel, linux-kernel, Bartosz Golaszewski

This series adds pdata quirks and other changes required to make vpif
work on the da850-evm board.

v1 -> v2:
- added patch 1/5 - don't bail-out from pdata_quirks_check() after
  applying a single quirk
- changed the comment above the new fixed regulator to make it more
  descriptive
- removed unnecessary #ifdefs from pdata-quirks.c

v2 -> v3:
- added patch 6/6: add enable GPIOs to pdata-quirks - this is needed
  because vpif gets its resources from pdata-quirks instead of the
  device tree

Bartosz Golaszewski (4):
  ARM: davinci: da8xx: allow having multiple pdata-quirks
  ARM: da850-evm: add a fixed regulator for the UI board IO expander
  ARM: davinci: add pdata-quirks for da850-evm vpif display
  ARM: davinci: add enable GPIOs for vpif capture to pdata-quirks

Kevin Hilman (2):
  ARM: davinci: board-da850-evm: add I2C ID for VPIF
  ARM: davinci: da8xx: add pdata-quirks for VPIF capture

 arch/arm/mach-davinci/board-da850-evm.c |   4 +
 arch/arm/mach-davinci/da8xx-dt.c        |   1 +
 arch/arm/mach-davinci/pdata-quirks.c    | 187 +++++++++++++++++++++++++++++++-
 3 files changed, 191 insertions(+), 1 deletion(-)

-- 
2.9.3

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

* [PATCH v3 0/6] ARM: davinci: vpif capture & display support
@ 2017-02-22 14:13 ` Bartosz Golaszewski
  0 siblings, 0 replies; 22+ messages in thread
From: Bartosz Golaszewski @ 2017-02-22 14:13 UTC (permalink / raw)
  To: linux-arm-kernel

This series adds pdata quirks and other changes required to make vpif
work on the da850-evm board.

v1 -> v2:
- added patch 1/5 - don't bail-out from pdata_quirks_check() after
  applying a single quirk
- changed the comment above the new fixed regulator to make it more
  descriptive
- removed unnecessary #ifdefs from pdata-quirks.c

v2 -> v3:
- added patch 6/6: add enable GPIOs to pdata-quirks - this is needed
  because vpif gets its resources from pdata-quirks instead of the
  device tree

Bartosz Golaszewski (4):
  ARM: davinci: da8xx: allow having multiple pdata-quirks
  ARM: da850-evm: add a fixed regulator for the UI board IO expander
  ARM: davinci: add pdata-quirks for da850-evm vpif display
  ARM: davinci: add enable GPIOs for vpif capture to pdata-quirks

Kevin Hilman (2):
  ARM: davinci: board-da850-evm: add I2C ID for VPIF
  ARM: davinci: da8xx: add pdata-quirks for VPIF capture

 arch/arm/mach-davinci/board-da850-evm.c |   4 +
 arch/arm/mach-davinci/da8xx-dt.c        |   1 +
 arch/arm/mach-davinci/pdata-quirks.c    | 187 +++++++++++++++++++++++++++++++-
 3 files changed, 191 insertions(+), 1 deletion(-)

-- 
2.9.3

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

* [PATCH v3 1/6] ARM: davinci: da8xx: allow having multiple pdata-quirks
  2017-02-22 14:13 ` Bartosz Golaszewski
@ 2017-02-22 14:13   ` Bartosz Golaszewski
  -1 siblings, 0 replies; 22+ messages in thread
From: Bartosz Golaszewski @ 2017-02-22 14:13 UTC (permalink / raw)
  To: Sekhar Nori, David Lechner, Kevin Hilman, Michael Turquette,
	Patrick Titiano, Laurent Pinchart, Russell King
  Cc: linux-arm-kernel, linux-kernel, Bartosz Golaszewski

We currently bail-out after applying a single quirk. We will want
to reuse the function doing the vpif capture registration so remove
the break; and continue iterating over the quirk array.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/pdata-quirks.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/mach-davinci/pdata-quirks.c b/arch/arm/mach-davinci/pdata-quirks.c
index 5b57da4..36fb217 100644
--- a/arch/arm/mach-davinci/pdata-quirks.c
+++ b/arch/arm/mach-davinci/pdata-quirks.c
@@ -23,7 +23,6 @@ static void pdata_quirks_check(struct pdata_init *quirks)
 		if (of_machine_is_compatible(quirks->compatible)) {
 			if (quirks->fn)
 				quirks->fn();
-			break;
 		}
 		quirks++;
 	}
-- 
2.9.3

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

* [PATCH v3 1/6] ARM: davinci: da8xx: allow having multiple pdata-quirks
@ 2017-02-22 14:13   ` Bartosz Golaszewski
  0 siblings, 0 replies; 22+ messages in thread
From: Bartosz Golaszewski @ 2017-02-22 14:13 UTC (permalink / raw)
  To: linux-arm-kernel

We currently bail-out after applying a single quirk. We will want
to reuse the function doing the vpif capture registration so remove
the break; and continue iterating over the quirk array.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/pdata-quirks.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/mach-davinci/pdata-quirks.c b/arch/arm/mach-davinci/pdata-quirks.c
index 5b57da4..36fb217 100644
--- a/arch/arm/mach-davinci/pdata-quirks.c
+++ b/arch/arm/mach-davinci/pdata-quirks.c
@@ -23,7 +23,6 @@ static void pdata_quirks_check(struct pdata_init *quirks)
 		if (of_machine_is_compatible(quirks->compatible)) {
 			if (quirks->fn)
 				quirks->fn();
-			break;
 		}
 		quirks++;
 	}
-- 
2.9.3

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

* [PATCH v3 2/6] ARM: davinci: board-da850-evm: add I2C ID for VPIF
  2017-02-22 14:13 ` Bartosz Golaszewski
@ 2017-02-22 14:13   ` Bartosz Golaszewski
  -1 siblings, 0 replies; 22+ messages in thread
From: Bartosz Golaszewski @ 2017-02-22 14:13 UTC (permalink / raw)
  To: Sekhar Nori, David Lechner, Kevin Hilman, Michael Turquette,
	Patrick Titiano, Laurent Pinchart, Russell King
  Cc: linux-arm-kernel, linux-kernel

From: Kevin Hilman <khilman@baylibre.com>

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 6f1e129..0b9ff2a 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -1213,6 +1213,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] 22+ messages in thread

* [PATCH v3 2/6] ARM: davinci: board-da850-evm: add I2C ID for VPIF
@ 2017-02-22 14:13   ` Bartosz Golaszewski
  0 siblings, 0 replies; 22+ messages in thread
From: Bartosz Golaszewski @ 2017-02-22 14:13 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kevin Hilman <khilman@baylibre.com>

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 6f1e129..0b9ff2a 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -1213,6 +1213,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] 22+ messages in thread

* [PATCH v3 3/6] ARM: davinci: da8xx: add pdata-quirks for VPIF capture
  2017-02-22 14:13 ` Bartosz Golaszewski
@ 2017-02-22 14:13   ` Bartosz Golaszewski
  -1 siblings, 0 replies; 22+ messages in thread
From: Bartosz Golaszewski @ 2017-02-22 14:13 UTC (permalink / raw)
  To: Sekhar Nori, David Lechner, Kevin Hilman, Michael Turquette,
	Patrick Titiano, Laurent Pinchart, Russell King
  Cc: linux-arm-kernel, linux-kernel, Bartosz Golaszewski

From: Kevin Hilman <khilman@baylibre.com>

For da8xx DT platforms, use pdata-quirks to add 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>
[Bartosz: removed unnecessary #ifdefs]
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/da8xx-dt.c     |   1 +
 arch/arm/mach-davinci/pdata-quirks.c | 104 +++++++++++++++++++++++++++++++++++
 2 files changed, 105 insertions(+)

diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c
index e3cef50..5699ce3 100644
--- a/arch/arm/mach-davinci/da8xx-dt.c
+++ b/arch/arm/mach-davinci/da8xx-dt.c
@@ -53,6 +53,7 @@ static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
 	OF_DEV_AUXDATA("ti,da830-musb", 0x01e00000, "musb-da8xx", NULL),
 	OF_DEV_AUXDATA("ti,da830-usb-phy", 0x01c1417c, "da8xx-usb-phy", NULL),
 	OF_DEV_AUXDATA("ti,da850-ahci", 0x01e18000, "ahci_da850", NULL),
+	OF_DEV_AUXDATA("ti,da850-vpif", 0x01e17000, "vpif", NULL),
 	{}
 };
 
diff --git a/arch/arm/mach-davinci/pdata-quirks.c b/arch/arm/mach-davinci/pdata-quirks.c
index 36fb217..cf88195 100644
--- a/arch/arm/mach-davinci/pdata-quirks.c
+++ b/arch/arm/mach-davinci/pdata-quirks.c
@@ -10,13 +10,115 @@
 #include <linux/kernel.h>
 #include <linux/of_platform.h>
 
+#include <media/i2c/tvp514x.h>
+
 #include <mach/common.h>
+#include <mach/da8xx.h>
 
 struct pdata_init {
 	const char *compatible;
 	void (*fn)(void);
 };
 
+#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;
+
+	ret = da850_register_vpif_capture(&da850_vpif_capture_config);
+	if (ret)
+		pr_warn("%s: VPIF capture setup failed: %d\n",
+			__func__, ret);
+}
+
 static void pdata_quirks_check(struct pdata_init *quirks)
 {
 	while (quirks->compatible) {
@@ -29,6 +131,8 @@ static void pdata_quirks_check(struct pdata_init *quirks)
 }
 
 static struct pdata_init pdata_quirks[] __initdata = {
+	{ "ti,da850-lcdk", da850_vpif_legacy_init, },
+	{ "ti,da850-evm", da850_vpif_legacy_init, },
 	{ /* sentinel */ },
 };
 
-- 
2.9.3

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

* [PATCH v3 3/6] ARM: davinci: da8xx: add pdata-quirks for VPIF capture
@ 2017-02-22 14:13   ` Bartosz Golaszewski
  0 siblings, 0 replies; 22+ messages in thread
From: Bartosz Golaszewski @ 2017-02-22 14:13 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kevin Hilman <khilman@baylibre.com>

For da8xx DT platforms, use pdata-quirks to add 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>
[Bartosz: removed unnecessary #ifdefs]
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/da8xx-dt.c     |   1 +
 arch/arm/mach-davinci/pdata-quirks.c | 104 +++++++++++++++++++++++++++++++++++
 2 files changed, 105 insertions(+)

diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c
index e3cef50..5699ce3 100644
--- a/arch/arm/mach-davinci/da8xx-dt.c
+++ b/arch/arm/mach-davinci/da8xx-dt.c
@@ -53,6 +53,7 @@ static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
 	OF_DEV_AUXDATA("ti,da830-musb", 0x01e00000, "musb-da8xx", NULL),
 	OF_DEV_AUXDATA("ti,da830-usb-phy", 0x01c1417c, "da8xx-usb-phy", NULL),
 	OF_DEV_AUXDATA("ti,da850-ahci", 0x01e18000, "ahci_da850", NULL),
+	OF_DEV_AUXDATA("ti,da850-vpif", 0x01e17000, "vpif", NULL),
 	{}
 };
 
diff --git a/arch/arm/mach-davinci/pdata-quirks.c b/arch/arm/mach-davinci/pdata-quirks.c
index 36fb217..cf88195 100644
--- a/arch/arm/mach-davinci/pdata-quirks.c
+++ b/arch/arm/mach-davinci/pdata-quirks.c
@@ -10,13 +10,115 @@
 #include <linux/kernel.h>
 #include <linux/of_platform.h>
 
+#include <media/i2c/tvp514x.h>
+
 #include <mach/common.h>
+#include <mach/da8xx.h>
 
 struct pdata_init {
 	const char *compatible;
 	void (*fn)(void);
 };
 
+#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;
+
+	ret = da850_register_vpif_capture(&da850_vpif_capture_config);
+	if (ret)
+		pr_warn("%s: VPIF capture setup failed: %d\n",
+			__func__, ret);
+}
+
 static void pdata_quirks_check(struct pdata_init *quirks)
 {
 	while (quirks->compatible) {
@@ -29,6 +131,8 @@ static void pdata_quirks_check(struct pdata_init *quirks)
 }
 
 static struct pdata_init pdata_quirks[] __initdata = {
+	{ "ti,da850-lcdk", da850_vpif_legacy_init, },
+	{ "ti,da850-evm", da850_vpif_legacy_init, },
 	{ /* sentinel */ },
 };
 
-- 
2.9.3

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

* [PATCH v3 4/6] ARM: da850-evm: add a fixed regulator for the UI board IO expander
  2017-02-22 14:13 ` Bartosz Golaszewski
@ 2017-02-22 14:13   ` Bartosz Golaszewski
  -1 siblings, 0 replies; 22+ messages in thread
From: Bartosz Golaszewski @ 2017-02-22 14:13 UTC (permalink / raw)
  To: Sekhar Nori, David Lechner, Kevin Hilman, Michael Turquette,
	Patrick Titiano, Laurent Pinchart, Russell King
  Cc: linux-arm-kernel, linux-kernel, Bartosz Golaszewski

Without this regulator the tca6416 GPIO expander on the UI board can't
be probed in board file mode and we're not getting VPIF IRQs.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/board-da850-evm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index 0b9ff2a..b5625d0 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -828,6 +828,9 @@ static struct regulator_consumer_supply fixed_supplies[] = {
 
 	/* Baseboard 1.8V: 5V -> TPS73701DCQ -> 1.8V */
 	REGULATOR_SUPPLY("DVDD", "1-0018"),
+
+	/* UI card 3.3V: 5V -> TPS73701DCQ -> 3.3V */
+	REGULATOR_SUPPLY("vcc", "1-0020"),
 };
 
 /* TPS65070 voltage regulator support */
-- 
2.9.3

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

* [PATCH v3 4/6] ARM: da850-evm: add a fixed regulator for the UI board IO expander
@ 2017-02-22 14:13   ` Bartosz Golaszewski
  0 siblings, 0 replies; 22+ messages in thread
From: Bartosz Golaszewski @ 2017-02-22 14:13 UTC (permalink / raw)
  To: linux-arm-kernel

Without this regulator the tca6416 GPIO expander on the UI board can't
be probed in board file mode and we're not getting VPIF IRQs.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/board-da850-evm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index 0b9ff2a..b5625d0 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -828,6 +828,9 @@ static struct regulator_consumer_supply fixed_supplies[] = {
 
 	/* Baseboard 1.8V: 5V -> TPS73701DCQ -> 1.8V */
 	REGULATOR_SUPPLY("DVDD", "1-0018"),
+
+	/* UI card 3.3V: 5V -> TPS73701DCQ -> 3.3V */
+	REGULATOR_SUPPLY("vcc", "1-0020"),
 };
 
 /* TPS65070 voltage regulator support */
-- 
2.9.3

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

* [PATCH v3 5/6] ARM: davinci: add pdata-quirks for da850-evm vpif display
  2017-02-22 14:13 ` Bartosz Golaszewski
@ 2017-02-22 14:13   ` Bartosz Golaszewski
  -1 siblings, 0 replies; 22+ messages in thread
From: Bartosz Golaszewski @ 2017-02-22 14:13 UTC (permalink / raw)
  To: Sekhar Nori, David Lechner, Kevin Hilman, Michael Turquette,
	Patrick Titiano, Laurent Pinchart, Russell King
  Cc: linux-arm-kernel, linux-kernel, Bartosz Golaszewski

Similarly to vpif capture: we need to register the vpif display driver
and the corresponding adv7343 encoder in pdata-quirks as the DT
support is not complete - there isn't currently a way to define the
output_routing in the V4L2 drivers (c.f. s_routing) via DT.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/pdata-quirks.c | 72 ++++++++++++++++++++++++++++++++++--
 1 file changed, 69 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-davinci/pdata-quirks.c b/arch/arm/mach-davinci/pdata-quirks.c
index cf88195..e2160ce 100644
--- a/arch/arm/mach-davinci/pdata-quirks.c
+++ b/arch/arm/mach-davinci/pdata-quirks.c
@@ -11,6 +11,7 @@
 #include <linux/of_platform.h>
 
 #include <media/i2c/tvp514x.h>
+#include <media/i2c/adv7343.h>
 
 #include <mach/common.h>
 #include <mach/da8xx.h>
@@ -105,7 +106,7 @@ static struct vpif_capture_config da850_vpif_capture_config = {
 	.card_name = "DA850/OMAP-L138 Video Capture",
 };
 
-static void __init da850_vpif_legacy_init(void)
+static void __init da850_vpif_capture_legacy_init(void)
 {
 	int ret;
 
@@ -119,6 +120,70 @@ static void __init da850_vpif_legacy_init(void)
 			__func__, ret);
 }
 
+static struct adv7343_platform_data adv7343_pdata = {
+	.mode_config = {
+		.dac = { 1, 1, 1 },
+	},
+	.sd_config = {
+		.sd_dac_out = { 1 },
+	},
+};
+
+static struct vpif_subdev_info da850_vpif_subdev[] = {
+	{
+		.name = "adv7343",
+		.board_info = {
+			I2C_BOARD_INFO("adv7343", 0x2a),
+			.platform_data = &adv7343_pdata,
+		},
+	},
+};
+
+static const struct vpif_output da850_ch0_outputs[] = {
+	{
+		.output = {
+			.index = 0,
+			.name = "Composite",
+			.type = V4L2_OUTPUT_TYPE_ANALOG,
+			.capabilities = V4L2_OUT_CAP_STD,
+			.std = V4L2_STD_ALL,
+		},
+		.subdev_name = "adv7343",
+		.output_route = ADV7343_COMPOSITE_ID,
+	},
+	{
+		.output = {
+			.index = 1,
+			.name = "S-Video",
+			.type = V4L2_OUTPUT_TYPE_ANALOG,
+			.capabilities = V4L2_OUT_CAP_STD,
+			.std = V4L2_STD_ALL,
+		},
+		.subdev_name = "adv7343",
+		.output_route = ADV7343_SVIDEO_ID,
+	},
+};
+
+static struct vpif_display_config da850_vpif_display_config = {
+	.subdevinfo   = da850_vpif_subdev,
+	.subdev_count = ARRAY_SIZE(da850_vpif_subdev),
+	.chan_config[0] = {
+		.outputs = da850_ch0_outputs,
+		.output_count = ARRAY_SIZE(da850_ch0_outputs),
+	},
+	.card_name    = "DA850/OMAP-L138 Video Display",
+};
+
+static void __init da850_vpif_display_legacy_init(void)
+{
+	int ret;
+
+	ret = da850_register_vpif_display(&da850_vpif_display_config);
+	if (ret)
+		pr_warn("%s: VPIF display setup failed: %d\n",
+			__func__, ret);
+}
+
 static void pdata_quirks_check(struct pdata_init *quirks)
 {
 	while (quirks->compatible) {
@@ -131,8 +196,9 @@ static void pdata_quirks_check(struct pdata_init *quirks)
 }
 
 static struct pdata_init pdata_quirks[] __initdata = {
-	{ "ti,da850-lcdk", da850_vpif_legacy_init, },
-	{ "ti,da850-evm", da850_vpif_legacy_init, },
+	{ "ti,da850-lcdk", da850_vpif_capture_legacy_init, },
+	{ "ti,da850-evm", da850_vpif_display_legacy_init, },
+	{ "ti,da850-evm", da850_vpif_capture_legacy_init, },
 	{ /* sentinel */ },
 };
 
-- 
2.9.3

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

* [PATCH v3 5/6] ARM: davinci: add pdata-quirks for da850-evm vpif display
@ 2017-02-22 14:13   ` Bartosz Golaszewski
  0 siblings, 0 replies; 22+ messages in thread
From: Bartosz Golaszewski @ 2017-02-22 14:13 UTC (permalink / raw)
  To: linux-arm-kernel

Similarly to vpif capture: we need to register the vpif display driver
and the corresponding adv7343 encoder in pdata-quirks as the DT
support is not complete - there isn't currently a way to define the
output_routing in the V4L2 drivers (c.f. s_routing) via DT.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/pdata-quirks.c | 72 ++++++++++++++++++++++++++++++++++--
 1 file changed, 69 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-davinci/pdata-quirks.c b/arch/arm/mach-davinci/pdata-quirks.c
index cf88195..e2160ce 100644
--- a/arch/arm/mach-davinci/pdata-quirks.c
+++ b/arch/arm/mach-davinci/pdata-quirks.c
@@ -11,6 +11,7 @@
 #include <linux/of_platform.h>
 
 #include <media/i2c/tvp514x.h>
+#include <media/i2c/adv7343.h>
 
 #include <mach/common.h>
 #include <mach/da8xx.h>
@@ -105,7 +106,7 @@ static struct vpif_capture_config da850_vpif_capture_config = {
 	.card_name = "DA850/OMAP-L138 Video Capture",
 };
 
-static void __init da850_vpif_legacy_init(void)
+static void __init da850_vpif_capture_legacy_init(void)
 {
 	int ret;
 
@@ -119,6 +120,70 @@ static void __init da850_vpif_legacy_init(void)
 			__func__, ret);
 }
 
+static struct adv7343_platform_data adv7343_pdata = {
+	.mode_config = {
+		.dac = { 1, 1, 1 },
+	},
+	.sd_config = {
+		.sd_dac_out = { 1 },
+	},
+};
+
+static struct vpif_subdev_info da850_vpif_subdev[] = {
+	{
+		.name = "adv7343",
+		.board_info = {
+			I2C_BOARD_INFO("adv7343", 0x2a),
+			.platform_data = &adv7343_pdata,
+		},
+	},
+};
+
+static const struct vpif_output da850_ch0_outputs[] = {
+	{
+		.output = {
+			.index = 0,
+			.name = "Composite",
+			.type = V4L2_OUTPUT_TYPE_ANALOG,
+			.capabilities = V4L2_OUT_CAP_STD,
+			.std = V4L2_STD_ALL,
+		},
+		.subdev_name = "adv7343",
+		.output_route = ADV7343_COMPOSITE_ID,
+	},
+	{
+		.output = {
+			.index = 1,
+			.name = "S-Video",
+			.type = V4L2_OUTPUT_TYPE_ANALOG,
+			.capabilities = V4L2_OUT_CAP_STD,
+			.std = V4L2_STD_ALL,
+		},
+		.subdev_name = "adv7343",
+		.output_route = ADV7343_SVIDEO_ID,
+	},
+};
+
+static struct vpif_display_config da850_vpif_display_config = {
+	.subdevinfo   = da850_vpif_subdev,
+	.subdev_count = ARRAY_SIZE(da850_vpif_subdev),
+	.chan_config[0] = {
+		.outputs = da850_ch0_outputs,
+		.output_count = ARRAY_SIZE(da850_ch0_outputs),
+	},
+	.card_name    = "DA850/OMAP-L138 Video Display",
+};
+
+static void __init da850_vpif_display_legacy_init(void)
+{
+	int ret;
+
+	ret = da850_register_vpif_display(&da850_vpif_display_config);
+	if (ret)
+		pr_warn("%s: VPIF display setup failed: %d\n",
+			__func__, ret);
+}
+
 static void pdata_quirks_check(struct pdata_init *quirks)
 {
 	while (quirks->compatible) {
@@ -131,8 +196,9 @@ static void pdata_quirks_check(struct pdata_init *quirks)
 }
 
 static struct pdata_init pdata_quirks[] __initdata = {
-	{ "ti,da850-lcdk", da850_vpif_legacy_init, },
-	{ "ti,da850-evm", da850_vpif_legacy_init, },
+	{ "ti,da850-lcdk", da850_vpif_capture_legacy_init, },
+	{ "ti,da850-evm", da850_vpif_display_legacy_init, },
+	{ "ti,da850-evm", da850_vpif_capture_legacy_init, },
 	{ /* sentinel */ },
 };
 
-- 
2.9.3

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

* [PATCH v3 6/6] ARM: davinci: add enable GPIOs for vpif capture to pdata-quirks
  2017-02-22 14:13 ` Bartosz Golaszewski
@ 2017-02-22 14:13   ` Bartosz Golaszewski
  -1 siblings, 0 replies; 22+ messages in thread
From: Bartosz Golaszewski @ 2017-02-22 14:13 UTC (permalink / raw)
  To: Sekhar Nori, David Lechner, Kevin Hilman, Michael Turquette,
	Patrick Titiano, Laurent Pinchart, Russell King
  Cc: linux-arm-kernel, linux-kernel, Bartosz Golaszewski

On the da850-evm board we need to select the UI expander video capture
function to make vpif capture work. Add the relevant GPIOs to the
pdata-quirks.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/pdata-quirks.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/arch/arm/mach-davinci/pdata-quirks.c b/arch/arm/mach-davinci/pdata-quirks.c
index e2160ce..b60f422 100644
--- a/arch/arm/mach-davinci/pdata-quirks.c
+++ b/arch/arm/mach-davinci/pdata-quirks.c
@@ -9,6 +9,7 @@
  */
 #include <linux/kernel.h>
 #include <linux/of_platform.h>
+#include <linux/gpio/machine.h>
 
 #include <media/i2c/tvp514x.h>
 #include <media/i2c/adv7343.h>
@@ -120,6 +121,20 @@ static void __init da850_vpif_capture_legacy_init(void)
 			__func__, ret);
 }
 
+static struct gpiod_lookup_table vpif_capture_enable_gpios = {
+	.dev_id = "vpif_capture",
+	.table = {
+		GPIO_LOOKUP_IDX("tca6416", 7, "enable", 0, GPIO_ACTIVE_HIGH),
+		GPIO_LOOKUP_IDX("tca6416", 6, "enable", 1, GPIO_ACTIVE_HIGH),
+		GPIO_LOOKUP_IDX("tca6416", 5, "enable", 2, GPIO_ACTIVE_LOW),
+	},
+};
+
+static void __init da850_vpif_capture_gpio_sel_init(void)
+{
+	gpiod_add_lookup_table(&vpif_capture_enable_gpios);
+}
+
 static struct adv7343_platform_data adv7343_pdata = {
 	.mode_config = {
 		.dac = { 1, 1, 1 },
@@ -199,6 +214,7 @@ static struct pdata_init pdata_quirks[] __initdata = {
 	{ "ti,da850-lcdk", da850_vpif_capture_legacy_init, },
 	{ "ti,da850-evm", da850_vpif_display_legacy_init, },
 	{ "ti,da850-evm", da850_vpif_capture_legacy_init, },
+	{ "ti,da850-evm", da850_vpif_capture_gpio_sel_init, },
 	{ /* sentinel */ },
 };
 
-- 
2.9.3

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

* [PATCH v3 6/6] ARM: davinci: add enable GPIOs for vpif capture to pdata-quirks
@ 2017-02-22 14:13   ` Bartosz Golaszewski
  0 siblings, 0 replies; 22+ messages in thread
From: Bartosz Golaszewski @ 2017-02-22 14:13 UTC (permalink / raw)
  To: linux-arm-kernel

On the da850-evm board we need to select the UI expander video capture
function to make vpif capture work. Add the relevant GPIOs to the
pdata-quirks.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/pdata-quirks.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/arch/arm/mach-davinci/pdata-quirks.c b/arch/arm/mach-davinci/pdata-quirks.c
index e2160ce..b60f422 100644
--- a/arch/arm/mach-davinci/pdata-quirks.c
+++ b/arch/arm/mach-davinci/pdata-quirks.c
@@ -9,6 +9,7 @@
  */
 #include <linux/kernel.h>
 #include <linux/of_platform.h>
+#include <linux/gpio/machine.h>
 
 #include <media/i2c/tvp514x.h>
 #include <media/i2c/adv7343.h>
@@ -120,6 +121,20 @@ static void __init da850_vpif_capture_legacy_init(void)
 			__func__, ret);
 }
 
+static struct gpiod_lookup_table vpif_capture_enable_gpios = {
+	.dev_id = "vpif_capture",
+	.table = {
+		GPIO_LOOKUP_IDX("tca6416", 7, "enable", 0, GPIO_ACTIVE_HIGH),
+		GPIO_LOOKUP_IDX("tca6416", 6, "enable", 1, GPIO_ACTIVE_HIGH),
+		GPIO_LOOKUP_IDX("tca6416", 5, "enable", 2, GPIO_ACTIVE_LOW),
+	},
+};
+
+static void __init da850_vpif_capture_gpio_sel_init(void)
+{
+	gpiod_add_lookup_table(&vpif_capture_enable_gpios);
+}
+
 static struct adv7343_platform_data adv7343_pdata = {
 	.mode_config = {
 		.dac = { 1, 1, 1 },
@@ -199,6 +214,7 @@ static struct pdata_init pdata_quirks[] __initdata = {
 	{ "ti,da850-lcdk", da850_vpif_capture_legacy_init, },
 	{ "ti,da850-evm", da850_vpif_display_legacy_init, },
 	{ "ti,da850-evm", da850_vpif_capture_legacy_init, },
+	{ "ti,da850-evm", da850_vpif_capture_gpio_sel_init, },
 	{ /* sentinel */ },
 };
 
-- 
2.9.3

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

* Re: [PATCH v3 6/6] ARM: davinci: add enable GPIOs for vpif capture to pdata-quirks
  2017-02-22 14:13   ` Bartosz Golaszewski
@ 2017-02-28  8:49     ` Sekhar Nori
  -1 siblings, 0 replies; 22+ messages in thread
From: Sekhar Nori @ 2017-02-28  8:49 UTC (permalink / raw)
  To: Bartosz Golaszewski, David Lechner, Kevin Hilman,
	Michael Turquette, Patrick Titiano, Laurent Pinchart,
	Russell King
  Cc: linux-arm-kernel, linux-kernel

On Wednesday 22 February 2017 07:43 PM, Bartosz Golaszewski wrote:
> On the da850-evm board we need to select the UI expander video capture
> function to make vpif capture work. Add the relevant GPIOs to the
> pdata-quirks.
> 
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>

Hmm, why do we need this despite enable-gpios in DT ?

Thanks,
Sekhar

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

* [PATCH v3 6/6] ARM: davinci: add enable GPIOs for vpif capture to pdata-quirks
@ 2017-02-28  8:49     ` Sekhar Nori
  0 siblings, 0 replies; 22+ messages in thread
From: Sekhar Nori @ 2017-02-28  8:49 UTC (permalink / raw)
  To: linux-arm-kernel

On Wednesday 22 February 2017 07:43 PM, Bartosz Golaszewski wrote:
> On the da850-evm board we need to select the UI expander video capture
> function to make vpif capture work. Add the relevant GPIOs to the
> pdata-quirks.
> 
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>

Hmm, why do we need this despite enable-gpios in DT ?

Thanks,
Sekhar

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

* Re: [PATCH v3 3/6] ARM: davinci: da8xx: add pdata-quirks for VPIF capture
  2017-02-22 14:13   ` Bartosz Golaszewski
@ 2017-02-28  8:57     ` Sekhar Nori
  -1 siblings, 0 replies; 22+ messages in thread
From: Sekhar Nori @ 2017-02-28  8:57 UTC (permalink / raw)
  To: Bartosz Golaszewski, David Lechner, Kevin Hilman,
	Michael Turquette, Patrick Titiano, Laurent Pinchart,
	Russell King
  Cc: linux-arm-kernel, linux-kernel

On Wednesday 22 February 2017 07:43 PM, Bartosz Golaszewski wrote:
> From: Kevin Hilman <khilman@baylibre.com>
> 
> For da8xx DT platforms, use pdata-quirks to add 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>
> [Bartosz: removed unnecessary #ifdefs]
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> ---
>  arch/arm/mach-davinci/da8xx-dt.c     |   1 +
>  arch/arm/mach-davinci/pdata-quirks.c | 104 +++++++++++++++++++++++++++++++++++
>  2 files changed, 105 insertions(+)
> 
> diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c
> index e3cef50..5699ce3 100644
> --- a/arch/arm/mach-davinci/da8xx-dt.c
> +++ b/arch/arm/mach-davinci/da8xx-dt.c
> @@ -53,6 +53,7 @@ static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
>  	OF_DEV_AUXDATA("ti,da830-musb", 0x01e00000, "musb-da8xx", NULL),
>  	OF_DEV_AUXDATA("ti,da830-usb-phy", 0x01c1417c, "da8xx-usb-phy", NULL),
>  	OF_DEV_AUXDATA("ti,da850-ahci", 0x01e18000, "ahci_da850", NULL),
> +	OF_DEV_AUXDATA("ti,da850-vpif", 0x01e17000, "vpif", NULL),

You don't talk about adding OF_DEV_AUXDATA in patch description. Can you
either add description for this change or spin it into a separate patch?
I prefer the later, but will take it either way.

> +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;

Since you anyway register quirk for lcdk separately, you can as well
create da850_lcdk_vpif_capture_init() which sets subdev_count to 1
unconditionally.

Also, since you rename the function to add "capture" down the series,
you can as well have that name from the start. It will make the later
patches easier to read.

Thanks,
Sekhar

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

* [PATCH v3 3/6] ARM: davinci: da8xx: add pdata-quirks for VPIF capture
@ 2017-02-28  8:57     ` Sekhar Nori
  0 siblings, 0 replies; 22+ messages in thread
From: Sekhar Nori @ 2017-02-28  8:57 UTC (permalink / raw)
  To: linux-arm-kernel

On Wednesday 22 February 2017 07:43 PM, Bartosz Golaszewski wrote:
> From: Kevin Hilman <khilman@baylibre.com>
> 
> For da8xx DT platforms, use pdata-quirks to add 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>
> [Bartosz: removed unnecessary #ifdefs]
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> ---
>  arch/arm/mach-davinci/da8xx-dt.c     |   1 +
>  arch/arm/mach-davinci/pdata-quirks.c | 104 +++++++++++++++++++++++++++++++++++
>  2 files changed, 105 insertions(+)
> 
> diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c
> index e3cef50..5699ce3 100644
> --- a/arch/arm/mach-davinci/da8xx-dt.c
> +++ b/arch/arm/mach-davinci/da8xx-dt.c
> @@ -53,6 +53,7 @@ static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
>  	OF_DEV_AUXDATA("ti,da830-musb", 0x01e00000, "musb-da8xx", NULL),
>  	OF_DEV_AUXDATA("ti,da830-usb-phy", 0x01c1417c, "da8xx-usb-phy", NULL),
>  	OF_DEV_AUXDATA("ti,da850-ahci", 0x01e18000, "ahci_da850", NULL),
> +	OF_DEV_AUXDATA("ti,da850-vpif", 0x01e17000, "vpif", NULL),

You don't talk about adding OF_DEV_AUXDATA in patch description. Can you
either add description for this change or spin it into a separate patch?
I prefer the later, but will take it either way.

> +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;

Since you anyway register quirk for lcdk separately, you can as well
create da850_lcdk_vpif_capture_init() which sets subdev_count to 1
unconditionally.

Also, since you rename the function to add "capture" down the series,
you can as well have that name from the start. It will make the later
patches easier to read.

Thanks,
Sekhar

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

* Re: [PATCH v3 6/6] ARM: davinci: add enable GPIOs for vpif capture to pdata-quirks
  2017-02-28  8:49     ` Sekhar Nori
@ 2017-02-28  9:42       ` Bartosz Golaszewski
  -1 siblings, 0 replies; 22+ messages in thread
From: Bartosz Golaszewski @ 2017-02-28  9:42 UTC (permalink / raw)
  To: Sekhar Nori
  Cc: David Lechner, Kevin Hilman, Michael Turquette, Patrick Titiano,
	Laurent Pinchart, Russell King, arm-soc, LKML

2017-02-28 9:49 GMT+01:00 Sekhar Nori <nsekhar@ti.com>:
> On Wednesday 22 February 2017 07:43 PM, Bartosz Golaszewski wrote:
>> On the da850-evm board we need to select the UI expander video capture
>> function to make vpif capture work. Add the relevant GPIOs to the
>> pdata-quirks.
>>
>> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>
> Hmm, why do we need this despite enable-gpios in DT ?
>

I didn't look at the exact code path, but if we're using pdata-quirks,
the of_node in struct device passed to vpif_probe is NULL (one of the
reasons why we're not mixing DT and pdata for vpif subdevices
configuration etc.). So it seems that as long as we don't switch over
to DT entirely we need to have the GPIOs here as well.

Thanks,
Bartosz

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

* [PATCH v3 6/6] ARM: davinci: add enable GPIOs for vpif capture to pdata-quirks
@ 2017-02-28  9:42       ` Bartosz Golaszewski
  0 siblings, 0 replies; 22+ messages in thread
From: Bartosz Golaszewski @ 2017-02-28  9:42 UTC (permalink / raw)
  To: linux-arm-kernel

2017-02-28 9:49 GMT+01:00 Sekhar Nori <nsekhar@ti.com>:
> On Wednesday 22 February 2017 07:43 PM, Bartosz Golaszewski wrote:
>> On the da850-evm board we need to select the UI expander video capture
>> function to make vpif capture work. Add the relevant GPIOs to the
>> pdata-quirks.
>>
>> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>
> Hmm, why do we need this despite enable-gpios in DT ?
>

I didn't look at the exact code path, but if we're using pdata-quirks,
the of_node in struct device passed to vpif_probe is NULL (one of the
reasons why we're not mixing DT and pdata for vpif subdevices
configuration etc.). So it seems that as long as we don't switch over
to DT entirely we need to have the GPIOs here as well.

Thanks,
Bartosz

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

* Re: [PATCH v3 1/6] ARM: davinci: da8xx: allow having multiple pdata-quirks
  2017-02-22 14:13   ` Bartosz Golaszewski
@ 2017-02-28 18:00     ` Kevin Hilman
  -1 siblings, 0 replies; 22+ messages in thread
From: Kevin Hilman @ 2017-02-28 18:00 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Sekhar Nori, David Lechner, Michael Turquette, Patrick Titiano,
	Laurent Pinchart, Russell King, linux-arm-kernel, linux-kernel

Bartosz Golaszewski <bgolaszewski@baylibre.com> writes:

> We currently bail-out after applying a single quirk. We will want
> to reuse the function doing the vpif capture registration so remove
> the break; and continue iterating over the quirk array.
>
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>

Reviewed-by: Kevin Hilman <khilman@baylibre.com>

> ---
>  arch/arm/mach-davinci/pdata-quirks.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/arch/arm/mach-davinci/pdata-quirks.c b/arch/arm/mach-davinci/pdata-quirks.c
> index 5b57da4..36fb217 100644
> --- a/arch/arm/mach-davinci/pdata-quirks.c
> +++ b/arch/arm/mach-davinci/pdata-quirks.c
> @@ -23,7 +23,6 @@ static void pdata_quirks_check(struct pdata_init *quirks)
>  		if (of_machine_is_compatible(quirks->compatible)) {
>  			if (quirks->fn)
>  				quirks->fn();
> -			break;
>  		}
>  		quirks++;
>  	}

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

* [PATCH v3 1/6] ARM: davinci: da8xx: allow having multiple pdata-quirks
@ 2017-02-28 18:00     ` Kevin Hilman
  0 siblings, 0 replies; 22+ messages in thread
From: Kevin Hilman @ 2017-02-28 18:00 UTC (permalink / raw)
  To: linux-arm-kernel

Bartosz Golaszewski <bgolaszewski@baylibre.com> writes:

> We currently bail-out after applying a single quirk. We will want
> to reuse the function doing the vpif capture registration so remove
> the break; and continue iterating over the quirk array.
>
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>

Reviewed-by: Kevin Hilman <khilman@baylibre.com>

> ---
>  arch/arm/mach-davinci/pdata-quirks.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/arch/arm/mach-davinci/pdata-quirks.c b/arch/arm/mach-davinci/pdata-quirks.c
> index 5b57da4..36fb217 100644
> --- a/arch/arm/mach-davinci/pdata-quirks.c
> +++ b/arch/arm/mach-davinci/pdata-quirks.c
> @@ -23,7 +23,6 @@ static void pdata_quirks_check(struct pdata_init *quirks)
>  		if (of_machine_is_compatible(quirks->compatible)) {
>  			if (quirks->fn)
>  				quirks->fn();
> -			break;
>  		}
>  		quirks++;
>  	}

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

end of thread, other threads:[~2017-02-28 18:09 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-22 14:13 [PATCH v3 0/6] ARM: davinci: vpif capture & display support Bartosz Golaszewski
2017-02-22 14:13 ` Bartosz Golaszewski
2017-02-22 14:13 ` [PATCH v3 1/6] ARM: davinci: da8xx: allow having multiple pdata-quirks Bartosz Golaszewski
2017-02-22 14:13   ` Bartosz Golaszewski
2017-02-28 18:00   ` Kevin Hilman
2017-02-28 18:00     ` Kevin Hilman
2017-02-22 14:13 ` [PATCH v3 2/6] ARM: davinci: board-da850-evm: add I2C ID for VPIF Bartosz Golaszewski
2017-02-22 14:13   ` Bartosz Golaszewski
2017-02-22 14:13 ` [PATCH v3 3/6] ARM: davinci: da8xx: add pdata-quirks for VPIF capture Bartosz Golaszewski
2017-02-22 14:13   ` Bartosz Golaszewski
2017-02-28  8:57   ` Sekhar Nori
2017-02-28  8:57     ` Sekhar Nori
2017-02-22 14:13 ` [PATCH v3 4/6] ARM: da850-evm: add a fixed regulator for the UI board IO expander Bartosz Golaszewski
2017-02-22 14:13   ` Bartosz Golaszewski
2017-02-22 14:13 ` [PATCH v3 5/6] ARM: davinci: add pdata-quirks for da850-evm vpif display Bartosz Golaszewski
2017-02-22 14:13   ` Bartosz Golaszewski
2017-02-22 14:13 ` [PATCH v3 6/6] ARM: davinci: add enable GPIOs for vpif capture to pdata-quirks Bartosz Golaszewski
2017-02-22 14:13   ` Bartosz Golaszewski
2017-02-28  8:49   ` Sekhar Nori
2017-02-28  8:49     ` Sekhar Nori
2017-02-28  9:42     ` Bartosz Golaszewski
2017-02-28  9:42       ` Bartosz Golaszewski

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.