diff mbox series

[v3,34/35] media: camss: csid: Add support for events triggered by user controls

Message ID 1532343772-27382-35-git-send-email-todor.tomov@linaro.org
State Accepted
Commit 988b3ae3e0e9374b6be3b4e58524cfa6f224d8d5
Headers show
Series None | expand

Commit Message

Todor Tomov July 23, 2018, 11:02 a.m. UTC
Changing a user control value can trigger an event to other
users. Add support for that.

Signed-off-by: Todor Tomov <todor.tomov@linaro.org>

---
 drivers/media/platform/qcom/camss/camss-csid.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

-- 
2.7.4

Comments

Sakari Ailus July 24, 2018, 12:55 p.m. UTC | #1
Hi Todor,

On Mon, Jul 23, 2018 at 02:02:51PM +0300, Todor Tomov wrote:
> Changing a user control value can trigger an event to other

> users. Add support for that.

> 

> Signed-off-by: Todor Tomov <todor.tomov@linaro.org>


Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>


No need to wait more acks from me; please just check the comments I've
given so far.

-- 
Sakari Ailus
sakari.ailus@linux.intel.com
diff mbox series

Patch

diff --git a/drivers/media/platform/qcom/camss/camss-csid.c b/drivers/media/platform/qcom/camss/camss-csid.c
index a581377..b50eb96 100644
--- a/drivers/media/platform/qcom/camss/camss-csid.c
+++ b/drivers/media/platform/qcom/camss/camss-csid.c
@@ -17,6 +17,7 @@ 
 #include <linux/regulator/consumer.h>
 #include <media/media-entity.h>
 #include <media/v4l2-device.h>
+#include <media/v4l2-event.h>
 #include <media/v4l2-subdev.h>
 
 #include "camss-csid.h"
@@ -1266,6 +1267,8 @@  static int csid_link_setup(struct media_entity *entity,
 
 static const struct v4l2_subdev_core_ops csid_core_ops = {
 	.s_power = csid_set_power,
+	.subscribe_event = v4l2_ctrl_subdev_subscribe_event,
+	.unsubscribe_event = v4l2_event_subdev_unsubscribe,
 };
 
 static const struct v4l2_subdev_video_ops csid_video_ops = {
@@ -1311,7 +1314,8 @@  int msm_csid_register_entity(struct csid_device *csid,
 
 	v4l2_subdev_init(sd, &csid_v4l2_ops);
 	sd->internal_ops = &csid_v4l2_internal_ops;
-	sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
+	sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE |
+		     V4L2_SUBDEV_FL_HAS_EVENTS;
 	snprintf(sd->name, ARRAY_SIZE(sd->name), "%s%d",
 		 MSM_CSID_NAME, csid->id);
 	v4l2_set_subdevdata(sd, csid);