Skip to contentSkip to conversation

media: ov7740: Add a V4L2 sensor-level driver

PATCH Superseded Wenyou Yang 3 participants 8 messages Oct 31, 2017 – Nov 3, 2017

Subsystems (4)

v4 of 9 Superseded Latest is v9 →

lore
Share & tools
lore
#0 lore raw

v4 cover media: ov7740: Add a V4L2 sensor-level driver

Add a Video4Linux2 sensor-level driver for the OmniVision OV7740 VGA camera image sensor.

Changes in v4:
- Assign 'val' a initial value to avoid warning: 'val' may be used uninitialized.
- Rename REG_REG15 to avoid warning: "REG_REG15" redefined.

Changes in v3:
- Explicitly document the "remote-endpoint" property.
- Put the MAINTAINERS change to a separate patch.

Changes in v2:
- Split off the bindings into a separate patch.
- Add a new entry to the MAINTAINERS file.

Wenyou Yang (3):
media: i2c: Add the ov7740 image sensor driver
media: ov7740: Document device tree bindings
MAINTAINERS: Add a new entry of the ov7740 driver

 .../devicetree/bindings/media/i2c/ov7740.txt       |   47 +
 MAINTAINERS                                        |    8 +
 drivers/media/i2c/Kconfig                          |    8 +
 drivers/media/i2c/Makefile                         |    1 +
 drivers/media/i2c/ov7740.c                         | 1220 ++++++++++++++++++++
 5 files changed, 1284 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/ov7740.txt
 create mode 100644 drivers/media/i2c/ov7740.c
Signature · 1 line
2.13.0
#1 lore raw

PATCH v4 1/3 media: i2c: Add the ov7740 image sensor driver

The ov7740 (color) image sensor is a high performance VGA CMOS image snesor, which supports for output formats: RAW RGB and YUV and image sizes: VGA, and QVGA, CIF and any size smaller.

---

Changes in v4:
- Assign 'val' a initial value to avoid warning: 'val' may be used uninitialized.
- Rename REG_REG15 to avoid warning: "REG_REG15" redefined.

Changes in v3: None
Changes in v2: None

 drivers/media/i2c/Kconfig  |    8 +
 drivers/media/i2c/Makefile |    1 +
 drivers/media/i2c/ov7740.c | 1220 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 1229 insertions(+)
 create mode 100644 drivers/media/i2c/ov7740.c
drivers/media/i2c/Kconfig +8 -0
index 3c6d6428f525..ac484bb82fae 100644
@@ -665,6 +665,14 @@ config VIDEO_OV7670
 	  OV7670 VGA camera.  It currently only works with the M88ALP01
 	  controller.
 
+config VIDEO_OV7740
+	tristate "OmniVision OV7740 sensor support"
+	depends on I2C && VIDEO_V4L2
+	depends on MEDIA_CAMERA_SUPPORT
+	---help---
+	  This is a Video4Linux2 sensor-level driver for the OmniVision
+	  OV7740 VGA camera sensor.
+
 config VIDEO_OV9650
 	tristate "OmniVision OV9650/OV9652 sensor support"
 	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
drivers/media/i2c/Makefile +1 -0
index f8d57e453936..be800c674e8d 100644
@@ -67,6 +67,7 @@ obj-$(CONFIG_VIDEO_OV5670) += ov5670.o
 obj-$(CONFIG_VIDEO_OV6650) += ov6650.o
 obj-$(CONFIG_VIDEO_OV7640) += ov7640.o
 obj-$(CONFIG_VIDEO_OV7670) += ov7670.o
+obj-$(CONFIG_VIDEO_OV7740) += ov7740.o
 obj-$(CONFIG_VIDEO_OV9650) += ov9650.o
 obj-$(CONFIG_VIDEO_OV13858) += ov13858.o
 obj-$(CONFIG_VIDEO_MT9M032) += mt9m032.o
drivers/media/i2c/ov7740.c new file +1220 -0

1,220 lines not on this page · raw message

Signature · 1 line
2.13.0
#2 lore raw

PATCH v4 2/3 media: ov7740: Document device tree bindings

In reply to Wenyou Yang

Add the device tree binding documentation for the ov7740 sensor driver.

---

Changes in v4: None
Changes in v3:
- Explicitly document the "remote-endpoint" property.

Changes in v2: None

 .../devicetree/bindings/media/i2c/ov7740.txt       | 47 ++++++++++++++++++++++
 1 file changed, 47 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/ov7740.txt
Documentation/devicetree/bindings/media/i2c/ov7740.txt new file +47 -0
new file mode 100644
index 000000000000..af781c3a5f0e
@@ -0,0 +1,47 @@
+* Omnivision OV7740 CMOS image sensor
+
+The Omnivision OV7740 image sensor supports multiple output image
+size, such as VGA, and QVGA, CIF and any size smaller. It also
+supports the RAW RGB and YUV output formats.
+
+The common video interfaces bindings (see video-interfaces.txt) should
+be used to specify link to the image data receiver. The OV7740 device
+node should contain one 'port' child node with an 'endpoint' subnode.
+
+Required Properties:
+- compatible:	"ovti,ov7740".
+- reg:		I2C slave address of the sensor.
+- clocks:	Reference to the xvclk input clock.
+- clock-names:	"xvclk".
+
+Optional Properties:
+- reset-gpios: Rreference to the GPIO connected to the reset_b pin,
+  if any. Active low with pull-ip resistor.
+- powerdown-gpios: Reference to the GPIO connected to the pwdn pin,
+  if any. Active high with pull-down resistor.
+
+Endpoint node mandatory properties:
+- remote-endpoint: A phandle to the bus receiver's endpoint node.
+
+Example:
+
+	i2c1: i2c at fc028000 {
+		ov7740: camera at 21 {
+			compatible = "ovti,ov7740";
+			reg = <0x21>;
+			pinctrl-names = "default";
+			pinctrl-0 = <&pinctrl_sensor_power &pinctrl_sensor_reset>;
+			clocks = <&isc>;
+			clock-names = "xvclk";
+			assigned-clocks = <&isc>;
+			assigned-clock-rates = <24000000>;
+			reset-gpios = <&pioA 43 GPIO_ACTIVE_LOW>;
+			powerdown-gpios = <&pioA 44 GPIO_ACTIVE_HIGH>;
+
+			port {
+				ov7740_0: endpoint {
+					remote-endpoint = <&isc_0>;
+				};
+			};
+		};
+	};
Signature · 1 line
2.13.0
maintainer Acked-by on v4 2/3
#3 lore raw

Re: [PATCH v4 2/3] media: ov7740: Document device tree bindings

Quoted 35 lines · Wenyou Yang

Add the device tree binding documentation for the ov7740 sensor driver.

---

Changes in v4: None
Changes in v3:
- Explicitly document the "remote-endpoint" property.

Changes in v2: None

 .../devicetree/bindings/media/i2c/ov7740.txt       | 47 ++++++++++++++++++++++
 1 file changed, 47 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/ov7740.txt
Documentation/devicetree/bindings/media/i2c/ov7740.txt new file +14 -0
new file mode 100644
index 000000000000..af781c3a5f0e
@@ -0,0 +1,47 @@
+* Omnivision OV7740 CMOS image sensor
+
+The Omnivision OV7740 image sensor supports multiple output image
+size, such as VGA, and QVGA, CIF and any size smaller. It also
+supports the RAW RGB and YUV output formats.
+
+The common video interfaces bindings (see video-interfaces.txt) should
+be used to specify link to the image data receiver. The OV7740 device
+node should contain one 'port' child node with an 'endpoint' subnode.
+
+Required Properties:
+- compatible:	"ovti,ov7740".
+- reg:		I2C slave address of the sensor.
+- clocks:	Reference to the xvclk input clock.

Documentation/devicetree/bindings/media/i2c/ov7740.txt line 24

Quoted 10 lines
Documentation/devicetree/bindings/media/i2c/ov7740.txt new file +10 -0
+- clock-names:	"xvclk".
+
+Optional Properties:
+- reset-gpios: Rreference to the GPIO connected to the reset_b pin,
+  if any. Active low with pull-ip resistor.
+- powerdown-gpios: Reference to the GPIO connected to the pwdn pin,
+  if any. Active high with pull-down resistor.
+
+Endpoint node mandatory properties:
+- remote-endpoint: A phandle to the bus receiver's endpoint node.

This is not really necessary. What's required is documenting how many ports and how many endpoints for each port which you have above.

#4 lore raw

Re: [PATCH v4 2/3] media: ov7740: Document device tree bindings

Hi Rob,

Quoted 41 lines · Rob Herring
Quoted 40 lines · Wenyou Yang

Add the device tree binding documentation for the ov7740 sensor driver.

---

Changes in v4: None
Changes in v3:
- Explicitly document the "remote-endpoint" property.

Changes in v2: None

 .../devicetree/bindings/media/i2c/ov7740.txt       | 47 ++++++++++++++++++++++
 1 file changed, 47 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/ov7740.txt
Documentation/devicetree/bindings/media/i2c/ov7740.txt new file +19 -0
new file mode 100644
index 000000000000..af781c3a5f0e
@@ -0,0 +1,47 @@
+* Omnivision OV7740 CMOS image sensor
+
+The Omnivision OV7740 image sensor supports multiple output image
+size, such as VGA, and QVGA, CIF and any size smaller. It also
+supports the RAW RGB and YUV output formats.
+
+The common video interfaces bindings (see video-interfaces.txt) should
+be used to specify link to the image data receiver. The OV7740 device
+node should contain one 'port' child node with an 'endpoint' subnode.
+
+Required Properties:
+- compatible:	"ovti,ov7740".
+- reg:		I2C slave address of the sensor.
+- clocks:	Reference to the xvclk input clock.
+- clock-names:	"xvclk".
+
+Optional Properties:
+- reset-gpios: Rreference to the GPIO connected to the reset_b pin,
+  if any. Active low with pull-ip resistor.
Quoted 8 lines

Documentation/devicetree/bindings/media/i2c/ov7740.txt line 24

Quoted 5 lines
Documentation/devicetree/bindings/media/i2c/ov7740.txt new file +5 -0
+- powerdown-gpios: Reference to the GPIO connected to the pwdn pin,
+  if any. Active high with pull-down resistor.
+
+Endpoint node mandatory properties:
+- remote-endpoint: A phandle to the bus receiver's endpoint node.

This is not really necessary. What's required is documenting how many ports and how many endpoints for each port which you have above.

I actually requested adding that as the practice, as far as I've understood it, has been to document all properties relevant for the hardware (apart from things such as assigned-clocks etc.).

The port and endpoints have been elaborated above and I think that should be fine as-is.

The graph bindings document (referred by video-interfaces.txt) the remote-endpoint property in an endpoint as an optional property, however you can't really use the sensor if it's not connected to anything. The same goes for video-interfaces.txt: remote-endpoint in an endpoint is optional.

I have no objections removing remote-endpoint here, though, if you think it's not relevant here.

Signature · 4 lines
Kind regards,

Sakari Ailus
e-mail: sakari.ailus at iki.fi
#5 lore raw

PATCH v4 3/3 MAINTAINERS: Add a new entry of the ov7740 driver

In reply to Wenyou Yang

Add a new entry of the ov7740 sensor driver to the MAINTAINERS file.

---

Changes in v4: None
Changes in v3:
- Put the MAINTAINERS change to a separate patch.

Changes in v2:
- Split off the bindings into a separate patch.
- Add a new entry to the MAINTAINERS file.

 MAINTAINERS | 8 ++++++++
 1 file changed, 8 insertions(+)
MAINTAINERS +8 -0
index adbf69306e9e..42b93599a0af 100644
@@ -9973,6 +9973,14 @@ S:	Maintained
 F:	drivers/media/i2c/ov7670.c
 F:	Documentation/devicetree/bindings/media/i2c/ov7670.txt
 
+OMNIVISION OV7740 SENSOR DRIVER
+M:	Wenyou Yang <[email protected]>
+L:	linux-media at vger.kernel.org
+T:	git git://linuxtv.org/media_tree.git
+S:	Maintained
+F:	drivers/media/i2c/ov7740.c
+F:	Documentation/devicetree/bindings/media/i2c/ov7740.txt
+
 ONENAND FLASH DRIVER
 M:	Kyungmin Park <[email protected]>
 L:	linux-mtd at lists.infradead.org
Signature · 1 line
2.13.0
#6 lore raw
In reply to Wenyou Yang

Hi Wenyou,

Quoted 2 lines · Wenyou Yang

Add a Video4Linux2 sensor-level driver for the OmniVision OV7740 VGA camera image sensor.

For the next version, could you rearrange your patches a bit as follows:

1. DT bindings
2. The driver and MAINTAINERS entry

Putting the MAINTAINERS entry separately from the driver emits a warning from checkpatch.pl. Bindings are naturally separate from driver and should precede the driver as the driver musn't use undocumented bindings.

Thanks.

Signature · 2 lines
Sakari Ailus
e-mail: sakari.ailus at iki.fi
#7 lore raw
In reply to Wenyou Yang
Quoted 2 lines · Wenyou Yang

Add a Video4Linux2 sensor-level driver for the OmniVision OV7740 VGA camera image sensor.

Oh, and please wait until the patches have been reviewed, no need to send v5 before that.

Signature · 2 lines
Sakari Ailus
e-mail: sakari.ailus at iki.fi