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

media: ov5670: 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
dce6dd44 5bd4098c

+10 -1
+10 -1
drivers/media/i2c/ov5670.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 OV5670_REG_CHIP_ID 0x300a ··· 2421 2420 return 0; 2422 2421 } 2423 2422 2423 + static const struct v4l2_subdev_core_ops ov5670_core_ops = { 2424 + .log_status = v4l2_ctrl_subdev_log_status, 2425 + .subscribe_event = v4l2_ctrl_subdev_subscribe_event, 2426 + .unsubscribe_event = v4l2_event_subdev_unsubscribe, 2427 + }; 2428 + 2424 2429 static const struct v4l2_subdev_video_ops ov5670_video_ops = { 2425 2430 .s_stream = ov5670_set_stream, 2426 2431 }; ··· 2443 2436 }; 2444 2437 2445 2438 static const struct v4l2_subdev_ops ov5670_subdev_ops = { 2439 + .core = &ov5670_core_ops, 2446 2440 .video = &ov5670_video_ops, 2447 2441 .pad = &ov5670_pad_ops, 2448 2442 .sensor = &ov5670_sensor_ops, ··· 2497 2489 } 2498 2490 2499 2491 ov5670->sd.internal_ops = &ov5670_internal_ops; 2500 - ov5670->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; 2492 + ov5670->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | 2493 + V4L2_SUBDEV_FL_HAS_EVENTS; 2501 2494 ov5670->sd.entity.ops = &ov5670_subdev_entity_ops; 2502 2495 ov5670->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR; 2503 2496