diff options
author | Sylwester Nawrocki <s.nawrocki@samsung.com> | 2012-03-06 07:10:13 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-05-14 14:33:47 -0300 |
commit | 4eb3419d401579b262f61d4d03cf10598ab0e2a2 (patch) | |
tree | 2e02782ac35f41d5653ade810e0698f5f5463fe5 /drivers/media/video/m5mols/m5mols_controls.c | |
parent | 48311db6768040970d4a28faab17583b5177af84 (diff) | |
download | blackbird-op-linux-4eb3419d401579b262f61d4d03cf10598ab0e2a2.tar.gz blackbird-op-linux-4eb3419d401579b262f61d4d03cf10598ab0e2a2.zip |
[media] m5mols: Add wide dynamic range control
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/m5mols/m5mols_controls.c')
-rw-r--r-- | drivers/media/video/m5mols/m5mols_controls.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/media/video/m5mols/m5mols_controls.c b/drivers/media/video/m5mols/m5mols_controls.c index 797836315225..512c3603b280 100644 --- a/drivers/media/video/m5mols/m5mols_controls.c +++ b/drivers/media/video/m5mols/m5mols_controls.c @@ -360,6 +360,21 @@ static int m5mols_set_iso(struct m5mols_info *info, int auto_iso) return m5mols_write(&info->sd, AE_ISO, iso); } +static int m5mols_set_wdr(struct m5mols_info *info, int wdr) +{ + int ret; + + ret = m5mols_write(&info->sd, MON_TONE_CTL, wdr ? 9 : 5); + if (ret < 0) + return ret; + + ret = m5mols_set_mode(info, REG_CAPTURE); + if (ret < 0) + return ret; + + return m5mols_write(&info->sd, CAPP_WDR_EN, wdr); +} + static int m5mols_g_volatile_ctrl(struct v4l2_ctrl *ctrl) { struct v4l2_subdev *sd = to_sd(ctrl); @@ -436,6 +451,10 @@ static int m5mols_s_ctrl(struct v4l2_ctrl *ctrl) case V4L2_CID_COLORFX: ret = m5mols_set_color_effect(info, ctrl->val); break; + + case V4L2_CID_WIDE_DYNAMIC_RANGE: + ret = m5mols_set_wdr(info, ctrl->val); + break; } if (ret == 0 && info->mode != last_mode) @@ -513,6 +532,9 @@ int m5mols_init_controls(struct v4l2_subdev *sd) info->colorfx = v4l2_ctrl_new_std_menu(&info->handle, &m5mols_ctrl_ops, V4L2_CID_COLORFX, 4, 0, V4L2_COLORFX_NONE); + info->wdr = v4l2_ctrl_new_std(&info->handle, &m5mols_ctrl_ops, + V4L2_CID_WIDE_DYNAMIC_RANGE, 0, 1, 1, 0); + if (info->handle.error) { int ret = info->handle.error; v4l2_err(sd, "Failed to initialize controls: %d\n", ret); |