Skip to contentSkip to conversation

media: i2c: imx219: Declare that the driver can create events

PATCH Superseded Dafna Hirschfeld 2 participants 2 messages Nov 16, 2020

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: i2c: imx219: Declare that the driver can create events

The flag V4L2_SUBDEV_FL_HAS_EVENTS is required if the subdev can generate events. It can create events from the ctrl handler, therefore this is required.

---
This patch fixes compliance issues found in imx219:

fail: v4l2-test-controls.cpp(830): failed to find event for control 'Exposure'
test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: FAIL

 drivers/media/i2c/imx219.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/media/i2c/imx219.c +2 -1
index ef2b1a6a0f4a..ba1c5e59ddf4 100644
@@ -1503,7 +1503,8 @@ static int imx219_probe(struct i2c_client *client)
 
 	/* Initialize subdev */
 	imx219->sd.internal_ops = &imx219_internal_ops;
-	imx219->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
+	imx219->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE |
+			    V4L2_SUBDEV_FL_HAS_EVENTS;
 	imx219->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR;
 
 	/* Initialize source pad */
Signature · 7 lines
2.17.1


_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
Reviewed-by on v1 1/1
#1 lore raw

Hi Dave,

Thank you for the patch.

Quoted 6 lines · Dafna Hirschfeld

The flag V4L2_SUBDEV_FL_HAS_EVENTS is required if the subdev can generate events. It can create events from the ctrl handler, therefore this is required.

We should probably revisit this in the V4L2 core, as all subdevs that handle controls can generate events, it shouldn't need to be manually implemented in each of them.

Quoted 23 lines

---
This patch fixes compliance issues found in imx219:

fail: v4l2-test-controls.cpp(830): failed to find event for control 'Exposure'
test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: FAIL

 drivers/media/i2c/imx219.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/media/i2c/imx219.c +2 -1
index ef2b1a6a0f4a..ba1c5e59ddf4 100644
@@ -1503,7 +1503,8 @@ static int imx219_probe(struct i2c_client *client)
 
 	/* Initialize subdev */
 	imx219->sd.internal_ops = &imx219_internal_ops;
-	imx219->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
+	imx219->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE |
+			    V4L2_SUBDEV_FL_HAS_EVENTS;
 	imx219->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR;
 
 	/* Initialize source pad */
Signature · 8 lines
Regards,

Laurent Pinchart

_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip