Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: ov13858: Add implementation for events

Use v4l2 control API helpers to support the events.

Fixes v4l2-compliance:

test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: FAIL

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

authored by

Ricardo Ribalda and committed by
Mauro Carvalho Chehab
5bd4098c 98442bd0

+10 -1
+10 -1
drivers/media/i2c/ov13858.c
··· 7 7 #include <linux/pm_runtime.h> 8 8 #include <media/v4l2-ctrls.h> 9 9 #include <media/v4l2-device.h> 10 + #include <media/v4l2-event.h> 10 11 #include <media/v4l2-fwnode.h> 11 12 12 13 #define OV13858_REG_VALUE_08BIT 1 ··· 1554 1553 return 0; 1555 1554 } 1556 1555 1556 + static const struct v4l2_subdev_core_ops ov13858_core_ops = { 1557 + .log_status = v4l2_ctrl_subdev_log_status, 1558 + .subscribe_event = v4l2_ctrl_subdev_subscribe_event, 1559 + .unsubscribe_event = v4l2_event_subdev_unsubscribe, 1560 + }; 1561 + 1557 1562 static const struct v4l2_subdev_video_ops ov13858_video_ops = { 1558 1563 .s_stream = ov13858_set_stream, 1559 1564 }; ··· 1576 1569 }; 1577 1570 1578 1571 static const struct v4l2_subdev_ops ov13858_subdev_ops = { 1572 + .core = &ov13858_core_ops, 1579 1573 .video = &ov13858_video_ops, 1580 1574 .pad = &ov13858_pad_ops, 1581 1575 .sensor = &ov13858_sensor_ops, ··· 1732 1724 1733 1725 /* Initialize subdev */ 1734 1726 ov13858->sd.internal_ops = &ov13858_internal_ops; 1735 - ov13858->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; 1727 + ov13858->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | 1728 + V4L2_SUBDEV_FL_HAS_EVENTS; 1736 1729 ov13858->sd.entity.ops = &ov13858_subdev_entity_ops; 1737 1730 ov13858->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR; 1738 1731