summaryrefslogtreecommitdiffstats
path: root/drivers/media/v4l2-core
diff options
context:
space:
mode:
authorRicardo Ribalda <ricardo.ribalda@gmail.com>2018-03-28 15:12:35 -0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-04-08 11:49:47 +0200
commitfe1d928469cc7fcde4a079f52d6e67dc1445fb52 (patch)
tree33462f76de1d57392b6af8a63b3437b327ea5120 /drivers/media/v4l2-core
parent5f5fe19a886db65a5a9a8b4cc27473e0a5ce7916 (diff)
downloadlinux-stable-fe1d928469cc7fcde4a079f52d6e67dc1445fb52.tar.gz
linux-stable-fe1d928469cc7fcde4a079f52d6e67dc1445fb52.tar.bz2
linux-stable-fe1d928469cc7fcde4a079f52d6e67dc1445fb52.zip
media: media/v4l2-ctrls: volatiles should not generate CH_VALUE
Volatile controls should not generate CH_VALUE events. Set has_changed to false to prevent this happening. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/media/v4l2-core')
-rw-r--r--drivers/media/v4l2-core/v4l2-ctrls.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c
index 3c4e22855652..2bdb2a3512a4 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -1619,6 +1619,15 @@ static int cluster_changed(struct v4l2_ctrl *master)
if (ctrl == NULL)
continue;
+ /*
+ * Set has_changed to false to avoid generating
+ * the event V4L2_EVENT_CTRL_CH_VALUE
+ */
+ if (ctrl->flags & V4L2_CTRL_FLAG_VOLATILE) {
+ ctrl->has_changed = false;
+ continue;
+ }
+
for (idx = 0; !ctrl_changed && idx < ctrl->elems; idx++)
ctrl_changed = !ctrl->type_ops->equal(ctrl, idx,
ctrl->p_cur, ctrl->p_new);