[Letux-kernel] omap3 isp -- media-ctl

Javier Martinez Canillas javier at osg.samsung.com
Wed Sep 7 17:42:31 CEST 2016


Hello Nikolaus,

On 09/07/2016 11:29 AM, H. Nikolaus Schaller wrote:
> Hi Javier,
> I am trying to upgrade our camera subsystem on a omap3 board
> to use the latest DT based kernel but have trouble using the
> media-ctl tool as before (we have a working setup on 3.12).
> 
> Problem 1: there is no /dev/media*
>
> root at letux:~# media-ctl -v -p
> Opening media device /dev/media0
> media_device_open: Can't open media device /dev/media0
> Failed to enumerate /dev/media0 (-2)
> root at letux:~# ls -l /dev/media*
> ls: cannot access /dev/media*: No such file or directory
> root at letux:~# ls -l /dev/video*
> crw-rw---- 1 root video 81, 0 Sep  7 12:17 /dev/video0
> crw-rw---- 1 root video 81, 1 Sep  7 12:17 /dev/video1
> crw-rw---- 1 root video 81, 2 Sep  7 12:17 /dev/video2
> crw-rw---- 1 root video 81, 3 Sep  7 12:17 /dev/video3
> crw-rw---- 1 root video 81, 4 Sep  7 12:17 /dev/video4
> crw-rw---- 1 root video 81, 5 Sep  7 12:17 /dev/video5
> crw-rw---- 1 root video 81, 6 Sep  7 12:17 /dev/video6
> root at letux:~#
> 
> Problem 2: if I try to use /dev/video*
> 
> root at letux:~# media-ctl -v -d /dev/video0 -p
> Opening media device /dev/video0
> media_device_enumerate: Unable to retrieve media device information for device /dev/video0 (Inappropriate ioctl for device)
> Failed to enumerate /dev/video0 (-25)
> root at letux:~# 
>
> So do you have some working example how to successfully control
> the ISP from user space with latest kernels?
>

The omap3isp driver doesn't have legacy platform data support anymore so
you need to have nodes for both the omap3isp and your camera sensor.

Look at commit 78c66fbcec71 ("[media] v4l: omap3isp: Drop platform data
support") that landed in Linux version 4.3.

So you need something like the following patch [0] in order to work.

> Our setup:
> * kernel 4.8-rc5 (with patches for the camera module)
> * Debian Jessie
> * v4l-utils (Jessie)
> 
> I have also tried to build the latest (stable = 1.10.1) media-ctl from
> https://git.linuxtv.org/v4l-utils.git
> but see no difference.
>

I don't think is a user-space issue but a kernel-space one as mentioned.

Could you please share your complete boot log? Does the omap3isp driver
probes? and does probe the driver for your attached camera sensor?

> Our old setup did simply work with media-ctl on /dev/media0 and no
> -d option required.
> 
> BR and thanks for any hints,
> Nikolaus
> 
> 

[0]:
commit 5a54b2d7dbbaeaf418aa602ce8b9b6496d9045c4
Author: Eduard Gavin <egavinc at gmail.com>
Date:   Thu Sep 10 17:23:02 2015 +0200

    ARM: dts: omap3-igep0020: Add ISP and TVP5150 device nodes
    
    Signed-off-by: Eduard Gavin <egavinc at gmail.com>
    Signed-off-by: Javier Martinez Canillas <javier at osg.samsung.com>

diff --git a/arch/arm/boot/dts/omap3-igep.dtsi b/arch/arm/boot/dts/omap3-igep.dtsi
index f4f2ce46d681..4ddcdff64d8a 100644
--- a/arch/arm/boot/dts/omap3-igep.dtsi
+++ b/arch/arm/boot/dts/omap3-igep.dtsi
@@ -89,6 +89,13 @@
 		>;
 	};
 
+	i2c2_pins: pinmux_i2c2_pins {
+		pinctrl-single,pins = <
+			0x18e (PIN_INPUT | MUX_MODE0)   /* i2c2_scl.i2c2_scl */
+			0x190 (PIN_INPUT | MUX_MODE0)   /* i2c2_sda.i2c2_sda */
+		>;
+	};
+
 	i2c3_pins: pinmux_i2c3_pins {
 		pinctrl-single,pins = <
 			OMAP3_CORE1_IOPAD(0x21c2, PIN_INPUT | MUX_MODE0)	/* i2c3_scl.i2c3_scl */
diff --git a/arch/arm/boot/dts/omap3-igep0020-common.dtsi b/arch/arm/boot/dts/omap3-igep0020-common.dtsi
index 667f96245729..63a1953b151e 100644
--- a/arch/arm/boot/dts/omap3-igep0020-common.dtsi
+++ b/arch/arm/boot/dts/omap3-igep0020-common.dtsi
@@ -107,6 +129,8 @@
 	pinctrl-0 = <
 		&tfp410_pins
 		&dss_dpi_pins
+		&cam_pins
+		&tvp5150_pins
 	>;
 
 	tfp410_pins: pinmux_tfp410_pins {
@@ -115,6 +139,38 @@
 		>;
 	};
 
+	tvp5150_pins: pinmux_tvp5150_pins {
+                pinctrl-single,pins = <
+						OMAP3_CORE1_IOPAD(0x2130, PIN_OUTPUT | MUX_MODE4) /* ccdc_wen.gpio167 - tvp5150 reset pin */
+						OMAP3_CORE1_IOPAD(0x2132, PIN_OUTPUT | MUX_MODE4) /* cam_strobe.gpio126 - tvp5150 power down pin*/
+						>;
+        };
+        
+	cam_pins: pinmux_cam_pins {
+                pinctrl-single,pins = <
+                        OMAP3_CORE1_IOPAD(0x210c, PIN_INPUT | MUX_MODE0)  /* cam_hs.cam_hs */
+                        OMAP3_CORE1_IOPAD(0x210e, PIN_INPUT | MUX_MODE0)  /* cam_vs.cam_vs */
+                        OMAP3_CORE1_IOPAD(0x2110, PIN_OUTPUT| MUX_MODE0)  /* cam_xclka.cam_xclka */
+                        OMAP3_CORE1_IOPAD(0x2112, PIN_INPUT | MUX_MODE0)  /* cam_pclk.cam_pclk */
+                        OMAP3_CORE1_IOPAD(0x2114, PIN_INPUT | MUX_MODE4)  /* cam_fld.gpio98 */
+                        OMAP3_CORE1_IOPAD(0x2116, PIN_INPUT | MUX_MODE0)  /* cam_d0.cam_d0 */
+                        OMAP3_CORE1_IOPAD(0x2118, PIN_INPUT | MUX_MODE0)  /* cam_d1.cam_d1 */
+                        OMAP3_CORE1_IOPAD(0x211a, PIN_INPUT | MUX_MODE0)  /* cam_d2.cam_d2 */
+                        OMAP3_CORE1_IOPAD(0x211c, PIN_INPUT | MUX_MODE0)  /* cam_d3.cam_d3 */
+                        OMAP3_CORE1_IOPAD(0x211e, PIN_INPUT | MUX_MODE0)  /* cam_d4.cam_d4 */
+                        OMAP3_CORE1_IOPAD(0x2120, PIN_INPUT | MUX_MODE0)  /* cam_d5.cam_d5 */
+                        OMAP3_CORE1_IOPAD(0x2122, PIN_INPUT | MUX_MODE0)  /* cam_d6.cam_d6 */
+                        OMAP3_CORE1_IOPAD(0x2124, PIN_INPUT | MUX_MODE0)  /* cam_d7.cam_d7 */
+                        OMAP3_CORE1_IOPAD(0x2126, PIN_INPUT | MUX_MODE0)  /* cam_d8.cam_d8 */
+                        OMAP3_CORE1_IOPAD(0x2128, PIN_INPUT | MUX_MODE0)  /* cam_d9.cam_d9 */
+                        OMAP3_CORE1_IOPAD(0x212a, PIN_INPUT | MUX_MODE0)  /* cam_d10.cam_d10 */
+                        OMAP3_CORE1_IOPAD(0x212c, PIN_INPUT | MUX_MODE0)  /* cam_d11.cam_d11 */
+                        OMAP3_CORE1_IOPAD(0x212e, PIN_INPUT | MUX_MODE4)  /* cam_xclkb.gpio111 */
+                        /* OMAP3_CORE1_IOPAD(0x2130, PIN_INPUT | MUX_MODE0)   cam_wen.cam_wen */
+                        /* OMAP3_CORE1_IOPAD(0x2132, PIN_INPUT | MUX_MODE0)   cam_strobe.cam_strobe */
+                >;
+        };
+
 	dss_dpi_pins: pinmux_dss_dpi_pins {
 		pinctrl-single,pins = <
 			OMAP3_CORE1_IOPAD(0x20d4, PIN_OUTPUT | MUX_MODE0)   /* dss_pclk.dss_pclk */
@@ -167,9 +223,9 @@
 &omap3_pmx_core2 {
 	pinctrl-names = "default";
 	pinctrl-0 = <
-		&hsusbb1_pins
-	>;
-
+		&hsusbb1_pins		
+		>;
+		
 	hsusbb1_pins: pinmux_hsusbb1_pins {
 		pinctrl-single,pins = <
 			OMAP3630_CORE2_IOPAD(0x25da, PIN_OUTPUT | MUX_MODE3)		/* etk_ctl.hsusb1_clk */
@@ -202,13 +258,47 @@
 	};
 };
 
-&i2c3 {
-	clock-frequency = <100000>;
+&i2c2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c2_pins>;
+	
+	clock-frequency = <400000>;
+	
+	tvp5150 at 5c {
+			compatible = "ti,tvp5150";
+			reg = <0x5c>;	
+			pinctrl-0 = <&tvp5150_pins>;
+			pdn-gpios = <&gpio4 30 GPIO_ACTIVE_LOW>;
+			reset-gpios = <&gpio6 7 GPIO_ACTIVE_LOW>;
+			
+			port {
+				tvp5150_1: endpoint {
+					remote-endpoint = <&ccdc_ep>;
+				};
+			};
+	};
 
-	/*
-	 * Display monitor features are burnt in the EEPROM
-	 * as EDID data.
-	 */
 	eeprom at 50 {
 		compatible = "ti,eeprom";
 		reg = <0x50>;
@@ -261,3 +351,20 @@
 	pinctrl-0 = <&mmc1_pins &mmc1_wp_pins>;
 	wp-gpios = <&gpio1 29 GPIO_ACTIVE_LOW>;	/* gpio_29 */
 };
+
+&isp {
+	vdd-csiphy1-supply = <&vaux2>;
+	vdd-csiphy2-supply = <&vaux2>;
+	ports {
+		port at 0 {
+			reg = <0>;
+			ccdc_ep: endpoint {
+				remote-endpoint = <&tvp5150_1>;
+				bus-width = <8>;
+				data-shift = <0>;
+			};
+		};
+	};
+};

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America


More information about the Letux-kernel mailing list