summaryrefslogtreecommitdiff
path: root/drivers/media/video/m5mols/m5mols_controls.c
diff options
context:
space:
mode:
authorSylwester Nawrocki <s.nawrocki@samsung.com>2012-03-06 14:10:27 +0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-05-14 21:34:02 +0400
commitefcb07c1bbd43846aff192f28ad755fc8c93ad81 (patch)
treef3d60330ed8bf701dc10a8c52bb00caf71f038a6 /drivers/media/video/m5mols/m5mols_controls.c
parent4eb3419d401579b262f61d4d03cf10598ab0e2a2 (diff)
downloadlinux-efcb07c1bbd43846aff192f28ad755fc8c93ad81.tar.xz
[media] m5mols: Add image stabilization 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.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/media/video/m5mols/m5mols_controls.c b/drivers/media/video/m5mols/m5mols_controls.c
index 512c3603b280..6c607d467c6e 100644
--- a/drivers/media/video/m5mols/m5mols_controls.c
+++ b/drivers/media/video/m5mols/m5mols_controls.c
@@ -375,6 +375,19 @@ static int m5mols_set_wdr(struct m5mols_info *info, int wdr)
return m5mols_write(&info->sd, CAPP_WDR_EN, wdr);
}
+static int m5mols_set_stabilization(struct m5mols_info *info, int val)
+{
+ struct v4l2_subdev *sd = &info->sd;
+ unsigned int evp = val ? 0xe : 0x0;
+ int ret;
+
+ ret = m5mols_write(sd, AE_EV_PRESET_MONITOR, evp);
+ if (ret < 0)
+ return ret;
+
+ return m5mols_write(sd, AE_EV_PRESET_CAPTURE, evp);
+}
+
static int m5mols_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
{
struct v4l2_subdev *sd = to_sd(ctrl);
@@ -455,6 +468,10 @@ static int m5mols_s_ctrl(struct v4l2_ctrl *ctrl)
case V4L2_CID_WIDE_DYNAMIC_RANGE:
ret = m5mols_set_wdr(info, ctrl->val);
break;
+
+ case V4L2_CID_IMAGE_STABILIZATION:
+ ret = m5mols_set_stabilization(info, ctrl->val);
+ break;
}
if (ret == 0 && info->mode != last_mode)
@@ -535,6 +552,9 @@ int m5mols_init_controls(struct v4l2_subdev *sd)
info->wdr = v4l2_ctrl_new_std(&info->handle, &m5mols_ctrl_ops,
V4L2_CID_WIDE_DYNAMIC_RANGE, 0, 1, 1, 0);
+ info->stabilization = v4l2_ctrl_new_std(&info->handle, &m5mols_ctrl_ops,
+ V4L2_CID_IMAGE_STABILIZATION, 0, 1, 1, 0);
+
if (info->handle.error) {
int ret = info->handle.error;
v4l2_err(sd, "Failed to initialize controls: %d\n", ret);