From: Kieran Bingham <kieran.bingham@ideasonboard.com>
To: Tarang Raval <tarang.raval@siliconsignals.io>,
sakari.ailus@linux.intel.com
Cc: Tarang Raval <tarang.raval@siliconsignals.io>,
Dave Stevenson <dave.stevenson@raspberrypi.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 2/2] media: i2c: imx219: Replace exposure magic value with named constant
Date: Fri, 31 Oct 2025 15:08:27 +0000 [thread overview]
Message-ID: <176192330798.567526.14611830953271874355@ping.linuxembedded.co.uk> (raw)
In-Reply-To: <20251031114835.113026-3-tarang.raval@siliconsignals.io>
Quoting Tarang Raval (2025-10-31 11:48:35)
> Introduce IMX219_EXPOSURE_OFFSET (4) and use it instead of the literal
> '4' when computing the maximum coarse exposure. The IMX219 datasheet
> specifies the maximum storage time as frame_length_lines - 4.
> (Ref: Datasheet section 5-7-1)
>
> Also fix one indentation issue for consistency.
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
>
> Signed-off-by: Tarang Raval <tarang.raval@siliconsignals.io>
> ---
> drivers/media/i2c/imx219.c | 13 +++++++------
> 1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c
> index 40693635c0c3..e87d5a18fe87 100644
> --- a/drivers/media/i2c/imx219.c
> +++ b/drivers/media/i2c/imx219.c
> @@ -68,6 +68,7 @@
> #define IMX219_EXPOSURE_STEP 1
> #define IMX219_EXPOSURE_DEFAULT 0x640
> #define IMX219_EXPOSURE_MAX 65535
> +#define IMX219_EXPOSURE_OFFSET 4
>
> /* V_TIMING internal */
> #define IMX219_REG_FRM_LENGTH_A CCI_REG16(0x0160)
> @@ -450,9 +451,9 @@ static int imx219_set_ctrl(struct v4l2_ctrl *ctrl)
> int exposure_max, exposure_def;
>
> /* Update max exposure while meeting expected vblanking */
> - exposure_max = format->height + ctrl->val - 4;
> + exposure_max = format->height + ctrl->val - IMX219_EXPOSURE_OFFSET;
> exposure_def = (exposure_max < IMX219_EXPOSURE_DEFAULT) ?
> - exposure_max : IMX219_EXPOSURE_DEFAULT;
> + exposure_max : IMX219_EXPOSURE_DEFAULT;
> ret = __v4l2_ctrl_modify_range(imx219->exposure,
> imx219->exposure->minimum,
> exposure_max,
> @@ -579,9 +580,9 @@ static int imx219_init_controls(struct imx219 *imx219)
> IMX219_LLP_MIN - mode->width,
> IMX219_LLP_MAX - mode->width, 1,
> IMX219_LLP_MIN - mode->width);
> - exposure_max = mode->fll_def - 4;
> + exposure_max = mode->fll_def - IMX219_EXPOSURE_OFFSET;
> exposure_def = (exposure_max < IMX219_EXPOSURE_DEFAULT) ?
> - exposure_max : IMX219_EXPOSURE_DEFAULT;
> + exposure_max : IMX219_EXPOSURE_DEFAULT;
> imx219->exposure = v4l2_ctrl_new_std(ctrl_hdlr, &imx219_ctrl_ops,
> V4L2_CID_EXPOSURE,
> IMX219_EXPOSURE_MIN, exposure_max,
> @@ -900,9 +901,9 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd,
> return ret;
>
> /* Update max exposure while meeting expected vblanking */
> - exposure_max = mode->fll_def - 4;
> + exposure_max = mode->fll_def - IMX219_EXPOSURE_OFFSET;
> exposure_def = (exposure_max < IMX219_EXPOSURE_DEFAULT) ?
> - exposure_max : IMX219_EXPOSURE_DEFAULT;
> + exposure_max : IMX219_EXPOSURE_DEFAULT;
> ret = __v4l2_ctrl_modify_range(imx219->exposure,
> imx219->exposure->minimum,
> exposure_max,
> --
> 2.34.1
>
next prev parent reply other threads:[~2025-10-31 15:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-31 11:48 [PATCH v1 0/2] media: i2c: imx219: Improve error handling and readability Tarang Raval
2025-10-31 11:48 ` [PATCH v1 1/2] media: i2c: imx219: Propagate errors from control range updates Tarang Raval
2025-11-03 18:17 ` Dave Stevenson
2025-11-04 7:04 ` Tarang Raval
2025-11-04 15:21 ` Isaac Scott
2025-10-31 11:48 ` [PATCH v1 2/2] media: i2c: imx219: Replace exposure magic value with named constant Tarang Raval
2025-10-31 15:08 ` Kieran Bingham [this message]
2025-11-03 18:19 ` Dave Stevenson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=176192330798.567526.14611830953271874355@ping.linuxembedded.co.uk \
--to=kieran.bingham@ideasonboard.com \
--cc=dave.stevenson@raspberrypi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=tarang.raval@siliconsignals.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®