arm64: dts: qcom: sc8280xp: fix and improve pinctrl
v2 cover arm64: dts: qcom: sc8280xp: fix and improve pinctrl
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.
---
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/[email protected]
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(-)
Signature · 1 line
2.54.0
PATCH v2 1/3 arm64: dts: qcom: sc8280xp-x13s: Fix the drive-strength of mclk pin
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.
--- arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts +1 -1
@@ -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; };
Signature · 1 line
2.54.0
Re: [PATCH v2 1/3] arm64: dts: qcom: sc8280xp-x13s: Fix the drive-strength of mclk pin
Quoted 14 lines · Pengyu Luo
The value can be retrieve via windbg on Windows.
lkd> !dd f111000 L8
ctl_reg=>0x284in
drivers/pinctrl/qcom/pinctrl-msm.c
functionmsm_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;
...
Quoted 5 lines
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 <[email protected]>---
Thank you!
Konrad
PATCH v2 2/3 arm64: dts: qcom: sc8280xp: Add camera MCLK pinctrl
In reply to Pengyu LuoDefine pinctrl definitions to enable camera master clocks on sc8280xp.
--- arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 56 ++++++++++++++++++++++++++ 1 file changed, 56 insertions(+)
arch/arm64/boot/dts/qcom/sc8280xp.dtsi +56 -0
@@ -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 */
Signature · 1 line
2.54.0
PATCH v2 3/3 arm64: dts: qcom: sc8280xp-x13s: Use predefined MCLK pinctrl
In reply to Pengyu LuoNow 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.
--- .../boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)
arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts +2 -8
@@ -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";
Signature · 1 line
2.54.0
Re: [PATCH v2 3/3] arm64: dts: qcom: sc8280xp-x13s: Use predefined MCLK pinctrl
Quoted 6 lines · 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 <[email protected]>---
Konrad
Quoted 5 lines · Pengyu Luo
Add camera mclk pinctrl definitions to
sc8280xp.dtsiand drop local and duplicated definitions, as this is common for sc8280xp based devices. Since the correct drive-strength is 6, fix it too.
Applied, thanks!
[1/3] arm64: dts: qcom: sc8280xp-x13s: Fix the drive-strength of mclk pin
commit: 06f07e693cc33d5d9695652f679c6321a751020e
[2/3] arm64: dts: qcom: sc8280xp: Add camera MCLK pinctrl
commit: 6e2f2454640b21db48d1f1bc8a068a8862d6cf1f
[3/3] arm64: dts: qcom: sc8280xp-x13s: Use predefined MCLK pinctrl
commit: fbe4faae9869fcb03884c078187f985db693298cBest regards,
Signature · 1 line
Bjorn Andersson <[email protected]>