mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ricardo Ribalda <ribalda@chromium.org>
To: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Yong Zhi <yong.zhi@intel.com>, Bingbu Cao <bingbu.cao@intel.com>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	Chiranjeevi Rapolu <chiranjeevi.rapolu@intel.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Ricardo Ribalda <ribalda@chromium.org>
Subject: [PATCH v3 8/8] media: ov5670: Add implementation for events
Date: Fri,  1 Oct 2021 11:25:22 +0000	[thread overview]
Message-ID: <20211001112522.2839602-9-ribalda@chromium.org> (raw)
In-Reply-To: <20211001112522.2839602-1-ribalda@chromium.org>

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>
---
 drivers/media/i2c/ov5670.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/media/i2c/ov5670.c b/drivers/media/i2c/ov5670.c
index 49189926afd67..251f459ab484a 100644
--- a/drivers/media/i2c/ov5670.c
+++ b/drivers/media/i2c/ov5670.c
@@ -7,6 +7,7 @@
 #include <linux/pm_runtime.h>
 #include <media/v4l2-ctrls.h>
 #include <media/v4l2-device.h>
+#include <media/v4l2-event.h>
 #include <media/v4l2-fwnode.h>
 
 #define OV5670_REG_CHIP_ID		0x300a
@@ -2420,6 +2421,12 @@ static int ov5670_identify_module(struct ov5670 *ov5670)
 	return 0;
 }
 
+static const struct v4l2_subdev_core_ops ov5670_core_ops = {
+	.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 ov5670_video_ops = {
 	.s_stream = ov5670_set_stream,
 };
@@ -2436,6 +2443,7 @@ static const struct v4l2_subdev_sensor_ops ov5670_sensor_ops = {
 };
 
 static const struct v4l2_subdev_ops ov5670_subdev_ops = {
+	.core = &ov5670_core_ops,
 	.video = &ov5670_video_ops,
 	.pad = &ov5670_pad_ops,
 	.sensor = &ov5670_sensor_ops,
@@ -2489,7 +2497,8 @@ static int ov5670_probe(struct i2c_client *client)
 	}
 
 	ov5670->sd.internal_ops = &ov5670_internal_ops;
-	ov5670->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
+	ov5670->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE |
+			    V4L2_SUBDEV_FL_HAS_EVENTS;
 	ov5670->sd.entity.ops = &ov5670_subdev_entity_ops;
 	ov5670->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR;
 
-- 
2.33.0.800.g4c38ced690-goog


      parent reply	other threads:[~2021-10-01 11:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-01 11:25 [PATCH v3 0/8] media: ipu3 + i2c: Fix v4l2-compliance issues Ricardo Ribalda
2021-10-01 11:25 ` [PATCH v3 1/8] media: ipu3-cio2 Check num_planes and sizes in queue_setup Ricardo Ribalda
2021-10-06 21:56   ` Sakari Ailus
2021-10-06 22:27     ` Ricardo Ribalda
2021-10-01 11:25 ` [PATCH v3 2/8] media: ipu3-imgu: Refactor bytesperpixel calculation Ricardo Ribalda
2021-10-01 11:25 ` [PATCH v3 3/8] media: ipu3-imgu: Set valid initial format Ricardo Ribalda
2021-10-06 21:50   ` Sakari Ailus
2021-10-01 11:25 ` [PATCH v3 4/8] media: ipu3-imgu: imgu_fmt: Handle properly try Ricardo Ribalda
2021-10-01 11:25 ` [PATCH v3 5/8] media: ipu3-imgu: VIDIOC_QUERYCAP: Fix bus_info Ricardo Ribalda
2021-10-01 11:25 ` [PATCH v3 6/8] media: dw9714: Add implementation for events Ricardo Ribalda
2021-10-01 11:25 ` [PATCH v3 7/8] media: ov13858: " Ricardo Ribalda
2021-10-01 11:25 ` Ricardo Ribalda [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211001112522.2839602-9-ribalda@chromium.org \
    --to=ribalda@chromium.org \
    --cc=bingbu.cao@intel.com \
    --cc=chiranjeevi.rapolu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=yong.zhi@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®