[4/5] media: i2c: imx335: Fix hblank min/max values

Message ID 20231010005126.3425444-5-kieran.bingham@ideasonboard.com
State New
Headers
Series [1/5] media: dt-bindings: media: imx335: Add supply bindings |

Commit Message

Kieran Bingham Oct. 10, 2023, 12:51 a.m. UTC
  The V4L2_CID_HBLANK control is marked as readonly and can only be a
single value.

Set the minimum and maximum value to match the mode value.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 drivers/media/i2c/imx335.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Umang Jain Oct. 10, 2023, 4:15 a.m. UTC | #1
Hi Kieran

On 10/10/23 6:21 AM, Kieran Bingham wrote:
> The V4L2_CID_HBLANK control is marked as readonly and can only be a
> single value.
>
> Set the minimum and maximum value to match the mode value.
>
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>

> ---
>   drivers/media/i2c/imx335.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/i2c/imx335.c b/drivers/media/i2c/imx335.c
> index 026777eb362e..1a34b2a43718 100644
> --- a/drivers/media/i2c/imx335.c
> +++ b/drivers/media/i2c/imx335.c
> @@ -1043,8 +1043,8 @@ static int imx335_init_controls(struct imx335 *imx335)
>   	imx335->hblank_ctrl = v4l2_ctrl_new_std(ctrl_hdlr,
>   						&imx335_ctrl_ops,
>   						V4L2_CID_HBLANK,
> -						IMX335_REG_MIN,
> -						IMX335_REG_MAX,
> +						mode->hblank,
> +						mode->hblank,
>   						1, mode->hblank);
>   	if (imx335->hblank_ctrl)
>   		imx335->hblank_ctrl->flags |= V4L2_CTRL_FLAG_READ_ONLY;
  

Patch

diff --git a/drivers/media/i2c/imx335.c b/drivers/media/i2c/imx335.c
index 026777eb362e..1a34b2a43718 100644
--- a/drivers/media/i2c/imx335.c
+++ b/drivers/media/i2c/imx335.c
@@ -1043,8 +1043,8 @@  static int imx335_init_controls(struct imx335 *imx335)
 	imx335->hblank_ctrl = v4l2_ctrl_new_std(ctrl_hdlr,
 						&imx335_ctrl_ops,
 						V4L2_CID_HBLANK,
-						IMX335_REG_MIN,
-						IMX335_REG_MAX,
+						mode->hblank,
+						mode->hblank,
 						1, mode->hblank);
 	if (imx335->hblank_ctrl)
 		imx335->hblank_ctrl->flags |= V4L2_CTRL_FLAG_READ_ONLY;