All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] arm64: dts: qcom: sc8280xp: fix and improve pinctrl
@ 2026-06-29  6:59 Pengyu Luo
  2026-06-29  6:59 ` [PATCH v2 1/3] arm64: dts: qcom: sc8280xp-x13s: Fix the drive-strength of mclk pin Pengyu Luo
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Pengyu Luo @ 2026-06-29  6:59 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Bryan O'Donoghue, Vladimir Zapolskiy
  Cc: linux-arm-msm, devicetree, linux-kernel, Pengyu Luo

Add camera mclk pinctrl definitions to sc8280xp.dtsi and drop local
and duplicated definitions, as this is common for sc8280xp based
devices. Since the correct drive-strength is 6, fix it too.

Signed-off-by: Pengyu Luo <mitltlatltl@gmail.com>
---
Changes in v2:
- Collect tag
- Add Fixes tag (Konrad)
- Rearrange the patches to ensure the fix is properly backported (Vladimir)
- Link to v1: https://lore.kernel.org/linux-arm-msm/20260607160435.36546-1-mitltlatltl@gmail.com

Pengyu Luo (3):
  arm64: dts: qcom: sc8280xp-x13s: Fix the drive-strength of mclk pin
  arm64: dts: qcom: sc8280xp: Add camera MCLK pinctrl
  arm64: dts: qcom: sc8280xp-x13s: Use predefined MCLK pinctrl

 .../qcom/sc8280xp-lenovo-thinkpad-x13s.dts    | 10 +---
 arch/arm64/boot/dts/qcom/sc8280xp.dtsi        | 56 +++++++++++++++++++
 2 files changed, 58 insertions(+), 8 deletions(-)

-- 
2.54.0


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

* [PATCH v2 1/3] arm64: dts: qcom: sc8280xp-x13s: Fix the drive-strength of mclk pin
  2026-06-29  6:59 [PATCH v2 0/3] arm64: dts: qcom: sc8280xp: fix and improve pinctrl Pengyu Luo
@ 2026-06-29  6:59 ` Pengyu Luo
  2026-06-29  9:02   ` Konrad Dybcio
  2026-06-29  6:59 ` [PATCH v2 2/3] arm64: dts: qcom: sc8280xp: Add camera MCLK pinctrl Pengyu Luo
  2026-06-29  6:59 ` [PATCH v2 3/3] arm64: dts: qcom: sc8280xp-x13s: Use predefined " Pengyu Luo
  2 siblings, 1 reply; 6+ messages in thread
From: Pengyu Luo @ 2026-06-29  6:59 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Bryan O'Donoghue, Vladimir Zapolskiy
  Cc: linux-arm-msm, devicetree, linux-kernel, Pengyu Luo

The value can be retrieve via windbg on Windows.

lkd> !dd f111000 L8

ctl_reg => 0x284

in drivers/pinctrl/qcom/pinctrl-msm.c
function msm_gpio_dbg_show_one()
...
drive = (ctl_reg >> g->drv_bit) & 7; // (0x284 >> 6) & 7 == 2
...
seq_printf(s, " %dmA", msm_regval_to_drive(drive)); // (drive + 1) * 2 == 6;
...

So the value is 6, not 16, it matches Windows now.

Fixes: 21927e94caa5 ("arm64: dts: qcom: sc8280xp-x13s: Enable RGB sensor")
Signed-off-by: Pengyu Luo <mitltlatltl@gmail.com>
---
 arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
index abd9c5a67b9f..3ddd44e16e67 100644
--- a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
+++ b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
@@ -1555,7 +1555,7 @@ cam_rgb_default: cam-rgb-default-state {
 		mclk-pins {
 			pins = "gpio17";
 			function = "cam_mclk";
-			drive-strength = <16>;
+			drive-strength = <6>;
 			bias-disable;
 		};
 
-- 
2.54.0


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

* [PATCH v2 2/3] arm64: dts: qcom: sc8280xp: Add camera MCLK pinctrl
  2026-06-29  6:59 [PATCH v2 0/3] arm64: dts: qcom: sc8280xp: fix and improve pinctrl Pengyu Luo
  2026-06-29  6:59 ` [PATCH v2 1/3] arm64: dts: qcom: sc8280xp-x13s: Fix the drive-strength of mclk pin Pengyu Luo
@ 2026-06-29  6:59 ` Pengyu Luo
  2026-06-29  6:59 ` [PATCH v2 3/3] arm64: dts: qcom: sc8280xp-x13s: Use predefined " Pengyu Luo
  2 siblings, 0 replies; 6+ messages in thread
From: Pengyu Luo @ 2026-06-29  6:59 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Bryan O'Donoghue, Vladimir Zapolskiy
  Cc: linux-arm-msm, devicetree, linux-kernel, Pengyu Luo,
	Konrad Dybcio

Define pinctrl definitions to enable camera master clocks on sc8280xp.

Suggested-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Pengyu Luo <mitltlatltl@gmail.com>
---
 arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 56 ++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sc8280xp.dtsi b/arch/arm64/boot/dts/qcom/sc8280xp.dtsi
index a2bd6b10e475..0dbcd3069a3b 100644
--- a/arch/arm64/boot/dts/qcom/sc8280xp.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc8280xp.dtsi
@@ -5484,6 +5484,62 @@ tlmm: pinctrl@f100000 {
 			gpio-ranges = <&tlmm 0 0 230>;
 			wakeup-parent = <&pdc>;
 
+			cam_mclk0_default: cam-mclk0-default-state {
+				pins = "gpio119";
+				function = "cam_mclk";
+				drive-strength = <6>;
+				bias-disable;
+			};
+
+			cam_mclk1_default: cam-mclk1-default-state {
+				pins = "gpio120";
+				function = "cam_mclk";
+				drive-strength = <6>;
+				bias-disable;
+			};
+
+			cam_mclk2_default: cam-mclk2-default-state {
+				pins = "gpio16";
+				function = "cam_mclk";
+				drive-strength = <6>;
+				bias-disable;
+			};
+
+			cam_mclk3_default: cam-mclk3-default-state {
+				pins = "gpio17";
+				function = "cam_mclk";
+				drive-strength = <6>;
+				bias-disable;
+			};
+
+			cam_mclk4_default: cam-mclk4-default-state {
+				pins = "gpio6";
+				function = "cam_mclk";
+				drive-strength = <6>;
+				bias-disable;
+			};
+
+			cam_mclk5_default: cam-mclk5-default-state {
+				pins = "gpio7";
+				function = "cam_mclk";
+				drive-strength = <6>;
+				bias-disable;
+			};
+
+			cam_mclk6_default: cam-mclk6-default-state {
+				pins = "gpio33";
+				function = "cam_mclk";
+				drive-strength = <6>;
+				bias-disable;
+			};
+
+			cam_mclk7_default: cam-mclk7-default-state {
+				pins = "gpio34";
+				function = "cam_mclk";
+				drive-strength = <6>;
+				bias-disable;
+			};
+
 			cci0_default: cci0-default-state {
 				cci0_i2c0_default: cci0-i2c0-default-pins {
 					/* cci_i2c_sda0, cci_i2c_scl0 */
-- 
2.54.0


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

* [PATCH v2 3/3] arm64: dts: qcom: sc8280xp-x13s: Use predefined MCLK pinctrl
  2026-06-29  6:59 [PATCH v2 0/3] arm64: dts: qcom: sc8280xp: fix and improve pinctrl Pengyu Luo
  2026-06-29  6:59 ` [PATCH v2 1/3] arm64: dts: qcom: sc8280xp-x13s: Fix the drive-strength of mclk pin Pengyu Luo
  2026-06-29  6:59 ` [PATCH v2 2/3] arm64: dts: qcom: sc8280xp: Add camera MCLK pinctrl Pengyu Luo
@ 2026-06-29  6:59 ` Pengyu Luo
  2026-06-29  9:02   ` Konrad Dybcio
  2 siblings, 1 reply; 6+ messages in thread
From: Pengyu Luo @ 2026-06-29  6:59 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Bryan O'Donoghue, Vladimir Zapolskiy
  Cc: linux-arm-msm, devicetree, linux-kernel, Pengyu Luo

Now that the predefined MCLK pinctrl configuration is available in the
sc8280xp SoC DTSI, switch the ThinkPad X13s to use it. Drop the local,
duplicate MCLK pin definition from the camera pinctrl node.

Signed-off-by: Pengyu Luo <mitltlatltl@gmail.com>
---
 .../boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts    | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
index 3ddd44e16e67..5d652be69e44 100644
--- a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
+++ b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
@@ -674,8 +674,9 @@ camera@10 {
 		reg = <0x10>;
 
 		reset-gpios = <&tlmm 15 GPIO_ACTIVE_LOW>;
+
+		pinctrl-0 = <&cam_rgb_default>, <&cam_mclk3_default>;
 		pinctrl-names = "default";
-		pinctrl-0 = <&cam_rgb_default>;
 
 		leds = <&privacy_led>;
 		led-names = "privacy";
@@ -1552,13 +1553,6 @@ cam_indicator_en: cam-indicator-en-state {
 	};
 
 	cam_rgb_default: cam-rgb-default-state {
-		mclk-pins {
-			pins = "gpio17";
-			function = "cam_mclk";
-			drive-strength = <6>;
-			bias-disable;
-		};
-
 		sc-rgb-xshut-n-pins {
 			pins = "gpio15";
 			function = "gpio";
-- 
2.54.0


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

* Re: [PATCH v2 1/3] arm64: dts: qcom: sc8280xp-x13s: Fix the drive-strength of mclk pin
  2026-06-29  6:59 ` [PATCH v2 1/3] arm64: dts: qcom: sc8280xp-x13s: Fix the drive-strength of mclk pin Pengyu Luo
@ 2026-06-29  9:02   ` Konrad Dybcio
  0 siblings, 0 replies; 6+ messages in thread
From: Konrad Dybcio @ 2026-06-29  9:02 UTC (permalink / raw)
  To: Pengyu Luo, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Bryan O'Donoghue,
	Vladimir Zapolskiy
  Cc: linux-arm-msm, devicetree, linux-kernel

On 6/29/26 8:59 AM, Pengyu Luo wrote:
> The value can be retrieve via windbg on Windows.
> 
> lkd> !dd f111000 L8
> 
> ctl_reg => 0x284
> 
> in drivers/pinctrl/qcom/pinctrl-msm.c
> function msm_gpio_dbg_show_one()
> ...
> drive = (ctl_reg >> g->drv_bit) & 7; // (0x284 >> 6) & 7 == 2
> ...
> seq_printf(s, " %dmA", msm_regval_to_drive(drive)); // (drive + 1) * 2 == 6;
> ...
> 
> So the value is 6, not 16, it matches Windows now.
> 
> Fixes: 21927e94caa5 ("arm64: dts: qcom: sc8280xp-x13s: Enable RGB sensor")
> Signed-off-by: Pengyu Luo <mitltlatltl@gmail.com>
> ---

Thank you!

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

Konrad


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

* Re: [PATCH v2 3/3] arm64: dts: qcom: sc8280xp-x13s: Use predefined MCLK pinctrl
  2026-06-29  6:59 ` [PATCH v2 3/3] arm64: dts: qcom: sc8280xp-x13s: Use predefined " Pengyu Luo
@ 2026-06-29  9:02   ` Konrad Dybcio
  0 siblings, 0 replies; 6+ messages in thread
From: Konrad Dybcio @ 2026-06-29  9:02 UTC (permalink / raw)
  To: Pengyu Luo, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Bryan O'Donoghue,
	Vladimir Zapolskiy
  Cc: linux-arm-msm, devicetree, linux-kernel

On 6/29/26 8:59 AM, Pengyu Luo wrote:
> Now that the predefined MCLK pinctrl configuration is available in the
> sc8280xp SoC DTSI, switch the ThinkPad X13s to use it. Drop the local,
> duplicate MCLK pin definition from the camera pinctrl node.
> 
> Signed-off-by: Pengyu Luo <mitltlatltl@gmail.com>
> ---

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

Konrad

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

end of thread, other threads:[~2026-06-29  9:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-29  6:59 [PATCH v2 0/3] arm64: dts: qcom: sc8280xp: fix and improve pinctrl Pengyu Luo
2026-06-29  6:59 ` [PATCH v2 1/3] arm64: dts: qcom: sc8280xp-x13s: Fix the drive-strength of mclk pin Pengyu Luo
2026-06-29  9:02   ` Konrad Dybcio
2026-06-29  6:59 ` [PATCH v2 2/3] arm64: dts: qcom: sc8280xp: Add camera MCLK pinctrl Pengyu Luo
2026-06-29  6:59 ` [PATCH v2 3/3] arm64: dts: qcom: sc8280xp-x13s: Use predefined " Pengyu Luo
2026-06-29  9:02   ` Konrad Dybcio

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.