mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-03 23:58:05 +00:00
media: imx258: Register H/V flip controls
Register controls for V4L2_CID_HFLIP and V4L2_CID_VFLIP. The controls are registered as read-only and enabled by default, as the driver embeds a 180 degrees rotation in its programming sequences and only supports that mode of operations. Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
This commit is contained in:
parent
c8f30770c6
commit
6e4731e756
1 changed files with 13 additions and 1 deletions
|
@ -1151,6 +1151,7 @@ static int imx258_init_controls(struct imx258 *imx258)
|
|||
struct i2c_client *client = v4l2_get_subdevdata(&imx258->sd);
|
||||
struct v4l2_fwnode_device_properties props;
|
||||
struct v4l2_ctrl_handler *ctrl_hdlr;
|
||||
struct v4l2_ctrl *vflip, *hflip;
|
||||
s64 vblank_def;
|
||||
s64 vblank_min;
|
||||
s64 pixel_rate_min;
|
||||
|
@ -1158,7 +1159,7 @@ static int imx258_init_controls(struct imx258 *imx258)
|
|||
int ret;
|
||||
|
||||
ctrl_hdlr = &imx258->ctrl_handler;
|
||||
ret = v4l2_ctrl_handler_init(ctrl_hdlr, 11);
|
||||
ret = v4l2_ctrl_handler_init(ctrl_hdlr, 13);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
@ -1174,6 +1175,17 @@ static int imx258_init_controls(struct imx258 *imx258)
|
|||
if (imx258->link_freq)
|
||||
imx258->link_freq->flags |= V4L2_CTRL_FLAG_READ_ONLY;
|
||||
|
||||
/* The driver only supports one bayer order and flips by default. */
|
||||
hflip = v4l2_ctrl_new_std(ctrl_hdlr, &imx258_ctrl_ops,
|
||||
V4L2_CID_HFLIP, 1, 1, 1, 1);
|
||||
if (hflip)
|
||||
hflip->flags |= V4L2_CTRL_FLAG_READ_ONLY;
|
||||
|
||||
vflip = v4l2_ctrl_new_std(ctrl_hdlr, &imx258_ctrl_ops,
|
||||
V4L2_CID_VFLIP, 1, 1, 1, 1);
|
||||
if (vflip)
|
||||
vflip->flags |= V4L2_CTRL_FLAG_READ_ONLY;
|
||||
|
||||
pixel_rate_max = link_freq_to_pixel_rate(link_freq_menu_items[0]);
|
||||
pixel_rate_min = link_freq_to_pixel_rate(link_freq_menu_items[1]);
|
||||
/* By default, PIXEL_RATE is read only */
|
||||
|
|
Loading…
Reference in a new issue