Skip to contentSkip to conversation

media: i2c: Add ov08d10 camera sensor driver

PATCH Applied Jimmy Su 2 participants 2 messages Jan 12, 2022

Subsystems (3)

v7 of 9 Applied Latest is v9 →

lore
Share & tools
lore

Jimmy Su

author maintainer
#0 lore raw

PATCH v7 1/1 media: i2c: Add ov08d10 camera sensor driver

Add a v4l2 sub-device driver for the OmniVision ov08d10 image sensor. This camera sensor is using the i2c bus for control and the csi-2 bus for data.

The following features are supported:
- manual exposure and analog/digital gain control
- vblank/hblank control
- test pattern
- image vertical flip and horizontal mirror control
- supported resolution:
- 3280x2460 at 30 FPS
- 3264x2448 at 30 FPS
- 1632x1224 at 30 FPS
- supported bayer order output:
- SGRBG10 as default
- SBGGR10 at flip mode
- SRGGB10 at mirror mode
- SGBRG10 at flip + mirror mode

---
 MAINTAINERS                 |    7 +
 drivers/media/i2c/Kconfig   |   13 +
 drivers/media/i2c/Makefile  |    1 +
 drivers/media/i2c/ov08d10.c | 1525 +++++++++++++++++++++++++++++++++++
 4 files changed, 1546 insertions(+)
 create mode 100644 drivers/media/i2c/ov08d10.c
MAINTAINERS +7 -0
index 38235471fed0..1a14a6e13fd6 100644
@@ -14050,6 +14050,13 @@ T:	git git://linuxtv.org/media_tree.git
 F:	Documentation/devicetree/bindings/media/i2c/ovti,ov02a10.yaml
 F:	drivers/media/i2c/ov02a10.c
 
+OMNIVISION OV08D10 SENSOR DRIVER
+M:	Jimmy Su <[email protected]>
+L:	[email protected]
+S:	Maintained
+T:	git git://linuxtv.org/media_tree.git
+F:	drivers/media/i2c/ov08d10.c
+
 OMNIVISION OV13858 SENSOR DRIVER
 M:	Sakari Ailus <[email protected]>
 L:	[email protected]
drivers/media/i2c/Kconfig +13 -0
index 69c56e24a612..3b1a66b735e1 100644
@@ -912,6 +912,19 @@ config VIDEO_OV02A10
 	  To compile this driver as a module, choose M here: the
 	  module will be called ov02a10.
 
+config VIDEO_OV08D10
+        tristate "OmniVision OV08D10 sensor support"
+        depends on I2C && VIDEO_V4L2
+        select MEDIA_CONTROLLER
+        select VIDEO_V4L2_SUBDEV_API
+        select V4L2_FWNODE
+        help
+          This is a Video4Linux2 sensor driver for the OmniVision
+          OV08D10 camera sensor.
+
+          To compile this driver as a module, choose M here: the
+          module will be called ov08d10.
+
 config VIDEO_OV2640
 	tristate "OmniVision OV2640 sensor support"
 	depends on VIDEO_V4L2 && I2C
drivers/media/i2c/Makefile +1 -0
index b01f6cd05ee8..4fb2abc25aba 100644
@@ -65,6 +65,7 @@ obj-$(CONFIG_VIDEO_SONY_BTF_MPX) += sony-btf-mpx.o
 obj-$(CONFIG_VIDEO_UPD64031A) += upd64031a.o
 obj-$(CONFIG_VIDEO_UPD64083) += upd64083.o
 obj-$(CONFIG_VIDEO_OV02A10) += ov02a10.o
+obj-$(CONFIG_VIDEO_OV08D10) += ov08d10.o
 obj-$(CONFIG_VIDEO_OV2640) += ov2640.o
 obj-$(CONFIG_VIDEO_OV2680) += ov2680.o
 obj-$(CONFIG_VIDEO_OV2685) += ov2685.o
drivers/media/i2c/ov08d10.c new file +1525 -0

1,525 lines not on this page · raw message

Signature · 1 line
2.17.1
maintainer Applied
#1 lore raw

Hi Jimmy,

Quoted 19 lines · Jimmy Su

Add a v4l2 sub-device driver for the OmniVision ov08d10 image sensor. This camera sensor is using the i2c bus for control and the csi-2 bus for data.

The following features are supported:
- manual exposure and analog/digital gain control
- vblank/hblank control
- test pattern
- image vertical flip and horizontal mirror control
- supported resolution:
- 3280x2460 at 30 FPS
- 3264x2448 at 30 FPS
- 1632x1224 at 30 FPS
- supported bayer order output:
- SGRBG10 as default
- SBGGR10 at flip mode
- SRGGB10 at mirror mode
- SGBRG10 at flip + mirror mode

Quoted 1 line

Thanks for the patch.

I've applied it with the following diff --- the mutex needs to be released only after the controls have been (un)grabbed:

drivers/media/i2c/ov08d10.c +2 -1
index 34d7936499e9..92888024c774 100644
@@ -1121,12 +1121,13 @@ static int ov08d10_set_stream(struct v4l2_subdev *sd, int enable)
 	}
 
 	ov08d10->streaming = enable;
-	mutex_unlock(&ov08d10->mutex);
 
 	/* vflip and hflip cannot change during streaming */
 	__v4l2_ctrl_grab(ov08d10->vflip, enable);
 	__v4l2_ctrl_grab(ov08d10->hflip, enable);
 
+	mutex_unlock(&ov08d10->mutex);
+
 	return ret;
 }
 
Signature · 3 lines
Kind regards,

Sakari Ailus