OSDN Git Service

media: ov5640: support log_status ioctl and event interface
authorAkinobu Mita <akinobu.mita@gmail.com>
Mon, 12 Nov 2018 16:00:52 +0000 (11:00 -0500)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Fri, 23 Nov 2018 09:46:46 +0000 (04:46 -0500)
This adds log_status ioctl and event interface for ov5640's v4l2 controls.

Cc: Steve Longerbeam <slongerbeam@gmail.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/i2c/ov5640.c

index eaefdb5..a91d917 100644 (file)
@@ -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 @@ out:
 
 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);