Re: [PATCH v3 2/3] media: i2c: Add Sony IMX681 sensor driver
From: Krzysztof Kozlowski
Date: Fri Sep 11 2026 - 03:42:02 EST
On Wed, Sep 09, 2026 at 08:37:40PM +0000, Sergey Lebedev wrote:
> From: Andre Gilerson <andre.gilerson@xxxxxxxxx>
>
> The Sony IMX681 is the user-facing camera on the Microsoft Surface Pro 11
> for Business (Intel Lunar Lake, IPU7), where it is enumerated as ACPI
> device SONY0681. Without a driver the camera does not appear at all.
>
> There is no public documentation for this sensor. The initialisation
> sequence and the mode registers were recovered from I2C traces taken under
> Windows, and the driver does not pretend otherwise: imx681_init_regs[] is
> 21 register writes whose individual meaning is not known.
>
> What is not from the traces is derived and written down. The link frequency
> comes from the PLL configuration visible in the same traces - 19.2 MHz
> EXCK, PLL2_MUL 303, PLL2_PRE_DIV 3, giving 1939.2 MHz on the bus and
> therefore 969.6 MHz per lane - and the pixel rate follows from that, the
> lane count and the bit depth. The gain law and the black level were
> measured against the sensor rather than taken from the traces; the numbers
> are in the cover letter.
>
> The driver uses the streams API, v4l2-cci for register access, the subdev
> state API and runtime PM, and validates the endpoint's lane count and link
> frequency against what the firmware describes.
>
> Signed-off-by: Andre Gilerson <andre.gilerson@xxxxxxxxx>
> Signed-off-by: Sergey Lebedev <lsa.uz@xxxxx>
> ---
> MAINTAINERS | 8 +
> drivers/media/i2c/Kconfig | 10 +
> drivers/media/i2c/Makefile | 1 +
> drivers/media/i2c/imx681.c | 884 +++++++++++++++++++++++++++++++++++++
> 4 files changed, 903 insertions(+)
> create mode 100644 drivers/media/i2c/imx681.c
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index e12dc3ca5..198eaeefa 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -25586,6 +25586,14 @@ S: Maintained
> F: Documentation/devicetree/bindings/media/i2c/sony,imx678.yaml
> F: drivers/media/i2c/imx678.c
>
> +SONY IMX681 SENSOR DRIVER
> +M: Andre Gilerson <andre.gilerson@xxxxxxxxx>
> +L: linux-media@xxxxxxxxxxxxxxx
> +S: Maintained
> +T: git git://linuxtv.org/media.git
Drop, I don't think you/Andre have commit rights there.
> +F: Documentation/devicetree/bindings/media/i2c/sony,imx681.yaml
> +F: drivers/media/i2c/imx681.c
> +
...
> + /* Initialise V4L2 subdev */
> + v4l2_i2c_subdev_init(&imx681->sd, client, &imx681_subdev_ops);
> +
> + /* Initialise CCI regmap for 16-bit register addresses */
> + imx681->cci = devm_cci_regmap_init_i2c(client, 16);
> + if (IS_ERR(imx681->cci)) {
> + ret = PTR_ERR(imx681->cci);
> + dev_err(imx681->dev, "failed to init CCI: %d\n", ret);
> + return ret;
return dev_err_probe
> + }
> +
> + /* Get clock (optional - INT3472 provides it on Surface devices) */
> + imx681->xclk = devm_clk_get_optional(imx681->dev, NULL);
> + if (IS_ERR(imx681->xclk))
> + return dev_err_probe(imx681->dev, PTR_ERR(imx681->xclk),
> + "failed to get clock\n");
> +
> + if (imx681->xclk)
> + dev_dbg(imx681->dev, "clock rate: %lu Hz\n",
> + clk_get_rate(imx681->xclk));
Drop. clk_summary tells that. No need for obvious debug messages.
Best regards,
Krzysztof