Commit a7cbb138 authored by Enrico Scholz's avatar Enrico Scholz

onsemi: core: added 'hblank (effective)' control

Signed-off-by: Enrico Scholz's avatarEnrico Scholz <enrico.scholz@sigma-chemnitz.de>
parent 7136bacf
......@@ -2541,6 +2541,21 @@ static int onsemi_g_ctrl(struct v4l2_ctrl *ctrl)
goto out;
switch (ctrl->id) {
case V4L2_CID_X_HBLANK_EFFECTIVE: {
unsigned int h_size;
struct onsemi_v4l_parm const *parm = onsemi->v4l_parm;
if (!parm) {
rc = -EPIPE;
goto out;
}
onsemi_get_frame_size(onsemi, parm, &h_size, NULL);
ctrl->val = h_size - parm->crop.width;
rc = 0;
break;
}
default:
dev_dbg(onsemi->dev, "unhandled control %08x (%s)\n", ctrl->id,
v4l2_ctrl_get_name(ctrl->id));
......@@ -2577,6 +2592,17 @@ static struct v4l2_ctrl_config const onsemi_core_ctrls[] = {
.max = 65535,
.step = 1,
.def = 1,
}, {
.ops = &onsemi_core_ctrl_ops,
.id = V4L2_CID_X_HBLANK_EFFECTIVE,
.name = "hblank (effective)",
.type = V4L2_CTRL_TYPE_INTEGER,
.flags = (V4L2_CTRL_FLAG_READ_ONLY |
V4L2_CTRL_FLAG_VOLATILE),
.min = 0,
.max = 65535,
.step = 1,
.def = 1,
}, {
.ops = &onsemi_core_ctrl_ops,
.id = V4L2_CID_HFLIP,
......
......@@ -51,6 +51,7 @@ enum {
V4L2_CID_X_BLACK_LEVEL_AUTO,
V4L2_CID_X_FLASH_DELAY,
V4L2_CID_X_HBLANK_EFFECTIVE,
};
enum onsemi_pwr_state {
......
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