2023-04-11 18:20:26

by Konrad Dybcio

[permalink] [raw]
Subject: [PATCH v2 0/4] SM8150 Kumano updates

v1 -> v2:
- no-emmc -> no-mmc [4/4]
- drop superfluous input-enable [3/4]

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

Add gpio-line-names, set up fixed camera regulators and enable SDHCI2
on Xperia 1 / 5.

Signed-off-by: Konrad Dybcio <[email protected]>
---
Konrad Dybcio (4):
arm64: dts: qcom: sm8150-kumano: Add GPIO line names for PMIC GPIOs
arm64: dts: qcom: sm8150-kumano: Add GPIO line names for TLMM
arm64: dts: qcom: sm8150-kumano: Set up camera fixed regulators
arm64: dts: qcom: sm8150-kumano: Enable SDHCI2

.../boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi | 335 +++++++++++++++++++++
1 file changed, 335 insertions(+)
---
base-commit: 009795d283d1f9f043e5a4ff97d4140cde17e2d3
change-id: 20230315-topic-kumano_dts0-e6c1725cf25b

Best regards,
--
Konrad Dybcio <[email protected]>


2023-04-11 18:20:46

by Konrad Dybcio

[permalink] [raw]
Subject: [PATCH v2 3/4] arm64: dts: qcom: sm8150-kumano: Set up camera fixed regulators

Sony - as per usual - used a whole bunch of GPIO-gated fixed
voltage regulators for camera sensors on Kumano. Describe them
and the corresponding pins.

Signed-off-by: Konrad Dybcio <[email protected]>
---
.../boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi | 110 +++++++++++++++++++++
1 file changed, 110 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi b/arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi
index d1a3ab836019..ad402f3a90c3 100644
--- a/arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi
@@ -6,6 +6,7 @@
/dts-v1/;

#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
#include "sm8150.dtsi"
#include "pm8150.dtsi"
@@ -81,6 +82,66 @@ key-vol-down {
};
};

+ cam0_vdig_vreg: cam0-vdig-regulator {
+ compatible = "regulator-fixed";
+ regulator-name = "camera0_vdig_vreg";
+ gpio = <&tlmm 22 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+
+ pinctrl-0 = <&main_cam_pwr_en>;
+ pinctrl-names = "default";
+ };
+
+ cam1_vdig_vreg: cam1-vdig-regulator {
+ compatible = "regulator-fixed";
+ regulator-name = "camera1_vdig_vreg";
+ gpio = <&tlmm 79 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+
+ pinctrl-0 = <&sub_cam_pwr_en>;
+ pinctrl-names = "default";
+ };
+
+ cam2_vdig_vreg: cam2-vdig-regulator {
+ compatible = "regulator-fixed";
+ regulator-name = "camera2_vdig_vreg";
+ gpio = <&tlmm 25 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+
+ pinctrl-0 = <&chat_cam_pwr_en>;
+ pinctrl-names = "default";
+ };
+
+ cam3_vdig_vreg: cam3-vdig-regulator {
+ compatible = "regulator-fixed";
+ regulator-name = "camera3_vdig_vreg";
+ gpio = <&pm8150_gpios 7 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+
+ pinctrl-0 = <&supwc_pwr_en>;
+ pinctrl-names = "default";
+ };
+
+ cam_vmdr_vreg: cam-vmdr-regulator {
+ compatible = "regulator-fixed";
+ regulator-name = "camera_vmdr_vreg";
+ gpio = <&pm8150l_gpios 3 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+
+ pinctrl-0 = <&main_cam_pwr_vmdr_en>;
+ pinctrl-names = "default";
+ };
+
+ rgbcir_vreg: rgbcir-regulator {
+ compatible = "regulator-fixed";
+ regulator-name = "rgbcir_vreg";
+ gpio = <&tlmm 29 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+
+ pinctrl-0 = <&rgbc_ir_pwr_en>;
+ pinctrl-names = "default";
+ };
+
vph_pwr: vph-pwr-regulator {
compatible = "regulator-fixed";
regulator-name = "vph_pwr";
@@ -474,6 +535,15 @@ vol_down_n: vol-down-n-state {
bias-pull-up;
input-enable;
};
+
+ supwc_pwr_en: supwc-pwr-en-state {
+ pins = "gpio7";
+ function = "normal";
+ qcom,drive-strength = <1>;
+ power-source = <1>;
+ drive-push-pull;
+ output-low;
+ };
};

&pm8150b_gpios {
@@ -520,6 +590,15 @@ &pm8150l_gpios {
"NC", /* GPIO_10 */
"NC",
"NC";
+
+ main_cam_pwr_vmdr_en: main-cam-pwr-vmdr-en-state {
+ pins = "gpio3";
+ function = "normal";
+ qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
+ power-source = <0>;
+ drive-push-pull;
+ output-low;
+ };
};

&pon_pwrkey {
@@ -716,6 +795,37 @@ &tlmm {
"WL_CMD_DATA_CHAIN1",
"WL_BT_COEX_CLK",
"WL_BT_COEX_DATA";
+
+ main_cam_pwr_en: main-cam-pwr-en-state {
+ pins = "gpio22";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ output-low;
+ };
+
+ chat_cam_pwr_en: chat-cam-pwr-en-state {
+ pins = "gpio25";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ output-low;
+ };
+
+ rgbc_ir_pwr_en: rgbc-ir-pwr-en-state {
+ pins = "gpio29";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ output-low;
+ };
+
+ sub_cam_pwr_en: sub-cam-pwr-en-state {
+ pins = "gpio79";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-pull-down;
+ };
};

&uart2 {

--
2.40.0

2023-04-11 18:20:50

by Konrad Dybcio

[permalink] [raw]
Subject: [PATCH v2 4/4] arm64: dts: qcom: sm8150-kumano: Enable SDHCI2

From: Konrad Dybcio <[email protected]>

Set up and enable SDHCI2 to enable the microSD slot on Kumano
devices.

Signed-off-by: Konrad Dybcio <[email protected]>
---
arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi b/arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi
index ad402f3a90c3..baafea53770b 100644
--- a/arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi
@@ -618,6 +618,17 @@ &qupv3_id_1 {
status = "okay";
};

+&sdhc_2 {
+ vmmc-supply = <&vreg_l9c_2p9>;
+ vqmmc-supply = <&vreg_l6c_2p9>;
+ cd-gpios = <&tlmm 96 GPIO_ACTIVE_HIGH>;
+ bus-width = <4>;
+ no-sdio;
+ no-mmc;
+
+ status = "okay";
+};
+
&tlmm {
gpio-reserved-ranges = <126 4>;
gpio-line-names = "NFC_ESE_SPI_MISO", /* GPIO_0 */

--
2.40.0

2023-04-11 18:21:33

by Konrad Dybcio

[permalink] [raw]
Subject: [PATCH v2 2/4] arm64: dts: qcom: sm8150-kumano: Add GPIO line names for TLMM

Sony ever so graciously provides GPIO line names in their downstream
kernel (though sometimes they are not 100% accurate and you can judge
that by simply looking at them and with what drivers they are used).

Add these to the common DTSI to better document the hardware.

The pin assignment for TLMM is identical on both devices. Great job!

Signed-off-by: Konrad Dybcio <[email protected]>
---
.../boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi | 175 +++++++++++++++++++++
1 file changed, 175 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi b/arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi
index 6753c65d75bc..d1a3ab836019 100644
--- a/arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi
@@ -541,6 +541,181 @@ &qupv3_id_1 {

&tlmm {
gpio-reserved-ranges = <126 4>;
+ gpio-line-names = "NFC_ESE_SPI_MISO", /* GPIO_0 */
+ "NFC_ESE_SPI_MOSI",
+ "NFC_ESE_SPI_SCLK",
+ "NFC_ESE_SPI_CS_N",
+ "NC",
+ "NC",
+ "DISP_RESET_N",
+ "DEBUG_GPIO0",
+ "MDP_VSYNC_P",
+ "TS_I2C_SDA",
+ "TS_I2C_SCL", /* GPIO_10 */
+ "CAM_SOF",
+ "CAM2_RST_N",
+ "CAM_MCLK0",
+ "CAM_MCLK1",
+ "CAM_MCLK2",
+ "CAM_MCLK3",
+ "CCI_I2C_SDA0",
+ "CCI_I2C_SCL0",
+ "CCI_I2C_SDA1",
+ "CCI_I2C_SCL1", /* GPIO_20 */
+ "NC",
+ "MAIN_CAM_PWR_EN",
+ "CAM3_RST_N",
+ "NC",
+ "CHAT_CAM_PWR_EN",
+ "NC",
+ "NC",
+ "CAM0_RST_N",
+ "RGBC_IR_PWR_EN",
+ "CAM1_RST_N", /* GPIO_30 */
+ "CCI_I2C_SDA2",
+ "CCI_I2C_SCL2",
+ "CCI_I2C_SDA3",
+ "CCI_I2C_SCL3",
+ "NC",
+ "DEBUG_GPIO1",
+ "RGBC_IR_INT",
+ "USB_CC_DIR",
+ "NC",
+ "NC", /* GPIO_40 */
+ "NFC_EN",
+ "NFC_ESE_PWR_REQ",
+ "BT_HCI_UART_CTS_N",
+ "BT_HCI_UART_RFR_N",
+ "BT_HCI_UART_TXD",
+ "BT_HCI_UART_RXD",
+ "NFC_IRQ",
+ "NFC_DWL_REQ",
+ "UIM2_DETECT_EN",
+ "WLAN_SW_CTRL", /* GPIO_50 */
+ "APPS_I2C_SDA",
+ "APPS_I2C_SCL",
+ "NC",
+ "TS_RESET_N",
+ "NC",
+ "NC",
+ "NC",
+ "NC",
+ "HW_ID_0",
+ "NC", /* GPIO_60 */
+ "QLINK_REQUEST",
+ "QLINK_ENABLE",
+ "WMSS_RESET_N",
+ "SDM_GRFC_8",
+ "WDOG_DISABLE",
+ "NC",
+ "NC",
+ "PA_INDICATOR_OR",
+ "MSS_LTE_COXM_TXD",
+ "MSS_LTE_COXM_RXD", /* GPIO_70 */
+ "SDM_RFFE0_DATA",
+ "SDM_RFFE0_CLK",
+ "SDM_RFFE1_DATA",
+ "SDM_RFFE1_CLK",
+ "SDM_RFFE2_DATA",
+ "SDM_RFFE2_CLK",
+ "SDM_RFFE3_DATA",
+ "SDM_RFFE3_CLK",
+ "SUB_CAM_PWR_EN",
+ "FP_RESET_N", /* GPIO_80 */
+ "NC",
+ "NC",
+ "NC",
+ "NC",
+ "DEBUG_UART_TX",
+ "DEBUG_UART_RX",
+ "DVDT_WRT_DET_AND",
+ "NC",
+ "NC",
+ "NC", /* GPIO_90 */
+ "NC",
+ "NC",
+ "NC",
+ "NC",
+ "UDON_SWITCH_SEL",
+ "SD_CARD_DET_N",
+ "NC",
+ "CAMSENSOR_I2C_SDA",
+ "CAMSENSOR_I2C_SCL",
+ "USB_AUDIO_EN1", /* GPIO_100 */
+ "DISP_ERR_FG",
+ "NC",
+ "NC",
+ "NC",
+ "UIM2_DATA",
+ "UIM2_CLK",
+ "UIM2_RESET",
+ "UIM2_DET",
+ "UIM1_DATA",
+ "UIM1_CLK", /* GPIO_110 */
+ "UIM1_RESET",
+ "UIM1_PRESENT",
+ "NFC_CLK_REQ",
+ "SW_SERVICE",
+ "NC",
+ "RF_ID_EXTENSION",
+ "ALS_PROX_INT_N",
+ "FP_INT",
+ "DVDT_WRT_DET_OR",
+ "BAROMETER_INT", /* GPIO_120 */
+ "ACC_COVER_OPEN",
+ "TS_INT_N",
+ "CODEC_INT1_N",
+ "CODEC_INT2_N",
+ "TX_GTR_THRES_IN",
+ "FP_SPI_MISO",
+ "FP_SPI_MOSI",
+ "FP_SPI_SCLK",
+ "FP_SPI_CS_N",
+ "NC", /* GPIO_130 */
+ "DVDT_ENABLE",
+ "ACCEL_INT",
+ "NC",
+ "MAG_INT_N",
+ "NC",
+ "FORCED_USB_BOOT",
+ "NC",
+ "NC",
+ "HW_ID_1",
+ "NC", /* GPIO_140 */
+ "NC",
+ "NC",
+ "CODEC_RST_N",
+ "CDC_SPI_MISO",
+ "CDC_SPI_MOSI",
+ "CDC_SPI_SCLK",
+ "CDC_SPI_CS_N",
+ "NC",
+ "LPASS_SLIMBUS_CLK",
+ "LPASS_SLIMBUS_DATA0", /* GPIO_150 */
+ "LPASS_SLIMBUS_DATA1",
+ "USB_AUDIO_EN2",
+ "BT_FM_SLIMBUS_DATA",
+ "BT_FM_SLIMBUS_CLK",
+ "COMPASS_I2C_SDA",
+ "COMPASS_I2C_SCL",
+ "SSC_SPI_1_MISO",
+ "SSC_SPI_1_MOSI",
+ "SSC_SPI_1_CLK",
+ "SSC_SPI_1_CS_N", /* GPIO_160 */
+ "SSC_SENSOR_I2C_SDA",
+ "SSC_SENSOR_I2C_SCL",
+ "NC",
+ "NC",
+ "NC",
+ "NC",
+ "SSC_UART_1_TX",
+ "SSC_UART_1_RX",
+ "WL_CMD_CLK_CHAIN0",
+ "WL_CMD_DATA_CHAIN0", /* GPIO_170 */
+ "WL_CMD_CLK_CHAIN1",
+ "WL_CMD_DATA_CHAIN1",
+ "WL_BT_COEX_CLK",
+ "WL_BT_COEX_DATA";
};

&uart2 {

--
2.40.0

2023-04-11 18:22:56

by Konrad Dybcio

[permalink] [raw]
Subject: [PATCH v2 1/4] arm64: dts: qcom: sm8150-kumano: Add GPIO line names for PMIC GPIOs

Sony ever so graciously provides GPIO line names in their downstream
kernel (though sometimes they are not 100% accurate and you can judge
that by simply looking at them and with what drivers they are used).

Add these to the Griffin and Bahamut device trees to better document
the hardware.

They are the same on both devices! Very nice!

Signed-off-by: Konrad Dybcio <[email protected]>
---
.../boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi | 39 ++++++++++++++++++++++
1 file changed, 39 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi b/arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi
index 47e2430991ca..6753c65d75bc 100644
--- a/arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi
@@ -456,6 +456,17 @@ &i2c10 {
};

&pm8150_gpios {
+ gpio-line-names = "VOL_DOWN_N", /* GPIO_1 */
+ "",
+ "NC",
+ "NC",
+ "",
+ "NC",
+ "SUPWC_PWR_EN",
+ "",
+ "NC",
+ "NC"; /* GPIO_10 */
+
vol_down_n: vol-down-n-state {
pins = "gpio1";
function = "normal";
@@ -466,6 +477,19 @@ vol_down_n: vol-down-n-state {
};

&pm8150b_gpios {
+ gpio-line-names = "SNAPSHOT_N", /* GPIO_1 */
+ "FOCUS_N",
+ "NC",
+ "NC",
+ "RF_LCD_ID_EN",
+ "NC",
+ "TS_VDDH_EN",
+ "LCD_ID",
+ "",
+ "NC", /* GPIO_10 */
+ "NC",
+ "RF_ID";
+
snapshot_n: snapshot-n-state {
pins = "gpio1";
function = "normal";
@@ -483,6 +507,21 @@ focus_n: focus-n-state {
};
};

+&pm8150l_gpios {
+ gpio-line-names = "TS_VDDIO_EN", /* GPIO_1 */
+ "NC",
+ "MAIN_CAM_PWR_VMDR_EN",
+ "NC",
+ "",
+ "NC",
+ "NC",
+ "FP_LDO_EN",
+ "NC",
+ "NC", /* GPIO_10 */
+ "NC",
+ "NC";
+};
+
&pon_pwrkey {
status = "okay";
};

--
2.40.0

2023-04-14 07:34:11

by Marijn Suijten

[permalink] [raw]
Subject: Re: [PATCH v2 4/4] arm64: dts: qcom: sm8150-kumano: Enable SDHCI2

On 2023-04-11 20:14:44, Konrad Dybcio wrote:
> From: Konrad Dybcio <[email protected]>
>
> Set up and enable SDHCI2 to enable the microSD slot on Kumano
> devices.
>
> Signed-off-by: Konrad Dybcio <[email protected]>

Thanks for finally sending this and fixing the no-emmc -> no-emmc
property, I've been testing/using this out-of-tree patch for too long:

Reviewed-by: Marijn Suijten <[email protected]>

> ---
> arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi b/arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi
> index ad402f3a90c3..baafea53770b 100644
> --- a/arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi
> @@ -618,6 +618,17 @@ &qupv3_id_1 {
> status = "okay";
> };
>
> +&sdhc_2 {
> + vmmc-supply = <&vreg_l9c_2p9>;
> + vqmmc-supply = <&vreg_l6c_2p9>;
> + cd-gpios = <&tlmm 96 GPIO_ACTIVE_HIGH>;
> + bus-width = <4>;
> + no-sdio;
> + no-mmc;
> +
> + status = "okay";
> +};
> +
> &tlmm {
> gpio-reserved-ranges = <126 4>;
> gpio-line-names = "NFC_ESE_SPI_MISO", /* GPIO_0 */
>
> --
> 2.40.0
>

2023-05-25 05:43:08

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH v2 0/4] SM8150 Kumano updates

On Tue, 11 Apr 2023 20:14:40 +0200, Konrad Dybcio wrote:
> v1 -> v2:
> - no-emmc -> no-mmc [4/4]
> - drop superfluous input-enable [3/4]
>
> v1: https://lore.kernel.org/r/[email protected]
>
> Add gpio-line-names, set up fixed camera regulators and enable SDHCI2
> on Xperia 1 / 5.
>
> [...]

Applied, thanks!

[1/4] arm64: dts: qcom: sm8150-kumano: Add GPIO line names for PMIC GPIOs
commit: 20fd55b2b0acd496cc6d3cb98832fe2438939ac4
[2/4] arm64: dts: qcom: sm8150-kumano: Add GPIO line names for TLMM
commit: b949d8032fa287633faf895dc3669a7fd6720071
[3/4] arm64: dts: qcom: sm8150-kumano: Set up camera fixed regulators
commit: 7a740ec3045bfa3b476ea94dd2d70bc3ac5d0a0f
[4/4] arm64: dts: qcom: sm8150-kumano: Enable SDHCI2
commit: 644ab8bb42b596f16d01fb140088afb616f67cd8

Best regards,
--
Bjorn Andersson <[email protected]>