Commit 7b0bfa5f authored by Guilherme Gallo's avatar Guilherme Gallo Committed by Mauro Carvalho Chehab

media: vimc: implement basic v4l2-ctrls

Add brightness, contrast, hue and saturation controls in vimc-sensor
Signed-off-by: default avatarGuilherme Alcarde Gallo <gagallo7@gmail.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 2dd62390
......@@ -317,6 +317,18 @@ static int vimc_sen_s_ctrl(struct v4l2_ctrl *ctrl)
case V4L2_CID_VFLIP:
tpg_s_vflip(&vsen->tpg, ctrl->val);
break;
case V4L2_CID_BRIGHTNESS:
tpg_s_brightness(&vsen->tpg, ctrl->val);
break;
case V4L2_CID_CONTRAST:
tpg_s_contrast(&vsen->tpg, ctrl->val);
break;
case V4L2_CID_HUE:
tpg_s_hue(&vsen->tpg, ctrl->val);
break;
case V4L2_CID_SATURATION:
tpg_s_saturation(&vsen->tpg, ctrl->val);
break;
default:
return -EINVAL;
}
......@@ -378,6 +390,14 @@ static int vimc_sen_comp_bind(struct device *comp, struct device *master,
V4L2_CID_VFLIP, 0, 1, 1, 0);
v4l2_ctrl_new_std(&vsen->hdl, &vimc_sen_ctrl_ops,
V4L2_CID_HFLIP, 0, 1, 1, 0);
v4l2_ctrl_new_std(&vsen->hdl, &vimc_sen_ctrl_ops,
V4L2_CID_BRIGHTNESS, 0, 255, 1, 128);
v4l2_ctrl_new_std(&vsen->hdl, &vimc_sen_ctrl_ops,
V4L2_CID_CONTRAST, 0, 255, 1, 128);
v4l2_ctrl_new_std(&vsen->hdl, &vimc_sen_ctrl_ops,
V4L2_CID_HUE, -128, 127, 1, 0);
v4l2_ctrl_new_std(&vsen->hdl, &vimc_sen_ctrl_ops,
V4L2_CID_SATURATION, 0, 255, 1, 128);
vsen->sd.ctrl_handler = &vsen->hdl;
if (vsen->hdl.error) {
ret = vsen->hdl.error;
......
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