Skip to contentSkip to conversation

Add support for Omnivision OV5647

PATCH Superseded Ramiro Oliveira 3 participants 6 messages Dec 13, 2016 – Dec 19, 2016

Subsystems (4)

v6 of 11 Superseded Latest is v11 →

lore
Share & tools
lore
#0 lore raw

v6 cover Add support for Omnivision OV5647

Hello,

This patch adds support for the Omnivision OV5647 sensor.

At the moment it only supports 640x480 in Raw 8.

This is the sixth version of the OV5647 camera driver patchset.

v6:
- Add example to DT documentation
- Remove data-lanes and clock-lane property from DT
- Add external clock property to DT
- Order includes
- Remove unused variables and functions
- Add external clock handling
- Add power on counter
- Change from g/s_parm to g/s_frame_interval

v5:
- Refactor code
- Change comments
- Add missing error handling in some functions

v4:
- Add correct license
- Revert debugging info to generic infrastructure
- Turn defines into enums
- Correct code style issues
- Remove unused defines
- Make sure all errors where being handled
- Rename some functions to make code more readable
- Add some debugging info

v3:
- No changes. Re-submitted due to lack of responses

v2:
- Corrections in DT documentation

Ramiro Oliveira (2):
Add OV5647 device tree documentation
Add support for OV5647 sensor.

 .../devicetree/bindings/media/i2c/ov5647.txt       |  35 +
 MAINTAINERS                                        |   7 +
 drivers/media/i2c/Kconfig                          |  12 +
 drivers/media/i2c/Makefile                         |   1 +
 drivers/media/i2c/ov5647.c                         | 718 +++++++++++++++++++++
 5 files changed, 773 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/ov5647.txt
 create mode 100644 drivers/media/i2c/ov5647.c
Signature · 1 line
2.10.2
#1 lore raw

PATCH v6 1/2 Add OV5647 device tree documentation

Create device tree bindings documentation.

---
 .../devicetree/bindings/media/i2c/ov5647.txt       | 35 ++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/ov5647.txt
Documentation/devicetree/bindings/media/i2c/ov5647.txt new file +35 -0
new file mode 100644
index 0000000..46e5e30
@@ -0,0 +1,35 @@
+Omnivision OV5647 raw image sensor
+---------------------------------
+
+OV5647 is a raw image sensor with MIPI CSI-2 and CCP2 image data interfaces
+and CCI (I2C compatible) control bus.
+
+Required properties:
+
+- compatible	: "ovti,ov5647";
+- reg		: I2C slave address of the sensor;
+- clocks	: Reference to the xclk clock.
+- clock-names	: Should be "xclk".
+- clock-frequency: Frequency of the xclk clock
+
+The common video interfaces bindings (see video-interfaces.txt) should be
+used to specify link to the image data receiver. The OV5647 device
+node should contain one 'port' child node with an 'endpoint' subnode.
+
+Example:
+
+	i2c@0x02000 {
+		...
+		ov: camera@0x36 {
+			compatible = "ovti,ov5647";
+			reg = <0x36>;
+			clocks = <&camera_clk>;
+			clock-names = "xclk";
+			clock-frequency = <30000000>;
+			port {
+				camera_1: endpoint {
+					remote-endpoint = <&csi1_ep1>;
+				};
+			};
+		};
+	};
Signature · 1 line
2.10.2
Acked-by on v6 1/2
#2 lore raw

Re: [PATCH v6 1/2] Add OV5647 device tree documentation

Quoted 17 lines · Ramiro Oliveira

Create device tree bindings documentation.

---
 .../devicetree/bindings/media/i2c/ov5647.txt       | 35 ++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/ov5647.txt
Documentation/devicetree/bindings/media/i2c/ov5647.txt new file +3 -0
new file mode 100644
index 0000000..46e5e30
@@ -0,0 +1,35 @@
+Omnivision OV5647 raw image sensor
+---------------------------------
+

Documentation/devicetree/bindings/media/i2c/ov5647.txt line 13

Quoted 10 lines
Documentation/devicetree/bindings/media/i2c/ov5647.txt new file +10 -0
+OV5647 is a raw image sensor with MIPI CSI-2 and CCP2 image data interfaces
+and CCI (I2C compatible) control bus.
+
+Required properties:
+
+- compatible	: "ovti,ov5647";
+- reg		: I2C slave address of the sensor;
+- clocks	: Reference to the xclk clock.
+- clock-names	: Should be "xclk".
+- clock-frequency: Frequency of the xclk clock

Nit pick: you end the lines here with ';', '.' and nothing. Pick one :-).

Otherwise it looks good.

Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
maintainer
#3 lore raw

Re: [PATCH v6 1/2] Add OV5647 device tree documentation

In reply to Ramiro Oliveira
Quoted 21 lines · Ramiro Oliveira

Create device tree bindings documentation.

---
 .../devicetree/bindings/media/i2c/ov5647.txt       | 35 ++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/ov5647.txt
Documentation/devicetree/bindings/media/i2c/ov5647.txt new file +7 -0
new file mode 100644
index 0000000..46e5e30
@@ -0,0 +1,35 @@
+Omnivision OV5647 raw image sensor
+---------------------------------
+
+OV5647 is a raw image sensor with MIPI CSI-2 and CCP2 image data interfaces
+and CCI (I2C compatible) control bus.
+
+Required properties:

Documentation/devicetree/bindings/media/i2c/ov5647.txt line 17

Quoted 10 lines
Documentation/devicetree/bindings/media/i2c/ov5647.txt new file +10 -0
+
+- compatible	: "ovti,ov5647";
+- reg		: I2C slave address of the sensor;
+- clocks	: Reference to the xclk clock.
+- clock-names	: Should be "xclk".
+- clock-frequency: Frequency of the xclk clock
+
+The common video interfaces bindings (see video-interfaces.txt) should be
+used to specify link to the image data receiver. The OV5647 device
+node should contain one 'port' child node with an 'endpoint' subnode.

Would be good to add optional regulator supply properties, but that can come later.

Documentation/devicetree/bindings/media/i2c/ov5647.txt line 21

Quoted 4 lines
Documentation/devicetree/bindings/media/i2c/ov5647.txt new file +4 -0
+
+Example:
+
+	i2c@0x02000 {

No '0x' or leading 0s on unit addresses.

Documentation/devicetree/bindings/media/i2c/ov5647.txt line 23

Quoted 2 lines
Documentation/devicetree/bindings/media/i2c/ov5647.txt new file +2 -0
+		...
+		ov: camera@0x36 {

ditto.

Quoted 16 lines
Documentation/devicetree/bindings/media/i2c/ov5647.txt new file +12 -0
+			compatible = "ovti,ov5647";
+			reg = <0x36>;
+			clocks = <&camera_clk>;
+			clock-names = "xclk";
+			clock-frequency = <30000000>;
+			port {
+				camera_1: endpoint {
+					remote-endpoint = <&csi1_ep1>;
+				};
+			};
+		};
+	};
Signature · 1 line
2.10.2
#4 lore raw

PATCH v6 2/2 Add support for OV5647 sensor.

In reply to Ramiro Oliveira

Modes supported:
- 640x480 RAW 8

---
 MAINTAINERS                |   7 +
 drivers/media/i2c/Kconfig  |  12 +
 drivers/media/i2c/Makefile |   1 +
 drivers/media/i2c/ov5647.c | 718 +++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 738 insertions(+)
 create mode 100644 drivers/media/i2c/ov5647.c
MAINTAINERS +7 -0
index 52cc077..72e828a 100644
@@ -8923,6 +8923,13 @@ M:	Harald Welte <[email protected]>
 S:	Maintained
 F:	drivers/char/pcmcia/cm4040_cs.*
 
+OMNIVISION OV5647 SENSOR DRIVER
+M:	Ramiro Oliveira <[email protected]>
+L:	[email protected]
+T:	git git://linuxtv.org/media_tree.git
+S:	Maintained
+F:	drivers/media/i2c/ov5647.c
+
 OMNIVISION OV7670 SENSOR DRIVER
 M:	Jonathan Corbet <[email protected]>
 L:	[email protected]
drivers/media/i2c/Kconfig +12 -0
index b31fa6f..c1b78e5 100644
@@ -531,6 +531,18 @@ config VIDEO_OV2659
 	  To compile this driver as a module, choose M here: the
 	  module will be called ov2659.
 
+config VIDEO_OV5647
+	tristate "OmniVision OV5647 sensor support"
+	depends on OF
+	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+	depends on MEDIA_CAMERA_SUPPORT
+	---help---
+	  This is a Video4Linux2 sensor-level driver for the OmniVision
+	  OV5647 camera.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called ov5647.
+
 config VIDEO_OV7640
 	tristate "OmniVision OV7640 sensor support"
 	depends on I2C && VIDEO_V4L2
drivers/media/i2c/Makefile +1 -0
index 92773b2..0d9014c 100644
@@ -82,3 +82,4 @@ obj-$(CONFIG_VIDEO_IR_I2C)  += ir-kbd-i2c.o
 obj-$(CONFIG_VIDEO_ML86V7667)	+= ml86v7667.o
 obj-$(CONFIG_VIDEO_OV2659)	+= ov2659.o
 obj-$(CONFIG_VIDEO_TC358743)	+= tc358743.o
+obj-$(CONFIG_VIDEO_OV5647)	+= ov5647.o
drivers/media/i2c/ov5647.c new file +718 -0

718 lines not on this page · raw message

Signature · 1 line
2.10.2