From: Jai Luthra <jai.luthra@ideasonboard.com>
To: Himanshu Bhavani <himanshu.bhavani@siliconsignals.io>,
sakari.ailus@linux.intel.com
Cc: 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>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
Hans Verkuil <hverkuil+cisco@kernel.org>,
Hans de Goede <johannes.goede@oss.qualcomm.com>,
Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>,
Mehdi Djait <mehdi.djait@linux.intel.com>,
Elgin Perumbilly <elgin.perumbilly@siliconsignals.io>,
Xiaolei Wang <xiaolei.wang@windriver.com>,
Kate Hsuan <hpa@redhat.com>,
Walter Werner Schneider <contact@schnwalter.eu>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>,
linux-media@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH v3 2/3] media: i2c: add imx576 image sensor driver
Date: Fri, 07 Aug 2026 12:30:57 +0530 [thread overview]
Message-ID: <178608605778.4139729.11308202650136036897@freya> (raw)
In-Reply-To: <20260806120216.24145-3-himanshu.bhavani@siliconsignals.io>
Hi Himanshu,
Thanks for the patch.
Not a full review, but just a few comments on the PLL programming.
Quoting Himanshu Bhavani (2026-08-06 17:32:08)
> 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>
[...]
> +#define IMX576_INCLK_RATE (24 * HZ_PER_MHZ)
> +
> +#define IMX576_REG_CHIP_ID CCI_REG16(0x0016)
> +#define IMX576_CHIP_ID 0x0576
> +
> +#define IMX576_REG_MODE_SELECT CCI_REG8(0x0100)
> +#define IMX576_MODE_STANDBY 0x00
> +#define IMX576_MODE_STREAMING 0x01
> +
> +#define IMX576_REG_HOLD CCI_REG8(0x0104)
> +
> +#define IMX576_REG_EXPOSURE CCI_REG16(0x0202)
> +#define IMX576_EXPOSURE_MIN 8
> +#define IMX576_EXPOSURE_OFFSET 22
> +#define IMX576_EXPOSURE_STEP 1
> +#define IMX576_EXPOSURE_DEFAULT 0x0648
> +
> +#define IMX576_REG_ANALOG_GAIN CCI_REG16(0x0204)
> +#define IMX576_ANA_GAIN_MIN 0
> +#define IMX576_ANA_GAIN_MAX 978
> +#define IMX576_ANA_GAIN_STEP 1
> +#define IMX576_ANA_GAIN_DEFAULT 0
> +
> +#define IMX576_REG_IVT_PXCK_DIV CCI_REG8(0x0301)
> +#define IMX576_REG_IVT_SYCK_DIV CCI_REG8(0x0303)
> +#define IMX576_REG_IVT_PREPLLCK_DIV CCI_REG8(0x0305)
> +#define IMX576_REG_IVT_PLL_MPY CCI_REG16(0x0306)
> +#define IMX576_REG_IOP_SYCK_DIV CCI_REG8(0x030b)
> +#define IMX576_REG_IOP_PREPLLCK_DIV CCI_REG8(0x030d)
> +#define IMX576_REG_IOP_PLL_MPY CCI_REG16(0x030e)
> +#define IMX576_REG_PLL_MULT_DRIV CCI_REG8(0x0310)
> +
> +#define IMX576_REG_FRM_LENGTH_LINES CCI_REG16(0x0340)
> +#define IMX576_REG_LINE_LENGTH_PCK CCI_REG16(0x0342)
> +#define IMX576_LINE_LENGTH 6144
> +#define IMX576_VBLANK_DEF 4387
> +
> +/* FIXME: Exact VBLANK limit unknown (no datasheet). */
> +#define IMX576_VBLANK_MAX 32420
> +
> +#define IMX576_REG_X_ADD_STA CCI_REG16(0x0344)
> +#define IMX576_REG_Y_ADD_STA CCI_REG16(0x0346)
> +#define IMX576_REG_X_ADD_END CCI_REG16(0x0348)
> +#define IMX576_REG_Y_ADD_END CCI_REG16(0x034a)
> +#define IMX576_REG_X_OUTPUT_SIZE CCI_REG16(0x034c)
> +#define IMX576_REG_Y_OUTPUT_SIZE CCI_REG16(0x034e)
> +
> +#define IMX576_REG_DIG_CROP_X_OFFSET CCI_REG16(0x0408)
> +#define IMX576_REG_DIG_CROP_Y_OFFSET CCI_REG16(0x040a)
> +#define IMX576_REG_DIG_CROP_WIDTH CCI_REG16(0x040c)
> +#define IMX576_REG_DIG_CROP_HEIGHT CCI_REG16(0x040e)
This sensor's registers seem quite similar to the MIPI CCS specification.
Please check if the sensor is CCS compatible. Even if it is not, I think
the PLL programming is compatible, so you can use the helpers from
ccs-pll.c.
> +
> +#define IMX576_REG_BINNING_MODE CCI_REG8(0x0900)
> +#define IMX576_REG_BINNING_TYPE CCI_REG8(0x0901)
> +#define IMX576_REG_BINNING_WEIGHT CCI_REG8(0x0902)
> +
> +#define IMX576_PIXEL_RATE 813600000
> +#define IMX576_NUM_DATA_LANES 4
> +
> +/* IMX576 native and active pixel array size */
> +static const struct v4l2_rect imx576_native_area = {
> + .top = 0,
> + .left = 0,
> + .width = 5792,
> + .height = 4464,
> +};
> +
> +static const struct v4l2_rect imx576_active_area = {
> + .top = 136,
> + .left = 16,
> + .width = 5760,
> + .height = 4312,
> +};
> +
> +static const char * const imx576_supply_names[] = {
> + "vana", /* Analog Power */
> + "vif", /* Interface Power */
> + "vdig", /* Digital Power */
> +};
> +
> +static const struct cci_reg_sequence imx576_common_regs[] = {
[...]
> + { IMX576_REG_IVT_PXCK_DIV, 0x05 },
> + { IMX576_REG_IVT_SYCK_DIV, 0x02 },
> + { IMX576_REG_IVT_PREPLLCK_DIV, 0x04 },
> + { IMX576_REG_IVT_PLL_MPY, 0x0154 },
> + { IMX576_REG_IOP_SYCK_DIV, 0x01 },
> + { IMX576_REG_IOP_PREPLLCK_DIV, 0x04 },
> + { IMX576_REG_PLL_MULT_DRIV, 0x01 },
I think when Laurent asked to make the PLL configurable for different link
frequencies, he meant deriving these and the OP_PLL_MPY value instead of
hardcoding all of them and only supporting one link freq.
> + { CCI_REG8(0x0b06), 0x01 },
> + { CCI_REG8(0x3620), 0x01 },
> + { CCI_REG8(0x3f0c), 0x00 },
> +};
> +
Thanks,
Jai
next prev parent reply other threads:[~2026-08-07 7:01 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-06 12:02 [PATCH v3 0/3] media: i2c: Add imx576 camera sensor driver Himanshu Bhavani
2026-08-06 12:02 ` [PATCH v3 1/3] dt-bindings: media: i2c: Add imx576 sensor Himanshu Bhavani
2026-08-06 12:02 ` [PATCH v3 2/3] media: i2c: add imx576 image sensor driver Himanshu Bhavani
2026-08-07 7:00 ` Jai Luthra [this message]
2026-08-11 9:14 ` Himanshu Bhavani
2026-08-12 6:16 ` Jai Luthra
2026-08-14 11:35 ` Himanshu Bhavani
2026-08-14 12:52 ` Jai Luthra
2026-08-06 12:02 ` [PATCH v3 3/3] arm64: dts: qcom: sm7225-fairphone-fp4: Add Sony IMX576 front camera support Himanshu Bhavani
2026-08-07 6:55 ` Jai Luthra
2026-08-11 9:16 ` Himanshu Bhavani
2026-08-24 9:46 ` Konrad Dybcio
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=178608605778.4139729.11308202650136036897@freya \
--to=jai.luthra@ideasonboard.com \
--cc=andersson@kernel.org \
--cc=bartosz.golaszewski@oss.qualcomm.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=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=mehdi.djait@linux.intel.com \
--cc=robh@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=vladimir.zapolskiy@linaro.org \
--cc=xiaolei.wang@windriver.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