Commit 82a7c049 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[media] v4l2-ctrls: make manual_mode_value 8 bits and check against control range

Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 2330fb82
...@@ -1264,6 +1264,7 @@ void v4l2_ctrl_auto_cluster(unsigned ncontrols, struct v4l2_ctrl **controls, ...@@ -1264,6 +1264,7 @@ void v4l2_ctrl_auto_cluster(unsigned ncontrols, struct v4l2_ctrl **controls,
v4l2_ctrl_cluster(ncontrols, controls); v4l2_ctrl_cluster(ncontrols, controls);
WARN_ON(ncontrols <= 1); WARN_ON(ncontrols <= 1);
WARN_ON(manual_val < master->minimum || manual_val > master->maximum);
master->is_auto = true; master->is_auto = true;
master->manual_mode_value = manual_val; master->manual_mode_value = manual_val;
master->flags |= V4L2_CTRL_FLAG_UPDATE; master->flags |= V4L2_CTRL_FLAG_UPDATE;
......
...@@ -118,7 +118,7 @@ struct v4l2_ctrl { ...@@ -118,7 +118,7 @@ struct v4l2_ctrl {
unsigned int is_private:1; unsigned int is_private:1;
unsigned int is_volatile:1; unsigned int is_volatile:1;
unsigned int is_auto:1; unsigned int is_auto:1;
unsigned int manual_mode_value:5; unsigned int manual_mode_value:8;
const struct v4l2_ctrl_ops *ops; const struct v4l2_ctrl_ops *ops;
u32 id; u32 id;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment