Skip to contentSkip to conversation

media: i2c: small enhancements for camera sensor drivers

PATCH In review Akinobu Mita 3 participants 12 messages Nov 13, 2018 – Nov 14, 2018

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover media: i2c: small enhancements for camera sensor drivers

This patchset addds relatively small enhancements (log_status ioctl, event interface, V4L2_CID_TEST_PATTERN control, and V4L2_CID_COLORFX control) for mt9m111, ov2640, ov5640, ov7670, and ov772x drivers. I have these devices so these patches are tested with real devices.

Akinobu Mita (7):
media: mt9m111: support log_status ioctl and event interface
media: mt9m111: add V4L2_CID_COLORFX control
media: ov2640: add V4L2_CID_TEST_PATTERN control
media: ov2640: support log_status ioctl and event interface
media: ov5640: support log_status ioctl and event interface
media: ov7670: support log_status ioctl and event interface
media: ov772x: support log_status ioctl and event interface

 drivers/media/i2c/mt9m111.c | 44 ++++++++++++++++++++++++++++++++++++++++++--
 drivers/media/i2c/ov2640.c  | 21 +++++++++++++++++++--
 drivers/media/i2c/ov5640.c  |  7 ++++++-
 drivers/media/i2c/ov7670.c  |  6 +++++-
 drivers/media/i2c/ov772x.c  |  7 ++++++-
 5 files changed, 78 insertions(+), 7 deletions(-)
Cc Steve Longerbeam <[email protected]>
Cc Jonathan Corbet <[email protected]>
Cc Jacopo Mondi <[email protected]>
Cc Sakari Ailus <[email protected]>
Cc Mauro Carvalho Chehab <[email protected]>
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/7 media: mt9m111: support log_status ioctl and event interface

This adds log_status ioctl and event interface for mt9m111's v4l2 controls.

Cc Sakari Ailus <[email protected]>
Cc Mauro Carvalho Chehab <[email protected]>
---
 drivers/media/i2c/mt9m111.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/media/i2c/mt9m111.c +6 -1
index 1395986..f4fc459 100644
@@ -21,6 +21,7 @@
 #include <media/v4l2-common.h>
 #include <media/v4l2-ctrls.h>
 #include <media/v4l2-device.h>
+#include <media/v4l2-event.h>
 
 /*
  * MT9M111, MT9M112 and MT9M131:
@@ -862,6 +863,9 @@ static const struct v4l2_ctrl_ops mt9m111_ctrl_ops = {
 
 static const struct v4l2_subdev_core_ops mt9m111_subdev_core_ops = {
 	.s_power	= mt9m111_s_power,
+	.log_status = v4l2_ctrl_subdev_log_status,
+	.subscribe_event = v4l2_ctrl_subdev_subscribe_event,
+	.unsubscribe_event = v4l2_event_subdev_unsubscribe,
 #ifdef CONFIG_VIDEO_ADV_DEBUG
 	.g_register	= mt9m111_g_register,
 	.s_register	= mt9m111_s_register,
@@ -976,7 +980,8 @@ static int mt9m111_probe(struct i2c_client *client,
 	mt9m111->ctx = &context_b;
 
 	v4l2_i2c_subdev_init(&mt9m111->subdev, client, &mt9m111_subdev_ops);
-	mt9m111->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
+	mt9m111->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE |
+				 V4L2_SUBDEV_FL_HAS_EVENTS;
 
 	v4l2_ctrl_handler_init(&mt9m111->hdl, 5);
 	v4l2_ctrl_new_std(&mt9m111->hdl, &mt9m111_ctrl_ops,
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/7 media: mt9m111: add V4L2_CID_COLORFX control

In reply to Akinobu Mita

The mt9m111 has special camera effects feature. This makes use of it through V4L2_CID_COLORFX control.

Cc Sakari Ailus <[email protected]>
Cc Mauro Carvalho Chehab <[email protected]>
---
 drivers/media/i2c/mt9m111.c | 37 ++++++++++++++++++++++++++++++++++++-
 1 file changed, 36 insertions(+), 1 deletion(-)
drivers/media/i2c/mt9m111.c +36 -1
index f4fc459..58d134d 100644
@@ -102,6 +102,7 @@
 #define MT9M111_REDUCER_XSIZE_A		0x1a7
 #define MT9M111_REDUCER_YZOOM_A		0x1a9
 #define MT9M111_REDUCER_YSIZE_A		0x1aa
+#define MT9M111_EFFECTS_MODE		0x1e2
 
 #define MT9M111_OUTPUT_FORMAT_CTRL2_A	0x13a
 #define MT9M111_OUTPUT_FORMAT_CTRL2_B	0x19b
@@ -127,6 +128,7 @@
 #define MT9M111_OUTFMT_SWAP_YCbCr_C_Y_RGB_EVEN	(1 << 1)
 #define MT9M111_OUTFMT_SWAP_YCbCr_Cb_Cr_RGB_R_B	(1 << 0)
 #define MT9M111_TPG_SEL_MASK		GENMASK(2, 0)
+#define MT9M111_EFFECTS_MODE_MASK	GENMASK(2, 0)
 
 /*
  * Camera control register addresses (0x200..0x2ff not implemented)
@@ -727,6 +729,29 @@ static int mt9m111_set_test_pattern(struct mt9m111 *mt9m111, int val)
 				MT9M111_TPG_SEL_MASK);
 }
 
+static int mt9m111_set_colorfx(struct mt9m111 *mt9m111, int val)
+{
+	struct i2c_client *client = v4l2_get_subdevdata(&mt9m111->subdev);
+	static const struct v4l2_control colorfx[] = {
+		{ V4L2_COLORFX_NONE,		0 },
+		{ V4L2_COLORFX_BW,		1 },
+		{ V4L2_COLORFX_SEPIA,		2 },
+		{ V4L2_COLORFX_NEGATIVE,	3 },
+		{ V4L2_COLORFX_SOLARIZATION,	4 },
+	};
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(colorfx); i++) {
+		if (colorfx[i].id == val) {
+			return mt9m111_reg_mask(client, MT9M111_EFFECTS_MODE,
+						colorfx[i].value,
+						MT9M111_EFFECTS_MODE_MASK);
+		}
+	}
+
+	return -EINVAL;
+}
+
 static int mt9m111_s_ctrl(struct v4l2_ctrl *ctrl)
 {
 	struct mt9m111 *mt9m111 = container_of(ctrl->handler,
@@ -747,6 +772,8 @@ static int mt9m111_s_ctrl(struct v4l2_ctrl *ctrl)
 		return mt9m111_set_autowhitebalance(mt9m111, ctrl->val);
 	case V4L2_CID_TEST_PATTERN:
 		return mt9m111_set_test_pattern(mt9m111, ctrl->val);
+	case V4L2_CID_COLORFX:
+		return mt9m111_set_colorfx(mt9m111, ctrl->val);
 	}
 
 	return -EINVAL;
@@ -983,7 +1010,7 @@ static int mt9m111_probe(struct i2c_client *client,
 	mt9m111->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE |
 				 V4L2_SUBDEV_FL_HAS_EVENTS;
 
-	v4l2_ctrl_handler_init(&mt9m111->hdl, 5);
+	v4l2_ctrl_handler_init(&mt9m111->hdl, 7);
 	v4l2_ctrl_new_std(&mt9m111->hdl, &mt9m111_ctrl_ops,
 			V4L2_CID_VFLIP, 0, 1, 1, 0);
 	v4l2_ctrl_new_std(&mt9m111->hdl, &mt9m111_ctrl_ops,
@@ -999,6 +1026,14 @@ static int mt9m111_probe(struct i2c_client *client,
 			&mt9m111_ctrl_ops, V4L2_CID_TEST_PATTERN,
 			ARRAY_SIZE(mt9m111_test_pattern_menu) - 1, 0, 0,
 			mt9m111_test_pattern_menu);
+	v4l2_ctrl_new_std_menu(&mt9m111->hdl, &mt9m111_ctrl_ops,
+			V4L2_CID_COLORFX, V4L2_COLORFX_SOLARIZATION,
+			~(BIT(V4L2_COLORFX_NONE) |
+				BIT(V4L2_COLORFX_BW) |
+				BIT(V4L2_COLORFX_SEPIA) |
+				BIT(V4L2_COLORFX_NEGATIVE) |
+				BIT(V4L2_COLORFX_SOLARIZATION)),
+			V4L2_COLORFX_NONE);
 	mt9m111->subdev.ctrl_handler = &mt9m111->hdl;
 	if (mt9m111->hdl.error) {
 		ret = mt9m111->hdl.error;
Signature · 1 line
2.7.4
#3 lore raw

PATCH 3/7 media: ov2640: add V4L2_CID_TEST_PATTERN control

In reply to Akinobu Mita

The ov2640 has the test pattern generator features. This makes use of it through V4L2_CID_TEST_PATTERN control.

Cc Sakari Ailus <[email protected]>
Cc Mauro Carvalho Chehab <[email protected]>
---
 drivers/media/i2c/ov2640.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
drivers/media/i2c/ov2640.c +13 -1
index 20a8853..4992d77 100644
@@ -705,6 +705,11 @@ static int ov2640_reset(struct i2c_client *client)
 	return ret;
 }
 
+static const char * const ov2640_test_pattern_menu[] = {
+	"Disabled",
+	"Color bar",
+};
+
 /*
  * functions
  */
@@ -740,6 +745,9 @@ static int ov2640_s_ctrl(struct v4l2_ctrl *ctrl)
 	case V4L2_CID_HFLIP:
 		val = ctrl->val ? REG04_HFLIP_IMG : 0x00;
 		return ov2640_mask_set(client, REG04, REG04_HFLIP_IMG, val);
+	case V4L2_CID_TEST_PATTERN:
+		val = ctrl->val ? COM7_COLOR_BAR_TEST : 0x00;
+		return ov2640_mask_set(client, COM7, COM7_COLOR_BAR_TEST, val);
 	}
 
 	return -EINVAL;
@@ -1184,12 +1192,16 @@ static int ov2640_probe(struct i2c_client *client,
 	v4l2_i2c_subdev_init(&priv->subdev, client, &ov2640_subdev_ops);
 	priv->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
 	mutex_init(&priv->lock);
-	v4l2_ctrl_handler_init(&priv->hdl, 2);
+	v4l2_ctrl_handler_init(&priv->hdl, 3);
 	priv->hdl.lock = &priv->lock;
 	v4l2_ctrl_new_std(&priv->hdl, &ov2640_ctrl_ops,
 			V4L2_CID_VFLIP, 0, 1, 1, 0);
 	v4l2_ctrl_new_std(&priv->hdl, &ov2640_ctrl_ops,
 			V4L2_CID_HFLIP, 0, 1, 1, 0);
+	v4l2_ctrl_new_std_menu_items(&priv->hdl, &ov2640_ctrl_ops,
+			V4L2_CID_TEST_PATTERN,
+			ARRAY_SIZE(ov2640_test_pattern_menu) - 1, 0, 0,
+			ov2640_test_pattern_menu);
 	priv->subdev.ctrl_handler = &priv->hdl;
 	if (priv->hdl.error) {
 		ret = priv->hdl.error;
Signature · 1 line
2.7.4
maintainer
#4 lore raw

Re: [PATCH 3/7] media: ov2640: add V4L2_CID_TEST_PATTERN control

Quoted 15 lines · Akinobu Mita

The ov2640 has the test pattern generator features. This makes use of it through V4L2_CID_TEST_PATTERN control.

Cc Sakari Ailus <[email protected]>
Cc Mauro Carvalho Chehab <[email protected]>
---
 drivers/media/i2c/ov2640.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
drivers/media/i2c/ov2640.c +0 -0
index 20a8853..4992d77 100644

drivers/media/i2c/ov2640.c static int ov2640_reset(struct i2c_client *client) · line 710

Quoted 6 lines
drivers/media/i2c/ov2640.c +3 -0
@@ -705,6 +705,11 @@ static int ov2640_reset(struct i2c_client *client)
 	return ret;
 }
 
+static const char * const ov2640_test_pattern_menu[] = {
+	"Disabled",
+	"Color bar",

s/b/B/

The smiapp driver uses "Eight Vertical Colour Bars", not sure if that'd fit here or not. FYI.

Quoted 36 lines
drivers/media/i2c/ov2640.c +10 -1
+};
+
 /*
  * functions
  */
@@ -740,6 +745,9 @@ static int ov2640_s_ctrl(struct v4l2_ctrl *ctrl)
 	case V4L2_CID_HFLIP:
 		val = ctrl->val ? REG04_HFLIP_IMG : 0x00;
 		return ov2640_mask_set(client, REG04, REG04_HFLIP_IMG, val);
+	case V4L2_CID_TEST_PATTERN:
+		val = ctrl->val ? COM7_COLOR_BAR_TEST : 0x00;
+		return ov2640_mask_set(client, COM7, COM7_COLOR_BAR_TEST, val);
 	}
 
 	return -EINVAL;
@@ -1184,12 +1192,16 @@ static int ov2640_probe(struct i2c_client *client,
 	v4l2_i2c_subdev_init(&priv->subdev, client, &ov2640_subdev_ops);
 	priv->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
 	mutex_init(&priv->lock);
-	v4l2_ctrl_handler_init(&priv->hdl, 2);
+	v4l2_ctrl_handler_init(&priv->hdl, 3);
 	priv->hdl.lock = &priv->lock;
 	v4l2_ctrl_new_std(&priv->hdl, &ov2640_ctrl_ops,
 			V4L2_CID_VFLIP, 0, 1, 1, 0);
 	v4l2_ctrl_new_std(&priv->hdl, &ov2640_ctrl_ops,
 			V4L2_CID_HFLIP, 0, 1, 1, 0);
+	v4l2_ctrl_new_std_menu_items(&priv->hdl, &ov2640_ctrl_ops,
+			V4L2_CID_TEST_PATTERN,
+			ARRAY_SIZE(ov2640_test_pattern_menu) - 1, 0, 0,
+			ov2640_test_pattern_menu);
 	priv->subdev.ctrl_handler = &priv->hdl;
 	if (priv->hdl.error) {
 		ret = priv->hdl.error;
Signature · 1 line
2.7.4
Signature · 2 lines
Sakari Ailus
[email protected]
#5 lore raw

Re: [PATCH 3/7] media: ov2640: add V4L2_CID_TEST_PATTERN control

2018年11月13日(火) 19:37 Sakari Ailus <[email protected]>:

Quoted 20 lines · Akinobu Mita
Quoted 18 lines

The ov2640 has the test pattern generator features. This makes use of it through V4L2_CID_TEST_PATTERN control.

Cc Sakari Ailus <[email protected]>
Cc Mauro Carvalho Chehab <[email protected]>
---
 drivers/media/i2c/ov2640.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
drivers/media/i2c/ov2640.c +0 -0
index 20a8853..4992d77 100644
@@ -705,6 +705,11 @@ static int ov2640_reset(struct i2c_client *client)
      return ret;
 }
 
Quoted 8 lines

drivers/media/i2c/ov2640.c static int ov2640_reset(struct i2c_client *client) · line 710

Quoted 3 lines
drivers/media/i2c/ov2640.c +3 -0
+static const char * const ov2640_test_pattern_menu[] = {
+     "Disabled",
+     "Color bar",

s/b/B/

The smiapp driver uses "Eight Vertical Colour Bars", not sure if that'd fit here or not. FYI.

This test pattern shows eight vertical color bars with blending actual sensor image, although the datasheet tells just 'Color bar'.

So either is fine for me.

maintainer
#6 lore raw

Re: [PATCH 3/7] media: ov2640: add V4L2_CID_TEST_PATTERN control

Quoted 27 lines · Akinobu Mita

2018年11月13日(火) 19:37 Sakari Ailus <[email protected]>:

Quoted 26 lines · Akinobu Mita
Quoted 15 lines

The ov2640 has the test pattern generator features. This makes use of it through V4L2_CID_TEST_PATTERN control.

Cc Sakari Ailus <[email protected]>
Cc Mauro Carvalho Chehab <[email protected]>
---
 drivers/media/i2c/ov2640.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
drivers/media/i2c/ov2640.c +0 -0
index 20a8853..4992d77 100644

drivers/media/i2c/ov2640.c static int ov2640_reset(struct i2c_client *client) · line 710

Quoted 6 lines
drivers/media/i2c/ov2640.c +3 -0
@@ -705,6 +705,11 @@ static int ov2640_reset(struct i2c_client *client)
      return ret;
 }
 
+static const char * const ov2640_test_pattern_menu[] = {
+     "Disabled",
+     "Color bar",

s/b/B/

Quoted 7 lines
Quoted 2 lines

The smiapp driver uses "Eight Vertical Colour Bars", not sure if that'd fit here or not. FYI.

This test pattern shows eight vertical color bars with blending actual sensor image, although the datasheet tells just 'Color bar'.

So either is fine for me.

I'll use what the smiapp driver does.

Thanks.

Signature · 2 lines
Sakari Ailus
[email protected]
#7 lore raw

PATCH 4/7 media: ov2640: support log_status ioctl and event interface

In reply to Akinobu Mita

This adds log_status ioctl and event interface for ov2640's v4l2 controls.

Cc Sakari Ailus <[email protected]>
Cc Mauro Carvalho Chehab <[email protected]>
---
 drivers/media/i2c/ov2640.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/media/i2c/ov2640.c +6 -1
index 4992d77..d8e91bc 100644
@@ -26,6 +26,7 @@
 #include <linux/videodev2.h>
 
 #include <media/v4l2-device.h>
+#include <media/v4l2-event.h>
 #include <media/v4l2-subdev.h>
 #include <media/v4l2-ctrls.h>
 #include <media/v4l2-image-sizes.h>
@@ -1096,6 +1097,9 @@ static const struct v4l2_ctrl_ops ov2640_ctrl_ops = {
 };
 
 static const struct v4l2_subdev_core_ops ov2640_subdev_core_ops = {
+	.log_status = v4l2_ctrl_subdev_log_status,
+	.subscribe_event = v4l2_ctrl_subdev_subscribe_event,
+	.unsubscribe_event = v4l2_event_subdev_unsubscribe,
 #ifdef CONFIG_VIDEO_ADV_DEBUG
 	.g_register	= ov2640_g_register,
 	.s_register	= ov2640_s_register,
@@ -1190,7 +1194,8 @@ static int ov2640_probe(struct i2c_client *client,
 		goto err_clk;
 
 	v4l2_i2c_subdev_init(&priv->subdev, client, &ov2640_subdev_ops);
-	priv->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
+	priv->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE |
+			      V4L2_SUBDEV_FL_HAS_EVENTS;
 	mutex_init(&priv->lock);
 	v4l2_ctrl_handler_init(&priv->hdl, 3);
 	priv->hdl.lock = &priv->lock;
Signature · 1 line
2.7.4
#8 lore raw

PATCH 5/7 media: ov5640: support log_status ioctl and event interface

In reply to Akinobu Mita

This adds log_status ioctl and event interface for ov5640's v4l2 controls.

Cc Steve Longerbeam <[email protected]>
Cc Sakari Ailus <[email protected]>
Cc Mauro Carvalho Chehab <[email protected]>
---
 drivers/media/i2c/ov5640.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/media/i2c/ov5640.c +6 -1
index eaefdb5..a91d917 100644
@@ -25,6 +25,7 @@
 #include <media/v4l2-async.h>
 #include <media/v4l2-ctrls.h>
 #include <media/v4l2-device.h>
+#include <media/v4l2-event.h>
 #include <media/v4l2-fwnode.h>
 #include <media/v4l2-subdev.h>
 
@@ -2641,6 +2642,9 @@ static int ov5640_s_stream(struct v4l2_subdev *sd, int enable)
 
 static const struct v4l2_subdev_core_ops ov5640_core_ops = {
 	.s_power = ov5640_s_power,
+	.log_status = v4l2_ctrl_subdev_log_status,
+	.subscribe_event = v4l2_ctrl_subdev_subscribe_event,
+	.unsubscribe_event = v4l2_event_subdev_unsubscribe,
 };
 
 static const struct v4l2_subdev_video_ops ov5640_video_ops = {
@@ -2795,7 +2799,8 @@ static int ov5640_probe(struct i2c_client *client,
 
 	v4l2_i2c_subdev_init(&sensor->sd, client, &ov5640_subdev_ops);
 
-	sensor->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
+	sensor->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE |
+			    V4L2_SUBDEV_FL_HAS_EVENTS;
 	sensor->pad.flags = MEDIA_PAD_FL_SOURCE;
 	sensor->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR;
 	ret = media_entity_pads_init(&sensor->sd.entity, 1, &sensor->pad);
Signature · 1 line
2.7.4
#9 lore raw

PATCH 6/7 media: ov7670: support log_status ioctl and event interface

In reply to Akinobu Mita

This adds log_status ioctl and event interface for ov7670's v4l2 controls.

Cc Jonathan Corbet <[email protected]>
Cc Sakari Ailus <[email protected]>
Cc Mauro Carvalho Chehab <[email protected]>
---
 drivers/media/i2c/ov7670.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/media/i2c/ov7670.c +5 -1
index bc68a3a..a70a6ff 100644
@@ -20,6 +20,7 @@
 #include <linux/gpio.h>
 #include <linux/gpio/consumer.h>
 #include <media/v4l2-device.h>
+#include <media/v4l2-event.h>
 #include <media/v4l2-ctrls.h>
 #include <media/v4l2-fwnode.h>
 #include <media/v4l2-mediabus.h>
@@ -1651,6 +1652,9 @@ static int ov7670_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
 static const struct v4l2_subdev_core_ops ov7670_core_ops = {
 	.reset = ov7670_reset,
 	.init = ov7670_init,
+	.log_status = v4l2_ctrl_subdev_log_status,
+	.subscribe_event = v4l2_ctrl_subdev_subscribe_event,
+	.unsubscribe_event = v4l2_event_subdev_unsubscribe,
 #ifdef CONFIG_VIDEO_ADV_DEBUG
 	.g_register = ov7670_g_register,
 	.s_register = ov7670_s_register,
@@ -1773,7 +1777,7 @@ static int ov7670_probe(struct i2c_client *client,
 
 #ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
 	sd->internal_ops = &ov7670_subdev_internal_ops;
-	sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
+	sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS;
 #endif
 
 	info->clock_speed = 30; /* default: a guess */
Signature · 1 line
2.7.4
#10 lore raw

PATCH 7/7 media: ov772x: support log_status ioctl and event interface

In reply to Akinobu Mita

This adds log_status ioctl and event interface for ov772x's v4l2 controls.

Cc Jacopo Mondi <[email protected]>
Cc Sakari Ailus <[email protected]>
Cc Mauro Carvalho Chehab <[email protected]>
---
 drivers/media/i2c/ov772x.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/media/i2c/ov772x.c +6 -1
index fefff7f..2e9a758 100644
@@ -30,6 +30,7 @@
 
 #include <media/v4l2-ctrls.h>
 #include <media/v4l2-device.h>
+#include <media/v4l2-event.h>
 #include <media/v4l2-image-sizes.h>
 #include <media/v4l2-subdev.h>
 
@@ -1287,6 +1288,9 @@ static const struct v4l2_ctrl_ops ov772x_ctrl_ops = {
 };
 
 static const struct v4l2_subdev_core_ops ov772x_subdev_core_ops = {
+	.log_status = v4l2_ctrl_subdev_log_status,
+	.subscribe_event = v4l2_ctrl_subdev_subscribe_event,
+	.unsubscribe_event = v4l2_event_subdev_unsubscribe,
 #ifdef CONFIG_VIDEO_ADV_DEBUG
 	.g_register	= ov772x_g_register,
 	.s_register	= ov772x_s_register,
@@ -1379,7 +1383,8 @@ static int ov772x_probe(struct i2c_client *client,
 	mutex_init(&priv->lock);
 
 	v4l2_i2c_subdev_init(&priv->subdev, client, &ov772x_subdev_ops);
-	priv->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
+	priv->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE |
+			      V4L2_SUBDEV_FL_HAS_EVENTS;
 	v4l2_ctrl_handler_init(&priv->hdl, 3);
 	/* Use our mutex for the controls */
 	priv->hdl.lock = &priv->lock;
Signature · 1 line
2.7.4
maintainer Acked-by on the v1 series
#11 lore raw
In reply to Akinobu Mita

Hello Mita-san,
thanks for the patches

Quoted 5 lines · Akinobu Mita

This patchset addds relatively small enhancements (log_status ioctl, event interface, V4L2_CID_TEST_PATTERN control, and V4L2_CID_COLORFX control) for mt9m111, ov2640, ov5640, ov7670, and ov772x drivers. I have these devices so these patches are tested with real devices.

For the ov772x part:

Thanks
j

Quoted 24 lines

Akinobu Mita (7):
media: mt9m111: support log_status ioctl and event interface
media: mt9m111: add V4L2_CID_COLORFX control
media: ov2640: add V4L2_CID_TEST_PATTERN control
media: ov2640: support log_status ioctl and event interface
media: ov5640: support log_status ioctl and event interface
media: ov7670: support log_status ioctl and event interface
media: ov772x: support log_status ioctl and event interface

 drivers/media/i2c/mt9m111.c | 44 ++++++++++++++++++++++++++++++++++++++++++--
 drivers/media/i2c/ov2640.c  | 21 +++++++++++++++++++--
 drivers/media/i2c/ov5640.c  |  7 ++++++-
 drivers/media/i2c/ov7670.c  |  6 +++++-
 drivers/media/i2c/ov772x.c  |  7 ++++++-
 5 files changed, 78 insertions(+), 7 deletions(-)

Cc: Steve Longerbeam <[email protected]>
Cc: Jonathan Corbet <[email protected]>
Cc: Jacopo Mondi <[email protected]>
Cc: Sakari Ailus <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
--
2.7.4