Skip to contentSkip to conversation

Add initial dual front camera and rear flash support for Pixel 3 / 3 XL

PATCH Superseded David Heidelberg 4 participants 7 messages Jul 21 – Sep 1

Subsystems (3)

v7 of 11 Superseded Latest is v11 →

lore
Share & tools
lore
#0 lore raw

v7 cover Add initial dual front camera and rear flash support for Pixel 3 / 3 XL

Describe the dual front-facing IMX355 sensors (standard and wide) and enable the PMI8998 flash LED with hardware-accurate limits.

This brings up the basic camera topology and flash support in DT.

---
Changes in v7:
- Depend on the
https://lore.kernel.org/all/[email protected]/
(Konrad)
- Sort the renamed regulators. Why Mr. Anderson, why. (Konrad)
- Link to v6: https://lore.kernel.org/r/[email protected]

Changes in v6:
- Remove forgotten bias-pull-down property from cci0_sleep node. (dtbs_check)
- ..-regulator -> regulator-.. (Konrad)
- Rename camera -pin to -state and remove _pin from the labes. (Konrad, dtbs_check)
- Link to v5: https://lore.kernel.org/r/[email protected]

Changes in v5:
- Added function-enumarator to flash LEDs. (Sashiko)
- Dropped l22a regulator needed only for NFOV actuator. (Sashiko)
- Dropped vdda-csi[0-2]-supply, as it was unused. (Sashiko).
- Added previously omited cam_mclk2_sleep sleep state.
- Link to v4: https://lore.kernel.org/r/[email protected]

Changes in v4:
- Use 24 MHz ext clock for the cameras, as the downstream does, since
the upstream driver can now support it.
- Added additional LED, as the phone contains two separately controlled white LEDs flash (upper and bottom, in one module).
- Increase flash-max-microamp, as I took wrong "flash" from the
downstream sources and dropped Dmitry R-b.
- Address formatting issues. (Konrad)
- Link to v3: https://lore.kernel.org/r/[email protected]

Changes in v3:
- Dropped cam_vio label. (Dmitry)
- Move the MCLK2 pinctrl from cameras to common camss. (Dmitry)
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- leds.h include escaped the initial submission. Fixed.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
David Heidelberg (2):
arm64: dts: qcom: sdm845-google: Add dual front IMX355 cameras
arm64: dts: qcom: sdm845-google: Enable PMI8998 camera flash LEDs

 arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi | 199 ++++++++++++++++++++-
 1 file changed, 198 insertions(+), 1 deletion(-)

---
base-commit: 0718283ab28bc3907e10b61a6b4be6fefa1cbb2f
change-id: 20260315-pixel3-camera-a9989bf589ee
prerequisite-change-id: 20260608-kbingham-orientation-20afc0fb6957:v3
prerequisite-patch-id: 4ca069e5db821444cc3555a6ec3939c89dfaf233
prerequisite-patch-id: aa559ddd6f34d32f6f250e02086d1b2b932a2688
prerequisite-patch-id: c45901f8d919eb99a5bf282a1c89f5aa7c36cc52
prerequisite-patch-id: b2c8278c88db9d929453b8153f3e698cbf0053f9
prerequisite-patch-id: 3ce9cd5eab9a04b3b1f7d796a67b4c2cce903e1c
prerequisite-patch-id: 68e98a7f998b731d8c5520620e48b63dc839cf25
prerequisite-patch-id: 2b7d638e54d82ca3689ac06272440137e67f1656

Best regards,

Signature · 1 line
David Heidelberg <[email protected]>
#1 lore raw

PATCH v7 1/2 arm64: dts: qcom: sdm845-google: Add dual front IMX355 cameras

The Pixel 3 features two front-facing Sony IMX355 sensors with different focal lengths (standard and wide-angle).

Sensors are connected via CSIPHY port 1 and 2 and controlled over CCI I2C1, using MCLK2 as the clock source.

This enables support for the dual front camera configuration.

---
 arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi | 172 ++++++++++++++++++++-
 1 file changed, 171 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi +171 -1
index 9368fd6b87515..c8a28133fb38d 100644
@@ -1,16 +1,18 @@
 // SPDX-License-Identifier: GPL-2.0-only
 
 /dts-v1/;
 
 #include <dt-bindings/arm/qcom,ids.h>
 #include <dt-bindings/dma/qcom-gpi.h>
 #include <dt-bindings/input/linux-event-codes.h>
 #include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/media/video-interfaces.h>
+#include <dt-bindings/media/video-interface-devices.h>
 #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
 
 #include "sdm845.dtsi"
 #include "pm8998.dtsi"
 #include "pmi8998.dtsi"
 
 /delete-node/ &mpss_region;
 /delete-node/ &venus_mem;
@@ -108,16 +110,48 @@ gpio-keys {
 		key-vol-up {
 			label = "Volume Up";
 			linux,code = <KEY_VOLUMEUP>;
 			gpios = <&pm8998_gpios 6 GPIO_ACTIVE_LOW>;
 			debounce-interval = <15>;
 		};
 	};
 
+	camera_front_avdd: regulator-front-cam-avdd {
+		compatible = "regulator-fixed";
+		regulator-name = "front_cam_avdd";
+
+		regulator-min-microvolt = <2800000>;
+		regulator-max-microvolt = <2800000>;
+
+		gpios = <&tlmm 8 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+
+		pinctrl-0 = <&cam_front_avdd_default>;
+		pinctrl-names = "default";
+
+		vin-supply = <&vreg_bob>;
+	};
+
+	camera_front_aux_avdd: regulator-front-cam-aux-avdd {
+		compatible = "regulator-fixed";
+		regulator-name = "front_cam_aux_avdd";
+
+		regulator-min-microvolt = <2800000>;
+		regulator-max-microvolt = <2800000>;
+
+		gpios = <&tlmm 14 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+
+		pinctrl-0 = <&cam_front_aux_avdd_default>;
+		pinctrl-names = "default";
+
+		vin-supply = <&vreg_bob>;
+	};
+
 	vph_pwr: regulator-vph-pwr {
 		compatible = "regulator-fixed";
 		regulator-name = "vph_pwr";
 		regulator-min-microvolt = <3700000>;
 		regulator-max-microvolt = <3700000>;
 	};
 
 	vreg_s4a_1p8: regulator-vreg-s4a-1p8 {
@@ -314,16 +348,21 @@ vreg_l28a_3p0: ldo28 {
 			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
 			regulator-boot-on;
 			/*
 			 * We can't properly bring the panel back if it gets turned off
 			 * so keep it's regulators always on for now.
 			 */
 			regulator-always-on;
 		};
+
+		vreg_lvs1_1p8: lvs1 {
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <1800000>;
+		};
 	};
 
 	regulators-1 {
 		compatible = "qcom,pmi8998-rpmh-regulators";
 		qcom,pmic-id = "b";
 
 		vdd-bob-supply = <&vph_pwr>;
 
@@ -346,24 +385,127 @@ regulators-2 {
 
 		vreg_s3c_0p6: smps3 {
 			regulator-min-microvolt = <600000>;
 			regulator-max-microvolt = <600000>;
 		};
 	};
 };
 
+&camss {
+	vdda-phy-supply = <&vreg_l1a_0p875>;
+	vdda-pll-supply = <&vreg_l26a_1p2>;
+
+	/*
+	 * MCLK2 (GPIO15) is shared between both front camera sensors.
+	 * The clock is generated by CAMCC, therefore the pin is
+	 * configured here rather than in individual sensor nodes.
+	 */
+	pinctrl-0 = <&cam_mclk2_default>;
+	pinctrl-1 = <&cam_mclk2_sleep>;
+	pinctrl-names = "default", "sleep";
+
+	status = "okay";
+
+	ports {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		port@1 {
+			reg = <1>;
+
+			camss_endpoint1: endpoint {
+				bus-type = <MEDIA_BUS_TYPE_CSI2_DPHY>;
+				data-lanes = <0 1 2 3>;
+				remote-endpoint = <&cam_aux_front_endpoint>;
+			};
+		};
+
+		port@2 {
+			reg = <2>;
+
+			camss_endpoint2: endpoint {
+				bus-type = <MEDIA_BUS_TYPE_CSI2_DPHY>;
+				data-lanes = <0 1 2 3>;
+				remote-endpoint = <&cam_front_endpoint>;
+			};
+		};
+	};
+};
+
+&cci0_sleep {
+	/* bus has external pull-up */
+	/delete-property/ bias-pull-down;
+	bias-disable;
+};
+
 &cci {
 	status = "okay";
 };
 
 &cci_i2c1 {
 	/* actuator @0c */
 
-	/* front camera, imx355 @1a */
+	front_cam: camera@10 {
+		compatible = "sony,imx355";
+		reg = <0x10>;
+
+		clocks = <&clock_camcc CAM_CC_MCLK2_CLK>;
+		assigned-clocks = <&clock_camcc CAM_CC_MCLK2_CLK>;
+		assigned-clock-rates = <24000000>;
+
+		reset-gpios = <&tlmm 21 GPIO_ACTIVE_LOW>;
+
+		avdd-supply = <&camera_front_avdd>;
+		dvdd-supply = <&vreg_s3a_1p35>;
+		dovdd-supply = <&vreg_lvs1_1p8>;
+
+		pinctrl-0 = <&cam_front_reset_default>;
+		pinctrl-names = "default";
+
+		rotation = <270>;
+		orientation = <MEDIA_ORIENTATION_FRONT>;
+
+		port {
+			cam_front_endpoint: endpoint {
+				data-lanes = <1 2 3 4>;
+				link-frequencies = /bits/ 64 <360000000>;
+				remote-endpoint = <&camss_endpoint2>;
+			};
+		};
+	};
+
+	front_aux_cam: camera@1a {
+		compatible = "sony,imx355";
+		reg = <0x1a>;
+
+		clocks = <&clock_camcc CAM_CC_MCLK2_CLK>;
+		assigned-clocks = <&clock_camcc CAM_CC_MCLK2_CLK>;
+		assigned-clock-rates = <24000000>;
+
+		reset-gpios = <&tlmm 9 GPIO_ACTIVE_LOW>;
+
+		avdd-supply = <&camera_front_aux_avdd>;
+		dvdd-supply = <&vreg_s3a_1p35>;
+		dovdd-supply = <&vreg_lvs1_1p8>;
+
+		pinctrl-0 = <&cam_front_aux_reset_default>;
+		pinctrl-names = "default";
+
+		rotation = <270>;
+		orientation = <MEDIA_ORIENTATION_FRONT>;
+
+		port {
+			cam_aux_front_endpoint: endpoint {
+				data-lanes = <1 2 3 4>;
+				link-frequencies = /bits/ 64 <360000000>;
+				remote-endpoint = <&camss_endpoint1>;
+			};
+		};
+	};
 
 	/* eeprom @50, at24 driver says 8K */
 };
 
 &cdsp_pas {
 	firmware-name = "qcom/sdm845/Google/blueline/cdsp.mbn";
 
 	status = "okay";
@@ -485,16 +627,44 @@ nfc_int_default: nfc-int-default-state {
 
 	nfc_enable_default: nfc-enable-default-state {
 		pins = "gpio25", "gpio79";
 		function = "gpio";
 		drive-strength = <2>;
 		bias-pull-down;
 	};
 
+	cam_front_avdd_default: cam-avdd-default-state {
+		pins = "gpio8";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+	};
+
+	cam_front_aux_reset_default: cam-front-aux-reset-default-state {
+		pins = "gpio9";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+	};
+
+	cam_front_aux_avdd_default: cam-avdd-aux-default-state {
+		pins = "gpio14";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+	};
+
+	cam_front_reset_default: cam-front-reset-default-state {
+		pins = "gpio21";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+	};
+
 	touchscreen_reset: ts-reset-state {
 		pins = "gpio99";
 		function = "gpio";
 		drive-strength = <8>;
 		bias-pull-up;
 	};
 
 	touchscreen_pins: ts-pins-gpio-state {
Signature · 1 line
2.53.0
Reviewed-by on v7 1/2
#2 lore raw

Re: [PATCH v7 1/2] arm64: dts: qcom: sdm845-google: Add dual front IMX355 cameras

Quoted 20 lines · On 7/21/26 2:33 PM, David Heidelberg via B4 Relay wrote:

From: David Heidelberg <[email protected]>

The Pixel 3 features two front-facing Sony IMX355 sensors with different focal lengths (standard and wide-angle).

Sensors are connected via CSIPHY port 1 and 2 and controlled over CCI I2C1, using MCLK2 as the clock source.

This enables support for the dual front camera configuration.

---
 arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi | 172 ++++++++++++++++++++-
 1 file changed, 171 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi +0 -0
index 9368fd6b87515..c8a28133fb38d 100644

arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi line 10

Quoted 10 lines
arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi +2 -0
@@ -1,16 +1,18 @@
 // SPDX-License-Identifier: GPL-2.0-only
 
 /dts-v1/;
 
 #include <dt-bindings/arm/qcom,ids.h>
 #include <dt-bindings/dma/qcom-gpi.h>
 #include <dt-bindings/input/linux-event-codes.h>
 #include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/media/video-interfaces.h>
+#include <dt-bindings/media/video-interface-devices.h>

These should be flipped to be sorted.. if you smile very nicely, Bjorn could prob fix it up

Konrad

maintainer
#3 lore raw

Re: [PATCH v7 1/2] arm64: dts: qcom: sdm845-google: Add dual front IMX355 cameras

Quoted 25 lines · Konrad Dybcio
Quoted 24 lines · On 7/21/26 2:33 PM, David Heidelberg via B4 Relay wrote:

From: David Heidelberg <[email protected]>

The Pixel 3 features two front-facing Sony IMX355 sensors with different focal lengths (standard and wide-angle).

Sensors are connected via CSIPHY port 1 and 2 and controlled over CCI I2C1, using MCLK2 as the clock source.

This enables support for the dual front camera configuration.

---
 arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi | 172 ++++++++++++++++++++-
 1 file changed, 171 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi +0 -0
index 9368fd6b87515..c8a28133fb38d 100644
@@ -1,16 +1,18 @@
 // SPDX-License-Identifier: GPL-2.0-only
 
 /dts-v1/;
 
Quoted 10 lines

arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi line 10

Quoted 6 lines
arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi +2 -0
 #include <dt-bindings/arm/qcom,ids.h>
 #include <dt-bindings/dma/qcom-gpi.h>
 #include <dt-bindings/input/linux-event-codes.h>
 #include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/media/video-interfaces.h>
+#include <dt-bindings/media/video-interface-devices.h>

These should be flipped to be sorted.. if you smile very nicely, Bjorn could prob fix it up

Sure can do, but I don't have dt-bindings/media/video-interface-devices.h :(

Quoted 3 lines

Konrad

#4 lore raw

Re: [PATCH v7 1/2] arm64: dts: qcom: sdm845-google: Add dual front IMX355 cameras

it depends on the

https://lore.kernel.org/all/[email protected]/

I'll send the next revision.

David

Quoted 42 lines · Bjorn Andersson
Quoted 25 lines · Konrad Dybcio
Quoted 24 lines · On 7/21/26 2:33 PM, David Heidelberg via B4 Relay wrote:

From: David Heidelberg <[email protected]>

The Pixel 3 features two front-facing Sony IMX355 sensors with different focal lengths (standard and wide-angle).

Sensors are connected via CSIPHY port 1 and 2 and controlled over CCI I2C1, using MCLK2 as the clock source.

This enables support for the dual front camera configuration.

---
  arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi | 172 ++++++++++++++++++++-
  1 file changed, 171 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi +0 -0
index 9368fd6b87515..c8a28133fb38d 100644
@@ -1,16 +1,18 @@
  // SPDX-License-Identifier: GPL-2.0-only
 
  /dts-v1/;
 
Quoted 10 lines

arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi line 10

Quoted 6 lines
arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi +2 -0
  #include <dt-bindings/arm/qcom,ids.h>
  #include <dt-bindings/dma/qcom-gpi.h>
  #include <dt-bindings/input/linux-event-codes.h>
  #include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/media/video-interfaces.h>
+#include <dt-bindings/media/video-interface-devices.h>

These should be flipped to be sorted.. if you smile very nicely, Bjorn could prob fix it up

Sure can do, but I don't have dt-bindings/media/video-interface-devices.h :(

Quoted 3 lines

Konrad

#5 lore raw

Re: [PATCH v7 1/2] arm64: dts: qcom: sdm845-google: Add dual front IMX355 cameras

In reply to David Heidelberg
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] Mismatched Pinctrl Sleep State: `&cci0_sleep` overridden instead of `&cci1_sleep` --

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Mismatched Pinctrl Sleep State: &cci0_sleep overridden instead of &cci1_sleep --

--- Patch [1]: [PATCH v7 1/2] arm64: dts: qcom: sdm845-google: Add dual front IMX355 cameras --- commit 6f3cf4398dc835a329292905a7fe098ccc06dc9c
Author: David Heidelberg <[email protected]>

arm64: dts: qcom: sdm845-google: Add dual front IMX355 cameras

This patch adds support for the dual front IMX355 cameras on the Pixel 3. The cameras are connected via CSIPHY ports 1 and 2, and are controlled over the CCI I2C1 bus.

Quoted 4 lines
arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi +0 -0
index 9368fd6b87515..c8a28133fb38d 100644

[ ... ]

arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi regulators-2 { · line 438

Quoted 5 lines

+&cci0_sleep {

arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi +4 -0
+	/* bus has external pull-up */
+	/delete-property/ bias-pull-down;
+	bias-disable;
+};

[Severity: Medium]
Is it intentional to modify the sleep state for &cci0_sleep here?

The new front cameras are added to the &cci_i2c1 bus below, which depends on &cci1_sleep for its suspend state. Modifying &cci0_sleep means &cci1_sleep will retain its default bias-pull-down configuration.

During suspend, the SoC will actively pull down the &cci_i2c1 pins, which will fight the external pull-up resistors on that bus and cause continuous leakage current and battery drain.

Should this remove the bias-pull-down property on &cci1_sleep instead?

Quoted 10 lines
arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi +2 -1
+
 &cci {
 	status = "okay";
 };
@@ -358,7 +444,63 @@ &cci {
 &cci_i2c1 {
 	/* actuator @0c */
 
-	/* front camera, imx355 @1a */
+	front_cam: camera@10 {

[ ... ]

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

PATCH v7 2/2 arm64: dts: qcom: sdm845-google: Enable PMI8998 camera flash LEDs

In reply to David Heidelberg

Enable the PMI8998 flash LED block and describe two white flash LEDs used for the rear camera.

Configure the LED in flash mode with hardware limits matching the original device configuration, including maximum current and timeout.

In contrary to downstream, we can control both LEDs separately.

---
 arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi | 27 ++++++++++++++++++++++
 1 file changed, 27 insertions(+)
arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi +27 -0
index c8a28133fb38d..8d35e33ef7aaf 100644
@@ -1,16 +1,17 @@
 // SPDX-License-Identifier: GPL-2.0-only
 
 /dts-v1/;
 
 #include <dt-bindings/arm/qcom,ids.h>
 #include <dt-bindings/dma/qcom-gpi.h>
 #include <dt-bindings/input/linux-event-codes.h>
 #include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/leds/common.h>
 #include <dt-bindings/media/video-interfaces.h>
 #include <dt-bindings/media/video-interface-devices.h>
 #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
 
 #include "sdm845.dtsi"
 #include "pm8998.dtsi"
 #include "pmi8998.dtsi"
 
@@ -591,16 +592,42 @@ &pm8998_resin {
 };
 
 &pmi8998_charger {
 	monitored-battery = <&battery>;
 
 	status = "okay";
 };
 
+&pmi8998_flash {
+	status = "okay";
+
+	/* upper part of the flash module */
+	led-0 {
+		function = LED_FUNCTION_FLASH;
+		color = <LED_COLOR_ID_WHITE>;
+		led-sources = <1>;
+		led-max-microamp = <500000>;
+		flash-max-microamp = <1500000>;
+		flash-max-timeout-us = <1280000>;
+		function-enumerator = <0>;
+	};
+
+	/* lower part of the flash module */
+	led-1 {
+		function = LED_FUNCTION_FLASH;
+		color = <LED_COLOR_ID_WHITE>;
+		led-sources = <2>;
+		led-max-microamp = <500000>;
+		flash-max-microamp = <1500000>;
+		flash-max-timeout-us = <1280000>;
+		function-enumerator = <1>;
+	};
+};
+
 &qupv3_id_0 {
 	status = "okay";
 };
 
 &qupv3_id_1 {
 	status = "okay";
 };
 
Signature · 1 line
2.53.0