Skip to contentSkip to conversation

ARM: davinci: vpif capture & display support

PATCH Superseded Bartosz Golaszewski 3 participants 10 messages Feb 16, 2017 – Feb 20, 2017

Subsystems (3)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

cover ARM: davinci: vpif capture & display support

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

Bartosz Golaszewski (2):
ARM: da850-evm: add a fixed regulator for the UI board IO expander
ARM: davinci: add pdata-quirks for da850-evm vpif display

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    | 178 ++++++++++++++++++++++++++++++++
 3 files changed, 183 insertions(+)
Signature · 1 line
2.9.3
#1 lore raw

PATCH 1/4 ARM: davinci: board-da850-evm: add I2C ID for VPIF

From: Kevin Hilman <[email protected]>

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

---
 arch/arm/mach-davinci/board-da850-evm.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-davinci/board-da850-evm.c +1 -0
index 6f1e129..0b9ff2a 100644
@@ -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),
Signature · 1 line
2.9.3
#2 lore raw

PATCH 2/4 ARM: davinci: da8xx: add pdata-quirks for VPIF capture

In reply to Bartosz Golaszewski

From: Kevin Hilman <[email protected]>

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)

---
 arch/arm/mach-davinci/da8xx-dt.c     |   1 +
 arch/arm/mach-davinci/pdata-quirks.c | 111 +++++++++++++++++++++++++++++++++++
 2 files changed, 112 insertions(+)
arch/arm/mach-davinci/da8xx-dt.c +1 -0
index e3cef50..5699ce3 100644
@@ -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),
 	{}
 };
 
arch/arm/mach-davinci/pdata-quirks.c +111 -0

130 lines not on this page · raw message

Signature · 1 line
2.9.3
#4 lore raw

PATCH 3/4 ARM: da850-evm: add a fixed regulator for the UI board IO expander

In reply to 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.

---
 arch/arm/mach-davinci/board-da850-evm.c | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/mach-davinci/board-da850-evm.c +3 -0
index 0b9ff2a..1b6a07b 100644
@@ -828,6 +828,9 @@ static struct regulator_consumer_supply fixed_supplies[] = {
 
 	/* Baseboard 1.8V: 5V -> TPS73701DCQ -> 1.8V */
 	REGULATOR_SUPPLY("DVDD", "1-0018"),
+
+	/* Dummy regulator for the UI board IO expander. */
+	REGULATOR_SUPPLY("vcc", "1-0020"),
 };
 
 /* TPS65070 voltage regulator support */
Signature · 1 line
2.9.3
#6 lore raw

PATCH 4/4 ARM: davinci: add pdata-quirks for da850-evm vpif display

In reply to 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.

---
 arch/arm/mach-davinci/pdata-quirks.c | 69 +++++++++++++++++++++++++++++++++++-
 1 file changed, 68 insertions(+), 1 deletion(-)
arch/arm/mach-davinci/pdata-quirks.c +68 -1
index 3ca773f..c659c76 100644
@@ -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>
@@ -106,7 +107,65 @@ static struct vpif_capture_config da850_vpif_capture_config = {
 	},
 	.card_name = "DA850/OMAP-L138 Video Capture",
 };
+#endif /* IS_ENABLED(CONFIG_VIDEO_DAVINCI_VPIF_CAPTURE) */
 
+#if IS_ENABLED(CONFIG_DA850_UI_SD_VIDEO_PORT)
+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",
+};
+#endif /* defined(CONFIG_DA850_UI_SD_VIDEO_PORT) */
+
+#if IS_ENABLED(CONFIG_VIDEO_DAVINCI_VPIF_CAPTURE) || IS_ENABLED(CONFIG_DA850_UI_SD_VIDEO_PORT)
 static void __init da850_vpif_legacy_init(void)
 {
 	int ret;
@@ -119,8 +178,16 @@ static void __init da850_vpif_legacy_init(void)
 	if (ret)
 		pr_warn("%s: VPIF capture setup failed: %d\n",
 			__func__, ret);
+
+	/* LCDK doesn't support VPIF display */
+	if (of_machine_is_compatible("ti,da850-evm")) {
+		ret = da850_register_vpif_display(&da850_vpif_display_config);
+		if (ret)
+			pr_warn("%s: VPIF display setup failed: %d\n",
+				__func__, ret);
+	}
 }
-#endif
+#endif /* IS_ENABLED(CONFIG_VIDEO_DAVINCI_VPIF_CAPTURE) || IS_ENABLED(CONFIG_DA850_UI_SD_VIDEO_PORT) */
 
 static void pdata_quirks_check(struct pdata_init *quirks)
 {
Signature · 1 line
2.9.3
#7 lore raw

Re: [PATCH 4/4] ARM: davinci: add pdata-quirks for da850-evm vpif display

Quoted 79 lines · 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.

---
 arch/arm/mach-davinci/pdata-quirks.c | 69 +++++++++++++++++++++++++++++++++++-
 1 file changed, 68 insertions(+), 1 deletion(-)
arch/arm/mach-davinci/pdata-quirks.c +58 -0
index 3ca773f..c659c76 100644
 
+#endif /* IS_ENABLED(CONFIG_VIDEO_DAVINCI_VPIF_CAPTURE) */
 
+#if IS_ENABLED(CONFIG_DA850_UI_SD_VIDEO_PORT)
+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",
+};
+#endif /* defined(CONFIG_DA850_UI_SD_VIDEO_PORT) */
+
+#if IS_ENABLED(CONFIG_VIDEO_DAVINCI_VPIF_CAPTURE) || IS_ENABLED(CONFIG_DA850_UI_SD_VIDEO_PORT)
 static void __init da850_vpif_legacy_init(void)
 {
 	int ret;

arch/arm/mach-davinci/pdata-quirks.c static void __init da850_vpif_legacy_init(void) · line 184

Quoted 7 lines
arch/arm/mach-davinci/pdata-quirks.c +4 -0
@@ -119,8 +178,16 @@ static void __init da850_vpif_legacy_init(void)
 	if (ret)
 		pr_warn("%s: VPIF capture setup failed: %d\n",
 			__func__, ret);
+
+	/* LCDK doesn't support VPIF display */
+	if (of_machine_is_compatible("ti,da850-evm")) {
+		ret = da850_register_vpif_display(&da850_vpif_display_config);

This fails to build when CONFIG_DA850_UI_SD_VIDEO_PORT is switched off. Probably means you need separate functions for registering capture and display parts.

I haven't reviewed rest of the patchset yet. Just noticed these while applying them for some testing. You may want to wait sometime before sending the next version.

Thanks,
Sekhar

#8 lore raw

Re: [PATCH 4/4] ARM: davinci: add pdata-quirks for da850-evm vpif display

2017-02-17 14:15 GMT+01:00 Sekhar Nori <[email protected]>:

Quoted 92 lines · Bartosz Golaszewski
Quoted 79 lines

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.

---
 arch/arm/mach-davinci/pdata-quirks.c | 69 +++++++++++++++++++++++++++++++++++-
 1 file changed, 68 insertions(+), 1 deletion(-)
arch/arm/mach-davinci/pdata-quirks.c +58 -0
index 3ca773f..c659c76 100644
 
+#endif /* IS_ENABLED(CONFIG_VIDEO_DAVINCI_VPIF_CAPTURE) */
 
+#if IS_ENABLED(CONFIG_DA850_UI_SD_VIDEO_PORT)
+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",
+};
+#endif /* defined(CONFIG_DA850_UI_SD_VIDEO_PORT) */
+
+#if IS_ENABLED(CONFIG_VIDEO_DAVINCI_VPIF_CAPTURE) || IS_ENABLED(CONFIG_DA850_UI_SD_VIDEO_PORT)
 static void __init da850_vpif_legacy_init(void)
 {
      int ret;

arch/arm/mach-davinci/pdata-quirks.c static void __init da850_vpif_legacy_init(void) · line 184

Quoted 7 lines
arch/arm/mach-davinci/pdata-quirks.c +4 -0
@@ -119,8 +178,16 @@ static void __init da850_vpif_legacy_init(void)
      if (ret)
              pr_warn("%s: VPIF capture setup failed: %d\n",
                      __func__, ret);
+
+     /* LCDK doesn't support VPIF display */
+     if (of_machine_is_compatible("ti,da850-evm")) {
+             ret = da850_register_vpif_display(&da850_vpif_display_config);

This fails to build when CONFIG_DA850_UI_SD_VIDEO_PORT is switched off. Probably means you need separate functions for registering capture and display parts.

Quoted 7 lines

I haven't reviewed rest of the patchset yet. Just noticed these while applying them for some testing. You may want to wait sometime before sending the next version.

Thanks,
Sekhar

Eek! My bad, didn't test different configs with that.

Thanks,
Bartosz

#9 lore raw

Re: [PATCH 4/4] ARM: davinci: add pdata-quirks for da850-evm vpif display

In reply to Bartosz Golaszewski
reproduce: wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree…

Hi Bartosz,

[auto build test ERROR on arm-soc/for-next]
[also build test ERROR on next-20170217]
[cannot apply to v4.10-rc8]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Bartosz-Golaszewski/ARM-davinci-vpif-capture-display-support/20170217-044437
base:   https://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc.git for-next
config: arm-davinci_all_defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 6.1.1-9) 6.1.1 20160705

reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm

All errors (new ones prefixed by >>):

arch/arm/mach-davinci/pdata-quirks.c: In function 'da850_vpif_legacy_init':

>> arch/arm/mach-davinci/pdata-quirks.c:184:38: error: 'da850_vpif_display_config' undeclared (first use in this function)
      ret = da850_register_vpif_display(&da850_vpif_display_config);
                                         ^~~~~~~~~~~~~~~~~~~~~~~~~

arch/arm/mach-davinci/pdata-quirks.c:184:38: note: each undeclared identifier is reported only once for each function it appears in

vim +/da850_vpif_display_config +184 arch/arm/mach-davinci/pdata-quirks.c

178 if (ret)
179 pr_warn("%s: VPIF capture setup failed: %d\n",
180 __func__, ret);
181
182 /* LCDK doesn't support VPIF display */
183 if (of_machine_is_compatible("ti,da850-evm")) {

 > 184			ret = da850_register_vpif_display(&da850_vpif_display_config);

185 if (ret)
186 pr_warn("%s: VPIF display setup failed: %d\n",
187 __func__, ret);

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 23948 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170218/026dd944/attachment-0001.gz>

#3 lore raw

Re: [PATCH 2/4] ARM: davinci: da8xx: add pdata-quirks for VPIF capture

In reply to Bartosz Golaszewski
Quoted 10 lines · Bartosz Golaszewski

From: Kevin Hilman <[email protected]>

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)

[...]

arch/arm/mach-davinci/pdata-quirks.c static void pdata_quirks_check(struct pdata_init *quirks) · line 142

Quoted 6 lines

static struct pdata_init pdata_quirks[] __initdata = {

arch/arm/mach-davinci/pdata-quirks.c +5 -0
+#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

We should remove these ifdefs around device registration. Devices should be registered irrespective of driver support. Also, these were being used in the board file to drive selection gpios. That functionality should now move to drivers.

Thanks,
Sekhar

#5 lore raw

Re: [PATCH 3/4] ARM: da850-evm: add a fixed regulator for the UI board IO expander

In reply to Bartosz Golaszewski
Quoted 13 lines · 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.

---
 arch/arm/mach-davinci/board-da850-evm.c | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/mach-davinci/board-da850-evm.c +0 -0
index 0b9ff2a..1b6a07b 100644

arch/arm/mach-davinci/board-da850-evm.c static struct regulator_consumer_supply fixed_supplies[] = { · line 832

Quoted 5 lines
arch/arm/mach-davinci/board-da850-evm.c +2 -0
@@ -828,6 +828,9 @@ static struct regulator_consumer_supply fixed_supplies[] = {
 
 	/* Baseboard 1.8V: 5V -> TPS73701DCQ -> 1.8V */
 	REGULATOR_SUPPLY("DVDD", "1-0018"),
+
+	/* Dummy regulator for the UI board IO expander. */

Instead may be:

	/* UI card 3.3V: 5V -> TPS73701DCQ -> 3.3V */

arch/arm/mach-davinci/board-da850-evm.c static struct regulator_consumer_supply fixed_supplies[] = { · line 833

Quoted 1 line
arch/arm/mach-davinci/board-da850-evm.c +1 -0
+	REGULATOR_SUPPLY("vcc", "1-0020"),

Thanks,
Sekhar