All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nokia n900: update dts with camera support
@ 2017-08-10 20:49 ` Pavel Machek
  0 siblings, 0 replies; 32+ messages in thread
From: Pavel Machek @ 2017-08-10 20:49 UTC (permalink / raw)
  To: pali.rohar, sre, kernel list, linux-arm-kernel, linux-omap, tony,
	khilman, aaro.koskinen, ivo.g.dimitrov.75, patrikbachan, serge,
	abcloriens, sakari.ailus

[-- Attachment #1: Type: text/plain, Size: 3427 bytes --]


Add camera support to N900 dts. Also add a note about MMC & debugging.

Signed-off-by: Pavel Machek <pavel@ucw.cz>


diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts
index 49f3708..b1be53d 100644
--- a/arch/arm/boot/dts/omap3-n900.dts
+++ b/arch/arm/boot/dts/omap3-n900.dts
@@ -144,6 +144,15 @@
 		io-channel-names = "temp", "bsi", "vbat";
 	};
 
+	rear_camera: camera@0 {
+		compatible = "linux,camera";
+
+		module {
+			model = "TCM8341MD";
+			sensor = <&cam1>;
+		};
+	};
+
 	pwm9: dmtimer-pwm {
 		compatible = "ti,omap-dmtimer-pwm";
 		#pwm-cells = <3>;
@@ -164,6 +173,31 @@
 	};
 };
 
+&isp {
+	vdds_csib-supply = <&vaux2>;
+
+	pinctrl-names = "default";
+	pinctrl-0 = <&camera_pins>;
+
+	ports {
+		port@1 {
+			reg = <1>;
+
+			csi_isp: endpoint {
+				remote-endpoint = <&csi_cam1>;
+				bus-type = <3>; /* CCP2 */
+				clock-lanes = <1>;
+				data-lanes = <0>;
+				lane-polarity = <0 0>;
+				clock-inv = <0>;
+				/* Select strobe = <1> for back camera, <0> for front camera */
+				strobe = <1>;
+				crc = <0>;
+			};
+		};
+	};
+};
+
 &omap3_pmx_core {
 	pinctrl-names = "default";
 
@@ -328,6 +362,22 @@
 			OMAP3_CORE1_IOPAD(0x218e, PIN_OUTPUT | MUX_MODE4)		/* gpio 157 => cmt_bsi */
 		>;
 	};
+
+	camera_pins: pinmux_camera {
+		pinctrl-single,pins = <
+			OMAP3_CORE1_IOPAD(0x210c, PIN_OUTPUT | MUX_MODE7)       /* cam_hs */
+			OMAP3_CORE1_IOPAD(0x210e, PIN_OUTPUT | MUX_MODE7)       /* cam_vs */
+			OMAP3_CORE1_IOPAD(0x2110, PIN_OUTPUT | MUX_MODE0)       /* cam_xclka */
+			OMAP3_CORE1_IOPAD(0x211e, PIN_OUTPUT | MUX_MODE7)       /* cam_d4 */
+			OMAP3_CORE1_IOPAD(0x2122, PIN_INPUT | MUX_MODE0)        /* cam_d6 */
+			OMAP3_CORE1_IOPAD(0x2124, PIN_INPUT | MUX_MODE0)        /* cam_d7 */
+			OMAP3_CORE1_IOPAD(0x2126, PIN_INPUT | MUX_MODE0)        /* cam_d8 */
+			OMAP3_CORE1_IOPAD(0x2128, PIN_INPUT | MUX_MODE0)        /* cam_d9 */
+			OMAP3_CORE1_IOPAD(0x212a, PIN_OUTPUT | MUX_MODE7)       /* cam_d10 */
+			OMAP3_CORE1_IOPAD(0x212e, PIN_OUTPUT | MUX_MODE7)       /* cam_xclkb */
+			OMAP3_CORE1_IOPAD(0x2132, PIN_OUTPUT | MUX_MODE0)       /* cam_strobe */
+		>;
+	};
 };
 
 &i2c1 {
@@ -726,6 +776,40 @@
 		st,max-limit-y = <32>;
 		st,max-limit-z = <32>;
 	};
+
+	cam1: camera@3e {
+		compatible = "toshiba,et8ek8";
+		reg = <0x3e>;
+
+		vana-supply = <&vaux4>;
+
+		clocks = <&isp 0>;
+		clock-names = "extclk";
+		clock-frequency = <9600000>;
+
+		reset-gpio = <&gpio4 6 GPIO_ACTIVE_HIGH>; /* 102 */
+
+		port {
+			csi_cam1: endpoint {
+				bus-type = <3>; /* CCP2 */
+				strobe = <1>;
+				clock-inv = <0>;
+				crc = <1>;
+
+				remote-endpoint = <&csi_isp>;
+			};
+		};
+	};
+
+	/* D/A converter for auto-focus */
+	ad5820: dac@0c {
+		compatible = "adi,ad5820";
+		reg = <0x0c>;
+
+		VANA-supply = <&vaux4>;
+
+		#io-channel-cells = <0>;
+	};
 };
 
 &mmc1 {
@@ -733,6 +817,9 @@
 	pinctrl-0 = <&mmc1_pins>;
 	vmmc-supply = <&vmmc1>;
 	bus-width = <4>;
+	/* For debugging, it is often good idea to remove this GPIO.
+	   It means you can remove back cover (to reboot by removing
+	   battery) and still use the MMC card. */
 	cd-gpios = <&gpio6 0 GPIO_ACTIVE_HIGH>; /* 160 */
 };
 

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

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

* [PATCH] nokia n900: update dts with camera support
@ 2017-08-10 20:49 ` Pavel Machek
  0 siblings, 0 replies; 32+ messages in thread
From: Pavel Machek @ 2017-08-10 20:49 UTC (permalink / raw)
  To: linux-arm-kernel


Add camera support to N900 dts. Also add a note about MMC & debugging.

Signed-off-by: Pavel Machek <pavel@ucw.cz>


diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts
index 49f3708..b1be53d 100644
--- a/arch/arm/boot/dts/omap3-n900.dts
+++ b/arch/arm/boot/dts/omap3-n900.dts
@@ -144,6 +144,15 @@
 		io-channel-names = "temp", "bsi", "vbat";
 	};
 
+	rear_camera: camera at 0 {
+		compatible = "linux,camera";
+
+		module {
+			model = "TCM8341MD";
+			sensor = <&cam1>;
+		};
+	};
+
 	pwm9: dmtimer-pwm {
 		compatible = "ti,omap-dmtimer-pwm";
 		#pwm-cells = <3>;
@@ -164,6 +173,31 @@
 	};
 };
 
+&isp {
+	vdds_csib-supply = <&vaux2>;
+
+	pinctrl-names = "default";
+	pinctrl-0 = <&camera_pins>;
+
+	ports {
+		port at 1 {
+			reg = <1>;
+
+			csi_isp: endpoint {
+				remote-endpoint = <&csi_cam1>;
+				bus-type = <3>; /* CCP2 */
+				clock-lanes = <1>;
+				data-lanes = <0>;
+				lane-polarity = <0 0>;
+				clock-inv = <0>;
+				/* Select strobe = <1> for back camera, <0> for front camera */
+				strobe = <1>;
+				crc = <0>;
+			};
+		};
+	};
+};
+
 &omap3_pmx_core {
 	pinctrl-names = "default";
 
@@ -328,6 +362,22 @@
 			OMAP3_CORE1_IOPAD(0x218e, PIN_OUTPUT | MUX_MODE4)		/* gpio 157 => cmt_bsi */
 		>;
 	};
+
+	camera_pins: pinmux_camera {
+		pinctrl-single,pins = <
+			OMAP3_CORE1_IOPAD(0x210c, PIN_OUTPUT | MUX_MODE7)       /* cam_hs */
+			OMAP3_CORE1_IOPAD(0x210e, PIN_OUTPUT | MUX_MODE7)       /* cam_vs */
+			OMAP3_CORE1_IOPAD(0x2110, PIN_OUTPUT | MUX_MODE0)       /* cam_xclka */
+			OMAP3_CORE1_IOPAD(0x211e, PIN_OUTPUT | MUX_MODE7)       /* cam_d4 */
+			OMAP3_CORE1_IOPAD(0x2122, PIN_INPUT | MUX_MODE0)        /* cam_d6 */
+			OMAP3_CORE1_IOPAD(0x2124, PIN_INPUT | MUX_MODE0)        /* cam_d7 */
+			OMAP3_CORE1_IOPAD(0x2126, PIN_INPUT | MUX_MODE0)        /* cam_d8 */
+			OMAP3_CORE1_IOPAD(0x2128, PIN_INPUT | MUX_MODE0)        /* cam_d9 */
+			OMAP3_CORE1_IOPAD(0x212a, PIN_OUTPUT | MUX_MODE7)       /* cam_d10 */
+			OMAP3_CORE1_IOPAD(0x212e, PIN_OUTPUT | MUX_MODE7)       /* cam_xclkb */
+			OMAP3_CORE1_IOPAD(0x2132, PIN_OUTPUT | MUX_MODE0)       /* cam_strobe */
+		>;
+	};
 };
 
 &i2c1 {
@@ -726,6 +776,40 @@
 		st,max-limit-y = <32>;
 		st,max-limit-z = <32>;
 	};
+
+	cam1: camera at 3e {
+		compatible = "toshiba,et8ek8";
+		reg = <0x3e>;
+
+		vana-supply = <&vaux4>;
+
+		clocks = <&isp 0>;
+		clock-names = "extclk";
+		clock-frequency = <9600000>;
+
+		reset-gpio = <&gpio4 6 GPIO_ACTIVE_HIGH>; /* 102 */
+
+		port {
+			csi_cam1: endpoint {
+				bus-type = <3>; /* CCP2 */
+				strobe = <1>;
+				clock-inv = <0>;
+				crc = <1>;
+
+				remote-endpoint = <&csi_isp>;
+			};
+		};
+	};
+
+	/* D/A converter for auto-focus */
+	ad5820: dac at 0c {
+		compatible = "adi,ad5820";
+		reg = <0x0c>;
+
+		VANA-supply = <&vaux4>;
+
+		#io-channel-cells = <0>;
+	};
 };
 
 &mmc1 {
@@ -733,6 +817,9 @@
 	pinctrl-0 = <&mmc1_pins>;
 	vmmc-supply = <&vmmc1>;
 	bus-width = <4>;
+	/* For debugging, it is often good idea to remove this GPIO.
+	   It means you can remove back cover (to reboot by removing
+	   battery) and still use the MMC card. */
 	cd-gpios = <&gpio6 0 GPIO_ACTIVE_HIGH>; /* 160 */
 };
 

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170810/a51bb504/attachment.sig>

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

* Re: [PATCH] nokia n900: update dts with camera support
  2017-08-10 20:49 ` Pavel Machek
@ 2017-08-13 15:37   ` Pali Rohár
  -1 siblings, 0 replies; 32+ messages in thread
From: Pali Rohár @ 2017-08-13 15:37 UTC (permalink / raw)
  To: Pavel Machek
  Cc: sre, kernel list, linux-arm-kernel, linux-omap, tony, khilman,
	aaro.koskinen, ivo.g.dimitrov.75, patrikbachan, serge,
	abcloriens, sakari.ailus

On Thursday 10 August 2017 22:49:23 Pavel Machek wrote:
> 
> Add camera support to N900 dts. Also add a note about MMC & debugging.
> 
> Signed-off-by: Pavel Machek <pavel@ucw.cz>

Looks good,

Acked-by: Pali Rohár <pali.rohar@gmail.com>

> 
> diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts
> index 49f3708..b1be53d 100644
> --- a/arch/arm/boot/dts/omap3-n900.dts
> +++ b/arch/arm/boot/dts/omap3-n900.dts
> @@ -144,6 +144,15 @@
>  		io-channel-names = "temp", "bsi", "vbat";
>  	};
>  
> +	rear_camera: camera@0 {
> +		compatible = "linux,camera";
> +
> +		module {
> +			model = "TCM8341MD";
> +			sensor = <&cam1>;
> +		};
> +	};
> +
>  	pwm9: dmtimer-pwm {
>  		compatible = "ti,omap-dmtimer-pwm";
>  		#pwm-cells = <3>;
> @@ -164,6 +173,31 @@
>  	};
>  };
>  
> +&isp {
> +	vdds_csib-supply = <&vaux2>;
> +
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&camera_pins>;
> +
> +	ports {
> +		port@1 {
> +			reg = <1>;
> +
> +			csi_isp: endpoint {
> +				remote-endpoint = <&csi_cam1>;
> +				bus-type = <3>; /* CCP2 */
> +				clock-lanes = <1>;
> +				data-lanes = <0>;
> +				lane-polarity = <0 0>;
> +				clock-inv = <0>;
> +				/* Select strobe = <1> for back camera, <0> for front camera */
> +				strobe = <1>;
> +				crc = <0>;
> +			};
> +		};
> +	};
> +};
> +
>  &omap3_pmx_core {
>  	pinctrl-names = "default";
>  
> @@ -328,6 +362,22 @@
>  			OMAP3_CORE1_IOPAD(0x218e, PIN_OUTPUT | MUX_MODE4)		/* gpio 157 => cmt_bsi */
>  		>;
>  	};
> +
> +	camera_pins: pinmux_camera {
> +		pinctrl-single,pins = <
> +			OMAP3_CORE1_IOPAD(0x210c, PIN_OUTPUT | MUX_MODE7)       /* cam_hs */
> +			OMAP3_CORE1_IOPAD(0x210e, PIN_OUTPUT | MUX_MODE7)       /* cam_vs */
> +			OMAP3_CORE1_IOPAD(0x2110, PIN_OUTPUT | MUX_MODE0)       /* cam_xclka */
> +			OMAP3_CORE1_IOPAD(0x211e, PIN_OUTPUT | MUX_MODE7)       /* cam_d4 */
> +			OMAP3_CORE1_IOPAD(0x2122, PIN_INPUT | MUX_MODE0)        /* cam_d6 */
> +			OMAP3_CORE1_IOPAD(0x2124, PIN_INPUT | MUX_MODE0)        /* cam_d7 */
> +			OMAP3_CORE1_IOPAD(0x2126, PIN_INPUT | MUX_MODE0)        /* cam_d8 */
> +			OMAP3_CORE1_IOPAD(0x2128, PIN_INPUT | MUX_MODE0)        /* cam_d9 */
> +			OMAP3_CORE1_IOPAD(0x212a, PIN_OUTPUT | MUX_MODE7)       /* cam_d10 */
> +			OMAP3_CORE1_IOPAD(0x212e, PIN_OUTPUT | MUX_MODE7)       /* cam_xclkb */
> +			OMAP3_CORE1_IOPAD(0x2132, PIN_OUTPUT | MUX_MODE0)       /* cam_strobe */
> +		>;
> +	};
>  };
>  
>  &i2c1 {
> @@ -726,6 +776,40 @@
>  		st,max-limit-y = <32>;
>  		st,max-limit-z = <32>;
>  	};
> +
> +	cam1: camera@3e {
> +		compatible = "toshiba,et8ek8";
> +		reg = <0x3e>;
> +
> +		vana-supply = <&vaux4>;
> +
> +		clocks = <&isp 0>;
> +		clock-names = "extclk";
> +		clock-frequency = <9600000>;
> +
> +		reset-gpio = <&gpio4 6 GPIO_ACTIVE_HIGH>; /* 102 */
> +
> +		port {
> +			csi_cam1: endpoint {
> +				bus-type = <3>; /* CCP2 */
> +				strobe = <1>;
> +				clock-inv = <0>;
> +				crc = <1>;
> +
> +				remote-endpoint = <&csi_isp>;
> +			};
> +		};
> +	};
> +
> +	/* D/A converter for auto-focus */
> +	ad5820: dac@0c {
> +		compatible = "adi,ad5820";
> +		reg = <0x0c>;
> +
> +		VANA-supply = <&vaux4>;
> +
> +		#io-channel-cells = <0>;
> +	};
>  };
>  
>  &mmc1 {
> @@ -733,6 +817,9 @@
>  	pinctrl-0 = <&mmc1_pins>;
>  	vmmc-supply = <&vmmc1>;
>  	bus-width = <4>;
> +	/* For debugging, it is often good idea to remove this GPIO.
> +	   It means you can remove back cover (to reboot by removing
> +	   battery) and still use the MMC card. */
>  	cd-gpios = <&gpio6 0 GPIO_ACTIVE_HIGH>; /* 160 */
>  };
>  
> 

-- 
Pali Rohár
pali.rohar@gmail.com

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

* [PATCH] nokia n900: update dts with camera support
@ 2017-08-13 15:37   ` Pali Rohár
  0 siblings, 0 replies; 32+ messages in thread
From: Pali Rohár @ 2017-08-13 15:37 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday 10 August 2017 22:49:23 Pavel Machek wrote:
> 
> Add camera support to N900 dts. Also add a note about MMC & debugging.
> 
> Signed-off-by: Pavel Machek <pavel@ucw.cz>

Looks good,

Acked-by: Pali Roh?r <pali.rohar@gmail.com>

> 
> diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts
> index 49f3708..b1be53d 100644
> --- a/arch/arm/boot/dts/omap3-n900.dts
> +++ b/arch/arm/boot/dts/omap3-n900.dts
> @@ -144,6 +144,15 @@
>  		io-channel-names = "temp", "bsi", "vbat";
>  	};
>  
> +	rear_camera: camera at 0 {
> +		compatible = "linux,camera";
> +
> +		module {
> +			model = "TCM8341MD";
> +			sensor = <&cam1>;
> +		};
> +	};
> +
>  	pwm9: dmtimer-pwm {
>  		compatible = "ti,omap-dmtimer-pwm";
>  		#pwm-cells = <3>;
> @@ -164,6 +173,31 @@
>  	};
>  };
>  
> +&isp {
> +	vdds_csib-supply = <&vaux2>;
> +
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&camera_pins>;
> +
> +	ports {
> +		port at 1 {
> +			reg = <1>;
> +
> +			csi_isp: endpoint {
> +				remote-endpoint = <&csi_cam1>;
> +				bus-type = <3>; /* CCP2 */
> +				clock-lanes = <1>;
> +				data-lanes = <0>;
> +				lane-polarity = <0 0>;
> +				clock-inv = <0>;
> +				/* Select strobe = <1> for back camera, <0> for front camera */
> +				strobe = <1>;
> +				crc = <0>;
> +			};
> +		};
> +	};
> +};
> +
>  &omap3_pmx_core {
>  	pinctrl-names = "default";
>  
> @@ -328,6 +362,22 @@
>  			OMAP3_CORE1_IOPAD(0x218e, PIN_OUTPUT | MUX_MODE4)		/* gpio 157 => cmt_bsi */
>  		>;
>  	};
> +
> +	camera_pins: pinmux_camera {
> +		pinctrl-single,pins = <
> +			OMAP3_CORE1_IOPAD(0x210c, PIN_OUTPUT | MUX_MODE7)       /* cam_hs */
> +			OMAP3_CORE1_IOPAD(0x210e, PIN_OUTPUT | MUX_MODE7)       /* cam_vs */
> +			OMAP3_CORE1_IOPAD(0x2110, PIN_OUTPUT | MUX_MODE0)       /* cam_xclka */
> +			OMAP3_CORE1_IOPAD(0x211e, PIN_OUTPUT | MUX_MODE7)       /* cam_d4 */
> +			OMAP3_CORE1_IOPAD(0x2122, PIN_INPUT | MUX_MODE0)        /* cam_d6 */
> +			OMAP3_CORE1_IOPAD(0x2124, PIN_INPUT | MUX_MODE0)        /* cam_d7 */
> +			OMAP3_CORE1_IOPAD(0x2126, PIN_INPUT | MUX_MODE0)        /* cam_d8 */
> +			OMAP3_CORE1_IOPAD(0x2128, PIN_INPUT | MUX_MODE0)        /* cam_d9 */
> +			OMAP3_CORE1_IOPAD(0x212a, PIN_OUTPUT | MUX_MODE7)       /* cam_d10 */
> +			OMAP3_CORE1_IOPAD(0x212e, PIN_OUTPUT | MUX_MODE7)       /* cam_xclkb */
> +			OMAP3_CORE1_IOPAD(0x2132, PIN_OUTPUT | MUX_MODE0)       /* cam_strobe */
> +		>;
> +	};
>  };
>  
>  &i2c1 {
> @@ -726,6 +776,40 @@
>  		st,max-limit-y = <32>;
>  		st,max-limit-z = <32>;
>  	};
> +
> +	cam1: camera at 3e {
> +		compatible = "toshiba,et8ek8";
> +		reg = <0x3e>;
> +
> +		vana-supply = <&vaux4>;
> +
> +		clocks = <&isp 0>;
> +		clock-names = "extclk";
> +		clock-frequency = <9600000>;
> +
> +		reset-gpio = <&gpio4 6 GPIO_ACTIVE_HIGH>; /* 102 */
> +
> +		port {
> +			csi_cam1: endpoint {
> +				bus-type = <3>; /* CCP2 */
> +				strobe = <1>;
> +				clock-inv = <0>;
> +				crc = <1>;
> +
> +				remote-endpoint = <&csi_isp>;
> +			};
> +		};
> +	};
> +
> +	/* D/A converter for auto-focus */
> +	ad5820: dac at 0c {
> +		compatible = "adi,ad5820";
> +		reg = <0x0c>;
> +
> +		VANA-supply = <&vaux4>;
> +
> +		#io-channel-cells = <0>;
> +	};
>  };
>  
>  &mmc1 {
> @@ -733,6 +817,9 @@
>  	pinctrl-0 = <&mmc1_pins>;
>  	vmmc-supply = <&vmmc1>;
>  	bus-width = <4>;
> +	/* For debugging, it is often good idea to remove this GPIO.
> +	   It means you can remove back cover (to reboot by removing
> +	   battery) and still use the MMC card. */
>  	cd-gpios = <&gpio6 0 GPIO_ACTIVE_HIGH>; /* 160 */
>  };
>  
> 

-- 
Pali Roh?r
pali.rohar at gmail.com

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

* Re: [PATCH] nokia n900: update dts with camera support
  2017-08-13 15:37   ` Pali Rohár
@ 2017-08-14 17:49     ` Tony Lindgren
  -1 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2017-08-14 17:49 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Pavel Machek, sre, kernel list, linux-arm-kernel, linux-omap,
	khilman, aaro.koskinen, ivo.g.dimitrov.75, patrikbachan, serge,
	abcloriens, sakari.ailus

* Pali Rohár <pali.rohar@gmail.com> [170813 08:38]:
> On Thursday 10 August 2017 22:49:23 Pavel Machek wrote:
> > 
> > Add camera support to N900 dts. Also add a note about MMC & debugging.
> > 
> > Signed-off-by: Pavel Machek <pavel@ucw.cz>
> 
> Looks good,
> 
> Acked-by: Pali Rohár <pali.rohar@gmail.com>

Applying into omap-for-v4.14/dt-v2 thanks.

Tony

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

* [PATCH] nokia n900: update dts with camera support
@ 2017-08-14 17:49     ` Tony Lindgren
  0 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2017-08-14 17:49 UTC (permalink / raw)
  To: linux-arm-kernel

* Pali Roh?r <pali.rohar@gmail.com> [170813 08:38]:
> On Thursday 10 August 2017 22:49:23 Pavel Machek wrote:
> > 
> > Add camera support to N900 dts. Also add a note about MMC & debugging.
> > 
> > Signed-off-by: Pavel Machek <pavel@ucw.cz>
> 
> Looks good,
> 
> Acked-by: Pali Roh?r <pali.rohar@gmail.com>

Applying into omap-for-v4.14/dt-v2 thanks.

Tony

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

* Re: [PATCH] nokia n900: update dts with camera support
  2017-08-10 20:49 ` Pavel Machek
@ 2017-08-14 20:19   ` Sakari Ailus
  -1 siblings, 0 replies; 32+ messages in thread
From: Sakari Ailus @ 2017-08-14 20:19 UTC (permalink / raw)
  To: Pavel Machek
  Cc: pali.rohar, sre, kernel list, linux-arm-kernel, linux-omap, tony,
	khilman, aaro.koskinen, ivo.g.dimitrov.75, patrikbachan, serge,
	abcloriens

Hi Pavel,

Thanks for the patch.

I understand Tony already applied this one. I'd have a few comments below,
could you address them in another patch, please?

On Thu, Aug 10, 2017 at 10:49:23PM +0200, Pavel Machek wrote:
> 
> Add camera support to N900 dts. Also add a note about MMC & debugging.
> 
> Signed-off-by: Pavel Machek <pavel@ucw.cz>
> 
> 
> diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts
> index 49f3708..b1be53d 100644
> --- a/arch/arm/boot/dts/omap3-n900.dts
> +++ b/arch/arm/boot/dts/omap3-n900.dts
> @@ -144,6 +144,15 @@
>  		io-channel-names = "temp", "bsi", "vbat";
>  	};
>  
> +	rear_camera: camera@0 {
> +		compatible = "linux,camera";
> +
> +		module {
> +			model = "TCM8341MD";
> +			sensor = <&cam1>;
> +		};
> +	};

There's no reference to rear_camera. I understand that this represents the
camera module but as we don't have any documented way to describe camera
modules (nor we have really discussed the matter), this should be removed
for now.

Perhaps later on, but I be it'd look quite different.

> +
>  	pwm9: dmtimer-pwm {
>  		compatible = "ti,omap-dmtimer-pwm";
>  		#pwm-cells = <3>;
> @@ -164,6 +173,31 @@
>  	};
>  };
>  
> +&isp {
> +	vdds_csib-supply = <&vaux2>;
> +
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&camera_pins>;
> +
> +	ports {
> +		port@1 {
> +			reg = <1>;
> +
> +			csi_isp: endpoint {
> +				remote-endpoint = <&csi_cam1>;
> +				bus-type = <3>; /* CCP2 */
> +				clock-lanes = <1>;
> +				data-lanes = <0>;
> +				lane-polarity = <0 0>;
> +				clock-inv = <0>;
> +				/* Select strobe = <1> for back camera, <0> for front camera */
> +				strobe = <1>;
> +				crc = <0>;

crc is not a documented binding in video-interfaces.txt. Same for
clock-inv. clock-inv is used by v4l2-fwnode.c already. Describing both in
video-interfaces.txt would certainly make sense though, as well as adding
support for crc in CCP2 to V4L2 fwnode.

Could you submit patches for that? I can do that as well but it'll probably
take some days at least.

> +			};
> +		};
> +	};
> +};
> +
>  &omap3_pmx_core {
>  	pinctrl-names = "default";
>  
> @@ -328,6 +362,22 @@
>  			OMAP3_CORE1_IOPAD(0x218e, PIN_OUTPUT | MUX_MODE4)		/* gpio 157 => cmt_bsi */
>  		>;
>  	};
> +
> +	camera_pins: pinmux_camera {
> +		pinctrl-single,pins = <
> +			OMAP3_CORE1_IOPAD(0x210c, PIN_OUTPUT | MUX_MODE7)       /* cam_hs */
> +			OMAP3_CORE1_IOPAD(0x210e, PIN_OUTPUT | MUX_MODE7)       /* cam_vs */
> +			OMAP3_CORE1_IOPAD(0x2110, PIN_OUTPUT | MUX_MODE0)       /* cam_xclka */
> +			OMAP3_CORE1_IOPAD(0x211e, PIN_OUTPUT | MUX_MODE7)       /* cam_d4 */
> +			OMAP3_CORE1_IOPAD(0x2122, PIN_INPUT | MUX_MODE0)        /* cam_d6 */
> +			OMAP3_CORE1_IOPAD(0x2124, PIN_INPUT | MUX_MODE0)        /* cam_d7 */
> +			OMAP3_CORE1_IOPAD(0x2126, PIN_INPUT | MUX_MODE0)        /* cam_d8 */
> +			OMAP3_CORE1_IOPAD(0x2128, PIN_INPUT | MUX_MODE0)        /* cam_d9 */
> +			OMAP3_CORE1_IOPAD(0x212a, PIN_OUTPUT | MUX_MODE7)       /* cam_d10 */
> +			OMAP3_CORE1_IOPAD(0x212e, PIN_OUTPUT | MUX_MODE7)       /* cam_xclkb */
> +			OMAP3_CORE1_IOPAD(0x2132, PIN_OUTPUT | MUX_MODE0)       /* cam_strobe */
> +		>;
> +	};
>  };
>  
>  &i2c1 {
> @@ -726,6 +776,40 @@
>  		st,max-limit-y = <32>;
>  		st,max-limit-z = <32>;
>  	};
> +
> +	cam1: camera@3e {
> +		compatible = "toshiba,et8ek8";
> +		reg = <0x3e>;
> +
> +		vana-supply = <&vaux4>;
> +
> +		clocks = <&isp 0>;
> +		clock-names = "extclk";
> +		clock-frequency = <9600000>;
> +
> +		reset-gpio = <&gpio4 6 GPIO_ACTIVE_HIGH>; /* 102 */
> +
> +		port {
> +			csi_cam1: endpoint {
> +				bus-type = <3>; /* CCP2 */
> +				strobe = <1>;
> +				clock-inv = <0>;
> +				crc = <1>;
> +
> +				remote-endpoint = <&csi_isp>;
> +			};
> +		};
> +	};
> +
> +	/* D/A converter for auto-focus */
> +	ad5820: dac@0c {
> +		compatible = "adi,ad5820";
> +		reg = <0x0c>;
> +
> +		VANA-supply = <&vaux4>;
> +
> +		#io-channel-cells = <0>;
> +	};
>  };
>  
>  &mmc1 {
> @@ -733,6 +817,9 @@
>  	pinctrl-0 = <&mmc1_pins>;
>  	vmmc-supply = <&vmmc1>;
>  	bus-width = <4>;
> +	/* For debugging, it is often good idea to remove this GPIO.
> +	   It means you can remove back cover (to reboot by removing
> +	   battery) and still use the MMC card. */
>  	cd-gpios = <&gpio6 0 GPIO_ACTIVE_HIGH>; /* 160 */
>  };
>  
> 

-- 
Regards,

Sakari Ailus
e-mail: sakari.ailus@iki.fi

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

* [PATCH] nokia n900: update dts with camera support
@ 2017-08-14 20:19   ` Sakari Ailus
  0 siblings, 0 replies; 32+ messages in thread
From: Sakari Ailus @ 2017-08-14 20:19 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Pavel,

Thanks for the patch.

I understand Tony already applied this one. I'd have a few comments below,
could you address them in another patch, please?

On Thu, Aug 10, 2017 at 10:49:23PM +0200, Pavel Machek wrote:
> 
> Add camera support to N900 dts. Also add a note about MMC & debugging.
> 
> Signed-off-by: Pavel Machek <pavel@ucw.cz>
> 
> 
> diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts
> index 49f3708..b1be53d 100644
> --- a/arch/arm/boot/dts/omap3-n900.dts
> +++ b/arch/arm/boot/dts/omap3-n900.dts
> @@ -144,6 +144,15 @@
>  		io-channel-names = "temp", "bsi", "vbat";
>  	};
>  
> +	rear_camera: camera at 0 {
> +		compatible = "linux,camera";
> +
> +		module {
> +			model = "TCM8341MD";
> +			sensor = <&cam1>;
> +		};
> +	};

There's no reference to rear_camera. I understand that this represents the
camera module but as we don't have any documented way to describe camera
modules (nor we have really discussed the matter), this should be removed
for now.

Perhaps later on, but I be it'd look quite different.

> +
>  	pwm9: dmtimer-pwm {
>  		compatible = "ti,omap-dmtimer-pwm";
>  		#pwm-cells = <3>;
> @@ -164,6 +173,31 @@
>  	};
>  };
>  
> +&isp {
> +	vdds_csib-supply = <&vaux2>;
> +
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&camera_pins>;
> +
> +	ports {
> +		port at 1 {
> +			reg = <1>;
> +
> +			csi_isp: endpoint {
> +				remote-endpoint = <&csi_cam1>;
> +				bus-type = <3>; /* CCP2 */
> +				clock-lanes = <1>;
> +				data-lanes = <0>;
> +				lane-polarity = <0 0>;
> +				clock-inv = <0>;
> +				/* Select strobe = <1> for back camera, <0> for front camera */
> +				strobe = <1>;
> +				crc = <0>;

crc is not a documented binding in video-interfaces.txt. Same for
clock-inv. clock-inv is used by v4l2-fwnode.c already. Describing both in
video-interfaces.txt would certainly make sense though, as well as adding
support for crc in CCP2 to V4L2 fwnode.

Could you submit patches for that? I can do that as well but it'll probably
take some days at least.

> +			};
> +		};
> +	};
> +};
> +
>  &omap3_pmx_core {
>  	pinctrl-names = "default";
>  
> @@ -328,6 +362,22 @@
>  			OMAP3_CORE1_IOPAD(0x218e, PIN_OUTPUT | MUX_MODE4)		/* gpio 157 => cmt_bsi */
>  		>;
>  	};
> +
> +	camera_pins: pinmux_camera {
> +		pinctrl-single,pins = <
> +			OMAP3_CORE1_IOPAD(0x210c, PIN_OUTPUT | MUX_MODE7)       /* cam_hs */
> +			OMAP3_CORE1_IOPAD(0x210e, PIN_OUTPUT | MUX_MODE7)       /* cam_vs */
> +			OMAP3_CORE1_IOPAD(0x2110, PIN_OUTPUT | MUX_MODE0)       /* cam_xclka */
> +			OMAP3_CORE1_IOPAD(0x211e, PIN_OUTPUT | MUX_MODE7)       /* cam_d4 */
> +			OMAP3_CORE1_IOPAD(0x2122, PIN_INPUT | MUX_MODE0)        /* cam_d6 */
> +			OMAP3_CORE1_IOPAD(0x2124, PIN_INPUT | MUX_MODE0)        /* cam_d7 */
> +			OMAP3_CORE1_IOPAD(0x2126, PIN_INPUT | MUX_MODE0)        /* cam_d8 */
> +			OMAP3_CORE1_IOPAD(0x2128, PIN_INPUT | MUX_MODE0)        /* cam_d9 */
> +			OMAP3_CORE1_IOPAD(0x212a, PIN_OUTPUT | MUX_MODE7)       /* cam_d10 */
> +			OMAP3_CORE1_IOPAD(0x212e, PIN_OUTPUT | MUX_MODE7)       /* cam_xclkb */
> +			OMAP3_CORE1_IOPAD(0x2132, PIN_OUTPUT | MUX_MODE0)       /* cam_strobe */
> +		>;
> +	};
>  };
>  
>  &i2c1 {
> @@ -726,6 +776,40 @@
>  		st,max-limit-y = <32>;
>  		st,max-limit-z = <32>;
>  	};
> +
> +	cam1: camera at 3e {
> +		compatible = "toshiba,et8ek8";
> +		reg = <0x3e>;
> +
> +		vana-supply = <&vaux4>;
> +
> +		clocks = <&isp 0>;
> +		clock-names = "extclk";
> +		clock-frequency = <9600000>;
> +
> +		reset-gpio = <&gpio4 6 GPIO_ACTIVE_HIGH>; /* 102 */
> +
> +		port {
> +			csi_cam1: endpoint {
> +				bus-type = <3>; /* CCP2 */
> +				strobe = <1>;
> +				clock-inv = <0>;
> +				crc = <1>;
> +
> +				remote-endpoint = <&csi_isp>;
> +			};
> +		};
> +	};
> +
> +	/* D/A converter for auto-focus */
> +	ad5820: dac at 0c {
> +		compatible = "adi,ad5820";
> +		reg = <0x0c>;
> +
> +		VANA-supply = <&vaux4>;
> +
> +		#io-channel-cells = <0>;
> +	};
>  };
>  
>  &mmc1 {
> @@ -733,6 +817,9 @@
>  	pinctrl-0 = <&mmc1_pins>;
>  	vmmc-supply = <&vmmc1>;
>  	bus-width = <4>;
> +	/* For debugging, it is often good idea to remove this GPIO.
> +	   It means you can remove back cover (to reboot by removing
> +	   battery) and still use the MMC card. */
>  	cd-gpios = <&gpio6 0 GPIO_ACTIVE_HIGH>; /* 160 */
>  };
>  
> 

-- 
Regards,

Sakari Ailus
e-mail: sakari.ailus at iki.fi

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

* Re: [PATCH] nokia n900: update dts with camera support
  2017-08-14 20:19   ` Sakari Ailus
@ 2017-08-14 20:33     ` Tony Lindgren
  -1 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2017-08-14 20:33 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: Pavel Machek, pali.rohar, sre, kernel list, linux-arm-kernel,
	linux-omap, khilman, aaro.koskinen, ivo.g.dimitrov.75,
	patrikbachan, serge, abcloriens

* Sakari Ailus <sakari.ailus@iki.fi> [170814 13:20]:
> Hi Pavel,
> 
> Thanks for the patch.
> 
> I understand Tony already applied this one. I'd have a few comments below,
> could you address them in another patch, please?

Oops sorry about that. It looked trivial enough for me.
Yes an incremental patces to follow-up please.

Regards,

Tony

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

* [PATCH] nokia n900: update dts with camera support
@ 2017-08-14 20:33     ` Tony Lindgren
  0 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2017-08-14 20:33 UTC (permalink / raw)
  To: linux-arm-kernel

* Sakari Ailus <sakari.ailus@iki.fi> [170814 13:20]:
> Hi Pavel,
> 
> Thanks for the patch.
> 
> I understand Tony already applied this one. I'd have a few comments below,
> could you address them in another patch, please?

Oops sorry about that. It looked trivial enough for me.
Yes an incremental patces to follow-up please.

Regards,

Tony

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

* Re: [PATCH] nokia n900: update dts with camera support
  2017-08-14 20:19   ` Sakari Ailus
@ 2017-08-15 22:03     ` Pavel Machek
  -1 siblings, 0 replies; 32+ messages in thread
From: Pavel Machek @ 2017-08-15 22:03 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: pali.rohar, sre, kernel list, linux-arm-kernel, linux-omap, tony,
	khilman, aaro.koskinen, ivo.g.dimitrov.75, patrikbachan, serge,
	abcloriens

[-- Attachment #1: Type: text/plain, Size: 4967 bytes --]

Hi!

> I understand Tony already applied this one. I'd have a few comments below,
> could you address them in another patch, please?

Yes.

> > +	rear_camera: camera@0 {
> > +		compatible = "linux,camera";
> > +
> > +		module {
> > +			model = "TCM8341MD";
> > +			sensor = <&cam1>;
> > +		};
> > +	};
> 
> There's no reference to rear_camera. I understand that this represents the
> camera module but as we don't have any documented way to describe camera
> modules (nor we have really discussed the matter), this should be removed
> for now.
> 
> Perhaps later on, but I be it'd look quite different.

Ok, this is easy.

> > +				bus-type = <3>; /* CCP2 */
> > +				clock-lanes = <1>;
> > +				data-lanes = <0>;
> > +				lane-polarity = <0 0>;
> > +				clock-inv = <0>;
> > +				/* Select strobe = <1> for back camera, <0> for front camera */
> > +				strobe = <1>;
> > +				crc = <0>;
> 
> crc is not a documented binding in video-interfaces.txt. Same for
> clock-inv. clock-inv is used by v4l2-fwnode.c already. Describing both in
> video-interfaces.txt would certainly make sense though, as well as adding
> support for crc in CCP2 to V4L2 fwnode.
> 
> Could you submit patches for that? I can do that as well but it'll probably
> take some days at least.

Ok, no longer that easy. But see below, something like that?

Could you suggest better documentation lines? I'm afraid Rob will not
like "not inverted" vs. "inverted"... would "camera sensor protects
image data of each frame with crc" be suitable?

Best regards,

Signed-off-by: Pavel Machek <pavel@ucw.cz>

									Pavel

diff --git a/Documentation/devicetree/bindings/media/video-interfaces.txt b/Documentation/devicetree/bindings/media/video-interfaces.txt
index 852041a..aade681 100644
--- a/Documentation/devicetree/bindings/media/video-interfaces.txt
+++ b/Documentation/devicetree/bindings/media/video-interfaces.txt
@@ -119,6 +119,8 @@ Optional endpoint properties
   as 0 (normal). This property is valid for serial busses only.
 - strobe: Whether the clock signal is used as clock (0) or strobe (1). Used
   with CCP2, for instance.
+- clock-inv: polarity of clock/strobe signal. 0 - not inverted, 1 - inverted
+- crc: crc is in use
 
 Example
 -------
diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts
index b1be53d..0c1ef5c 100644
--- a/arch/arm/boot/dts/omap3-n900.dts
+++ b/arch/arm/boot/dts/omap3-n900.dts
@@ -144,15 +144,6 @@
 		io-channel-names = "temp", "bsi", "vbat";
 	};
 
-	rear_camera: camera@0 {
-		compatible = "linux,camera";
-
-		module {
-			model = "TCM8341MD";
-			sensor = <&cam1>;
-		};
-	};
-
 	pwm9: dmtimer-pwm {
 		compatible = "ti,omap-dmtimer-pwm";
 		#pwm-cells = <3>;
@@ -192,7 +183,7 @@
 				clock-inv = <0>;
 				/* Select strobe = <1> for back camera, <0> for front camera */
 				strobe = <1>;
-				crc = <0>;
+				crc = <1>;
 			};
 		};
 	};
diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c
index 6cb1f04..3e17d72 100644
--- a/drivers/media/platform/omap3isp/isp.c
+++ b/drivers/media/platform/omap3isp/isp.c
@@ -2098,12 +2098,12 @@ static int isp_fwnode_parse(struct device *dev, struct fwnode_handle *fwnode,
 
 			buscfg->bus.ccp2.strobe_clk_pol =
 				vep.bus.mipi_csi1.clock_inv;
+			buscfg->bus.ccp2.crc =
+				vep.bus.mipi_csi1.crc;
 			buscfg->bus.ccp2.phy_layer = vep.bus.mipi_csi1.strobe;
 			buscfg->bus.ccp2.ccp2_mode =
 				vep.bus_type == V4L2_MBUS_CCP2;
 			buscfg->bus.ccp2.vp_clk_pol = 1;
-
-			buscfg->bus.ccp2.crc = 1;
 		} else {
 			buscfg->bus.csi2.lanecfg.clk.pos =
 				vep.bus.mipi_csi2.clock_lane;
diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c
index 5cd2687..ce1af2d 100644
--- a/drivers/media/v4l2-core/v4l2-fwnode.c
+++ b/drivers/media/v4l2-core/v4l2-fwnode.c
@@ -170,6 +170,9 @@ v4l2_fwnode_endpoint_parse_csi1_bus(struct fwnode_handle *fwnode,
 	if (!fwnode_property_read_u32(fwnode, "clock-lanes", &v))
 		bus->clock_lane = v;
 
+	if (!fwnode_property_read_u32(fwnode, "crc", &v))
+		bus->crc = v;
+
 	if (bus_type == V4L2_FWNODE_BUS_TYPE_CCP2)
 		vep->bus_type = V4L2_MBUS_CCP2;
 	else
diff --git a/include/media/v4l2-fwnode.h b/include/media/v4l2-fwnode.h
index cb34dcb..eb820dc 100644
--- a/include/media/v4l2-fwnode.h
+++ b/include/media/v4l2-fwnode.h
@@ -66,11 +66,13 @@ struct v4l2_fwnode_bus_parallel {
  *		   index (1)
  * @data_lane: the number of the data lane
  * @clock_lane: the number of the clock lane
+ * @crc: crc is in use
  */
 struct v4l2_fwnode_bus_mipi_csi1 {
 	bool clock_inv;
 	bool strobe;
 	bool lane_polarity[2];
+	bool crc;
 	unsigned char data_lane;
 	unsigned char clock_lane;
 };
									
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

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

* [PATCH] nokia n900: update dts with camera support
@ 2017-08-15 22:03     ` Pavel Machek
  0 siblings, 0 replies; 32+ messages in thread
From: Pavel Machek @ 2017-08-15 22:03 UTC (permalink / raw)
  To: linux-arm-kernel

Hi!

> I understand Tony already applied this one. I'd have a few comments below,
> could you address them in another patch, please?

Yes.

> > +	rear_camera: camera at 0 {
> > +		compatible = "linux,camera";
> > +
> > +		module {
> > +			model = "TCM8341MD";
> > +			sensor = <&cam1>;
> > +		};
> > +	};
> 
> There's no reference to rear_camera. I understand that this represents the
> camera module but as we don't have any documented way to describe camera
> modules (nor we have really discussed the matter), this should be removed
> for now.
> 
> Perhaps later on, but I be it'd look quite different.

Ok, this is easy.

> > +				bus-type = <3>; /* CCP2 */
> > +				clock-lanes = <1>;
> > +				data-lanes = <0>;
> > +				lane-polarity = <0 0>;
> > +				clock-inv = <0>;
> > +				/* Select strobe = <1> for back camera, <0> for front camera */
> > +				strobe = <1>;
> > +				crc = <0>;
> 
> crc is not a documented binding in video-interfaces.txt. Same for
> clock-inv. clock-inv is used by v4l2-fwnode.c already. Describing both in
> video-interfaces.txt would certainly make sense though, as well as adding
> support for crc in CCP2 to V4L2 fwnode.
> 
> Could you submit patches for that? I can do that as well but it'll probably
> take some days at least.

Ok, no longer that easy. But see below, something like that?

Could you suggest better documentation lines? I'm afraid Rob will not
like "not inverted" vs. "inverted"... would "camera sensor protects
image data of each frame with crc" be suitable?

Best regards,

Signed-off-by: Pavel Machek <pavel@ucw.cz>

									Pavel

diff --git a/Documentation/devicetree/bindings/media/video-interfaces.txt b/Documentation/devicetree/bindings/media/video-interfaces.txt
index 852041a..aade681 100644
--- a/Documentation/devicetree/bindings/media/video-interfaces.txt
+++ b/Documentation/devicetree/bindings/media/video-interfaces.txt
@@ -119,6 +119,8 @@ Optional endpoint properties
   as 0 (normal). This property is valid for serial busses only.
 - strobe: Whether the clock signal is used as clock (0) or strobe (1). Used
   with CCP2, for instance.
+- clock-inv: polarity of clock/strobe signal. 0 - not inverted, 1 - inverted
+- crc: crc is in use
 
 Example
 -------
diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts
index b1be53d..0c1ef5c 100644
--- a/arch/arm/boot/dts/omap3-n900.dts
+++ b/arch/arm/boot/dts/omap3-n900.dts
@@ -144,15 +144,6 @@
 		io-channel-names = "temp", "bsi", "vbat";
 	};
 
-	rear_camera: camera at 0 {
-		compatible = "linux,camera";
-
-		module {
-			model = "TCM8341MD";
-			sensor = <&cam1>;
-		};
-	};
-
 	pwm9: dmtimer-pwm {
 		compatible = "ti,omap-dmtimer-pwm";
 		#pwm-cells = <3>;
@@ -192,7 +183,7 @@
 				clock-inv = <0>;
 				/* Select strobe = <1> for back camera, <0> for front camera */
 				strobe = <1>;
-				crc = <0>;
+				crc = <1>;
 			};
 		};
 	};
diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c
index 6cb1f04..3e17d72 100644
--- a/drivers/media/platform/omap3isp/isp.c
+++ b/drivers/media/platform/omap3isp/isp.c
@@ -2098,12 +2098,12 @@ static int isp_fwnode_parse(struct device *dev, struct fwnode_handle *fwnode,
 
 			buscfg->bus.ccp2.strobe_clk_pol =
 				vep.bus.mipi_csi1.clock_inv;
+			buscfg->bus.ccp2.crc =
+				vep.bus.mipi_csi1.crc;
 			buscfg->bus.ccp2.phy_layer = vep.bus.mipi_csi1.strobe;
 			buscfg->bus.ccp2.ccp2_mode =
 				vep.bus_type == V4L2_MBUS_CCP2;
 			buscfg->bus.ccp2.vp_clk_pol = 1;
-
-			buscfg->bus.ccp2.crc = 1;
 		} else {
 			buscfg->bus.csi2.lanecfg.clk.pos =
 				vep.bus.mipi_csi2.clock_lane;
diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c
index 5cd2687..ce1af2d 100644
--- a/drivers/media/v4l2-core/v4l2-fwnode.c
+++ b/drivers/media/v4l2-core/v4l2-fwnode.c
@@ -170,6 +170,9 @@ v4l2_fwnode_endpoint_parse_csi1_bus(struct fwnode_handle *fwnode,
 	if (!fwnode_property_read_u32(fwnode, "clock-lanes", &v))
 		bus->clock_lane = v;
 
+	if (!fwnode_property_read_u32(fwnode, "crc", &v))
+		bus->crc = v;
+
 	if (bus_type == V4L2_FWNODE_BUS_TYPE_CCP2)
 		vep->bus_type = V4L2_MBUS_CCP2;
 	else
diff --git a/include/media/v4l2-fwnode.h b/include/media/v4l2-fwnode.h
index cb34dcb..eb820dc 100644
--- a/include/media/v4l2-fwnode.h
+++ b/include/media/v4l2-fwnode.h
@@ -66,11 +66,13 @@ struct v4l2_fwnode_bus_parallel {
  *		   index (1)
  * @data_lane: the number of the data lane
  * @clock_lane: the number of the clock lane
+ * @crc: crc is in use
  */
 struct v4l2_fwnode_bus_mipi_csi1 {
 	bool clock_inv;
 	bool strobe;
 	bool lane_polarity[2];
+	bool crc;
 	unsigned char data_lane;
 	unsigned char clock_lane;
 };
									
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170816/b4598985/attachment.sig>

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

* Re: [PATCH] nokia n900: update dts with camera support
  2017-08-15 22:03     ` Pavel Machek
@ 2017-08-16 20:53       ` Sebastian Reichel
  -1 siblings, 0 replies; 32+ messages in thread
From: Sebastian Reichel @ 2017-08-16 20:53 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Sakari Ailus, pali.rohar, kernel list, linux-arm-kernel,
	linux-omap, tony, khilman, aaro.koskinen, ivo.g.dimitrov.75,
	patrikbachan, serge, abcloriens

[-- Attachment #1: Type: text/plain, Size: 859 bytes --]

Hi,

On Wed, Aug 16, 2017 at 12:03:49AM +0200, Pavel Machek wrote:
> diff --git a/Documentation/devicetree/bindings/media/video-interfaces.txt b/Documentation/devicetree/bindings/media/video-interfaces.txt
> index 852041a..aade681 100644
> --- a/Documentation/devicetree/bindings/media/video-interfaces.txt
> +++ b/Documentation/devicetree/bindings/media/video-interfaces.txt
> @@ -119,6 +119,8 @@ Optional endpoint properties
>    as 0 (normal). This property is valid for serial busses only.
>  - strobe: Whether the clock signal is used as clock (0) or strobe (1). Used
>    with CCP2, for instance.
> +- clock-inv: polarity of clock/strobe signal. 0 - not inverted, 1 - inverted
> +- crc: crc is in use

booleans in DT are not done with <0> and <1>, but as properties without
values. True = property exists, False = property does not exist.

-- Sebastian

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* [PATCH] nokia n900: update dts with camera support
@ 2017-08-16 20:53       ` Sebastian Reichel
  0 siblings, 0 replies; 32+ messages in thread
From: Sebastian Reichel @ 2017-08-16 20:53 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Wed, Aug 16, 2017 at 12:03:49AM +0200, Pavel Machek wrote:
> diff --git a/Documentation/devicetree/bindings/media/video-interfaces.txt b/Documentation/devicetree/bindings/media/video-interfaces.txt
> index 852041a..aade681 100644
> --- a/Documentation/devicetree/bindings/media/video-interfaces.txt
> +++ b/Documentation/devicetree/bindings/media/video-interfaces.txt
> @@ -119,6 +119,8 @@ Optional endpoint properties
>    as 0 (normal). This property is valid for serial busses only.
>  - strobe: Whether the clock signal is used as clock (0) or strobe (1). Used
>    with CCP2, for instance.
> +- clock-inv: polarity of clock/strobe signal. 0 - not inverted, 1 - inverted
> +- crc: crc is in use

booleans in DT are not done with <0> and <1>, but as properties without
values. True = property exists, False = property does not exist.

-- Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170816/5d8992fb/attachment.sig>

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

* Re: [PATCH] nokia n900: update dts with camera support
  2017-08-16 20:53       ` Sebastian Reichel
@ 2017-08-16 20:59         ` Pavel Machek
  -1 siblings, 0 replies; 32+ messages in thread
From: Pavel Machek @ 2017-08-16 20:59 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Sakari Ailus, pali.rohar, kernel list, linux-arm-kernel,
	linux-omap, tony, khilman, aaro.koskinen, ivo.g.dimitrov.75,
	patrikbachan, serge, abcloriens

> Hi,
> 
> On Wed, Aug 16, 2017 at 12:03:49AM +0200, Pavel Machek wrote:
> > diff --git a/Documentation/devicetree/bindings/media/video-interfaces.txt b/Documentation/devicetree/bindings/media/video-interfaces.txt
> > index 852041a..aade681 100644
> > --- a/Documentation/devicetree/bindings/media/video-interfaces.txt
> > +++ b/Documentation/devicetree/bindings/media/video-interfaces.txt
> > @@ -119,6 +119,8 @@ Optional endpoint properties
> >    as 0 (normal). This property is valid for serial busses only.
> >  - strobe: Whether the clock signal is used as clock (0) or strobe (1). Used
> >    with CCP2, for instance.
> > +- clock-inv: polarity of clock/strobe signal. 0 - not inverted, 1 - inverted
> > +- crc: crc is in use
> 
> booleans in DT are not done with <0> and <1>, but as properties without
> values. True = property exists, False = property does not exist.

Well, strobe property above already uses = <0>/<1> format, as do
others.

Problem with "false = property does not exist" is that you don't know
if it is "someone forgot to define it" or "someone made a typo" or
"dts is too old to know about this property" or "the property indeed
should be false"...
									Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

* [PATCH] nokia n900: update dts with camera support
@ 2017-08-16 20:59         ` Pavel Machek
  0 siblings, 0 replies; 32+ messages in thread
From: Pavel Machek @ 2017-08-16 20:59 UTC (permalink / raw)
  To: linux-arm-kernel

> Hi,
> 
> On Wed, Aug 16, 2017 at 12:03:49AM +0200, Pavel Machek wrote:
> > diff --git a/Documentation/devicetree/bindings/media/video-interfaces.txt b/Documentation/devicetree/bindings/media/video-interfaces.txt
> > index 852041a..aade681 100644
> > --- a/Documentation/devicetree/bindings/media/video-interfaces.txt
> > +++ b/Documentation/devicetree/bindings/media/video-interfaces.txt
> > @@ -119,6 +119,8 @@ Optional endpoint properties
> >    as 0 (normal). This property is valid for serial busses only.
> >  - strobe: Whether the clock signal is used as clock (0) or strobe (1). Used
> >    with CCP2, for instance.
> > +- clock-inv: polarity of clock/strobe signal. 0 - not inverted, 1 - inverted
> > +- crc: crc is in use
> 
> booleans in DT are not done with <0> and <1>, but as properties without
> values. True = property exists, False = property does not exist.

Well, strobe property above already uses = <0>/<1> format, as do
others.

Problem with "false = property does not exist" is that you don't know
if it is "someone forgot to define it" or "someone made a typo" or
"dts is too old to know about this property" or "the property indeed
should be false"...
									Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

* Re: [PATCH] nokia n900: update dts with camera support
  2017-08-16 20:59         ` Pavel Machek
@ 2017-08-16 21:23           ` Sakari Ailus
  -1 siblings, 0 replies; 32+ messages in thread
From: Sakari Ailus @ 2017-08-16 21:23 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Sebastian Reichel, pali.rohar, kernel list, linux-arm-kernel,
	linux-omap, tony, khilman, aaro.koskinen, ivo.g.dimitrov.75,
	patrikbachan, serge, abcloriens

On Wed, Aug 16, 2017 at 10:59:15PM +0200, Pavel Machek wrote:
> > Hi,
> > 
> > On Wed, Aug 16, 2017 at 12:03:49AM +0200, Pavel Machek wrote:
> > > diff --git a/Documentation/devicetree/bindings/media/video-interfaces.txt b/Documentation/devicetree/bindings/media/video-interfaces.txt
> > > index 852041a..aade681 100644
> > > --- a/Documentation/devicetree/bindings/media/video-interfaces.txt
> > > +++ b/Documentation/devicetree/bindings/media/video-interfaces.txt
> > > @@ -119,6 +119,8 @@ Optional endpoint properties
> > >    as 0 (normal). This property is valid for serial busses only.
> > >  - strobe: Whether the clock signal is used as clock (0) or strobe (1). Used
> > >    with CCP2, for instance.
> > > +- clock-inv: polarity of clock/strobe signal. 0 - not inverted, 1 - inverted
> > > +- crc: crc is in use
> > 
> > booleans in DT are not done with <0> and <1>, but as properties without
> > values. True = property exists, False = property does not exist.

Now that you mention it, I remember that now.

> 
> Well, strobe property above already uses = <0>/<1> format, as do
> others.
> 
> Problem with "false = property does not exist" is that you don't know
> if it is "someone forgot to define it" or "someone made a typo" or
> "dts is too old to know about this property" or "the property indeed
> should be false"...

As this is an established practice, I think we should follow it for bool
properties.

We could change the existing ones, too, and leave some extra checks in
place to handle old dtbs.

-- 
Regards,

Sakari Ailus
e-mail: sakari.ailus@iki.fi

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

* [PATCH] nokia n900: update dts with camera support
@ 2017-08-16 21:23           ` Sakari Ailus
  0 siblings, 0 replies; 32+ messages in thread
From: Sakari Ailus @ 2017-08-16 21:23 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Aug 16, 2017 at 10:59:15PM +0200, Pavel Machek wrote:
> > Hi,
> > 
> > On Wed, Aug 16, 2017 at 12:03:49AM +0200, Pavel Machek wrote:
> > > diff --git a/Documentation/devicetree/bindings/media/video-interfaces.txt b/Documentation/devicetree/bindings/media/video-interfaces.txt
> > > index 852041a..aade681 100644
> > > --- a/Documentation/devicetree/bindings/media/video-interfaces.txt
> > > +++ b/Documentation/devicetree/bindings/media/video-interfaces.txt
> > > @@ -119,6 +119,8 @@ Optional endpoint properties
> > >    as 0 (normal). This property is valid for serial busses only.
> > >  - strobe: Whether the clock signal is used as clock (0) or strobe (1). Used
> > >    with CCP2, for instance.
> > > +- clock-inv: polarity of clock/strobe signal. 0 - not inverted, 1 - inverted
> > > +- crc: crc is in use
> > 
> > booleans in DT are not done with <0> and <1>, but as properties without
> > values. True = property exists, False = property does not exist.

Now that you mention it, I remember that now.

> 
> Well, strobe property above already uses = <0>/<1> format, as do
> others.
> 
> Problem with "false = property does not exist" is that you don't know
> if it is "someone forgot to define it" or "someone made a typo" or
> "dts is too old to know about this property" or "the property indeed
> should be false"...

As this is an established practice, I think we should follow it for bool
properties.

We could change the existing ones, too, and leave some extra checks in
place to handle old dtbs.

-- 
Regards,

Sakari Ailus
e-mail: sakari.ailus at iki.fi

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

* Re: [PATCH] nokia n900: update dts with camera support
  2017-08-16 21:23           ` Sakari Ailus
@ 2017-08-17  0:08             ` Sebastian Reichel
  -1 siblings, 0 replies; 32+ messages in thread
From: Sebastian Reichel @ 2017-08-17  0:08 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: Pavel Machek, pali.rohar, kernel list, linux-arm-kernel,
	linux-omap, tony, khilman, aaro.koskinen, ivo.g.dimitrov.75,
	patrikbachan, serge, abcloriens

[-- Attachment #1: Type: text/plain, Size: 1947 bytes --]

Hi,

On Thu, Aug 17, 2017 at 12:23:44AM +0300, Sakari Ailus wrote:
> On Wed, Aug 16, 2017 at 10:59:15PM +0200, Pavel Machek wrote:
> > > On Wed, Aug 16, 2017 at 12:03:49AM +0200, Pavel Machek wrote:
> > > > diff --git a/Documentation/devicetree/bindings/media/video-interfaces.txt b/Documentation/devicetree/bindings/media/video-interfaces.txt
> > > > index 852041a..aade681 100644
> > > > --- a/Documentation/devicetree/bindings/media/video-interfaces.txt
> > > > +++ b/Documentation/devicetree/bindings/media/video-interfaces.txt
> > > > @@ -119,6 +119,8 @@ Optional endpoint properties
> > > >    as 0 (normal). This property is valid for serial busses only.
> > > >  - strobe: Whether the clock signal is used as clock (0) or strobe (1). Used
> > > >    with CCP2, for instance.
> > > > +- clock-inv: polarity of clock/strobe signal. 0 - not inverted, 1 - inverted
> > > > +- crc: crc is in use
> > > 
> > > booleans in DT are not done with <0> and <1>, but as properties without
> > > values. True = property exists, False = property does not exist.
> 
> Now that you mention it, I remember that now.
> 
> > Well, strobe property above already uses = <0>/<1> format, as do
> > others.
>
> > Problem with "false = property does not exist" is that you don't know
> > if it is "someone forgot to define it" or "someone made a typo" or
> > "dts is too old to know about this property" or "the property indeed
> > should be false"...
>
> As this is an established practice, I think we should follow it for bool
> properties.

Yes it's common practice, there is also device_property_read_bool()
to get the value.

> We could change the existing ones, too, and leave some extra checks in
> place to handle old dtbs.

The following should be downward compatible:

var = read_bool();
if (var && !read_int())
    var = false;

Btw. DT people should be CC'd for DT binding additions/changes.

-- Sebastian

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* [PATCH] nokia n900: update dts with camera support
@ 2017-08-17  0:08             ` Sebastian Reichel
  0 siblings, 0 replies; 32+ messages in thread
From: Sebastian Reichel @ 2017-08-17  0:08 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Thu, Aug 17, 2017 at 12:23:44AM +0300, Sakari Ailus wrote:
> On Wed, Aug 16, 2017 at 10:59:15PM +0200, Pavel Machek wrote:
> > > On Wed, Aug 16, 2017 at 12:03:49AM +0200, Pavel Machek wrote:
> > > > diff --git a/Documentation/devicetree/bindings/media/video-interfaces.txt b/Documentation/devicetree/bindings/media/video-interfaces.txt
> > > > index 852041a..aade681 100644
> > > > --- a/Documentation/devicetree/bindings/media/video-interfaces.txt
> > > > +++ b/Documentation/devicetree/bindings/media/video-interfaces.txt
> > > > @@ -119,6 +119,8 @@ Optional endpoint properties
> > > >    as 0 (normal). This property is valid for serial busses only.
> > > >  - strobe: Whether the clock signal is used as clock (0) or strobe (1). Used
> > > >    with CCP2, for instance.
> > > > +- clock-inv: polarity of clock/strobe signal. 0 - not inverted, 1 - inverted
> > > > +- crc: crc is in use
> > > 
> > > booleans in DT are not done with <0> and <1>, but as properties without
> > > values. True = property exists, False = property does not exist.
> 
> Now that you mention it, I remember that now.
> 
> > Well, strobe property above already uses = <0>/<1> format, as do
> > others.
>
> > Problem with "false = property does not exist" is that you don't know
> > if it is "someone forgot to define it" or "someone made a typo" or
> > "dts is too old to know about this property" or "the property indeed
> > should be false"...
>
> As this is an established practice, I think we should follow it for bool
> properties.

Yes it's common practice, there is also device_property_read_bool()
to get the value.

> We could change the existing ones, too, and leave some extra checks in
> place to handle old dtbs.

The following should be downward compatible:

var = read_bool();
if (var && !read_int())
    var = false;

Btw. DT people should be CC'd for DT binding additions/changes.

-- Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170817/a2106f21/attachment.sig>

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

* Re: [PATCH] nokia n900: update dts with camera support
  2017-08-17  0:08             ` Sebastian Reichel
@ 2017-08-17  6:20               ` Sakari Ailus
  -1 siblings, 0 replies; 32+ messages in thread
From: Sakari Ailus @ 2017-08-17  6:20 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Pavel Machek, pali.rohar, kernel list, linux-arm-kernel,
	linux-omap, tony, khilman, aaro.koskinen, ivo.g.dimitrov.75,
	patrikbachan, serge, abcloriens

Sebastian Reichel wrote:
> Hi,
> 
> On Thu, Aug 17, 2017 at 12:23:44AM +0300, Sakari Ailus wrote:
>> On Wed, Aug 16, 2017 at 10:59:15PM +0200, Pavel Machek wrote:
>>>> On Wed, Aug 16, 2017 at 12:03:49AM +0200, Pavel Machek wrote:
>>>>> diff --git a/Documentation/devicetree/bindings/media/video-interfaces.txt b/Documentation/devicetree/bindings/media/video-interfaces.txt
>>>>> index 852041a..aade681 100644
>>>>> --- a/Documentation/devicetree/bindings/media/video-interfaces.txt
>>>>> +++ b/Documentation/devicetree/bindings/media/video-interfaces.txt
>>>>> @@ -119,6 +119,8 @@ Optional endpoint properties
>>>>>    as 0 (normal). This property is valid for serial busses only.
>>>>>  - strobe: Whether the clock signal is used as clock (0) or strobe (1). Used
>>>>>    with CCP2, for instance.
>>>>> +- clock-inv: polarity of clock/strobe signal. 0 - not inverted, 1 - inverted
>>>>> +- crc: crc is in use
>>>>
>>>> booleans in DT are not done with <0> and <1>, but as properties without
>>>> values. True = property exists, False = property does not exist.
>>
>> Now that you mention it, I remember that now.
>>
>>> Well, strobe property above already uses = <0>/<1> format, as do
>>> others.
>>
>>> Problem with "false = property does not exist" is that you don't know
>>> if it is "someone forgot to define it" or "someone made a typo" or
>>> "dts is too old to know about this property" or "the property indeed
>>> should be false"...
>>
>> As this is an established practice, I think we should follow it for bool
>> properties.
> 
> Yes it's common practice, there is also device_property_read_bool()
> to get the value.
> 
>> We could change the existing ones, too, and leave some extra checks in
>> place to handle old dtbs.
> 
> The following should be downward compatible:
> 
> var = read_bool();
> if (var && !read_int())
>     var = false;
> 
> Btw. DT people should be CC'd for DT binding additions/changes.

Pavel: could you also add linux-media as well for the next version, please?

-- 
Sakari Ailus
sakari.ailus@iki.fi

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

* [PATCH] nokia n900: update dts with camera support
@ 2017-08-17  6:20               ` Sakari Ailus
  0 siblings, 0 replies; 32+ messages in thread
From: Sakari Ailus @ 2017-08-17  6:20 UTC (permalink / raw)
  To: linux-arm-kernel

Sebastian Reichel wrote:
> Hi,
> 
> On Thu, Aug 17, 2017 at 12:23:44AM +0300, Sakari Ailus wrote:
>> On Wed, Aug 16, 2017 at 10:59:15PM +0200, Pavel Machek wrote:
>>>> On Wed, Aug 16, 2017 at 12:03:49AM +0200, Pavel Machek wrote:
>>>>> diff --git a/Documentation/devicetree/bindings/media/video-interfaces.txt b/Documentation/devicetree/bindings/media/video-interfaces.txt
>>>>> index 852041a..aade681 100644
>>>>> --- a/Documentation/devicetree/bindings/media/video-interfaces.txt
>>>>> +++ b/Documentation/devicetree/bindings/media/video-interfaces.txt
>>>>> @@ -119,6 +119,8 @@ Optional endpoint properties
>>>>>    as 0 (normal). This property is valid for serial busses only.
>>>>>  - strobe: Whether the clock signal is used as clock (0) or strobe (1). Used
>>>>>    with CCP2, for instance.
>>>>> +- clock-inv: polarity of clock/strobe signal. 0 - not inverted, 1 - inverted
>>>>> +- crc: crc is in use
>>>>
>>>> booleans in DT are not done with <0> and <1>, but as properties without
>>>> values. True = property exists, False = property does not exist.
>>
>> Now that you mention it, I remember that now.
>>
>>> Well, strobe property above already uses = <0>/<1> format, as do
>>> others.
>>
>>> Problem with "false = property does not exist" is that you don't know
>>> if it is "someone forgot to define it" or "someone made a typo" or
>>> "dts is too old to know about this property" or "the property indeed
>>> should be false"...
>>
>> As this is an established practice, I think we should follow it for bool
>> properties.
> 
> Yes it's common practice, there is also device_property_read_bool()
> to get the value.
> 
>> We could change the existing ones, too, and leave some extra checks in
>> place to handle old dtbs.
> 
> The following should be downward compatible:
> 
> var = read_bool();
> if (var && !read_int())
>     var = false;
> 
> Btw. DT people should be CC'd for DT binding additions/changes.

Pavel: could you also add linux-media as well for the next version, please?

-- 
Sakari Ailus
sakari.ailus at iki.fi

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

* [PATCH] nokia n900: drop unneeded/undocumented parts of the dts
  2017-08-14 20:19   ` Sakari Ailus
@ 2017-08-28 13:18     ` Pavel Machek
  -1 siblings, 0 replies; 32+ messages in thread
From: Pavel Machek @ 2017-08-28 13:18 UTC (permalink / raw)
  To: Sakari Ailus, sakari.ailus
  Cc: pali.rohar, sre, kernel list, linux-arm-kernel, linux-omap, tony,
	khilman, aaro.koskinen, ivo.g.dimitrov.75, patrikbachan, serge,
	abcloriens

[-- Attachment #1: Type: text/plain, Size: 987 bytes --]


Sakari mentioned that some parts of the dts are not needed and do
not have proper documentation, yet.

As the camera works without them, remove them for now.

Signed-off-by: Pavel Machek <pavel@ucw.cz>

--- a/arch/arm/boot/dts/omap3-n900.dts
+++ b/arch/arm/boot/dts/omap3-n900.dts
@@ -144,15 +144,6 @@
 		io-channel-names = "temp", "bsi", "vbat";
 	};
 
-	rear_camera: camera@0 {
-		compatible = "linux,camera";
-
-		module {
-			model = "TCM8341MD";
-			sensor = <&cam1>;
-		};
-	};
-
 	pwm9: dmtimer-pwm {
 		compatible = "ti,omap-dmtimer-pwm";
 		#pwm-cells = <3>;
@@ -189,10 +180,8 @@
 				clock-lanes = <1>;
 				data-lanes = <0>;
 				lane-polarity = <0 0>;
-				clock-inv = <0>;
 				/* Select strobe = <1> for back camera, <0> for front camera */
 				strobe = <1>;
-				crc = <0>;
 			};
 		};
 	};

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

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

* [PATCH] nokia n900: drop unneeded/undocumented parts of the dts
@ 2017-08-28 13:18     ` Pavel Machek
  0 siblings, 0 replies; 32+ messages in thread
From: Pavel Machek @ 2017-08-28 13:18 UTC (permalink / raw)
  To: linux-arm-kernel


Sakari mentioned that some parts of the dts are not needed and do
not have proper documentation, yet.

As the camera works without them, remove them for now.

Signed-off-by: Pavel Machek <pavel@ucw.cz>

--- a/arch/arm/boot/dts/omap3-n900.dts
+++ b/arch/arm/boot/dts/omap3-n900.dts
@@ -144,15 +144,6 @@
 		io-channel-names = "temp", "bsi", "vbat";
 	};
 
-	rear_camera: camera at 0 {
-		compatible = "linux,camera";
-
-		module {
-			model = "TCM8341MD";
-			sensor = <&cam1>;
-		};
-	};
-
 	pwm9: dmtimer-pwm {
 		compatible = "ti,omap-dmtimer-pwm";
 		#pwm-cells = <3>;
@@ -189,10 +180,8 @@
 				clock-lanes = <1>;
 				data-lanes = <0>;
 				lane-polarity = <0 0>;
-				clock-inv = <0>;
 				/* Select strobe = <1> for back camera, <0> for front camera */
 				strobe = <1>;
-				crc = <0>;
 			};
 		};
 	};

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170828/0bd7ef9c/attachment.sig>

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

* Re: [PATCH] nokia n900: update dts with camera support
  2017-08-17  0:08             ` Sebastian Reichel
@ 2017-08-28 13:59               ` Pavel Machek
  -1 siblings, 0 replies; 32+ messages in thread
From: Pavel Machek @ 2017-08-28 13:59 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Sakari Ailus, pali.rohar, kernel list, linux-arm-kernel,
	linux-omap, tony, khilman, aaro.koskinen, ivo.g.dimitrov.75,
	patrikbachan, serge, abcloriens

[-- Attachment #1: Type: text/plain, Size: 1476 bytes --]

Hi!

> > > Well, strobe property above already uses = <0>/<1> format, as do
> > > others.
> >
> > > Problem with "false = property does not exist" is that you don't know
> > > if it is "someone forgot to define it" or "someone made a typo" or
> > > "dts is too old to know about this property" or "the property indeed
> > > should be false"...
> >
> > As this is an established practice, I think we should follow it for bool
> > properties.
> 
> Yes it's common practice, there is also device_property_read_bool()
> to get the value.
> 
> > We could change the existing ones, too, and leave some extra checks in
> > place to handle old dtbs.
> 
> The following should be downward compatible:
> 
> var = read_bool();
> if (var && !read_int())
>     var = false;
> 
> Btw. DT people should be CC'd for DT binding additions/changes.

Ok, so for now we do crc=1 by default. Now we'd like to have crc
support configurable in the dts. But if we just introduce "crc;"
option, it will break old dts users. We could introduce "no-crc;" and
that would work in this particular case, but will break when we want
different defaults at different devices.

Anyway, introducing "no-crc;" seems pretty ugly to me. I'd rather do
"crc=<0>;", in a similar way we handle other options now.

Best regards,
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

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

* [PATCH] nokia n900: update dts with camera support
@ 2017-08-28 13:59               ` Pavel Machek
  0 siblings, 0 replies; 32+ messages in thread
From: Pavel Machek @ 2017-08-28 13:59 UTC (permalink / raw)
  To: linux-arm-kernel

Hi!

> > > Well, strobe property above already uses = <0>/<1> format, as do
> > > others.
> >
> > > Problem with "false = property does not exist" is that you don't know
> > > if it is "someone forgot to define it" or "someone made a typo" or
> > > "dts is too old to know about this property" or "the property indeed
> > > should be false"...
> >
> > As this is an established practice, I think we should follow it for bool
> > properties.
> 
> Yes it's common practice, there is also device_property_read_bool()
> to get the value.
> 
> > We could change the existing ones, too, and leave some extra checks in
> > place to handle old dtbs.
> 
> The following should be downward compatible:
> 
> var = read_bool();
> if (var && !read_int())
>     var = false;
> 
> Btw. DT people should be CC'd for DT binding additions/changes.

Ok, so for now we do crc=1 by default. Now we'd like to have crc
support configurable in the dts. But if we just introduce "crc;"
option, it will break old dts users. We could introduce "no-crc;" and
that would work in this particular case, but will break when we want
different defaults at different devices.

Anyway, introducing "no-crc;" seems pretty ugly to me. I'd rather do
"crc=<0>;", in a similar way we handle other options now.

Best regards,
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170828/99e52bf9/attachment.sig>

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

* Re: [PATCH] nokia n900: update dts with camera support
  2017-08-28 13:59               ` Pavel Machek
@ 2017-08-28 15:07                 ` Sakari Ailus
  -1 siblings, 0 replies; 32+ messages in thread
From: Sakari Ailus @ 2017-08-28 15:07 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Sebastian Reichel, pali.rohar, kernel list, linux-arm-kernel,
	linux-omap, tony, khilman, aaro.koskinen, ivo.g.dimitrov.75,
	patrikbachan, serge, abcloriens

Hi Pavel,

On Mon, Aug 28, 2017 at 03:59:59PM +0200, Pavel Machek wrote:
> Hi!
> 
> > > > Well, strobe property above already uses = <0>/<1> format, as do
> > > > others.
> > >
> > > > Problem with "false = property does not exist" is that you don't know
> > > > if it is "someone forgot to define it" or "someone made a typo" or
> > > > "dts is too old to know about this property" or "the property indeed
> > > > should be false"...
> > >
> > > As this is an established practice, I think we should follow it for bool
> > > properties.
> > 
> > Yes it's common practice, there is also device_property_read_bool()
> > to get the value.
> > 
> > > We could change the existing ones, too, and leave some extra checks in
> > > place to handle old dtbs.
> > 
> > The following should be downward compatible:
> > 
> > var = read_bool();
> > if (var && !read_int())
> >     var = false;
> > 
> > Btw. DT people should be CC'd for DT binding additions/changes.
> 
> Ok, so for now we do crc=1 by default. Now we'd like to have crc
> support configurable in the dts. But if we just introduce "crc;"
> option, it will break old dts users. We could introduce "no-crc;" and
> that would work in this particular case, but will break when we want
> different defaults at different devices.
> 
> Anyway, introducing "no-crc;" seems pretty ugly to me. I'd rather do
> "crc=<0>;", in a similar way we handle other options now.

The same issue actually exists for CSI-2: the CRC is typically enabled and
I think you can at least disable the check (in OMAP3 ISP). Do we have a
need to disable it at the moment for any purpose? I think I've seen this
was disabled somewhere but it may just as well be a thoughtlessly written
configuration.

-- 
Regards,

Sakari Ailus
e-mail: sakari.ailus@iki.fi

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

* [PATCH] nokia n900: update dts with camera support
@ 2017-08-28 15:07                 ` Sakari Ailus
  0 siblings, 0 replies; 32+ messages in thread
From: Sakari Ailus @ 2017-08-28 15:07 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Pavel,

On Mon, Aug 28, 2017 at 03:59:59PM +0200, Pavel Machek wrote:
> Hi!
> 
> > > > Well, strobe property above already uses = <0>/<1> format, as do
> > > > others.
> > >
> > > > Problem with "false = property does not exist" is that you don't know
> > > > if it is "someone forgot to define it" or "someone made a typo" or
> > > > "dts is too old to know about this property" or "the property indeed
> > > > should be false"...
> > >
> > > As this is an established practice, I think we should follow it for bool
> > > properties.
> > 
> > Yes it's common practice, there is also device_property_read_bool()
> > to get the value.
> > 
> > > We could change the existing ones, too, and leave some extra checks in
> > > place to handle old dtbs.
> > 
> > The following should be downward compatible:
> > 
> > var = read_bool();
> > if (var && !read_int())
> >     var = false;
> > 
> > Btw. DT people should be CC'd for DT binding additions/changes.
> 
> Ok, so for now we do crc=1 by default. Now we'd like to have crc
> support configurable in the dts. But if we just introduce "crc;"
> option, it will break old dts users. We could introduce "no-crc;" and
> that would work in this particular case, but will break when we want
> different defaults at different devices.
> 
> Anyway, introducing "no-crc;" seems pretty ugly to me. I'd rather do
> "crc=<0>;", in a similar way we handle other options now.

The same issue actually exists for CSI-2: the CRC is typically enabled and
I think you can at least disable the check (in OMAP3 ISP). Do we have a
need to disable it at the moment for any purpose? I think I've seen this
was disabled somewhere but it may just as well be a thoughtlessly written
configuration.

-- 
Regards,

Sakari Ailus
e-mail: sakari.ailus at iki.fi

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

* Re: [PATCH] nokia n900: update dts with camera support
  2017-08-28 15:07                 ` Sakari Ailus
@ 2017-08-28 18:20                   ` Ivaylo Dimitrov
  -1 siblings, 0 replies; 32+ messages in thread
From: Ivaylo Dimitrov @ 2017-08-28 18:20 UTC (permalink / raw)
  To: Sakari Ailus, Pavel Machek
  Cc: Sebastian Reichel, pali.rohar, kernel list, linux-arm-kernel,
	linux-omap, tony, khilman, aaro.koskinen, patrikbachan, serge,
	abcloriens

Hi

On 28.08.2017 18:07, Sakari Ailus wrote:
> Hi Pavel,
> 
> On Mon, Aug 28, 2017 at 03:59:59PM +0200, Pavel Machek wrote:
>> Hi!
>>
>>>>> Well, strobe property above already uses = <0>/<1> format, as do
>>>>> others.
>>>>
>>>>> Problem with "false = property does not exist" is that you don't know
>>>>> if it is "someone forgot to define it" or "someone made a typo" or
>>>>> "dts is too old to know about this property" or "the property indeed
>>>>> should be false"...
>>>>
>>>> As this is an established practice, I think we should follow it for bool
>>>> properties.
>>>
>>> Yes it's common practice, there is also device_property_read_bool()
>>> to get the value.
>>>
>>>> We could change the existing ones, too, and leave some extra checks in
>>>> place to handle old dtbs.
>>>
>>> The following should be downward compatible:
>>>
>>> var = read_bool();
>>> if (var && !read_int())
>>>      var = false;
>>>
>>> Btw. DT people should be CC'd for DT binding additions/changes.
>>
>> Ok, so for now we do crc=1 by default. Now we'd like to have crc
>> support configurable in the dts. But if we just introduce "crc;"
>> option, it will break old dts users. We could introduce "no-crc;" and
>> that would work in this particular case, but will break when we want
>> different defaults at different devices.
>>
>> Anyway, introducing "no-crc;" seems pretty ugly to me. I'd rather do
>> "crc=<0>;", in a similar way we handle other options now.
> 
> The same issue actually exists for CSI-2: the CRC is typically enabled and
> I think you can at least disable the check (in OMAP3 ISP). Do we have a
> need to disable it at the moment for any purpose? I think I've seen this
> was disabled somewhere but it may just as well be a thoughtlessly written
> configuration.
> 

Front camera has crc disabled in Nokia kernel. I am not sure the sensor 
supports crc at all.

Regards,
Ivo

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

* [PATCH] nokia n900: update dts with camera support
@ 2017-08-28 18:20                   ` Ivaylo Dimitrov
  0 siblings, 0 replies; 32+ messages in thread
From: Ivaylo Dimitrov @ 2017-08-28 18:20 UTC (permalink / raw)
  To: linux-arm-kernel

Hi

On 28.08.2017 18:07, Sakari Ailus wrote:
> Hi Pavel,
> 
> On Mon, Aug 28, 2017 at 03:59:59PM +0200, Pavel Machek wrote:
>> Hi!
>>
>>>>> Well, strobe property above already uses = <0>/<1> format, as do
>>>>> others.
>>>>
>>>>> Problem with "false = property does not exist" is that you don't know
>>>>> if it is "someone forgot to define it" or "someone made a typo" or
>>>>> "dts is too old to know about this property" or "the property indeed
>>>>> should be false"...
>>>>
>>>> As this is an established practice, I think we should follow it for bool
>>>> properties.
>>>
>>> Yes it's common practice, there is also device_property_read_bool()
>>> to get the value.
>>>
>>>> We could change the existing ones, too, and leave some extra checks in
>>>> place to handle old dtbs.
>>>
>>> The following should be downward compatible:
>>>
>>> var = read_bool();
>>> if (var && !read_int())
>>>      var = false;
>>>
>>> Btw. DT people should be CC'd for DT binding additions/changes.
>>
>> Ok, so for now we do crc=1 by default. Now we'd like to have crc
>> support configurable in the dts. But if we just introduce "crc;"
>> option, it will break old dts users. We could introduce "no-crc;" and
>> that would work in this particular case, but will break when we want
>> different defaults at different devices.
>>
>> Anyway, introducing "no-crc;" seems pretty ugly to me. I'd rather do
>> "crc=<0>;", in a similar way we handle other options now.
> 
> The same issue actually exists for CSI-2: the CRC is typically enabled and
> I think you can at least disable the check (in OMAP3 ISP). Do we have a
> need to disable it at the moment for any purpose? I think I've seen this
> was disabled somewhere but it may just as well be a thoughtlessly written
> configuration.
> 

Front camera has crc disabled in Nokia kernel. I am not sure the sensor 
supports crc at all.

Regards,
Ivo

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

* Re: [PATCH] nokia n900: drop unneeded/undocumented parts of the dts
  2017-08-28 13:18     ` Pavel Machek
@ 2017-09-19 17:42       ` Tony Lindgren
  -1 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2017-09-19 17:42 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Sakari Ailus, sakari.ailus, pali.rohar, sre, kernel list,
	linux-arm-kernel, linux-omap, khilman, aaro.koskinen,
	ivo.g.dimitrov.75, patrikbachan, serge, abcloriens

* Pavel Machek <pavel@ucw.cz> [170828 06:18]:
> 
> Sakari mentioned that some parts of the dts are not needed and do
> not have proper documentation, yet.
> 
> As the camera works without them, remove them for now.
> 
> Signed-off-by: Pavel Machek <pavel@ucw.cz>

Applying into omap-for-v4.14/fixes to correct what already
got merged during the merge window.

Regards,

Tony

> --- a/arch/arm/boot/dts/omap3-n900.dts
> +++ b/arch/arm/boot/dts/omap3-n900.dts
> @@ -144,15 +144,6 @@
>  		io-channel-names = "temp", "bsi", "vbat";
>  	};
>  
> -	rear_camera: camera@0 {
> -		compatible = "linux,camera";
> -
> -		module {
> -			model = "TCM8341MD";
> -			sensor = <&cam1>;
> -		};
> -	};
> -
>  	pwm9: dmtimer-pwm {
>  		compatible = "ti,omap-dmtimer-pwm";
>  		#pwm-cells = <3>;
> @@ -189,10 +180,8 @@
>  				clock-lanes = <1>;
>  				data-lanes = <0>;
>  				lane-polarity = <0 0>;
> -				clock-inv = <0>;
>  				/* Select strobe = <1> for back camera, <0> for front camera */
>  				strobe = <1>;
> -				crc = <0>;
>  			};
>  		};
>  	};
> 
> -- 
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

* [PATCH] nokia n900: drop unneeded/undocumented parts of the dts
@ 2017-09-19 17:42       ` Tony Lindgren
  0 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2017-09-19 17:42 UTC (permalink / raw)
  To: linux-arm-kernel

* Pavel Machek <pavel@ucw.cz> [170828 06:18]:
> 
> Sakari mentioned that some parts of the dts are not needed and do
> not have proper documentation, yet.
> 
> As the camera works without them, remove them for now.
> 
> Signed-off-by: Pavel Machek <pavel@ucw.cz>

Applying into omap-for-v4.14/fixes to correct what already
got merged during the merge window.

Regards,

Tony

> --- a/arch/arm/boot/dts/omap3-n900.dts
> +++ b/arch/arm/boot/dts/omap3-n900.dts
> @@ -144,15 +144,6 @@
>  		io-channel-names = "temp", "bsi", "vbat";
>  	};
>  
> -	rear_camera: camera at 0 {
> -		compatible = "linux,camera";
> -
> -		module {
> -			model = "TCM8341MD";
> -			sensor = <&cam1>;
> -		};
> -	};
> -
>  	pwm9: dmtimer-pwm {
>  		compatible = "ti,omap-dmtimer-pwm";
>  		#pwm-cells = <3>;
> @@ -189,10 +180,8 @@
>  				clock-lanes = <1>;
>  				data-lanes = <0>;
>  				lane-polarity = <0 0>;
> -				clock-inv = <0>;
>  				/* Select strobe = <1> for back camera, <0> for front camera */
>  				strobe = <1>;
> -				crc = <0>;
>  			};
>  		};
>  	};
> 
> -- 
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

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

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-10 20:49 [PATCH] nokia n900: update dts with camera support Pavel Machek
2017-08-10 20:49 ` Pavel Machek
2017-08-13 15:37 ` Pali Rohár
2017-08-13 15:37   ` Pali Rohár
2017-08-14 17:49   ` Tony Lindgren
2017-08-14 17:49     ` Tony Lindgren
2017-08-14 20:19 ` Sakari Ailus
2017-08-14 20:19   ` Sakari Ailus
2017-08-14 20:33   ` Tony Lindgren
2017-08-14 20:33     ` Tony Lindgren
2017-08-15 22:03   ` Pavel Machek
2017-08-15 22:03     ` Pavel Machek
2017-08-16 20:53     ` Sebastian Reichel
2017-08-16 20:53       ` Sebastian Reichel
2017-08-16 20:59       ` Pavel Machek
2017-08-16 20:59         ` Pavel Machek
2017-08-16 21:23         ` Sakari Ailus
2017-08-16 21:23           ` Sakari Ailus
2017-08-17  0:08           ` Sebastian Reichel
2017-08-17  0:08             ` Sebastian Reichel
2017-08-17  6:20             ` Sakari Ailus
2017-08-17  6:20               ` Sakari Ailus
2017-08-28 13:59             ` Pavel Machek
2017-08-28 13:59               ` Pavel Machek
2017-08-28 15:07               ` Sakari Ailus
2017-08-28 15:07                 ` Sakari Ailus
2017-08-28 18:20                 ` Ivaylo Dimitrov
2017-08-28 18:20                   ` Ivaylo Dimitrov
2017-08-28 13:18   ` [PATCH] nokia n900: drop unneeded/undocumented parts of the dts Pavel Machek
2017-08-28 13:18     ` Pavel Machek
2017-09-19 17:42     ` Tony Lindgren
2017-09-19 17:42       ` Tony Lindgren

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.