public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Sebastian LaVine <slavine@d3embedded.com>
Cc: devicetree@vger.kernel.org, imx@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
	"Nícolas F. R. A. Prado" <nfraprado@collabora.com>,
	"Abel Vesa" <abel.vesa@linaro.org>,
	"Achath Vaishnav" <vaishnav.a@ti.com>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>,
	"Ard Biesheuvel" <ardb@kernel.org>,
	"Benjamin Mugnier" <benjamin.mugnier@foss.st.com>,
	"Biju Das" <biju.das.jz@bp.renesas.com>,
	"Bjorn Andersson" <quic_bjorande@quicinc.com>,
	"Catalin Marinas" <catalin.marinas@arm.com>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Dmitry Baryshkov" <dmitry.baryshkov@linaro.org>,
	"Elinor Montmasson" <elinor.montmasson@savoirfairelinux.com>,
	"Fabio Estevam" <festevam@gmail.com>,
	"Geert Uytterhoeven" <geert+renesas@glider.be>,
	"Hans Verkuil" <hverkuil@xs4all.nl>,
	"Javier Carrasco" <javier.carrasco@wolfvision.net>,
	"Jianzhong Xu" <xuj@ti.com>,
	"Julien Massot" <julien.massot@collabora.com>,
	"Kieran Bingham" <kieran.bingham@ideasonboard.com>,
	"Kory Maincent" <kory.maincent@bootlin.com>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski@linaro.org>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	"Mikhail Rudenko" <mike.rudenko@gmail.com>,
	"Nishanth Menon" <nm@ti.com>,
	"Pengutronix Kernel Team" <kernel@pengutronix.de>,
	"Rob Herring" <robh@kernel.org>,
	"Sakari Ailus" <sakari.ailus@linux.intel.com>,
	"Sascha Hauer" <s.hauer@pengutronix.de>,
	"Shawn Guo" <shawnguo@kernel.org>,
	"Stuart Burtner" <sburtner@d3embedded.com>,
	"Tero Kristo" <kristo@kernel.org>,
	"Thakkar Devarsh" <devarsht@ti.com>,
	"Tomi Valkeinen" <tomi.valkeinen@ideasonboard.com>,
	"Umang Jain" <umang.jain@ideasonboard.com>,
	"Vignesh Raghavendra" <vigneshr@ti.com>,
	"Will Deacon" <will@kernel.org>, "Zhi Mao" <zhi.mao@mediatek.com>
Subject: Re: [PATCH 2/4] media: i2c: Add driver for Sony IMX728
Date: Thu, 13 Feb 2025 12:19:03 +0200	[thread overview]
Message-ID: <20250213101903.GH5888@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20250212195656.69528-3-slavine@d3embedded.com>

Hi Sebastian,

Thank you for the patch.

I'll start with a partial review.

On Wed, Feb 12, 2025 at 02:56:54PM -0500, Sebastian LaVine wrote:
> Adds a driver for the Sony IMX728 image sensor.
> 
> Signed-off-by: Sebastian LaVine <slavine@d3embedded.com>
> Mentored-by: Stuart Burtner <sburtner@d3embedded.com>
> ---
>  MAINTAINERS                  |    1 +
>  arch/arm64/configs/defconfig |    1 +
>  drivers/media/i2c/Kconfig    |   12 +
>  drivers/media/i2c/Makefile   |    1 +
>  drivers/media/i2c/imx728.c   | 9655 ++++++++++++++++++++++++++++++++++
>  5 files changed, 9670 insertions(+)
>  create mode 100644 drivers/media/i2c/imx728.c

[snip]

> diff --git a/drivers/media/i2c/imx728.c b/drivers/media/i2c/imx728.c
> new file mode 100644
> index 000000000000..75120ca01ce6
> --- /dev/null
> +++ b/drivers/media/i2c/imx728.c
> @@ -0,0 +1,9655 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Sony IMX728 CMOS Image Sensor Driver
> + *
> + * Copyright (c) 2024-2025 Define Design Deploy Corp
> + */

[snip]

> +static const struct cci_reg_sequence imx728_wdr_12bit_3856x2176[] = {

This table is way too big, with over 8000 entries. Some are even
duplicated, with identical or different values for the same register. It
will take more than a second at 400kHz to program this.

At the very least I would expect a way to compact the table and make use
of I2C register address auto-increment. Default power-up values should
also likely be just dropped.

I haven't checked in details, but doesn't this table also contain tuning
data for your specific camera ?

[snip]

> +};

[snip]

> +static int imx728_get_frame_interval(struct v4l2_subdev *sd,
> +                                    struct v4l2_subdev_state *sd_state,
> +                                    struct v4l2_subdev_frame_interval *fi)
> +{
> +       struct imx728 *imx728 = to_imx728(sd);
> +
> +       fi->interval.numerator = 1;
> +       fi->interval.denominator = imx728->fps;
> +       return 0;
> +}
> +
> +static int imx728_set_frame_interval(struct v4l2_subdev *sd,
> +                                    struct v4l2_subdev_state *sd_state,
> +                                    struct v4l2_subdev_frame_interval *fi)
> +{
> +       struct imx728 *imx728 = to_imx728(sd);
> +       u32 req_fps;
> +
> +       mutex_lock(&imx728->lock);
> +
> +       if (fi->interval.numerator == 0 || fi->interval.denominator == 0) {
> +               fi->interval.denominator = IMX728_FRAMERATE_DEFAULT;
> +               fi->interval.numerator = 1;
> +       }
> +
> +       req_fps = clamp_val(DIV_ROUND_CLOSEST(fi->interval.denominator,
> +                                             fi->interval.numerator),
> +                           IMX728_FRAMERATE_MIN, IMX728_FRAMERATE_MAX);
> +
> +       fi->interval.numerator = 1;
> +       fi->interval.denominator = req_fps;
> +
> +       imx728->fps = req_fps;
> +
> +       mutex_unlock(&imx728->lock);
> +       dev_dbg(imx728->dev, "%s frame rate = %d\n", __func__, imx728->fps);
> +
> +       return 0;
> +}

The frame rate on raw sensors is controlled through h/v blanking. You
can drop thse functions, especially given that imx728->fps isn't used
anywhere else.

-- 
Regards,

Laurent Pinchart

  parent reply	other threads:[~2025-02-13 10:19 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-12 19:56 [PATCH 0/4] media: i2c: Add driver for Sony IMX728 Sebastian LaVine
2025-02-12 19:56 ` [PATCH 1/4] media: dt-bindings: Add " Sebastian LaVine
2025-02-12 20:07   ` Krzysztof Kozlowski
2025-02-26 19:15     ` Sebastian LaVine
2025-02-13  9:26   ` Krzysztof Kozlowski
2025-02-26 17:50     ` Sebastian LaVine
2025-02-26 18:53       ` Sebastian LaVine
2025-02-26 21:38       ` Krzysztof Kozlowski
2025-02-12 19:56 ` [PATCH 2/4] media: i2c: Add driver for " Sebastian LaVine
2025-02-12 20:11   ` Krzysztof Kozlowski
2025-02-26 20:13     ` Sebastian LaVine
2025-02-26 21:40       ` Krzysztof Kozlowski
2025-02-13 10:19   ` Laurent Pinchart [this message]
2025-03-10 19:39     ` Sebastian LaVine
2025-03-11 10:18       ` Sakari Ailus
2025-02-13 18:19   ` Krzysztof Kozlowski
2025-03-07 21:21     ` Sebastian LaVine
2025-02-19 17:51   ` Markus Elfring
2025-02-26 21:17     ` Sebastian LaVine
2025-02-12 19:56 ` [PATCH 3/4] arm64: dts: ti: k3-am62a7-sk: Add overlay for fusion 2 board Sebastian LaVine
2025-02-12 20:13   ` Krzysztof Kozlowski
2025-02-26 22:00     ` Sebastian LaVine
2025-02-18 18:45   ` Nishanth Menon
2025-02-26 22:04     ` Sebastian LaVine
2025-02-18 19:07   ` Vaishnav Achath
2025-03-10 18:32     ` Sebastian LaVine
2025-02-19  9:31   ` Tomi Valkeinen
2025-02-26 22:06     ` Sebastian LaVine
2025-02-12 19:56 ` [PATCH 4/4] arm64: dts: ti: Add overlays for IMX728 RCM Sebastian LaVine
2025-02-18 18:46   ` Nishanth Menon
2025-02-12 20:04 ` [PATCH 0/4] media: i2c: Add driver for Sony IMX728 Krzysztof Kozlowski
2025-02-26 16:50   ` Sebastian LaVine
2025-02-13 10:40 ` Kieran Bingham
2025-02-26 17:05   ` Sebastian LaVine

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=20250213101903.GH5888@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=abel.vesa@linaro.org \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=ardb@kernel.org \
    --cc=benjamin.mugnier@foss.st.com \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=catalin.marinas@arm.com \
    --cc=conor+dt@kernel.org \
    --cc=devarsht@ti.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=elinor.montmasson@savoirfairelinux.com \
    --cc=festevam@gmail.com \
    --cc=geert+renesas@glider.be \
    --cc=hverkuil@xs4all.nl \
    --cc=imx@lists.linux.dev \
    --cc=javier.carrasco@wolfvision.net \
    --cc=julien.massot@collabora.com \
    --cc=kernel@pengutronix.de \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=kory.maincent@bootlin.com \
    --cc=kristo@kernel.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=mike.rudenko@gmail.com \
    --cc=nfraprado@collabora.com \
    --cc=nm@ti.com \
    --cc=quic_bjorande@quicinc.com \
    --cc=robh@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=sakari.ailus@linux.intel.com \
    --cc=sburtner@d3embedded.com \
    --cc=shawnguo@kernel.org \
    --cc=slavine@d3embedded.com \
    --cc=tomi.valkeinen@ideasonboard.com \
    --cc=umang.jain@ideasonboard.com \
    --cc=vaishnav.a@ti.com \
    --cc=vigneshr@ti.com \
    --cc=will@kernel.org \
    --cc=xuj@ti.com \
    --cc=zhi.mao@mediatek.com \
    /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