public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] support camera found on Gaokun3
@ 2026-04-25 10:52 Pengyu Luo
  2026-04-25 10:52 ` [PATCH 1/4] media: hi846: fix hi846_write_reg_16 handling Pengyu Luo
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Pengyu Luo @ 2026-04-25 10:52 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Martin Kepplinger-Novakovic, Sakari Ailus,
	Mauro Carvalho Chehab, Hans Verkuil, Martin Kepplinger
  Cc: linux-arm-msm, devicetree, linux-kernel, linux-media, Pengyu Luo

This series adds support for front camera on Gaokun3(3.0GHz version).
The front sensor is Hi846, this series also fixes a error blocking
Hi846 driver function, and supports more mode on Hi846.

Signed-off-by: Pengyu Luo <mitltlatltl@gmail.com>
---
Pengyu Luo (4):
  media: hi846: fix hi846_write_reg_16 handling
  media: hi846: Add 6MP and 8MP mode support
  arm64: dts: qcom: sc8280xp: gaokun3: add front camera sensor node
  arm64: dts: qcom: sc8280xp: gaokun3: describe rear camera module
    information as musch as possible

 .../boot/dts/qcom/sc8280xp-huawei-gaokun3.dts | 255 +++++++++++++++++-
 drivers/media/i2c/hi846.c                     | 161 ++++++++++-
 2 files changed, 410 insertions(+), 6 deletions(-)

-- 
2.54.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/4] media: hi846: fix hi846_write_reg_16 handling
  2026-04-25 10:52 [PATCH 0/4] support camera found on Gaokun3 Pengyu Luo
@ 2026-04-25 10:52 ` Pengyu Luo
  2026-04-25 10:52 ` [PATCH 2/4] media: hi846: Add 6MP and 8MP mode support Pengyu Luo
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Pengyu Luo @ 2026-04-25 10:52 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Martin Kepplinger-Novakovic, Sakari Ailus,
	Mauro Carvalho Chehab, Hans Verkuil, Martin Kepplinger
  Cc: linux-arm-msm, devicetree, linux-kernel, linux-media, Pengyu Luo

hi846_write_reg_16() does not clear a positive *err value on success.
pm_runtime_get_if_in_use() returns a positive value when the device
is already in use. When hi846_set_ctrl() passes &ret holding this
positive value) to hi846_write_reg_16(), the function returns with ret
as is, the positive value propagates back as a return code, which
callers interpret as an error.

Fix this by resetting *err to 0 only when it is positive.

Fixes: 04fc06f6dc15 ("media: hi846: fix usage of pm_runtime_get_if_in_use()")
Signed-off-by: Pengyu Luo <mitltlatltl@gmail.com>
---
 drivers/media/i2c/hi846.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/i2c/hi846.c b/drivers/media/i2c/hi846.c
index a3f77b8434ca..09c109f3fba9 100644
--- a/drivers/media/i2c/hi846.c
+++ b/drivers/media/i2c/hi846.c
@@ -1270,6 +1270,8 @@ static void hi846_write_reg_16(struct hi846 *hi846, u16 reg, u16 val, int *err)
 
 	if (*err < 0)
 		return;
+	else
+		*err = 0;
 
 	put_unaligned_be16(reg, buf);
 	put_unaligned_be16(val, buf + 2);
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/4] media: hi846: Add 6MP and 8MP mode support
  2026-04-25 10:52 [PATCH 0/4] support camera found on Gaokun3 Pengyu Luo
  2026-04-25 10:52 ` [PATCH 1/4] media: hi846: fix hi846_write_reg_16 handling Pengyu Luo
@ 2026-04-25 10:52 ` Pengyu Luo
  2026-04-25 10:52 ` [PATCH 3/4] arm64: dts: qcom: sc8280xp: gaokun3: add front camera sensor node Pengyu Luo
  2026-04-25 10:53 ` [PATCH 4/4] arm64: dts: qcom: sc8280xp: gaokun3: describe rear camera module information as musch as possible Pengyu Luo
  3 siblings, 0 replies; 6+ messages in thread
From: Pengyu Luo @ 2026-04-25 10:52 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Martin Kepplinger-Novakovic, Sakari Ailus,
	Mauro Carvalho Chehab, Hans Verkuil, Martin Kepplinger
  Cc: linux-arm-msm, devicetree, linux-kernel, linux-media, Pengyu Luo

Hi846 is an 8MP sensor, but the upstream driver has only supported 2MP
mode for years. This patch adds 6MP and 8MP modes to maximize sensor
utilization.

Note that these modes require 4-lane MIPI CSI-2, as the downstream
driver only exposes 2MP, 6MP, and 8MP configurations in 4-lane
operation on the target device. The register sequences are extracted
from the downstream Windows driver.

Signed-off-by: Pengyu Luo <mitltlatltl@gmail.com>
---
 drivers/media/i2c/hi846.c | 159 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 158 insertions(+), 1 deletion(-)

diff --git a/drivers/media/i2c/hi846.c b/drivers/media/i2c/hi846.c
index 09c109f3fba9..d6739a7c2324 100644
--- a/drivers/media/i2c/hi846.c
+++ b/drivers/media/i2c/hi846.c
@@ -1027,6 +1027,111 @@ static const struct hi846_reg mode_1632x1224_mipi_4lane[] = {
 	{HI846_REG_TG_ENABLE,			0x0100},
 };
 
+static const struct hi846_reg mode_3264x1836_config[] = {
+	{HI846_REG_MODE_SELECT,			0x0000},
+	{HI846_REG_Y_ODD_INC_FOBP,		0x1111},
+	{HI846_REG_Y_ODD_INC_VACT,		0x1111},
+	{HI846_REG_Y_ADDR_START_VACT_H,		0x0172},
+	{HI846_REG_Y_ADDR_END_VACT_H,		0x089d},
+	{HI846_REG_UNKNOWN_005C,		0x2101},
+	{HI846_REG_FLL,				0x09de},
+	{HI846_REG_LLP,				0x0ed8},
+	{HI846_REG_BINNING_MODE,		0x0022},
+	{HI846_REG_HBIN_MODE,			0x0000},
+	{HI846_REG_UNKNOWN_0A24,		0x0000},
+	{HI846_REG_X_START_H,			0x0000},
+	{HI846_REG_X_OUTPUT_SIZE_H,		0x0cc0},
+	{HI846_REG_Y_OUTPUT_SIZE_H,		0x072c},
+	{HI846_REG_EXPOSURE,			0x09d8},
+
+	/* For OTP */
+	{HI846_REG_UNKNOWN_021C,		0x0001},
+	{HI846_REG_UNKNOWN_021E,		0x0235},
+
+	{HI846_REG_ISP_EN_H,			0x014a},
+	{HI846_REG_UNKNOWN_0418,		0x023e},
+	{HI846_REG_UNKNOWN_0B02,		0xe04d},
+	{HI846_REG_UNKNOWN_0B10,		0x6821},
+	{HI846_REG_UNKNOWN_0B12,		0x0120},
+	{HI846_REG_UNKNOWN_0B14,		0x0001},
+	{HI846_REG_UNKNOWN_2008,		0x38fd},
+	{HI846_REG_UNKNOWN_326E,		0x0000},
+
+// ?
+	// {0x0710, 0x074c},
+	// {0x0f32, 0x025a},
+	// {0x0f38, 0x025a},
+};
+
+static const struct hi846_reg mode_3264x1836_mipi_4lane[] = {
+	{HI846_REG_UNKNOWN_0900,		0x0300},
+	{HI846_REG_MIPI_TX_OP_MODE,		0xc319},
+	{HI846_REG_UNKNOWN_0914,		0xc109},
+	{HI846_REG_TCLK_PREPARE,		0x061a},
+	{HI846_REG_UNKNOWN_0918,		0x0407},
+	{HI846_REG_THS_ZERO,			0x0a0b},
+	{HI846_REG_TCLK_POST,			0x0e08},
+	{HI846_REG_UNKNOWN_091E,		0x0a00},
+	{HI846_REG_UNKNOWN_090C,		0x0427},
+	{HI846_REG_UNKNOWN_090E,		0x0059},
+	{HI846_REG_UNKNOWN_0954,		0x0089},
+	{HI846_REG_UNKNOWN_0956,		0x0000},
+	{HI846_REG_UNKNOWN_0958,		0xca80},
+	{HI846_REG_UNKNOWN_095A,		0x9240},
+	{HI846_REG_PLL_CFG_MIPI2_H,		0x4124},
+	{HI846_REG_TG_ENABLE,			0x0100},
+};
+
+static const struct hi846_reg mode_3264x2448_config[] = {
+	{HI846_REG_MODE_SELECT,			0x0000},
+	{HI846_REG_Y_ODD_INC_FOBP,		0x1111},
+	{HI846_REG_Y_ODD_INC_VACT,		0x1111},
+	{HI846_REG_Y_ADDR_START_VACT_H,		0x0040},
+	{HI846_REG_Y_ADDR_END_VACT_H,		0x09cf},
+	{HI846_REG_UNKNOWN_005C,		0x2101},
+	{HI846_REG_FLL,				0x09de},
+	{HI846_REG_LLP,				0x0ed8},
+	{HI846_REG_BINNING_MODE,		0x0022},
+	{HI846_REG_HBIN_MODE,			0x0000},
+	{HI846_REG_UNKNOWN_0A24,		0x0000},
+	{HI846_REG_X_START_H,			0x0000},
+	{HI846_REG_X_OUTPUT_SIZE_H,		0x0cc0},
+	{HI846_REG_Y_OUTPUT_SIZE_H,		0x0990},
+	{HI846_REG_EXPOSURE,			0x09d8},
+
+	/* For OTP */
+	{HI846_REG_UNKNOWN_021C,		0x0001},
+	{HI846_REG_UNKNOWN_021E,		0x0235},
+
+	{HI846_REG_ISP_EN_H,			0x014a},
+	{HI846_REG_UNKNOWN_0418,		0x0000},
+	{HI846_REG_UNKNOWN_0B02,		0xe04d},
+	{HI846_REG_UNKNOWN_0B10,		0x6821},
+	{HI846_REG_UNKNOWN_0B12,		0x0120},
+	{HI846_REG_UNKNOWN_0B14,		0x0001},
+	{HI846_REG_UNKNOWN_2008,		0x38fd},
+	{HI846_REG_UNKNOWN_326E,		0x0000},
+};
+
+static const struct hi846_reg mode_3264x2448_mipi_4lane[] = {
+	{HI846_REG_UNKNOWN_0900,		0x0300},
+	{HI846_REG_MIPI_TX_OP_MODE,		0xc319},
+	{HI846_REG_UNKNOWN_0914,		0xc109},
+	{HI846_REG_TCLK_PREPARE,		0x061a},
+	{HI846_REG_UNKNOWN_0918,		0x0407},
+	{HI846_REG_THS_ZERO,			0x0a0b},
+	{HI846_REG_TCLK_POST,			0x0e08},
+	{HI846_REG_UNKNOWN_091E,		0x0a00},
+	{HI846_REG_UNKNOWN_090C,		0x0427},
+	{HI846_REG_UNKNOWN_090E,		0x0059},
+	{HI846_REG_UNKNOWN_0954,		0x0089},
+	{HI846_REG_UNKNOWN_0956,		0x0000},
+	{HI846_REG_UNKNOWN_0958,		0xca80},
+	{HI846_REG_UNKNOWN_095A,		0x9240},
+	{HI846_REG_PLL_CFG_MIPI2_H,		0x4124},
+	{HI846_REG_TG_ENABLE,			0x0100},
+};
+
 static const char * const hi846_test_pattern_menu[] = {
 	"Disabled",
 	"Solid Colour",
@@ -1042,9 +1147,11 @@ static const char * const hi846_test_pattern_menu[] = {
 
 #define FREQ_INDEX_640	0
 #define FREQ_INDEX_1280	1
+#define FREQ_INDEX_3264	2
 static const s64 hi846_link_freqs[] = {
 	[FREQ_INDEX_640] = 80000000,
 	[FREQ_INDEX_1280] = 200000000,
+	[FREQ_INDEX_3264] = 288000000,
 };
 
 static const struct hi846_reg_list hi846_init_regs_list_2lane = {
@@ -1134,7 +1241,57 @@ static const struct hi846_mode supported_modes[] = {
 			.width = 1632 * 2,
 			.height = 1224 * 2,
 		},
-	}
+	},
+	{
+		.width = 3264,
+		.height = 1836,
+		.link_freq_index = FREQ_INDEX_3264,
+		.fps = 30,
+		.frame_len = 2526,
+		.llp = HI846_LINE_LENGTH,
+		.reg_list_config = {
+			.num_of_regs = ARRAY_SIZE(mode_3264x1836_config),
+			.regs = mode_3264x1836_config,
+		},
+		.reg_list_2lane = {
+			.num_of_regs = 0,
+		},
+		.reg_list_4lane = {
+			.num_of_regs = ARRAY_SIZE(mode_3264x1836_mipi_4lane),
+			.regs = mode_3264x1836_mipi_4lane,
+		},
+		.crop = {
+			.left = 0x46,
+			.top = 0x172,
+			.width = 3264,
+			.height = 1836,
+		},
+	},
+	{
+		.width = 3264,
+		.height = 2448,
+		.link_freq_index = FREQ_INDEX_3264,
+		.fps = 30,
+		.frame_len = 2526,
+		.llp = HI846_LINE_LENGTH,
+		.reg_list_config = {
+			.num_of_regs = ARRAY_SIZE(mode_3264x2448_config),
+			.regs = mode_3264x2448_config,
+		},
+		.reg_list_2lane = {
+			.num_of_regs = 0,
+		},
+		.reg_list_4lane = {
+			.num_of_regs = ARRAY_SIZE(mode_3264x2448_mipi_4lane),
+			.regs = mode_3264x2448_mipi_4lane,
+		},
+		.crop = {
+			.left = 0x46,
+			.top = 0x40,
+			.width = 3264,
+			.height = 2448,
+		},
+	},
 };
 
 struct hi846_datafmt {
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/4] arm64: dts: qcom: sc8280xp: gaokun3: add front camera sensor node
  2026-04-25 10:52 [PATCH 0/4] support camera found on Gaokun3 Pengyu Luo
  2026-04-25 10:52 ` [PATCH 1/4] media: hi846: fix hi846_write_reg_16 handling Pengyu Luo
  2026-04-25 10:52 ` [PATCH 2/4] media: hi846: Add 6MP and 8MP mode support Pengyu Luo
@ 2026-04-25 10:52 ` Pengyu Luo
  2026-04-27 13:00   ` Konrad Dybcio
  2026-04-25 10:53 ` [PATCH 4/4] arm64: dts: qcom: sc8280xp: gaokun3: describe rear camera module information as musch as possible Pengyu Luo
  3 siblings, 1 reply; 6+ messages in thread
From: Pengyu Luo @ 2026-04-25 10:52 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Martin Kepplinger-Novakovic, Sakari Ailus,
	Mauro Carvalho Chehab, Hans Verkuil, Martin Kepplinger
  Cc: linux-arm-msm, devicetree, linux-kernel, linux-media, Pengyu Luo

Hi846 is found on my Gaokun3, descripting it.

Note that it seems that only Goakun3(3.0GHz) version is equipped with
Hi846. Goakun3(2.69GHz) version is equipped with S5K4H7.

Signed-off-by: Pengyu Luo <mitltlatltl@gmail.com>
---
 .../boot/dts/qcom/sc8280xp-huawei-gaokun3.dts | 128 ++++++++++++++++++
 1 file changed, 128 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-huawei-gaokun3.dts b/arch/arm64/boot/dts/qcom/sc8280xp-huawei-gaokun3.dts
index 9819454abe13..39e559e91289 100644
--- a/arch/arm64/boot/dts/qcom/sc8280xp-huawei-gaokun3.dts
+++ b/arch/arm64/boot/dts/qcom/sc8280xp-huawei-gaokun3.dts
@@ -15,6 +15,7 @@
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/gpio-keys.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
 #include <dt-bindings/phy/phy.h>
 
@@ -27,6 +28,7 @@ / {
 	compatible = "huawei,gaokun3", "qcom,sc8280xp";
 
 	aliases {
+		i2c2 = &cci2_i2c1;
 		i2c4 = &i2c4;
 		i2c15 = &i2c15;
 		serial1 = &uart2;
@@ -47,6 +49,21 @@ framebuffer0: framebuffer@c6200000 {
 		};
 	};
 
+	leds {
+		compatible = "gpio-leds";
+
+		pinctrl-0 = <&cam_indicator_en>;
+		pinctrl-names = "default";
+
+		privacy_led: privacy-led {
+			function = LED_FUNCTION_INDICATOR;
+			color = <LED_COLOR_ID_WHITE>;
+			gpios = <&tlmm 34 GPIO_ACTIVE_HIGH>;
+			default-state = "off";
+			panic-indicator;
+		};
+	};
+
 	wcd938x: audio-codec {
 		compatible = "qcom,wcd9380-codec";
 
@@ -98,6 +115,20 @@ switch-mode {
 		};
 	};
 
+	vreg_camf_1p2: regulator-camf-1p2 {
+		compatible = "regulator-fixed";
+
+		regulator-name = "vreg_camf_1p2";
+		regulator-min-microvolt = <1200000>;
+		regulator-max-microvolt = <1200000>;
+
+		gpio = <&tlmm 44 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+
+		pinctrl-0 = <&camf_1p2_reg_en>;
+		pinctrl-names = "default";
+	};
+
 	vreg_misc_3p3: regulator-misc-3p3 {
 		compatible = "regulator-fixed";
 
@@ -462,6 +493,13 @@ vreg_l8c: ldo8 {
 						   RPMH_REGULATOR_MODE_HPM>;
 		};
 
+		vreg_l11c: ldo11 {
+			regulator-name = "vreg_l11c";
+			regulator-min-microvolt = <2800000>;
+			regulator-max-microvolt = <2800000>;
+			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+		};
+
 		vreg_l12c: ldo12 {
 			regulator-name = "vreg_l12c";
 			regulator-min-microvolt = <1800000>;
@@ -577,6 +615,66 @@ vreg_l10d: ldo10 {
 	};
 };
 
+&camss {
+	vdda-phy-supply = <&vreg_l6b>;
+	vdda-pll-supply = <&vreg_l3b>;
+
+	status = "okay";
+
+	ports {
+		port@3 {
+			csiphy3_ep: endpoint@0 {
+				reg = <0>;
+
+				clock-lanes = <7>;
+				data-lanes = <0 1 2 3>;
+				remote-endpoint = <&hi846_ep>;
+			};
+		};
+	};
+};
+
+&cci2 {
+	status = "okay";
+};
+
+&cci2_i2c1 {
+	/* On Goakun3(2.69GHz), S5K4H7@2d, image quality is better than hi846 */
+	camera_front: camera@20 {
+		compatible = "hynix,hi846";
+		reg = <0x20>;
+
+		pinctrl-0 = <&camf_rgb_default>;
+		pinctrl-names = "default";
+
+		clocks = <&camcc CAMCC_MCLK3_CLK>;
+
+		assigned-clocks = <&camcc CAMCC_MCLK3_CLK>;
+		assigned-clock-rates = <24000000>;
+
+		reset-gpios = <&tlmm 15 GPIO_ACTIVE_LOW>;
+		vddio-supply = <&vreg_l2c>;
+		vdda-supply = <&vreg_l11c>;
+		vddd-supply = <&vreg_camf_1p2>;
+
+		leds = <&privacy_led>;
+		led-names = "privacy";
+
+		orientation = <0>;	/* Front facing */
+		rotation = <0>;
+
+		port {
+			hi846_ep: endpoint {
+				data-lanes = <1 2 3 4>;
+				link-frequencies = /bits/ 64 <80000000 144000000 200000000 288000000>;
+				remote-endpoint = <&csiphy3_ep>;
+			};
+		};
+	};
+
+	/* actuator???@58, Goakun3(2.69GHz) only, eeprom@50 */
+};
+
 &dispcc0 {
 	status = "okay";
 };
@@ -1318,6 +1416,36 @@ hstp-sw-ctrl-pins {
 		};
 	};
 
+	cam_indicator_en: cam-indicator-en-state {
+		pins = "gpio34";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+	};
+
+	camf_1p2_reg_en: camf-1p2-reg-en-state {
+		pins = "gpio44";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+	};
+
+	camf_rgb_default: camf-rgb-default-state {
+		mclk-pins {
+			pins = "gpio17";
+			function = "cam_mclk";
+			drive-strength = <6>;
+			bias-disable;
+		};
+
+		sc-rgb-xshut-n-pins {
+			pins = "gpio15";
+			function = "gpio";
+			drive-strength = <2>;
+			bias-disable;
+		};
+	};
+
 	i2c4_default: i2c4-default-state {
 		pins = "gpio171", "gpio172";
 		function = "qup4";
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 4/4] arm64: dts: qcom: sc8280xp: gaokun3: describe rear camera module information as musch as possible
  2026-04-25 10:52 [PATCH 0/4] support camera found on Gaokun3 Pengyu Luo
                   ` (2 preceding siblings ...)
  2026-04-25 10:52 ` [PATCH 3/4] arm64: dts: qcom: sc8280xp: gaokun3: add front camera sensor node Pengyu Luo
@ 2026-04-25 10:53 ` Pengyu Luo
  3 siblings, 0 replies; 6+ messages in thread
From: Pengyu Luo @ 2026-04-25 10:53 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Martin Kepplinger-Novakovic, Sakari Ailus,
	Mauro Carvalho Chehab, Hans Verkuil, Martin Kepplinger
  Cc: linux-arm-msm, devicetree, linux-kernel, linux-media, Pengyu Luo

The rear sensor is S5K3L6, describing it but dropping compatible
string, since there is no upstream driver. A funcitonal downstream
driver is in comment.

The VCM is dw9714, describe it.

Signed-off-by: Pengyu Luo <mitltlatltl@gmail.com>
---
Please take this patch as a RFC, I am not sure, how much I am allowed
to add without a sensor driver.
---
 .../boot/dts/qcom/sc8280xp-huawei-gaokun3.dts | 129 +++++++++++++++++-
 1 file changed, 123 insertions(+), 6 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-huawei-gaokun3.dts b/arch/arm64/boot/dts/qcom/sc8280xp-huawei-gaokun3.dts
index 39e559e91289..76b1ecb3819d 100644
--- a/arch/arm64/boot/dts/qcom/sc8280xp-huawei-gaokun3.dts
+++ b/arch/arm64/boot/dts/qcom/sc8280xp-huawei-gaokun3.dts
@@ -22,12 +22,18 @@
 #include "sc8280xp.dtsi"
 #include "sc8280xp-pmics.dtsi"
 
+/* remove due to gpio pins collision, skip 2nd instance won't break things */
+/delete-node/ &cci1_i2c1;
+/delete-node/ &cci1_i2c1_default;
+/delete-node/ &cci1_i2c1_sleep;
+
 / {
 	chassis-type = "tablet";
 	model = "Matebook E Go";
 	compatible = "huawei,gaokun3", "qcom,sc8280xp";
 
 	aliases {
+		i2c1 = &cci1_i2c0;
 		i2c2 = &cci2_i2c1;
 		i2c4 = &i2c4;
 		i2c15 = &i2c15;
@@ -52,9 +58,17 @@ framebuffer0: framebuffer@c6200000 {
 	leds {
 		compatible = "gpio-leds";
 
-		pinctrl-0 = <&cam_indicator_en>;
+		pinctrl-0 = <&cam_indicator_en>, <&camera_flash_en>;
 		pinctrl-names = "default";
 
+		camera_flash: led {
+			function = LED_FUNCTION_FLASH;
+			color = <LED_COLOR_ID_WHITE>;
+			gpios = <&tlmm 93 GPIO_ACTIVE_HIGH>;
+			linux,default-trigger = "none";
+			default-state = "off";
+		};
+
 		privacy_led: privacy-led {
 			function = LED_FUNCTION_INDICATOR;
 			color = <LED_COLOR_ID_WHITE>;
@@ -129,6 +143,18 @@ vreg_camf_1p2: regulator-camf-1p2 {
 		pinctrl-names = "default";
 	};
 
+	vreg_camr: regulator-camr {
+		compatible = "regulator-fixed";
+
+		regulator-name = "vreg_camr";
+
+		gpio = <&tlmm 92 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+
+		pinctrl-0 = <&camr_reg_en>;
+		pinctrl-names = "default";
+	};
+
 	vreg_misc_3p3: regulator-misc-3p3 {
 		compatible = "regulator-fixed";
 
@@ -387,8 +413,8 @@ vreg_l1b: ldo1 {
 
 		vreg_l2b: ldo2 {
 			regulator-name = "vreg_l2b";
-			regulator-min-microvolt = <1904000>;
-			regulator-max-microvolt = <1904000>;
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <2800000>;
 			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
 		};
 
@@ -433,10 +459,9 @@ vreg_l6b: ldo6 {
 
 		vreg_l7b: ldo7 {
 			regulator-name = "vreg_l7b";
-			regulator-min-microvolt = <1800000>;
-			regulator-max-microvolt = <1800000>;
+			regulator-min-microvolt = <2800000>;
+			regulator-max-microvolt = <2800000>;
 			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
-			regulator-boot-on;
 		};
 
 		vreg_l9b: ldo9 {
@@ -622,6 +647,16 @@ &camss {
 	status = "okay";
 
 	ports {
+		port@0 {
+			csiphy0_ep: endpoint@0 {
+				reg = <0>;
+
+				clock-lanes = <7>;
+				data-lanes = <0 1 2 3>;
+				remote-endpoint = <&s5k3l6_ep>;
+			};
+		};
+
 		port@3 {
 			csiphy3_ep: endpoint@0 {
 				reg = <0>;
@@ -634,6 +669,58 @@ csiphy3_ep: endpoint@0 {
 	};
 };
 
+&cci1 {
+	status = "okay";
+};
+
+&cci1_i2c0 {
+	voice_coil_motor: vcm@c {
+		compatible = "dongwoon,dw9714";
+		reg = <0xc>;
+		vcc-supply = <&vreg_l7b>; /* FIXME: require l2c on first */
+	};
+
+	/*
+	 * https://source.puri.sm/Librem5/linux/-/blob/pureos/latest/drivers/media/i2c/s5k3l6xx.c
+	 *
+	 * This sensor has never been detected on Goakun3(2.69GHz)
+	 */
+	camera_rear: camera@10 {
+		reg = <0x10>;
+
+		pinctrl-0 = <&camr_rgb_default>;
+		pinctrl-names = "default";
+
+		clocks = <&camcc CAMCC_MCLK4_CLK>;
+		clock-names = "mclk";
+		clock-frequency = <24000000>;
+
+		rstn-gpios = <&tlmm 7 GPIO_ACTIVE_LOW>;
+
+		vddio-supply = <&vreg_camr>;
+		vdda-supply = <&vreg_l2b>;
+		vddd-supply = <&vreg_l2c>;
+
+		/* &camera_flash can't be enabled directly for now */
+		leds = <&privacy_led>;
+		led-names = "privacy";
+
+		lens-focus = <&voice_coil_motor>;
+
+		orientation = <1>;
+		rotation = <180>;
+
+		port {
+			s5k3l6_ep: endpoint {
+				data-lanes = <1 2 3 4>;
+				remote-endpoint = <&csiphy0_ep>;
+			};
+		};
+	};
+
+	/* eeprom@50/51 */
+};
+
 &cci2 {
 	status = "okay";
 };
@@ -1423,6 +1510,13 @@ cam_indicator_en: cam-indicator-en-state {
 		bias-disable;
 	};
 
+	camera_flash_en: camera-flash-en-state {
+		pins = "gpio93";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+	};
+
 	camf_1p2_reg_en: camf-1p2-reg-en-state {
 		pins = "gpio44";
 		function = "gpio";
@@ -1446,6 +1540,29 @@ sc-rgb-xshut-n-pins {
 		};
 	};
 
+	camr_reg_en: camr-reg-en-state {
+		pins = "gpio92";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+	};
+
+	camr_rgb_default: camr-rgb-default-state {
+		mclk-pins {
+			pins = "gpio6";
+			function = "cam_mclk";
+			drive-strength = <6>;
+			bias-disable;
+		};
+
+		sc-rgb-xshut-n-pins {
+			pins = "gpio7";
+			function = "gpio";
+			drive-strength = <2>;
+			bias-disable;
+		};
+	};
+
 	i2c4_default: i2c4-default-state {
 		pins = "gpio171", "gpio172";
 		function = "qup4";
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 3/4] arm64: dts: qcom: sc8280xp: gaokun3: add front camera sensor node
  2026-04-25 10:52 ` [PATCH 3/4] arm64: dts: qcom: sc8280xp: gaokun3: add front camera sensor node Pengyu Luo
@ 2026-04-27 13:00   ` Konrad Dybcio
  0 siblings, 0 replies; 6+ messages in thread
From: Konrad Dybcio @ 2026-04-27 13:00 UTC (permalink / raw)
  To: Pengyu Luo, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Martin Kepplinger-Novakovic,
	Sakari Ailus, Mauro Carvalho Chehab, Hans Verkuil,
	Martin Kepplinger
  Cc: linux-arm-msm, devicetree, linux-kernel, linux-media

On 4/25/26 12:52 PM, Pengyu Luo wrote:
> Hi846 is found on my Gaokun3, descripting it.
> 
> Note that it seems that only Goakun3(3.0GHz) version is equipped with
> Hi846. Goakun3(2.69GHz) version is equipped with S5K4H7.

Are there any other noticeable hw differences between the two variants,
that could warrant the DT to be split?

[...]

> +		orientation = <0>;	/* Front facing */

Please either drop the comment or s/tab/space

Konrad

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-04-27 13:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-25 10:52 [PATCH 0/4] support camera found on Gaokun3 Pengyu Luo
2026-04-25 10:52 ` [PATCH 1/4] media: hi846: fix hi846_write_reg_16 handling Pengyu Luo
2026-04-25 10:52 ` [PATCH 2/4] media: hi846: Add 6MP and 8MP mode support Pengyu Luo
2026-04-25 10:52 ` [PATCH 3/4] arm64: dts: qcom: sc8280xp: gaokun3: add front camera sensor node Pengyu Luo
2026-04-27 13:00   ` Konrad Dybcio
2026-04-25 10:53 ` [PATCH 4/4] arm64: dts: qcom: sc8280xp: gaokun3: describe rear camera module information as musch as possible Pengyu Luo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox