Skip to contentSkip to conversation

imx214: device tree binding

PATCH Superseded Ricardo Ribalda Delgado 3 participants 5 messages Oct 5, 2018

Subsystems (4)

v8 of 11 Superseded Latest is v11 →

lore
Share & tools
lore
#0 lore raw

PATCH v8 1/3 imx214: device tree binding

From: Ricardo Ribalda <[email protected]>

Document bindings for imx214 camera sensor

---
 .../devicetree/bindings/media/i2c/imx214.txt  | 53 +++++++++++++++++++
 1 file changed, 53 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/imx214.txt
Documentation/devicetree/bindings/media/i2c/imx214.txt new file +53 -0
new file mode 100644
index 000000000000..421a019ab7f9
@@ -0,0 +1,53 @@
+* Sony 1/3.06-Inch 13.13Mp CMOS Digital Image Sensor
+
+The Sony imx214 is a 1/3.06-inch CMOS active pixel digital image sensor with
+an active array size of 4224H x 3200V. It is programmable through an I2C
+interface. The I2C address can be configured to 0x1a or 0x10, depending on
+how the hardware is wired.
+Image data is sent through MIPI CSI-2, through 2 or 4 lanes at a maximum
+throughput of 1.2Gbps/lane.
+
+
+Required Properties:
+- compatible: value should be "sony,imx214" for imx214 sensor
+- reg: I2C bus address of the device
+- enable-gpios: GPIO descriptor for the enable pin.
+- vdddo-supply: Chip digital IO regulator (1.8V).
+- vdda-supply: Chip analog regulator (2.7V).
+- vddd-supply: Chip digital core regulator (1.12V).
+- clocks: Reference to the xclk clock.
+- clock-names:  Shall be "xclk".
+
+Optional Properties:
+- flash-leds: See ../video-interfaces.txt
+- lens-focus: See ../video-interfaces.txt
+
+The imx214 device node shall contain one 'port' child node with
+an 'endpoint' subnode. For further reading on port node refer to
+Documentation/devicetree/bindings/media/video-interfaces.txt.
+
+Required Properties on endpoint:
+- data-lanes: check ../video-interfaces.txt
+- link-frequencies: check ../video-interfaces.txt
+- remote-endpoint: check ../video-interfaces.txt
+
+Example:
+
+	camera_rear@1a {
+		compatible = "sony,imx214";
+		reg = <0x1a>;
+		vdddo-supply = <&pm8994_lvs1>;
+		vddd-supply = <&camera_vddd_1v12>;
+		vdda-supply = <&pm8994_l17>;
+		lens-focus = <&ad5820>;
+		enable-gpios = <&msmgpio 25 GPIO_ACTIVE_HIGH>;
+		clocks = <&mmcc CAMSS_MCLK0_CLK>;
+		clock-names = "xclk";
+		port {
+			imx214_ep: endpoint {
+				data-lanes = <1 2 3 4>;
+				link-frequencies = /bits/ 64 <480000000>;
+				remote-endpoint = <&csiphy0_ep>;
+			};
+		};
+	};
Signature · 1 line
2.19.0
#1 lore raw

PATCH v8 2/3 imx214: Add imx214 camera sensor driver

Add a V4L2 sub-device driver for the Sony IMX214 image sensor. This is a camera sensor using the I2C bus for control and the CSI-2 bus for data.

Tested on a DB820c alike board with Intrinsyc Open-Q 13MP camera.

---
Changelog from v7:

-remove unused define

Sakari Ailus (Thanks!):
parse_fwnode:
-Do not initialize ret
-goto done
-Do not call ctrl_handler_setup at probe

 MAINTAINERS                |    8 +
 drivers/media/i2c/Kconfig  |   12 +
 drivers/media/i2c/Makefile |    1 +
 drivers/media/i2c/imx214.c | 1116 ++++++++++++++++++++++++++++++++++++
 4 files changed, 1137 insertions(+)
 create mode 100644 drivers/media/i2c/imx214.c
MAINTAINERS +8 -0
index 9989925f658d..2ae68894e700 100644
@@ -13521,6 +13521,14 @@ S:	Maintained
 F:	drivers/ssb/
 F:	include/linux/ssb/
 
+SONY IMX214 SENSOR DRIVER
+M:	Ricardo Ribalda <[email protected]>
+L:	[email protected]
+T:	git git://linuxtv.org/media_tree.git
+S:	Maintained
+F:	drivers/media/i2c/imx214.c
+F:	Documentation/devicetree/bindings/media/i2c/imx214.txt
+
 SONY IMX258 SENSOR DRIVER
 M:	Sakari Ailus <[email protected]>
 L:	[email protected]
drivers/media/i2c/Kconfig +12 -0
index bfdb494686bf..d7e69ca0976c 100644
@@ -595,6 +595,18 @@ config VIDEO_APTINA_PLL
 config VIDEO_SMIAPP_PLL
 	tristate
 
+config VIDEO_IMX214
+	tristate "Sony IMX214 sensor support"
+	depends on GPIOLIB && I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+	depends on MEDIA_CAMERA_SUPPORT
+	depends on V4L2_FWNODE
+	help
+	  This is a Video4Linux2 sensor driver for the Sony
+	  IMX214 camera.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called imx214.
+
 config VIDEO_IMX258
 	tristate "Sony IMX258 sensor support"
 	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
drivers/media/i2c/Makefile +1 -0
index a94eb03d10d4..61305edc6165 100644
@@ -106,6 +106,7 @@ obj-$(CONFIG_VIDEO_I2C)		+= video-i2c.o
 obj-$(CONFIG_VIDEO_ML86V7667)	+= ml86v7667.o
 obj-$(CONFIG_VIDEO_OV2659)	+= ov2659.o
 obj-$(CONFIG_VIDEO_TC358743)	+= tc358743.o
+obj-$(CONFIG_VIDEO_IMX214)	+= imx214.o
 obj-$(CONFIG_VIDEO_IMX258)	+= imx258.o
 obj-$(CONFIG_VIDEO_IMX274)	+= imx274.o
 
drivers/media/i2c/imx214.c new file +1116 -0

1,116 lines not on this page · raw message

Signature · 1 line
2.19.0
#2 lore raw

PATCH v8 3/3 imx214: Fix range for V4L2_CID_EXPOSURE

In reply to Ricardo Ribalda Delgado

Going above 3184 changes the frame-rate of the sensor. Without this patch there is no way to change the exposure without affecting the frame-rate.

With the proper documentation we should be able the change the frame-rate at wish, but until that happens we just cap what the sensor can do.

---
 drivers/media/i2c/imx214.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/imx214.c +1 -1
index 46a2fdfbd049..0b99123161b8 100644
@@ -1027,7 +1027,7 @@ static int imx214_probe(struct i2c_client *client)
 	 */
 	imx214->exposure = v4l2_ctrl_new_std(&imx214->ctrls, &imx214_ctrl_ops,
 					     V4L2_CID_EXPOSURE,
-					     0, 0xffff, 1, 0x0c70);
+					     0, 3184, 1, 0x0c70);
 
 	ret = imx214->ctrls.error;
 	if (ret) {
Signature · 1 line
2.19.0
maintainer
#3 lore raw
In reply to Ricardo Ribalda Delgado
Quoted 7 lines · Ricardo Ribalda Delgado

From: Ricardo Ribalda <[email protected]>

Document bindings for imx214 camera sensor

checkpatch.pl complains that the author and S-o-b don't match.

Quoted 2 lines
---
 .../devicetree/bindings/media/i2c/imx214.txt  | 53 +++++++++++++++++++

sony,imx214.txt is preferred.

Quoted 9 lines
 1 file changed, 53 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/imx214.txt
Documentation/devicetree/bindings/media/i2c/imx214.txt new file +0 -0
new file mode 100644
index 000000000000..421a019ab7f9

Documentation/devicetree/bindings/media/i2c/imx214.txt line 6

Quoted 6 lines
Documentation/devicetree/bindings/media/i2c/imx214.txt new file +6 -0
@@ -0,0 +1,53 @@
+* Sony 1/3.06-Inch 13.13Mp CMOS Digital Image Sensor
+
+The Sony imx214 is a 1/3.06-inch CMOS active pixel digital image sensor with
+an active array size of 4224H x 3200V. It is programmable through an I2C
+interface. The I2C address can be configured to 0x1a or 0x10, depending on
+how the hardware is wired.

Move the addresses to reg description.

Quoted 20 lines
Documentation/devicetree/bindings/media/i2c/imx214.txt new file +20 -0
+Image data is sent through MIPI CSI-2, through 2 or 4 lanes at a maximum
+throughput of 1.2Gbps/lane.
+
+
+Required Properties:
+- compatible: value should be "sony,imx214" for imx214 sensor
+- reg: I2C bus address of the device
+- enable-gpios: GPIO descriptor for the enable pin.
+- vdddo-supply: Chip digital IO regulator (1.8V).
+- vdda-supply: Chip analog regulator (2.7V).
+- vddd-supply: Chip digital core regulator (1.12V).
+- clocks: Reference to the xclk clock.
+- clock-names:  Shall be "xclk".
+
+Optional Properties:
+- flash-leds: See ../video-interfaces.txt
+- lens-focus: See ../video-interfaces.txt
+
+The imx214 device node shall contain one 'port' child node with
+an 'endpoint' subnode. For further reading on port node refer to

Documentation/devicetree/bindings/media/i2c/imx214.txt line 36

Quoted 10 lines
Documentation/devicetree/bindings/media/i2c/imx214.txt new file +10 -0
+Documentation/devicetree/bindings/media/video-interfaces.txt.
+
+Required Properties on endpoint:
+- data-lanes: check ../video-interfaces.txt
+- link-frequencies: check ../video-interfaces.txt
+- remote-endpoint: check ../video-interfaces.txt
+
+Example:
+
+	camera_rear@1a {

camera-sensor@1a

If you need location, then perhaps use 'label'.

Quoted 20 lines
Documentation/devicetree/bindings/media/i2c/imx214.txt new file +17 -0
+		compatible = "sony,imx214";
+		reg = <0x1a>;
+		vdddo-supply = <&pm8994_lvs1>;
+		vddd-supply = <&camera_vddd_1v12>;
+		vdda-supply = <&pm8994_l17>;
+		lens-focus = <&ad5820>;
+		enable-gpios = <&msmgpio 25 GPIO_ACTIVE_HIGH>;
+		clocks = <&mmcc CAMSS_MCLK0_CLK>;
+		clock-names = "xclk";
+		port {
+			imx214_ep: endpoint {
+				data-lanes = <1 2 3 4>;
+				link-frequencies = /bits/ 64 <480000000>;
+				remote-endpoint = <&csiphy0_ep>;
+			};
+		};
+	};
Signature · 1 line
2.19.0
maintainer
#4 lore raw
In reply to Ricardo Ribalda Delgado

Hi Ricardo,

Quoted 20 lines · Ricardo Ribalda Delgado

From: Ricardo Ribalda <[email protected]>

Document bindings for imx214 camera sensor

---
 .../devicetree/bindings/media/i2c/imx214.txt  | 53 +++++++++++++++++++
 1 file changed, 53 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/imx214.txt
Documentation/devicetree/bindings/media/i2c/imx214.txt new file +2 -0
new file mode 100644
index 000000000000..421a019ab7f9
@@ -0,0 +1,53 @@
+* Sony 1/3.06-Inch 13.13Mp CMOS Digital Image Sensor
+

Documentation/devicetree/bindings/media/i2c/imx214.txt line 12

Quoted 10 lines
Documentation/devicetree/bindings/media/i2c/imx214.txt new file +10 -0
+The Sony imx214 is a 1/3.06-inch CMOS active pixel digital image sensor with
+an active array size of 4224H x 3200V. It is programmable through an I2C
+interface. The I2C address can be configured to 0x1a or 0x10, depending on
+how the hardware is wired.
+Image data is sent through MIPI CSI-2, through 2 or 4 lanes at a maximum
+throughput of 1.2Gbps/lane.
+
+
+Required Properties:
+- compatible: value should be "sony,imx214" for imx214 sensor

should -> shall ?

Signature · 4 lines
Regards,

Sakari Ailus
[email protected]