Skip to contentSkip to conversation

media: Add bindings and driver for Sony IMX708

PATCH New Jai Luthra 2 participants 7 messages Aug 7

Subsystems (4)
lore
Share & tools
lore

Jai Luthra

author
#0 lore raw

v2 cover media: Add bindings and driver for Sony IMX708

Hi,

This series adds dt-bindings and a basic V4L2 driver for Sony IMX708 camera sensor, used in Raspberry Pi Camera Module 3 [1].

This basic driver is an adaptation of the one present in the downstream rpi-6.18.y tree (written by Nick Hollinghurst). Many features from the downstream driver (like HDR, binned and 720p crop modes, etc.) are not present here, and will be added on top using common raw sensor model in a later series.

This has been tested on a Raspberry Pi 5 with libcamera.

[1]: https://www.raspberrypi.com/products/camera-module-3/

---
Changes in v2:
PATCH 1/3:
- Drop the |- before the description
- Add Dave as M:, and move [email protected] as R:
- Add Krzysztof's R-by tag
PATCH 2/3:
- New in v2, to support reuse of CCS PLL helpers with IMX708.
PATCH 3/3:
- Use the helpers from ccs-pll.h to calculate the VT and OP clock tree, setting up the limits following the datasheet instead of the CCS limit registers
- Keep the same VT Pixel Rate and OP Link Rate as before. The VT tree runs much faster than the 2-Lane CSI link, and we don't have enough details about the FIFO capacity to support freely-configurable rates just yet.
- Drop macros of CCS registers, and include ccs-regs.h to use the existing names
- Update Copyright and MODULE_AUTHOR entries

- Link to v1: https://lore.kernel.org/r/[email protected]

---
Jai Luthra (3):
dt-bindings: media: i2c: Add imx708 image sensor
media: ccs-pll: Support optional input for VT pixel rate
media: i2c: Add a driver for Sony IMX708

 .../devicetree/bindings/media/i2c/sony,imx708.yaml |  120 ++
 MAINTAINERS                                        |    9 +
 drivers/media/i2c/Kconfig                          |   12 +
 drivers/media/i2c/Makefile                         |    1 +
 drivers/media/i2c/ccs-pll.c                        |   13 +-
 drivers/media/i2c/ccs-pll.h                        |    4 +-
 drivers/media/i2c/imx708.c                         | 1312 ++++++++++++++++++++
 7 files changed, 1468 insertions(+), 3 deletions(-)

---
base-commit: 8a6e017c06fbc1b96af618e82a4d35889d442964
change-id: 20260715-imx708-967d68ca6ca8

Best regards,

Signature · 1 line
Jai Luthra <[email protected]>
author
#1 lore raw

PATCH v2 1/3 dt-bindings: media: i2c: Add imx708 image sensor

Sony IMX708 is an 11.9 Megapixel CMOS sensor, that can output pixels over MIPI CSI-2 bus. Add bindings for it.

---
Changes in v2:
- Drop the |- before the description
- Add Dave as M:, and move [email protected] as R:
- Add Krzysztof's R-by tag

---
 .../devicetree/bindings/media/i2c/sony,imx708.yaml | 120 +++++++++++++++++++++
 MAINTAINERS                                        |   8 ++
 2 files changed, 128 insertions(+)
Documentation/devicetree/bindings/media/i2c/sony,imx708.yaml new file +120 -0
new file mode 100644
index 000000000000..e41b3ca53706
@@ -0,0 +1,120 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/media/i2c/sony,imx708.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Sony IMX708 Sensor
+
+maintainers:
+  - Jai Luthra <[email protected]>
+  - Dave Stevenson <[email protected]>
+
+description:
+  The Sony IMX708 is a 1/2.3-inch CMOS active pixel digital image sensor
+  with an active array size of 4608H x 2592V. It is programmable through
+  I2C interface. The I2C address is fixed to 0x1A as per sensor data sheet.
+  Image data is sent through MIPI CSI-2, which is configured as either 2 or
+  4 data lanes.
+
+properties:
+  compatible:
+    const: sony,imx708
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  vdig-supply:
+    description:
+      Digital I/O voltage supply, 1.1 volts
+
+  vana1-supply:
+    description:
+      Analog1 voltage supply, 2.8 volts
+
+  vana2-supply:
+    description:
+      Analog2 voltage supply, 1.8 volts
+
+  vddl-supply:
+    description:
+      Digital core voltage supply, 1.8 volts
+
+  reset-gpios:
+    description: Sensor RESETN (XCLR) GPIO
+    maxItems: 1
+
+  port:
+    $ref: /schemas/graph.yaml#/$defs/port-base
+    additionalProperties: false
+
+    properties:
+      endpoint:
+        $ref: /schemas/media/video-interfaces.yaml#
+        unevaluatedProperties: false
+
+        properties:
+          data-lanes:
+            oneOf:
+              - items:
+                  - const: 1
+                  - const: 2
+              - items:
+                  - const: 1
+                  - const: 2
+                  - const: 3
+                  - const: 4
+
+        required:
+          - data-lanes
+          - link-frequencies
+
+    required:
+      - endpoint
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - vdig-supply
+  - vana1-supply
+  - vana2-supply
+  - vddl-supply
+  - port
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        camera@1a {
+            compatible = "sony,imx708";
+            reg = <0x1a>;
+
+            clocks = <&clk 90>;
+
+            vdig-supply = <&camera_vdig>;
+            vana1-supply = <&camera_vana1>;
+            vana2-supply = <&camera_vana2>;
+            vddl-supply = <&camera_vddl>;
+
+            reset-gpios = <&gpio 35 GPIO_ACTIVE_LOW>;
+
+            port {
+                imx708_ep: endpoint {
+                    data-lanes = <1 2>;
+                    link-frequencies = /bits/ 64 <450000000>;
+                    remote-endpoint = <&csi_ep>;
+                };
+            };
+        };
+    };
+...
MAINTAINERS +8 -0
index 3785b8c1de0a..9928f68175ed 100644
@@ -25281,6 +25281,14 @@ S:	Maintained
 F:	Documentation/devicetree/bindings/media/i2c/sony,imx678.yaml
 F:	drivers/media/i2c/imx678.c
 
+SONY IMX708 SENSOR DRIVER
+M:	Dave Stevenson <[email protected]>
+M:	Jai Luthra <[email protected]>
+R:	Raspberry Pi Kernel Maintenance <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	Documentation/devicetree/bindings/media/i2c/sony,imx708.yaml
+
 SONY MEMORYSTICK SUBSYSTEM
 M:	Maxim Levitsky <[email protected]>
 M:	Alex Dubov <[email protected]>
Signature · 1 line
2.54.0
#2 lore raw

Re: [PATCH v2 1/3] dt-bindings: media: i2c: Add imx708 image sensor

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [High] Swapped descriptions and voltages for VDIG and VDDL supplies risk hardware damage. - [Medium]…

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] Swapped descriptions and voltages for VDIG and VDDL supplies risk hardware damage.
- [Medium] Missing Common Schema Reference blocks standard video interface properties. --

--- Patch [1]: [PATCH v2 1/3] dt-bindings: media: i2c: Add imx708 image sensor --- commit 2d548d9db5698aed5ad6188c54ce0ae5aa972fd7
Author: Jai Luthra <[email protected]>

dt-bindings: media: i2c: Add imx708 image sensor

Adds device tree bindings for the Sony IMX708 image sensor. It defines the required properties, regulators, port structure, and includes an example configuration.

Quoted 7 lines
Documentation/devicetree/bindings/media/i2c/sony,imx708.yaml new file +1 -0
new file mode 100644
index 0000000000000..e41b3ca537063
@@ -0,0 +1,120 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)

[ ... ]

Documentation/devicetree/bindings/media/i2c/sony,imx708.yaml line 32

Quoted 13 lines
Documentation/devicetree/bindings/media/i2c/sony,imx708.yaml new file +13 -0
+properties:
+  compatible:
+    const: sony,imx708
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  vdig-supply:
+    description:
+      Digital I/O voltage supply, 1.1 volts

[Severity: High]
Are the voltages and descriptions for vdig-supply and vddl-supply swapped here? Standard Sony CMOS sensors typically use 1.8V for I/O (vdig) and 1.1V/1.2V for the core (vddl). Supplying 1.8V to a 1.1V digital core might cause permanent hardware damage if integrators follow this description.

Quoted 12 lines
Documentation/devicetree/bindings/media/i2c/sony,imx708.yaml new file +12 -0
+
+  vana1-supply:
+    description:
+      Analog1 voltage supply, 2.8 volts
+
+  vana2-supply:
+    description:
+      Analog2 voltage supply, 1.8 volts
+
+  vddl-supply:
+    description:
+      Digital core voltage supply, 1.8 volts

[ ... ]

Documentation/devicetree/bindings/media/i2c/sony,imx708.yaml line 88

Quoted 11 lines
Documentation/devicetree/bindings/media/i2c/sony,imx708.yaml new file +11 -0
+required:
+  - compatible
+  - reg
+  - clocks
+  - vdig-supply
+  - vana1-supply
+  - vana2-supply
+  - vddl-supply
+  - port
+
+additionalProperties: false

[Severity: Medium]
Will this strict rejection of additional properties prevent device trees from specifying standard physical attributes like orientation and rotation?

Typically, an allOf block including a reference to /schemas/media/video-interface-devices.yaml# is added near the properties block to inherit these common hardware properties, and unevaluatedProperties is used instead of additionalProperties. Without the common reference, valid hardware descriptions may fail validation.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
author
#3 lore raw

PATCH v2 2/3 media: ccs-pll: Support optional input for VT pixel rate

In reply to Jai Luthra

When the PLL is configured in DUAL_MODE (separate VT and OP trees) and the sensor's FIFOs allow derating and/or overrating, the VT pixel rate might be higher or lower than OP pixel rate.

Support such usecases by allowing an optional input for the target VT pixel rate.

---
 drivers/media/i2c/ccs-pll.c | 13 +++++++++++--
 drivers/media/i2c/ccs-pll.h |  4 +++-
 2 files changed, 14 insertions(+), 3 deletions(-)
drivers/media/i2c/ccs-pll.c +11 -2
index 1605cfa5db19..9aa164994cc7 100644
@@ -388,6 +388,14 @@ __ccs_pll_calculate_vt_tree(struct device *dev,
 	return 0;
 }
 
+static inline u32 ccs_pll_vt_pixel_rate(const struct ccs_pll *pll)
+{
+	if (pll->pixel_rate_pixel_array)
+		return pll->pixel_rate_pixel_array;
+
+	return pll->pixel_rate_csi;
+}
+
 static int ccs_pll_calculate_vt_tree(struct device *dev,
 				     const struct ccs_pll_limits *lim,
 				     struct ccs_pll *pll)
@@ -396,11 +404,12 @@ static int ccs_pll_calculate_vt_tree(struct device *dev,
 	struct ccs_pll_branch_fr *pll_fr = &pll->vt_fr;
 	u16 min_pre_pll_clk_div = lim_fr->min_pre_pll_clk_div;
 	u16 max_pre_pll_clk_div = lim_fr->max_pre_pll_clk_div;
+	u32 vt_pixel_rate = ccs_pll_vt_pixel_rate(pll);
 	u32 pre_mul, pre_div;
 
-	pre_div = gcd(pll->pixel_rate_csi,
+	pre_div = gcd(vt_pixel_rate,
 		      pll->ext_clk_freq_hz * pll->vt_lanes);
-	pre_mul = pll->pixel_rate_csi / pre_div;
+	pre_mul = vt_pixel_rate / pre_div;
 	pre_div = pll->ext_clk_freq_hz * pll->vt_lanes / pre_div;
 
 	/* Make sure PLL input frequency is within limits */
drivers/media/i2c/ccs-pll.h +3 -1
index e22903931e72..5c00a72c41df 100644
@@ -114,7 +114,9 @@ struct ccs_pll_branch_bk {
  * @op_bk: Operational timing back-end configuration (output)
  * @pixel_rate_csi: Pixel rate on the output data bus (output)
  * @pixel_rate_pixel_array: Nominal pixel rate in the sensor's pixel array
- *			    (output)
+ *			    (input/output). It is a valid input only when
+ *			    FLAG_DUAL_PLL is set, serving as a target rate
+ *			    for the VT tree.
  */
 struct ccs_pll {
 	/* input values */
Signature · 1 line
2.54.0
#4 lore raw

Re: [PATCH v2 2/3] media: ccs-pll: Support optional input for VT pixel rate

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [High] State reuse logic bug: Repurposing the output field `pixel_rate_pixel_array` as an optional input…

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] State reuse logic bug: Repurposing the output field pixel_rate_pixel_array as an optional input causes subsequent PLL recalculations to reuse the previous achieved rate, breaking dynamic adaptation.
- [High] Missing validation: The DUAL_PLL configuration path bypasses hardware limit checks for FIFO derating and overrating.
--

--- Patch [2]: [PATCH v2 2/3] media: ccs-pll: Support optional input for VT pixel rate --- commit 61f223eeeb41f300a2760175cdb5d9c15c35bf95
Author: Jai Luthra <[email protected]>

media: ccs-pll: Support optional input for VT pixel rate

This commit adds support for an optional target VT pixel rate input when the PLL is configured in DUAL_MODE. It utilizes the pixel_rate_pixel_array field to pass this input target, falling back to pixel_rate_csi if it is not provided.

Quoted 3 lines

When the PLL is configured in DUAL_MODE (separate VT and OP trees) and the sensor's FIFOs allow derating and/or overrating, the VT pixel rate might be higher or lower than OP pixel rate.

[Severity: High]
Does this bypass the hardware capability validation for FIFO derating and overrating?

When CCS_PLL_FLAG_DUAL_PLL is set, ccs_pll_calculate() breaks out of the loop early and returns successfully after calling ccs_pll_calculate_vt_tree(). This completely skips the call to check_ext_bounds().

Could this allow arbitrary diverging VT pixel rates to be applied that exceed the sensor's FIFO capabilities without throwing an error, leading to FIFO underflows or overflows?

Quoted 4 lines
drivers/media/i2c/ccs-pll.c +0 -0
index 1605cfa5db19d..9aa164994cc73 100644

[ ... ]

drivers/media/i2c/ccs-pll.c __ccs_pll_calculate_vt_tree(struct device *dev, · line 394

Quoted 8 lines
drivers/media/i2c/ccs-pll.c +4 -0
@@ -388,6 +388,14 @@ __ccs_pll_calculate_vt_tree(struct device *dev,
 	return 0;
 }
 
+static inline u32 ccs_pll_vt_pixel_rate(const struct ccs_pll *pll)
+{
+	if (pll->pixel_rate_pixel_array)
+		return pll->pixel_rate_pixel_array;

[Severity: High]
Does this cause a state reuse issue for subsequent PLL recalculations?

This helper treats pixel_rate_pixel_array as an input target. However, __ccs_pll_calculate_vt_tree() writes the achieved VT rate back into this same field:

drivers/media/i2c/ccs-pll.c:__ccs_pll_calculate_vt_tree() {
    ...
    pll->pixel_rate_pixel_array =
        pll_bk->pix_clk_freq_hz * pll->vt_lanes;
    ...
}

Callers like ccs_pll_update() in ccs-core.c maintain the struct ccs_pll across multiple calls (such as during V4L2 link frequency changes) without zeroing this field.

Since this helper unconditionally prefers pixel_rate_pixel_array if non-zero, won't subsequent configuration changes silently use the stale achieved rate from a previous calculation instead of the intended target?

Quoted 3 lines
drivers/media/i2c/ccs-pll.c +3 -0
+
+	return pll->pixel_rate_csi;
+}
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
author
#5 lore raw

PATCH v2 3/3 media: i2c: Add a driver for Sony IMX708

In reply to Jai Luthra

Sony IMX708 is an 11.9 Megapixel CMOS sensor with a 16:9 aspect ratio. It is a quad-bayer sensor with support for remosaicing the output to a normal 2x2 bayer pattern.

This basic driver adds supports for capturing the full active-area of 4608x2592, up to 14.35fps. The following features are supported by the driver:
- MIPI RAW10 output
- Fixed quad-bayer correction
- Multiple link frequencies (different IOP_PLL_MPY)
- VBLANK control for flexible frame-rate
- Analogue gain and exposure control
- Extremely long exposure time with LONG_EXP_SHIFT
- Test pattern support

The following features are currently not supported and may be added later. Some of them depend on the new common raw sensor model:
- Embedded data stream
- Freely configurable crop (analog and digital)
- 2x2 binning
- Quad-bayer multi-exposure HDR support
- HBLANK control
- 4-lane support
- Configurable clock-tree
- Flexible quad-bayer correction

---
Changes in v2:
- Use the helpers from ccs-pll.h to calculate the VT and OP clock tree, setting up the limits following the datasheet instead of the CCS limit registers
- Keep the same VT Pixel Rate and OP Link Rate as before. The VT tree runs much faster than the 2-Lane CSI link, and we don't have enough details about the FIFO capacity to support freely-configurable rates just yet.
- Drop macros of CCS registers, and include ccs-regs.h to use the existing names
- Update Copyright and MODULE_AUTHOR entries

---
 MAINTAINERS                |    1 +
 drivers/media/i2c/Kconfig  |   12 +
 drivers/media/i2c/Makefile |    1 +
 drivers/media/i2c/imx708.c | 1312 ++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 1326 insertions(+)
MAINTAINERS +1 -0
index 9928f68175ed..7317bd852264 100644
@@ -25288,6 +25288,7 @@ R:	Raspberry Pi Kernel Maintenance <[email protected]>
 L:	[email protected]
 S:	Maintained
 F:	Documentation/devicetree/bindings/media/i2c/sony,imx708.yaml
+F:	drivers/media/i2c/imx708.c
 
 SONY MEMORYSTICK SUBSYSTEM
 M:	Maxim Levitsky <[email protected]>
drivers/media/i2c/Kconfig +12 -0
index 5c52007f9cbe..38ec23eb6e38 100644
@@ -310,6 +310,18 @@ config VIDEO_IMX678
 	  To compile this driver as a module, choose M here: the
 	  module will be called imx678.
 
+config VIDEO_IMX708
+	tristate "Sony IMX708 sensor support"
+	depends on GPIOLIB
+	select V4L2_CCI_I2C
+	select VIDEO_CCS_PLL
+	help
+	  This is a Video4Linux2 sensor driver for the Sony
+	  IMX708 camera.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called imx708.
+
 config VIDEO_MAX9271_LIB
 	tristate
 
drivers/media/i2c/Makefile +1 -0
index d04bd5724552..15dc9755e321 100644
@@ -62,6 +62,7 @@ obj-$(CONFIG_VIDEO_IMX355) += imx355.o
 obj-$(CONFIG_VIDEO_IMX412) += imx412.o
 obj-$(CONFIG_VIDEO_IMX415) += imx415.o
 obj-$(CONFIG_VIDEO_IMX678) += imx678.o
+obj-$(CONFIG_VIDEO_IMX708) += imx708.o
 obj-$(CONFIG_VIDEO_IMX471) += imx471.o
 obj-$(CONFIG_VIDEO_IR_I2C) += ir-kbd-i2c.o
 obj-$(CONFIG_VIDEO_ISL7998X) += isl7998x.o
drivers/media/i2c/imx708.c new file +1312 -0

1,312 lines not on this page · raw message

Signature · 1 line
2.54.0
#6 lore raw

Re: [PATCH v2 3/3] media: i2c: Add a driver for Sony IMX708

Thank you for your contribution! Sashiko AI review found 5 potential issue(s) to consider: - [High] Incorrect hardware power-off sequence: clock disabled after regulators. - [Medium] Incorrect…

Thank you for your contribution! Sashiko AI review found 5 potential issue(s) to consider:
- [High] Incorrect hardware power-off sequence: clock disabled after regulators.
- [Medium] Incorrect Runtime PM initialization ordering in imx708_probe() bypasses autosuspend.
- [Medium] Loss of precision in frame length calculation allows exposure to exceed physical hardware limits.
- [Medium] Missing system sleep PM operations causes a power leak during system suspend.
- [Medium] Lockless data race on V4L2 control values during TRY format enumeration.
--

--- Patch [3]: [PATCH v2 3/3] media: i2c: Add a driver for Sony IMX708 --- commit 0f39548715745ff8d2825112d41ad4cfb31c5791
Author: Jai Luthra <[email protected]>
Subject: media: i2c: Add a driver for Sony IMX708

This commit adds a V4L2 subdevice driver for the Sony IMX708 11.9 Megapixel CMOS sensor. It supports capturing the full active area up to 14.35fps with features including MIPI RAW10 output, analog gain, and VBLANK control.

Quoted 5 lines
drivers/media/i2c/imx708.c new file +0 -0
new file mode 100644
index 0000000000000..7d5b8bdc2b437

[ ... ]

drivers/media/i2c/imx708.c line 339

Quoted 6 lines
drivers/media/i2c/imx708.c new file +6 -0
+static u32 imx708_get_format_code(struct imx708 *imx708)
+{
+	unsigned int i;
+
+	i = (imx708->vflip->val ? 2 : 0) |
+	    (imx708->hflip->val ? 1 : 0);

[Severity: Medium]
Could this result in a data race during format enumeration? When userspace calls VIDIOC_SUBDEV_ENUM_MBUS_CODE with V4L2_SUBDEV_FORMAT_TRY, the V4L2 core acquires the TRY state lock, which is independent of the control handler lock. If another thread modifies the flip controls via VIDIOC_S_CTRL concurrently, it could cause an inconsistent read of vflip->val and hflip->val in imx708_get_format_code(), leading to incorrect format enumeration results.

[ ... ]

Quoted 2 lines
drivers/media/i2c/imx708.c new file +2 -0
+static int imx708_set_ctrl(struct v4l2_ctrl *ctrl)
+{

[ ... ]

drivers/media/i2c/imx708.c line 424

Quoted 10 lines
drivers/media/i2c/imx708.c new file +10 -0
+	case V4L2_CID_VBLANK:
+		ret = imx708_set_frame_length(imx708,
+					      imx708_active_area.height +
+					      ctrl->val);
+		fallthrough; /* update exposure with new long_exp_shift */
+	case V4L2_CID_EXPOSURE:
+		cci_write(imx708->cci, CCS_R_COARSE_INTEGRATION_TIME,
+			  imx708->exposure->val >> imx708->long_exp_shift,
+			  &ret);
+		break;

[Severity: Medium]
Will this precision loss allow the programmed exposure time to exceed physical hardware limits? If VBLANK is set such that the active area plus the blanking exceeds 65535, long_exp_shift becomes greater than 0. If long_exp_shift is 7, and the frame length modulo 128 is 48 or greater, integer division truncates the shifted exposure value so it exactly equals the shifted frame length in imx708_set_ctrl(). This leaves a 0-line blanking margin instead of the required 48 lines, which could cause sensor malfunction or I2C errors.

[ ... ]

drivers/media/i2c/imx708.c line 929

Quoted 10 lines
drivers/media/i2c/imx708.c new file +10 -0
+static int imx708_power_off(struct device *dev)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct v4l2_subdev *sd = i2c_get_clientdata(client);
+	struct imx708 *imx708 = to_imx708(sd);
+
+	gpiod_set_value_cansleep(imx708->reset_gpio, 1);
+	regulator_bulk_disable(ARRAY_SIZE(imx708_supply_name),
+			       imx708->supplies);
+	clk_disable_unprepare(imx708->inclk);

[Severity: High]
Does this disable the regulators before the clock? Calling regulator_bulk_disable() while the external clock is still running can backpower the unpowered sensor IC through the clock pin's ESD protection diodes. This backwards sequencing in imx708_power_off() might cause latch-up, excessive current draw, or physical damage to the hardware.

[ ... ]

Quoted 2 lines
drivers/media/i2c/imx708.c new file +2 -0
+static int imx708_probe(struct i2c_client *client)
+{

[ ... ]

drivers/media/i2c/imx708.c line 1249

Quoted 11 lines
drivers/media/i2c/imx708.c new file +11 -0
+	ret = v4l2_async_register_subdev_sensor(&imx708->sd);
+	if (ret < 0) {
+		dev_err_probe(dev, ret, "failed to register sensor sub-device\n");
+		goto error_subdev_cleanup;
+	}
+
+	pm_runtime_idle(dev);
+	pm_runtime_set_autosuspend_delay(dev, 5000);
+	pm_runtime_use_autosuspend(dev);
+
+	return 0;

[Severity: Medium]
Might this bypass the autosuspend delay? By calling pm_runtime_idle() before pm_runtime_use_autosuspend() is enabled in imx708_probe(), the PM core sees a 0 usage count and immediately invokes the synchronous suspend callback. This causes the sensor to be powered off immediately during probe instead of remaining active for the intended 5000ms delay.

[ ... ]

drivers/media/i2c/imx708.c line 1294

Quoted 3 lines
drivers/media/i2c/imx708.c new file +3 -0
+static const struct dev_pm_ops imx708_pm_ops = {
+	SET_RUNTIME_PM_OPS(imx708_power_off, imx708_power_on, NULL)
+};

[Severity: Medium]
Is it intentional to omit the system sleep operations here? Since the PM operations structure only sets SET_RUNTIME_PM_OPS, the PM core will not force the device to suspend during system sleep. If the host system suspends while the camera is active, the sensor regulators and clocks will remain fully powered on, causing a power leak.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3