Devicetree
 help / color / mirror / Atom feed
From: Jai Luthra <jai.luthra@ideasonboard.com>
To: Himanshu Bhavani <himanshu.bhavani@siliconsignals.io>,
	sakari.ailus@linux.intel.com
Cc: tarang.raval@siliconsignals.io,
	Himanshu Bhavani <himanshu.bhavani@siliconsignals.io>,
	Hardevsinh Palaniya <hardevsinh.palaniya@siliconsignals.io>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Hans Verkuil <hverkuil+cisco@kernel.org>,
	Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>,
	Hans de Goede <johannes.goede@oss.qualcomm.com>,
	Elgin Perumbilly <elgin.perumbilly@siliconsignals.io>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Kate Hsuan <hpa@redhat.com>,
	Walter Werner Schneider <contact@schnwalter.eu>,
	Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>,
	Svyatoslav Ryhel <clamor95@gmail.com>,
	linux-media@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 2/2] media: i2c: add imx576 image sensor driver
Date: Wed, 26 Aug 2026 12:02:55 +0530	[thread overview]
Message-ID: <178772597500.9142.2498807519600395462@freya> (raw)
In-Reply-To: <20260819125647.68910-3-himanshu.bhavani@siliconsignals.io>

Hi Himanshu,

Thanks for the patch, and converting to CCS registers and helpers.

I only have a few minor comments.

Quoting Himanshu Bhavani (2026-08-19 18:26:40)
> Add a v4l2 subdevice driver for the Sony imx576 sensor.
> 
> The Sony IMX576 image sensor with an active
> array size of 5760 x 4312
> 
> The following features are supported:
> - Manual exposure an gain control support
> - vblank/hblank control support
> - Supported resolution: 5760 x 4312 30fps (SRGGB10)
> 
> Signed-off-by: Himanshu Bhavani <himanshu.bhavani@siliconsignals.io>
> ---
>  MAINTAINERS                |    1 +
>  drivers/media/i2c/Kconfig  |   10 +
>  drivers/media/i2c/Makefile |    1 +
>  drivers/media/i2c/imx576.c | 1103 ++++++++++++++++++++++++++++++++++++
>  4 files changed, 1115 insertions(+)
>  create mode 100644 drivers/media/i2c/imx576.c
> 
> diff --git a/drivers/media/i2c/imx576.c b/drivers/media/i2c/imx576.c
> new file mode 100644
> index 000000000000..8115d0c16cc3
> --- /dev/null
> +++ b/drivers/media/i2c/imx576.c

[...]

> +
> +#define IMX576_LINE_LENGTH             6144
> +#define IMX576_VBLANK_DEF              4387
> +
> +/* FIXME: Exact VBLANK limit unknown (no datasheet). */
> +#define IMX576_VBLANK_MAX              32420

You could try reading the CCS.MAX_FRAME_LENGTH_LINES register (0x1142), in
IMX708 that had a value of 0xffff, which did work during my testing.

[...]

> +       { CCI_REG8(0x0401), 0x00 },

This might be writing to the CCS.SCALING_MODE (0x400) register's lower
byte, so you could use the macro here (unless the higher byte is programmed
to something else?)


[...]

> +static int imx576_set_ctrl(struct v4l2_ctrl *ctrl)
> +{
> +       struct imx576 *imx576 = container_of_const(ctrl->handler,
> +                                                  struct imx576, handler);
> +       struct v4l2_subdev_state *state;
> +       struct v4l2_mbus_framefmt *fmt;
> +       int ret = 0;
> +
> +       state = v4l2_subdev_get_locked_active_state(&imx576->sd);
> +       fmt = v4l2_subdev_state_get_format(state, 0);
> +
> +       if (ctrl->id == V4L2_CID_VBLANK) {
> +               /* Honour the VBLANK limits when setting exposure */
> +               ret = __v4l2_ctrl_modify_range(imx576->exposure,
> +                                              IMX576_EXPOSURE_MIN,
> +                                              fmt->height + ctrl->val -
> +                                              IMX576_EXPOSURE_OFFSET,
> +                                              IMX576_EXPOSURE_STEP,
> +                                              IMX576_EXPOSURE_DEFAULT);
> +               if (ret)
> +                       return ret;
> +       }
> +
> +       if (pm_runtime_get_if_active(imx576->dev) == 0)
> +               return 0;
> +
> +       cci_write(imx576->regmap, CCS_R_GROUPED_PARAMETER_HOLD, 1, &ret);
> +
> +       switch (ctrl->id) {
> +       case V4L2_CID_VBLANK: {
> +               u64 vmax = fmt->height + ctrl->val;
> +
> +               cci_write(imx576->regmap, CCS_R_FRAME_LENGTH_LINES, vmax, &ret);
> +               break;
> +       }
> +       case V4L2_CID_EXPOSURE:
> +               cci_write(imx576->regmap, CCS_R_COARSE_INTEGRATION_TIME, ctrl->val, &ret);

Does exposure register need an update in cases where VBLANK was modified in
a way that old value goes out of bounds?

[...]

Thanks,
    Jai

      reply	other threads:[~2026-08-26  6:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-19 12:56 [PATCH v4 0/2] media: i2c: Add imx576 camera sensor driver Himanshu Bhavani
2026-08-19 12:56 ` [PATCH v4 1/2] dt-bindings: media: i2c: Add imx576 sensor Himanshu Bhavani
2026-08-19 12:56 ` [PATCH v4 2/2] media: i2c: add imx576 image sensor driver Himanshu Bhavani
2026-08-26  6:32   ` Jai Luthra [this message]

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=178772597500.9142.2498807519600395462@freya \
    --to=jai.luthra@ideasonboard.com \
    --cc=bartosz.golaszewski@oss.qualcomm.com \
    --cc=clamor95@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=contact@schnwalter.eu \
    --cc=devicetree@vger.kernel.org \
    --cc=elgin.perumbilly@siliconsignals.io \
    --cc=hardevsinh.palaniya@siliconsignals.io \
    --cc=himanshu.bhavani@siliconsignals.io \
    --cc=hpa@redhat.com \
    --cc=hverkuil+cisco@kernel.org \
    --cc=johannes.goede@oss.qualcomm.com \
    --cc=krzk+dt@kernel.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=robh@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=tarang.raval@siliconsignals.io \
    --cc=vladimir.zapolskiy@linaro.org \
    /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