media: media/v4l2-ctrls: volatiles should not generate CH_VALUE 91/175691/1
authorRicardo Ribalda <ricardo.ribalda@gmail.com>
Wed, 28 Mar 2018 18:12:35 +0000 (15:12 -0300)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 11 Apr 2018 11:59:18 +0000 (20:59 +0900)
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>
[sw0312.kim: cherry-pick from linux-3.18.y]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: Ia813ed1bf457bafcdae47c02d781203f2b19b3de

drivers/media/v4l2-core/v4l2-ctrls.c

index 3c4e228556521c59c15ef9b522d765add773f44f..2bdb2a3512a4aebb2a94a50dab39bc34f0f49835 100644 (file)
@@ -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);