mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 05:44:11 +00:00
media: i2c: st-vgxy61: Add V4L2_SUBDEV_FL_HAS_EVENTS and subscribe hooks
Any V4L2 subdevice that implements controls and declares V4L2_SUBDEV_FL_HAS_DEVNODE should also declare V4L2_SUBDEV_FL_HAS_EVENTS and implement subscribe_event and unsubscribe_event hooks. With that done, v4l2-compliance testing is now ok. Signed-off-by: Alain Volmat <alain.volmat@foss.st.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
This commit is contained in:
parent
2cc0f07718
commit
b4c4f8b816
1 changed files with 9 additions and 1 deletions
|
@ -21,6 +21,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>
|
||||
|
||||
|
@ -1464,6 +1465,11 @@ static int vgxy61_init_controls(struct vgxy61_dev *sensor)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static const struct v4l2_subdev_core_ops vgxy61_core_ops = {
|
||||
.subscribe_event = v4l2_ctrl_subdev_subscribe_event,
|
||||
.unsubscribe_event = v4l2_event_subdev_unsubscribe,
|
||||
};
|
||||
|
||||
static const struct v4l2_subdev_video_ops vgxy61_video_ops = {
|
||||
.s_stream = vgxy61_s_stream,
|
||||
};
|
||||
|
@ -1477,6 +1483,7 @@ static const struct v4l2_subdev_pad_ops vgxy61_pad_ops = {
|
|||
};
|
||||
|
||||
static const struct v4l2_subdev_ops vgxy61_subdev_ops = {
|
||||
.core = &vgxy61_core_ops,
|
||||
.video = &vgxy61_video_ops,
|
||||
.pad = &vgxy61_pad_ops,
|
||||
};
|
||||
|
@ -1846,7 +1853,8 @@ static int vgxy61_probe(struct i2c_client *client)
|
|||
|
||||
v4l2_i2c_subdev_init(&sensor->sd, client, &vgxy61_subdev_ops);
|
||||
sensor->sd.internal_ops = &vgxy61_internal_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.ops = &vgxy61_subdev_entity_ops;
|
||||
sensor->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR;
|
||||
|
|
Loading…
Reference in a new issue