Subject: [PATCH 1/7] arm64: dts: qcom: Introduce support for MSM8998 Sony Yoshino platform

This commit introduces support for the Sony Yoshino platform, using
the MSM8998 SoC, including:
- Sony Xperia XZ1 (codename Poplar),
- Sony Xperia XZ1 Compact (codename Lilac),
- Sony Xperia XZ Premium (codename Maple).

All of the three aforementioned smartphones are sharing a 99%
equal board configuration, with very small differences between
each other, which is the reason for the introduction of a common
msm8998-sony-xperia-yoshino DT.

This base configuration includes regulators and project-wide pin
configurations and it's made to boot to a serial console.

Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
Reviewed-by: Marijn Suijten <[email protected]>
---
arch/arm64/boot/dts/qcom/Makefile | 3 +
.../msm8998-sony-xperia-yoshino-lilac.dts | 19 +
.../msm8998-sony-xperia-yoshino-maple.dts | 43 ++
.../msm8998-sony-xperia-yoshino-poplar.dts | 24 +
.../dts/qcom/msm8998-sony-xperia-yoshino.dtsi | 481 ++++++++++++++++++
5 files changed, 570 insertions(+)
create mode 100644 arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-lilac.dts
create mode 100644 arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-maple.dts
create mode 100644 arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-poplar.dts
create mode 100644 arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi

diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile
index 70516508be56..8a0b558c3065 100644
--- a/arch/arm64/boot/dts/qcom/Makefile
+++ b/arch/arm64/boot/dts/qcom/Makefile
@@ -39,6 +39,9 @@ dtb-$(CONFIG_ARCH_QCOM) += msm8998-lenovo-miix-630.dtb
dtb-$(CONFIG_ARCH_QCOM) += msm8998-mtp.dtb
dtb-$(CONFIG_ARCH_QCOM) += msm8998-oneplus-cheeseburger.dtb
dtb-$(CONFIG_ARCH_QCOM) += msm8998-oneplus-dumpling.dtb
+dtb-$(CONFIG_ARCH_QCOM) += msm8998-sony-xperia-yoshino-lilac.dtb
+dtb-$(CONFIG_ARCH_QCOM) += msm8998-sony-xperia-yoshino-maple.dtb
+dtb-$(CONFIG_ARCH_QCOM) += msm8998-sony-xperia-yoshino-poplar.dtb
dtb-$(CONFIG_ARCH_QCOM) += qcs404-evb-1000.dtb
dtb-$(CONFIG_ARCH_QCOM) += qcs404-evb-4000.dtb
dtb-$(CONFIG_ARCH_QCOM) += qrb5165-rb5.dtb
diff --git a/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-lilac.dts b/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-lilac.dts
new file mode 100644
index 000000000000..550de79e0151
--- /dev/null
+++ b/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-lilac.dts
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) 2021, AngeloGioacchino Del Regno
+ * <[email protected]>
+ */
+
+/dts-v1/;
+
+#include "msm8998-sony-xperia-yoshino.dtsi"
+
+/ {
+ model = "Sony Xperia XZ1 Compact";
+ compatible = "sony,xperia-lilac", "qcom,msm8998";
+};
+
+&vreg_l22a_2p85 {
+ regulator-min-microvolt = <2800000>;
+ regulator-max-microvolt = <2800000>;
+};
diff --git a/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-maple.dts b/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-maple.dts
new file mode 100644
index 000000000000..35a6cdb55aec
--- /dev/null
+++ b/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-maple.dts
@@ -0,0 +1,43 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) 2021, AngeloGioacchino Del Regno
+ * <[email protected]>
+ */
+
+/dts-v1/;
+
+#include "msm8998-sony-xperia-yoshino.dtsi"
+
+/ {
+ model = "Sony Xperia XZ Premium";
+ compatible = "sony,xperia-maple", "qcom,msm8998";
+
+ disp_dvdd_vreg: disp-dvdd-vreg {
+ compatible = "regulator-fixed";
+ regulator-name = "disp_dvdd_en";
+ regulator-min-microvolt = <1350000>;
+ regulator-max-microvolt = <1350000>;
+ startup-delay-us = <0>;
+ enable-active-high;
+ gpio = <&pmi8998_gpio 10 GPIO_ACTIVE_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&disp_dvdd_en>;
+ };
+};
+
+&pmi8998_gpio {
+ disp_dvdd_en: disp-dvdd-en-active {
+ pins = "gpio10";
+ function = "normal";
+ bias-disable;
+ drive-push-pull;
+ output-high;
+ power-source = <0>;
+ qcom,drive-strength = <1>;
+ };
+};
+
+&vreg_l22a_2p85 {
+ regulator-min-microvolt = <2704000>;
+ regulator-max-microvolt = <2704000>;
+};
diff --git a/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-poplar.dts b/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-poplar.dts
new file mode 100644
index 000000000000..6255004b9a09
--- /dev/null
+++ b/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-poplar.dts
@@ -0,0 +1,24 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) 2021, AngeloGioacchino Del Regno
+ * <[email protected]>
+ */
+
+/dts-v1/;
+
+#include "msm8998-sony-xperia-yoshino.dtsi"
+
+/ {
+ model = "Sony Xperia XZ1";
+ compatible = "sony,xperia-poplar", "qcom,msm8998";
+};
+
+&vreg_l18a_2p85 {
+ regulator-min-microvolt = <2850000>;
+ regulator-max-microvolt = <2850000>;
+};
+
+&vreg_l22a_2p85 {
+ regulator-min-microvolt = <2700000>;
+ regulator-max-microvolt = <2700000>;
+};
diff --git a/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi b/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi
new file mode 100644
index 000000000000..b07cbc759807
--- /dev/null
+++ b/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi
@@ -0,0 +1,481 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) 2021, AngeloGioacchino Del Regno
+ * <[email protected]>
+ * Copyright (c) 2021, Konrad Dybcio <[email protected]>
+ */
+
+#include "msm8998.dtsi"
+#include "pm8005.dtsi"
+#include "pm8998.dtsi"
+#include "pmi8998.dtsi"
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
+#include <dt-bindings/sound/qcom,q6afe.h>
+#include <dt-bindings/sound/qcom,q6asm.h>
+
+/ {
+ /* required for bootloader to select correct board */
+ qcom,msm-id = <0x124 0x20000>, <0x124 0x20001>; /* 8998v2, v2.1 */
+ qcom,board-id = <8 0>;
+
+ board_vbat: vbat-regulator {
+ compatible = "regulator-fixed";
+ regulator-name = "VBAT";
+
+ regulator-min-microvolt = <4000000>;
+ regulator-max-microvolt = <4000000>;
+ regulator-always-on;
+ regulator-boot-on;
+ };
+
+ vph_pwr: vph-pwr-regulator {
+ compatible = "regulator-fixed";
+ regulator-name = "vph_pwr";
+ regulator-always-on;
+ regulator-boot-on;
+ };
+
+ gpio_keys {
+ compatible = "gpio-keys";
+ input-name = "gpio-keys";
+ label = "Side buttons";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&vol_down_pin_a>, <&cam_focus_pin_a>,
+ <&cam_snapshot_pin_a>;
+ vol-down {
+ label = "Volume Down";
+ gpios = <&pm8998_gpio 5 GPIO_ACTIVE_LOW>;
+ linux,input-type = <1>;
+ linux,code = <KEY_VOLUMEDOWN>;
+ gpio-key,wakeup;
+ debounce-interval = <15>;
+ };
+
+ camera-snapshot {
+ label = "Camera Snapshot";
+ gpios = <&pm8998_gpio 7 GPIO_ACTIVE_LOW>;
+ linux,input-type = <1>;
+ linux,code = <KEY_CAMERA>;
+ debounce-interval = <15>;
+ };
+
+ camera-focus {
+ label = "Camera Focus";
+ gpios = <&pm8998_gpio 8 GPIO_ACTIVE_LOW>;
+ linux,input-type = <1>;
+ linux,code = <KEY_CAMERA_FOCUS>;
+ debounce-interval = <15>;
+ };
+ };
+
+ gpio_hall_sensor {
+ compatible = "gpio-keys";
+ input-name = "hall-sensors";
+ label = "Hall sensors";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&hall_sensor0_default>;
+
+ hall_sensor0 {
+ label = "Cover Hall Sensor";
+ gpios = <&tlmm 124 GPIO_ACTIVE_LOW>;
+ linux,input-type = <EV_SW>;
+ linux,code = <SW_LID>;
+ gpio-key,wakeup;
+ debounce-interval = <30>;
+ };
+ };
+
+ reserved-memory {
+ #address-cells = <2>;
+ #size-cells = <2>;
+ ranges;
+
+ hyp_mem: memory@85800000 {
+ reg = <0x0 0x85800000 0x0 0x3700000>;
+ no-map;
+ };
+
+ cont_splash_mem: cont-splash-region@9d400000 {
+ reg = <0x0 0x9d400000 0x0 0x2400000>;
+ no-map;
+ };
+
+ zap_shader_region: gpu@f6400000 {
+ compatible = "shared-dma-pool";
+ reg = <0x0 0xf6400000 0x0 0x2000>;
+ no-map;
+ };
+
+ adsp_region: memory@fe000000 {
+ reg = <0x0 0xfe000000 0x0 0x800000>;
+ no-map;
+ };
+
+ qseecom_region: memory@fe800000 {
+ reg = <0x0 0xfe800000 0x0 0x1400000>;
+ no-map;
+ };
+
+ ramoops@ffc00000 {
+ compatible = "ramoops";
+ reg = <0x0 0xffc00000 0x0 0x100000>;
+ record-size = <0x10000>;
+ console-size = <0x60000>;
+ ftrace-size = <0x10000>;
+ pmsg-size = <0x20000>;
+ ecc-size = <16>;
+ };
+ };
+};
+
+&blsp2_uart1 {
+ status = "okay";
+};
+
+&mmcc {
+ status = "ok";
+};
+
+&mmss_smmu {
+ status = "ok";
+};
+
+&pm8005_lsid1 {
+ pm8005-regulators {
+ compatible = "qcom,pm8005-regulators";
+
+ vdd_s1-supply = <&vph_pwr>;
+
+ /* VDD_GFX supply */
+ pm8005_s1: s1 {
+ regulator-min-microvolt = <524000>;
+ regulator-max-microvolt = <1088000>;
+ regulator-enable-ramp-delay = <500>;
+
+ regulator-always-on;
+ };
+ };
+};
+
+&pm8998_gpio {
+ vol_down_pin_a: vol-down-active {
+ pins = "gpio5";
+ function = PMIC_GPIO_FUNC_NORMAL;
+ bias-pull-up;
+ input-enable;
+ qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
+ };
+
+ cam_focus_pin_a: cam-focus-btn-active {
+ pins = "gpio7";
+ function = PMIC_GPIO_FUNC_NORMAL;
+ bias-pull-up;
+ input-enable;
+ qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
+ };
+
+ cam_snapshot_pin_a: cam-snapshot-btn-active {
+ pins = "gpio8";
+ function = PMIC_GPIO_FUNC_NORMAL;
+ bias-pull-up;
+ input-enable;
+ qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
+ };
+};
+
+&pm8998_pon {
+ resin {
+ compatible = "pm8941-resin";
+ interrupts = <GIC_SPI 0x8 1 IRQ_TYPE_EDGE_BOTH>;
+ debounce = <15625>;
+ bias-pull-up;
+ linux,code = <KEY_VOLUMEUP>;
+ };
+};
+
+&qusb2phy {
+ status = "okay";
+
+ vdda-pll-supply = <&vreg_l12a_1p8>;
+ vdda-phy-dpdm-supply = <&vreg_l24a_3p075>;
+};
+
+&rpm_requests {
+ pm8998-regulators {
+ compatible = "qcom,rpm-pm8998-regulators";
+
+ vdd_s1-supply = <&vph_pwr>;
+ vdd_s2-supply = <&vph_pwr>;
+ vdd_s3-supply = <&vph_pwr>;
+ vdd_s4-supply = <&vph_pwr>;
+ vdd_s5-supply = <&vph_pwr>;
+ vdd_s6-supply = <&vph_pwr>;
+ vdd_s7-supply = <&vph_pwr>;
+ vdd_s8-supply = <&vph_pwr>;
+ vdd_s9-supply = <&vph_pwr>;
+ vdd_s10-supply = <&vph_pwr>;
+ vdd_s11-supply = <&vph_pwr>;
+ vdd_s12-supply = <&vph_pwr>;
+ vdd_s13-supply = <&vph_pwr>;
+ vdd_l1_l27-supply = <&vreg_s7a_1p025>;
+ vdd_l2_l8_l17-supply = <&vreg_s3a_1p35>;
+ vdd_l3_l11-supply = <&vreg_s7a_1p025>;
+ vdd_l4_l5-supply = <&vreg_s7a_1p025>;
+ vdd_l6-supply = <&vreg_s5a_2p04>;
+ vdd_l7_l12_l14_l15-supply = <&vreg_s5a_2p04>;
+ vdd_l9-supply = <&vreg_bob>;
+ vdd_l10_l23_l25-supply = <&vreg_bob>;
+ vdd_l13_l19_l21-supply = <&vreg_bob>;
+ vdd_l16_l28-supply = <&vreg_bob>;
+ vdd_l18_l22-supply = <&vreg_bob>;
+ vdd_l20_l24-supply = <&vreg_bob>;
+ vdd_l26-supply = <&vreg_s3a_1p35>;
+ vdd_lvs1_lvs2-supply = <&vreg_s4a_1p8>;
+
+ vreg_s3a_1p35: s3 {
+ regulator-min-microvolt = <1352000>;
+ regulator-max-microvolt = <1352000>;
+ };
+ vreg_s4a_1p8: s4 {
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-allow-set-load;
+ regulator-system-load = <100000>;
+ };
+ vreg_s5a_2p04: s5 {
+ regulator-min-microvolt = <1904000>;
+ regulator-max-microvolt = <2032000>;
+ };
+ vreg_s7a_1p025: s7 {
+ regulator-min-microvolt = <900000>;
+ regulator-max-microvolt = <1028000>;
+ };
+ vreg_l1a_0p875: l1 {
+ regulator-min-microvolt = <880000>;
+ regulator-max-microvolt = <880000>;
+ regulator-system-load = <73400>;
+ regulator-allow-set-load;
+ };
+ vreg_l2a_1p2: l2 {
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <1200000>;
+ regulator-system-load = <12560>;
+ regulator-allow-set-load;
+ };
+ vreg_l3a_1p0: l3 {
+ regulator-min-microvolt = <1000000>;
+ regulator-max-microvolt = <1000000>;
+ };
+ vreg_l5a_0p8: l5 {
+ regulator-min-microvolt = <800000>;
+ regulator-max-microvolt = <800000>;
+ };
+ vreg_l6a_1p8: l6 {
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ };
+ vreg_l7a_1p8: l7 {
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ };
+ vreg_l8a_1p2: l8 {
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <1200000>;
+ };
+ vreg_l9a_1p8: l9 {
+ regulator-min-microvolt = <1808000>;
+ regulator-max-microvolt = <2960000>;
+ };
+ vreg_l10a_1p8: l10 {
+ regulator-min-microvolt = <1808000>;
+ regulator-max-microvolt = <2960000>;
+ };
+ vreg_l11a_1p0: l11 {
+ regulator-min-microvolt = <1000000>;
+ regulator-max-microvolt = <1000000>;
+ };
+ vreg_l12a_1p8: l12 {
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ };
+ vreg_l13a_2p95: l13 {
+ regulator-min-microvolt = <1808000>;
+ regulator-max-microvolt = <2960000>;
+ regulator-allow-set-load;
+ };
+ vreg_l14a_1p85: l14 {
+ regulator-min-microvolt = <1848000>;
+ regulator-max-microvolt = <1856000>;
+ regulator-system-load = <32000>;
+ regulator-allow-set-load;
+ };
+ vreg_l15a_1p8: l15 {
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ };
+ vreg_l16a_2p7: l16 {
+ regulator-min-microvolt = <2704000>;
+ regulator-max-microvolt = <2704000>;
+ };
+ vreg_l17a_1p3: l17 {
+ regulator-min-microvolt = <1304000>;
+ regulator-max-microvolt = <1304000>;
+ };
+ vreg_l18a_2p85: l18 {};
+ vreg_l19a_2p7: l19 {
+ regulator-min-microvolt = <2696000>;
+ regulator-max-microvolt = <2704000>;
+ };
+ vreg_l20a_2p95: l20 {
+ regulator-min-microvolt = <2960000>;
+ regulator-max-microvolt = <2960000>;
+ regulator-allow-set-load;
+ regulator-system-load = <10000>;
+ };
+ vreg_l21a_2p95: l21 {
+ regulator-min-microvolt = <2960000>;
+ regulator-max-microvolt = <2960000>;
+ regulator-allow-set-load;
+ regulator-system-load = <800000>;
+ };
+ vreg_l22a_2p85: l22 { };
+ vreg_l23a_3p3: l23 {
+ regulator-min-microvolt = <3312000>;
+ regulator-max-microvolt = <3312000>;
+ };
+ vreg_l24a_3p075: l24 {
+ regulator-min-microvolt = <3088000>;
+ regulator-max-microvolt = <3088000>;
+ };
+ vreg_l25a_3p3: l25 {
+ regulator-min-microvolt = <3104000>;
+ regulator-max-microvolt = <3312000>;
+ };
+ vreg_l26a_1p2: l26 {
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <1200000>;
+ regulator-allow-set-load;
+ };
+ vreg_l28_3p0: l28 {
+ regulator-min-microvolt = <3000000>;
+ regulator-max-microvolt = <3000000>;
+ };
+ vreg_lvs1a_1p8: lvs1 { };
+ vreg_lvs2a_1p8: lvs2 { };
+
+ };
+
+ pmi8998-regulators {
+ compatible = "qcom,rpm-pmi8998-regulators";
+
+ vdd_bob-supply = <&vph_pwr>;
+
+ vreg_bob: bob {
+ regulator-min-microvolt = <3312000>;
+ regulator-max-microvolt = <3600000>;
+ };
+ };
+};
+
+&sdhc2 {
+ status = "okay";
+ cd-gpios = <&tlmm 95 GPIO_ACTIVE_HIGH>;
+
+ vmmc-supply = <&vreg_l21a_2p95>;
+ vqmmc-supply = <&vreg_l13a_2p95>;
+
+ pinctrl-names = "default", "sleep";
+ pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdc2_cd_on>;
+ pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_off>;
+};
+
+&tlmm {
+ gpio-reserved-ranges = <0 4>, <81 4>;
+
+ mdp_vsync_n: mdp-vsync-n {
+ pins = "gpio10";
+ function = "mdp_vsync_a";
+ drive-strength = <2>;
+ bias-pull-down;
+ };
+
+ nfc_ven: nfc-ven {
+ pins = "gpio12";
+ function = "gpio";
+ bias-disable;
+ drive-strength = <2>;
+ output-low;
+ };
+
+ msm_mclk0_default: msm-mclk0-active {
+ pins = "gpio13";
+ function = "cam_mclk";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
+ msm_mclk1_default: msm-mclk1-active {
+ pins = "gpio14";
+ function = "cam_mclk";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
+ cci0_default: cci0-default {
+ pins = "gpio18", "gpio19";
+ function = "cci_i2c";
+ bias-disable;
+ drive-strength = <2>;
+ };
+
+ cci1_default: cci1-default {
+ pins = "gpio19", "gpio20";
+ function = "cci_i2c";
+ bias-disable;
+ drive-strength = <2>;
+ };
+
+ hall_sensor0_default: acc-cover-open {
+ pins = "gpio124";
+ function = "gpio";
+ bias-disable;
+ drive-strength = <2>;
+ input-enable;
+ };
+};
+
+/*
+ * WARNING:
+ * Disable UFS until card quirks are in to avoid unrecoverable hard-brick
+ * that would happen as soon as the UFS card gets probed as, without the
+ * required quirks, the bootloader will be erased right after card probe.
+ */
+&ufshc {
+ status = "disabled";
+};
+
+&ufsphy {
+ status = "disabled";
+};
+
+&usb3 {
+ status = "okay";
+};
+
+&usb3_dwc3 {
+ /* Force to peripheral until we have Type-C hooked up */
+ dr_mode = "peripheral";
+};
+
+&usb3phy {
+ status = "okay";
+
+ vdda-phy-supply = <&vreg_l1a_0p875>;
+ vdda-pll-supply = <&vreg_l2a_1p2>;
+};
--
2.32.0


Subject: [PATCH 7/7] arm64: dts: qcom: msm8998-xperia: Add audio clock and its pin

All smartphones of this platform are equipped with a WCD9335 audio
codec, getting its MCLK from PM8998 gpio13: add this clock to DT.

Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
Reviewed-by: Marijn Suijten <[email protected]>
---
.../dts/qcom/msm8998-sony-xperia-yoshino.dtsi | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi b/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi
index 5fbe5abf4133..7aeebd3b2e9e 100644
--- a/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi
@@ -20,6 +20,19 @@ / {
qcom,msm-id = <0x124 0x20000>, <0x124 0x20001>; /* 8998v2, v2.1 */
qcom,board-id = <8 0>;

+ clocks {
+ compatible = "simple-bus";
+
+ div1_mclk: divclk1 {
+ compatible = "gpio-gate-clock";
+ pinctrl-0 = <&audio_mclk_pin>;
+ pinctrl-names = "default";
+ clocks = <&rpmcc RPM_SMD_DIV_CLK1>;
+ #clock-cells = <0>;
+ enable-gpios = <&pm8998_gpio 13 GPIO_ACTIVE_HIGH>;
+ };
+ };
+
board_vbat: vbat-regulator {
compatible = "regulator-fixed";
regulator-name = "VBAT";
@@ -313,6 +326,12 @@ cam_snapshot_pin_a: cam-snapshot-btn-active {
input-enable;
qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
};
+
+ audio_mclk_pin: audio-mclk-pin-active {
+ pins = "gpio13";
+ function = "func2";
+ power-source = <0>;
+ };
};

&pmi8998_gpio {
--
2.32.0

Subject: [PATCH 3/7] arm64: dts: qcom: msm8998-xperia: Add support for wcn3990 Bluetooth

This platform uses the WCN3990 Bluetooth chip, reachable on UART-3.

Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
Reviewed-by: Marijn Suijten <[email protected]>
---
.../dts/qcom/msm8998-sony-xperia-yoshino.dtsi | 17 +++++++++++++++++
1 file changed, 17 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi b/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi
index 2fe53e4675d5..66b009ba72fe 100644
--- a/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi
@@ -179,6 +179,23 @@ &blsp1_i2c5_sleep {
bias-disable;
};

+&blsp1_uart3 {
+ status = "okay";
+
+ bluetooth {
+ compatible = "qcom,wcn3990-bt";
+
+ vddio-supply = <&vreg_s4a_1p8>;
+ vddxo-supply = <&vreg_l7a_1p8>;
+ vddrf-supply = <&vreg_l17a_1p3>;
+ vddch0-supply = <&vreg_l25a_3p3>;
+ max-speed = <3200000>;
+
+ clocks = <&rpmcc RPM_SMD_RF_CLK2_PIN>;
+ };
+};
+
+
&blsp2_uart1 {
status = "okay";
};
--
2.32.0

Subject: [PATCH 2/7] arm64: dts: qcom: msm8998-xperia: Add RMI4 touchscreen support

All of the devices in the Sony Yoshino platform are using a Synaptics
RMI4-compatible touch IC with identical pins and supplies: enable the
I2C-5 bus and add the rmi4-i2c node along with the required pin
configurations.

Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
Reviewed-by: Marijn Suijten <[email protected]>
---
.../dts/qcom/msm8998-sony-xperia-yoshino.dtsi | 60 +++++++++++++++++++
1 file changed, 60 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi b/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi
index b07cbc759807..2fe53e4675d5 100644
--- a/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi
@@ -30,6 +30,15 @@ board_vbat: vbat-regulator {
regulator-boot-on;
};

+ touch_vddio_vreg: touch-vddio-vreg {
+ compatible = "regulator-fixed";
+ regulator-name = "touch_vddio_vreg";
+ startup-delay-us = <10000>;
+ gpio = <&tlmm 133 GPIO_ACTIVE_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&ts_vddio_en>;
+ };
+
vph_pwr: vph-pwr-regulator {
compatible = "regulator-fixed";
regulator-name = "vph_pwr";
@@ -134,6 +143,42 @@ ramoops@ffc00000 {
};
};

+&blsp1_i2c5 {
+ status = "okay";
+ clock-frequency = <355000>;
+
+ touchscreen: synaptics-rmi4-i2c@2c {
+ compatible = "syna,rmi4-i2c";
+ reg = <0x2c>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ interrupts-extended = <&tlmm 125 IRQ_TYPE_EDGE_FALLING>;
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&ts_int_n>;
+
+ vdd-supply = <&vreg_l28_3p0>;
+ vio-supply = <&touch_vddio_vreg>;
+
+ syna,reset-delay-ms = <220>;
+ syna,startup-delay-ms = <1000>;
+
+ rmi4-f01@1 {
+ reg = <0x01>;
+ syna,nosleep-mode = <1>;
+ };
+
+ rmi4-f11@11 {
+ reg = <0x11>;
+ syna,sensor-type = <1>;
+ };
+ };
+};
+
+&blsp1_i2c5_sleep {
+ bias-disable;
+};
+
&blsp2_uart1 {
status = "okay";
};
@@ -448,6 +493,21 @@ hall_sensor0_default: acc-cover-open {
drive-strength = <2>;
input-enable;
};
+
+ ts_int_n: ts-int-n {
+ pins = "gpio125";
+ function = "gpio";
+ drive-strength = <8>;
+ bias-pull-up;
+ };
+
+ ts_vddio_en: ts-vddio-en-default {
+ pins = "gpio133";
+ function = "gpio";
+ bias-disable;
+ drive-strength = <2>;
+ output-low;
+ };
};

/*
--
2.32.0

Subject: [PATCH 5/7] arm64: dts: qcom: msm8998-xperia: Configure display boost regulators

Add configuration for the LAB and IBB regulators (in boost mode):
this platform has smartphones with three different display sizes,
hence different displays requiring different voltage.

The common configuration parameters have been put in the common
device-tree, while specific voltage specs and soft-start-us are
variant specific, so they have been put into the machine specific
dts file.

Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
Reviewed-by: Marijn Suijten <[email protected]>
---
.../msm8998-sony-xperia-yoshino-lilac.dts | 11 ++++++++
.../msm8998-sony-xperia-yoshino-maple.dts | 11 ++++++++
.../msm8998-sony-xperia-yoshino-poplar.dts | 11 ++++++++
.../dts/qcom/msm8998-sony-xperia-yoshino.dtsi | 25 +++++++++++++++++++
4 files changed, 58 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-lilac.dts b/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-lilac.dts
index 550de79e0151..0de919357de4 100644
--- a/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-lilac.dts
+++ b/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-lilac.dts
@@ -13,6 +13,17 @@ / {
compatible = "sony,xperia-lilac", "qcom,msm8998";
};

+&ibb {
+ regulator-min-microvolt = <5500000>;
+ regulator-max-microvolt = <5500000>;
+};
+
+&lab {
+ regulator-min-microvolt = <5500000>;
+ regulator-max-microvolt = <5500000>;
+ qcom,soft-start-us = <800>;
+};
+
&vreg_l22a_2p85 {
regulator-min-microvolt = <2800000>;
regulator-max-microvolt = <2800000>;
diff --git a/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-maple.dts b/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-maple.dts
index 35a6cdb55aec..87115d648cef 100644
--- a/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-maple.dts
+++ b/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-maple.dts
@@ -25,6 +25,17 @@ disp_dvdd_vreg: disp-dvdd-vreg {
};
};

+&ibb {
+ regulator-min-microvolt = <5600000>;
+ regulator-max-microvolt = <5600000>;
+};
+
+&lab {
+ regulator-min-microvolt = <5800000>;
+ regulator-max-microvolt = <5800000>;
+ qcom,soft-start-us = <200>;
+};
+
&pmi8998_gpio {
disp_dvdd_en: disp-dvdd-en-active {
pins = "gpio10";
diff --git a/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-poplar.dts b/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-poplar.dts
index 6255004b9a09..9fa3583c951b 100644
--- a/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-poplar.dts
+++ b/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-poplar.dts
@@ -13,6 +13,17 @@ / {
compatible = "sony,xperia-poplar", "qcom,msm8998";
};

+&ibb {
+ regulator-min-microvolt = <5600000>;
+ regulator-max-microvolt = <5600000>;
+};
+
+&lab {
+ regulator-min-microvolt = <5600000>;
+ regulator-max-microvolt = <5600000>;
+ qcom,soft-start-us = <800>;
+};
+
&vreg_l18a_2p85 {
regulator-min-microvolt = <2850000>;
regulator-max-microvolt = <2850000>;
diff --git a/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi b/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi
index 8c7aba8eadee..80c2cd7ae0eb 100644
--- a/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi
@@ -207,6 +207,31 @@ &blsp2_uart1 {
status = "okay";
};

+&ibb {
+ regulator-min-microamp = <800000>;
+ regulator-max-microamp = <800000>;
+ regulator-enable-ramp-delay = <200>;
+ regulator-over-current-protection;
+ regulator-pull-down;
+ regulator-ramp-delay = <1>;
+ regulator-settling-time-up-us = <600>;
+ regulator-settling-time-down-us = <1000>;
+ regulator-soft-start;
+ qcom,discharge-resistor-kohms = <300>;
+};
+
+&lab {
+ regulator-min-microamp = <200000>;
+ regulator-max-microamp = <200000>;
+ regulator-enable-ramp-delay = <500>;
+ regulator-over-current-protection;
+ regulator-pull-down;
+ regulator-ramp-delay = <1>;
+ regulator-settling-time-up-us = <50000>;
+ regulator-settling-time-down-us = <3000>;
+ regulator-soft-start;
+};
+
&mmcc {
status = "ok";
};
--
2.32.0

2021-09-07 11:42:08

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH 1/7] arm64: dts: qcom: Introduce support for MSM8998 Sony Yoshino platform

Hi AngeloGioacchino,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on robh/for-next]
[also build test ERROR on v5.14 next-20210907]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/AngeloGioacchino-Del-Regno/arm64-dts-qcom-Introduce-support-for-MSM8998-Sony-Yoshino-platform/20210904-021033
base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: arm64-randconfig-r002-20210906 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/3f74465c0aa58eda122ee20c2962a7b8f4fe861b
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review AngeloGioacchino-Del-Regno/arm64-dts-qcom-Introduce-support-for-MSM8998-Sony-Yoshino-platform/20210904-021033
git checkout 3f74465c0aa58eda122ee20c2962a7b8f4fe861b
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=arm64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>

All errors (new ones prefixed by >>):

>> Error: arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi:141.1-6 Label or path mmcc not found
>> Error: arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi:145.1-11 Label or path mmss_smmu not found
>> FATAL ERROR: Syntax error parsing input tree

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]


Attachments:
(No filename) (1.89 kB)
.config.gz (43.41 kB)
Download all attachments

2021-09-07 13:24:50

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH 1/7] arm64: dts: qcom: Introduce support for MSM8998 Sony Yoshino platform

On Fri 03 Sep 11:09 PDT 2021, AngeloGioacchino Del Regno wrote:

> This commit introduces support for the Sony Yoshino platform, using
> the MSM8998 SoC, including:
> - Sony Xperia XZ1 (codename Poplar),
> - Sony Xperia XZ1 Compact (codename Lilac),
> - Sony Xperia XZ Premium (codename Maple).
>

Nice!

> diff --git a/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi b/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi
[..]
> + vph_pwr: vph-pwr-regulator {
> + compatible = "regulator-fixed";
> + regulator-name = "vph_pwr";
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> + gpio_keys {

Please don't use '_' in node names.

> + compatible = "gpio-keys";
> + input-name = "gpio-keys";
> + label = "Side buttons";
> + #address-cells = <1>;
> + #size-cells = <0>;
> + pinctrl-names = "default";
> + pinctrl-0 = <&vol_down_pin_a>, <&cam_focus_pin_a>,
> + <&cam_snapshot_pin_a>;
> + vol-down {
> + label = "Volume Down";
> + gpios = <&pm8998_gpio 5 GPIO_ACTIVE_LOW>;
> + linux,input-type = <1>;
> + linux,code = <KEY_VOLUMEDOWN>;
> + gpio-key,wakeup;
> + debounce-interval = <15>;
> + };
> +
> + camera-snapshot {
> + label = "Camera Snapshot";
> + gpios = <&pm8998_gpio 7 GPIO_ACTIVE_LOW>;
> + linux,input-type = <1>;
> + linux,code = <KEY_CAMERA>;
> + debounce-interval = <15>;
> + };
> +
> + camera-focus {
> + label = "Camera Focus";
> + gpios = <&pm8998_gpio 8 GPIO_ACTIVE_LOW>;
> + linux,input-type = <1>;
> + linux,code = <KEY_CAMERA_FOCUS>;
> + debounce-interval = <15>;
> + };
> + };
> +
> + gpio_hall_sensor {

Ditto.

> + compatible = "gpio-keys";
> + input-name = "hall-sensors";
> + label = "Hall sensors";
> + #address-cells = <1>;
> + #size-cells = <0>;
> + pinctrl-names = "default";
> + pinctrl-0 = <&hall_sensor0_default>;
> +
> + hall_sensor0 {

And here...

> + label = "Cover Hall Sensor";
> + gpios = <&tlmm 124 GPIO_ACTIVE_LOW>;
> + linux,input-type = <EV_SW>;
> + linux,code = <SW_LID>;
> + gpio-key,wakeup;
> + debounce-interval = <30>;
> + };
> + };
> +
> + reserved-memory {
> + #address-cells = <2>;
> + #size-cells = <2>;
> + ranges;
> +
> + hyp_mem: memory@85800000 {
> + reg = <0x0 0x85800000 0x0 0x3700000>;
> + no-map;
> + };
> +
> + cont_splash_mem: cont-splash-region@9d400000 {

Is there any reason for not just naming this "memory"?

> + reg = <0x0 0x9d400000 0x0 0x2400000>;
> + no-map;
> + };
> +
> + zap_shader_region: gpu@f6400000 {

This is also just "memory" here.

> + compatible = "shared-dma-pool";
> + reg = <0x0 0xf6400000 0x0 0x2000>;
> + no-map;
> + };
> +
[..]
> +&rpm_requests {
> + pm8998-regulators {
> + compatible = "qcom,rpm-pm8998-regulators";
> +
[..]
> + vreg_lvs1a_1p8: lvs1 { };
> + vreg_lvs2a_1p8: lvs2 { };
> +

Blank line.

> + };
> +
> + pmi8998-regulators {
> + compatible = "qcom,rpm-pmi8998-regulators";
> +
> + vdd_bob-supply = <&vph_pwr>;
> +
> + vreg_bob: bob {
> + regulator-min-microvolt = <3312000>;
> + regulator-max-microvolt = <3600000>;
> + };
> + };
> +};
> +
> +&sdhc2 {
> + status = "okay";
> + cd-gpios = <&tlmm 95 GPIO_ACTIVE_HIGH>;
> +
> + vmmc-supply = <&vreg_l21a_2p95>;
> + vqmmc-supply = <&vreg_l13a_2p95>;
> +
> + pinctrl-names = "default", "sleep";
> + pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdc2_cd_on>;
> + pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_off>;

How about grouping these various pins as "sdc2_default_state" and
"sdc2_sleep_state"?

> +};
> +
Regards,
Bjorn

2021-09-07 13:43:00

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH 3/7] arm64: dts: qcom: msm8998-xperia: Add support for wcn3990 Bluetooth

On Fri 03 Sep 11:09 PDT 2021, AngeloGioacchino Del Regno wrote:

> This platform uses the WCN3990 Bluetooth chip, reachable on UART-3.
>
> Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
> Reviewed-by: Marijn Suijten <[email protected]>
> ---
> .../dts/qcom/msm8998-sony-xperia-yoshino.dtsi | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi b/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi
> index 2fe53e4675d5..66b009ba72fe 100644
> --- a/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi
> +++ b/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi
> @@ -179,6 +179,23 @@ &blsp1_i2c5_sleep {
> bias-disable;
> };
>
> +&blsp1_uart3 {
> + status = "okay";
> +
> + bluetooth {
> + compatible = "qcom,wcn3990-bt";
> +
> + vddio-supply = <&vreg_s4a_1p8>;
> + vddxo-supply = <&vreg_l7a_1p8>;
> + vddrf-supply = <&vreg_l17a_1p3>;
> + vddch0-supply = <&vreg_l25a_3p3>;
> + max-speed = <3200000>;
> +
> + clocks = <&rpmcc RPM_SMD_RF_CLK2_PIN>;
> + };
> +};
> +
> +

Please drop the extra newline when you respin the series.

Regards,
Bjorn

> &blsp2_uart1 {
> status = "okay";
> };
> --
> 2.32.0
>

2021-09-07 13:43:05

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH 2/7] arm64: dts: qcom: msm8998-xperia: Add RMI4 touchscreen support

On Fri 03 Sep 11:09 PDT 2021, AngeloGioacchino Del Regno wrote:

> All of the devices in the Sony Yoshino platform are using a Synaptics
> RMI4-compatible touch IC with identical pins and supplies: enable the
> I2C-5 bus and add the rmi4-i2c node along with the required pin
> configurations.
>
> Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
> Reviewed-by: Marijn Suijten <[email protected]>
> ---
> .../dts/qcom/msm8998-sony-xperia-yoshino.dtsi | 60 +++++++++++++++++++
> 1 file changed, 60 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi b/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi
> index b07cbc759807..2fe53e4675d5 100644
> --- a/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi
> +++ b/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi
> @@ -30,6 +30,15 @@ board_vbat: vbat-regulator {
> regulator-boot-on;
> };
>
> + touch_vddio_vreg: touch-vddio-vreg {
> + compatible = "regulator-fixed";
> + regulator-name = "touch_vddio_vreg";
> + startup-delay-us = <10000>;
> + gpio = <&tlmm 133 GPIO_ACTIVE_HIGH>;
> + pinctrl-names = "default";
> + pinctrl-0 = <&ts_vddio_en>;
> + };
> +
> vph_pwr: vph-pwr-regulator {
> compatible = "regulator-fixed";
> regulator-name = "vph_pwr";
> @@ -134,6 +143,42 @@ ramoops@ffc00000 {
> };
> };
>
> +&blsp1_i2c5 {
> + status = "okay";
> + clock-frequency = <355000>;
> +
> + touchscreen: synaptics-rmi4-i2c@2c {

"touchscreen" sounds like a better "generic name" for the node.

Haven't checked the following patches yet, do you need the label?

Regards,
Bjorn

> + compatible = "syna,rmi4-i2c";
> + reg = <0x2c>;
> + #address-cells = <1>;
> + #size-cells = <0>;
> + interrupts-extended = <&tlmm 125 IRQ_TYPE_EDGE_FALLING>;
> +
> + pinctrl-names = "default";
> + pinctrl-0 = <&ts_int_n>;
> +
> + vdd-supply = <&vreg_l28_3p0>;
> + vio-supply = <&touch_vddio_vreg>;
> +
> + syna,reset-delay-ms = <220>;
> + syna,startup-delay-ms = <1000>;
> +
> + rmi4-f01@1 {
> + reg = <0x01>;
> + syna,nosleep-mode = <1>;
> + };
> +
> + rmi4-f11@11 {
> + reg = <0x11>;
> + syna,sensor-type = <1>;
> + };
> + };
> +};
> +
> +&blsp1_i2c5_sleep {
> + bias-disable;
> +};
> +
> &blsp2_uart1 {
> status = "okay";
> };
> @@ -448,6 +493,21 @@ hall_sensor0_default: acc-cover-open {
> drive-strength = <2>;
> input-enable;
> };
> +
> + ts_int_n: ts-int-n {
> + pins = "gpio125";
> + function = "gpio";
> + drive-strength = <8>;
> + bias-pull-up;
> + };
> +
> + ts_vddio_en: ts-vddio-en-default {
> + pins = "gpio133";
> + function = "gpio";
> + bias-disable;
> + drive-strength = <2>;
> + output-low;
> + };
> };
>
> /*
> --
> 2.32.0
>

2021-09-07 13:49:19

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH 7/7] arm64: dts: qcom: msm8998-xperia: Add audio clock and its pin

On Fri 03 Sep 11:09 PDT 2021, AngeloGioacchino Del Regno wrote:

> All smartphones of this platform are equipped with a WCD9335 audio
> codec, getting its MCLK from PM8998 gpio13: add this clock to DT.
>
> Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
> Reviewed-by: Marijn Suijten <[email protected]>
> ---
> .../dts/qcom/msm8998-sony-xperia-yoshino.dtsi | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi b/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi
> index 5fbe5abf4133..7aeebd3b2e9e 100644
> --- a/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi
> +++ b/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi
> @@ -20,6 +20,19 @@ / {
> qcom,msm-id = <0x124 0x20000>, <0x124 0x20001>; /* 8998v2, v2.1 */
> qcom,board-id = <8 0>;
>
> + clocks {
> + compatible = "simple-bus";
> +
> + div1_mclk: divclk1 {
> + compatible = "gpio-gate-clock";
> + pinctrl-0 = <&audio_mclk_pin>;
> + pinctrl-names = "default";
> + clocks = <&rpmcc RPM_SMD_DIV_CLK1>;

What controls the clock rate of divclk1?

Regards,
Bjorn

> + #clock-cells = <0>;
> + enable-gpios = <&pm8998_gpio 13 GPIO_ACTIVE_HIGH>;
> + };
> + };
> +
> board_vbat: vbat-regulator {
> compatible = "regulator-fixed";
> regulator-name = "VBAT";
> @@ -313,6 +326,12 @@ cam_snapshot_pin_a: cam-snapshot-btn-active {
> input-enable;
> qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
> };
> +
> + audio_mclk_pin: audio-mclk-pin-active {
> + pins = "gpio13";
> + function = "func2";
> + power-source = <0>;
> + };
> };
>
> &pmi8998_gpio {
> --
> 2.32.0
>

Subject: Re: [PATCH 1/7] arm64: dts: qcom: Introduce support for MSM8998 Sony Yoshino platform

Il 07/09/21 15:04, Bjorn Andersson ha scritto:
> On Fri 03 Sep 11:09 PDT 2021, AngeloGioacchino Del Regno wrote:
>
>> This commit introduces support for the Sony Yoshino platform, using
>> the MSM8998 SoC, including:
>> - Sony Xperia XZ1 (codename Poplar),
>> - Sony Xperia XZ1 Compact (codename Lilac),
>> - Sony Xperia XZ Premium (codename Maple).
>>
>
> Nice!
>
>> diff --git a/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi b/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi
> [..]
>> + vph_pwr: vph-pwr-regulator {
>> + compatible = "regulator-fixed";
>> + regulator-name = "vph_pwr";
>> + regulator-always-on;
>> + regulator-boot-on;
>> + };
>> +
>> + gpio_keys {
>
> Please don't use '_' in node names.
>

Sorry, all of that is fixed.

>> + reserved-memory {
>> + #address-cells = <2>;
>> + #size-cells = <2>;
>> + ranges;
>> +
>> + hyp_mem: memory@85800000 {
>> + reg = <0x0 0x85800000 0x0 0x3700000>;
>> + no-map;
>> + };
>> +
>> + cont_splash_mem: cont-splash-region@9d400000 {
>
> Is there any reason for not just naming this "memory"?
>

No, there's no reason. Changed to 'memory'.

>> + compatible = "shared-dma-pool";
>> + reg = <0x0 0xf6400000 0x0 0x2000>;
>> + no-map;
>> + };
>> +
> [..]
>> +&rpm_requests {
>> + pm8998-regulators {
>> + compatible = "qcom,rpm-pm8998-regulators";
>> +
> [..]
>> + vreg_lvs1a_1p8: lvs1 { };
>> + vreg_lvs2a_1p8: lvs2 { };
>> +
>
> Blank line.
>

Done.

Also, we had a better internal review of the 8998 dt patches, so in the
next version there will be even more cleanups.

>> + };
>> +
>> + pmi8998-regulators {
>> + compatible = "qcom,rpm-pmi8998-regulators";
>> +
>> + vdd_bob-supply = <&vph_pwr>;
>> +
>> + vreg_bob: bob {
>> + regulator-min-microvolt = <3312000>;
>> + regulator-max-microvolt = <3600000>;
>> + };
>> + };
>> +};
>> +
>> +&sdhc2 {
>> + status = "okay";
>> + cd-gpios = <&tlmm 95 GPIO_ACTIVE_HIGH>;
>> +
>> + vmmc-supply = <&vreg_l21a_2p95>;
>> + vqmmc-supply = <&vreg_l13a_2p95>;
>> +
>> + pinctrl-names = "default", "sleep";
>> + pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdc2_cd_on>;
>> + pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_off>;
>
> How about grouping these various pins as "sdc2_default_state" and
> "sdc2_sleep_state"?
>

I agree with you on the fact that groping these pins would look way better,
but I'm inheriting the sdc2 pinctrl from msm8998.dtsi and... all of the msm8998
boards, including msm8998-mtp and msm8998-clamshell (and whatever else inherits
these) are doing the same as what I am doing here.

That said, are you proposing to change 'em all?

Cheers,
- Angelo

>> +};
>> +
> Regards,
> Bjorn
>

Subject: Re: [PATCH 7/7] arm64: dts: qcom: msm8998-xperia: Add audio clock and its pin

Il 07/09/21 15:47, Bjorn Andersson ha scritto:
> On Fri 03 Sep 11:09 PDT 2021, AngeloGioacchino Del Regno wrote:
>
>> All smartphones of this platform are equipped with a WCD9335 audio
>> codec, getting its MCLK from PM8998 gpio13: add this clock to DT.
>>
>> Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
>> Reviewed-by: Marijn Suijten <[email protected]>
>> ---
>> .../dts/qcom/msm8998-sony-xperia-yoshino.dtsi | 19 +++++++++++++++++++
>> 1 file changed, 19 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi b/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi
>> index 5fbe5abf4133..7aeebd3b2e9e 100644
>> --- a/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi
>> +++ b/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi
>> @@ -20,6 +20,19 @@ / {
>> qcom,msm-id = <0x124 0x20000>, <0x124 0x20001>; /* 8998v2, v2.1 */
>> qcom,board-id = <8 0>;
>>
>> + clocks {
>> + compatible = "simple-bus";
>> +
>> + div1_mclk: divclk1 {
>> + compatible = "gpio-gate-clock";
>> + pinctrl-0 = <&audio_mclk_pin>;
>> + pinctrl-names = "default";
>> + clocks = <&rpmcc RPM_SMD_DIV_CLK1>;
>
> What controls the clock rate of divclk1?
>

That's going to be assigned to WCD9335 (oh btw, I have working audio locally!
it's not great, but I can hear sounds from the internal speakers), but I
haven't added the entire audio configuration in these submitted commits because:
1. It needs two GDSCs in GCC: adding them without enabling the lpass iommu will
produce a crash, as the iommu would go off when the kernel starts turning off
unused stuff... and we have secure contexts there, which means that the
hypervisor will say hello;
2. The lpass iommu needs a commit in the qcom smmu implementation detail driver,
as we need to select a different context (not the last ctx, but the one before)
for bypass streams emulation, as the last one seems to be untouchable... small
preview of the required commit:
qsmmu->bypass_cbndx = [value from dt], or [default == smmu->num_context_banks-1]
3. We need the lpass iommu to get "the audio stuff" (surely, no need to list it).

So that's the entire picture... I am planning to get this base merged in before
going for a cleanup and submission of the rest of what I have here.


Long story short: WCD9335 will be responsible for controlling this clock.

Cheers,
- Angelo

> Regards,
> Bjorn
>
>> + #clock-cells = <0>;
>> + enable-gpios = <&pm8998_gpio 13 GPIO_ACTIVE_HIGH>;
>> + };
>> + };
>> +
>> board_vbat: vbat-regulator {
>> compatible = "regulator-fixed";
>> regulator-name = "VBAT";
>> @@ -313,6 +326,12 @@ cam_snapshot_pin_a: cam-snapshot-btn-active {
>> input-enable;
>> qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
>> };
>> +
>> + audio_mclk_pin: audio-mclk-pin-active {
>> + pins = "gpio13";
>> + function = "func2";
>> + power-source = <0>;
>> + };
>> };
>>
>> &pmi8998_gpio {
>> --
>> 2.32.0
>>

Subject: Re: [PATCH 2/7] arm64: dts: qcom: msm8998-xperia: Add RMI4 touchscreen support

Il 07/09/21 15:41, Bjorn Andersson ha scritto:
> On Fri 03 Sep 11:09 PDT 2021, AngeloGioacchino Del Regno wrote:
>
>> All of the devices in the Sony Yoshino platform are using a Synaptics
>> RMI4-compatible touch IC with identical pins and supplies: enable the
>> I2C-5 bus and add the rmi4-i2c node along with the required pin
>> configurations.
>>
>> Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
>> Reviewed-by: Marijn Suijten <[email protected]>
>> ---
>> .../dts/qcom/msm8998-sony-xperia-yoshino.dtsi | 60 +++++++++++++++++++
>> 1 file changed, 60 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi b/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi
>> index b07cbc759807..2fe53e4675d5 100644
>> --- a/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi
>> +++ b/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi
>> @@ -30,6 +30,15 @@ board_vbat: vbat-regulator {
>> regulator-boot-on;
>> };
>>
>> + touch_vddio_vreg: touch-vddio-vreg {
>> + compatible = "regulator-fixed";
>> + regulator-name = "touch_vddio_vreg";
>> + startup-delay-us = <10000>;
>> + gpio = <&tlmm 133 GPIO_ACTIVE_HIGH>;
>> + pinctrl-names = "default";
>> + pinctrl-0 = <&ts_vddio_en>;
>> + };
>> +
>> vph_pwr: vph-pwr-regulator {
>> compatible = "regulator-fixed";
>> regulator-name = "vph_pwr";
>> @@ -134,6 +143,42 @@ ramoops@ffc00000 {
>> };
>> };
>>
>> +&blsp1_i2c5 {
>> + status = "okay";
>> + clock-frequency = <355000>;
>> +
>> + touchscreen: synaptics-rmi4-i2c@2c {
>
> "touchscreen" sounds like a better "generic name" for the node.
>
> Haven't checked the following patches yet, do you need the label?
>

Thank you, I forgot to remove the label after a cleanup.
Also, node name changed.

Cheers,
- Angelo

> Regards,
> Bjorn
>
>> + compatible = "syna,rmi4-i2c";
>> + reg = <0x2c>;
>> + #address-cells = <1>;
>> + #size-cells = <0>;
>> + interrupts-extended = <&tlmm 125 IRQ_TYPE_EDGE_FALLING>;
>> +
>> + pinctrl-names = "default";
>> + pinctrl-0 = <&ts_int_n>;
>> +
>> + vdd-supply = <&vreg_l28_3p0>;
>> + vio-supply = <&touch_vddio_vreg>;
>> +
>> + syna,reset-delay-ms = <220>;
>> + syna,startup-delay-ms = <1000>;
>> +
>> + rmi4-f01@1 {
>> + reg = <0x01>;
>> + syna,nosleep-mode = <1>;
>> + };
>> +
>> + rmi4-f11@11 {
>> + reg = <0x11>;
>> + syna,sensor-type = <1>;
>> + };
>> + };
>> +};
>> +
>> +&blsp1_i2c5_sleep {
>> + bias-disable;
>> +};
>> +
>> &blsp2_uart1 {
>> status = "okay";
>> };
>> @@ -448,6 +493,21 @@ hall_sensor0_default: acc-cover-open {
>> drive-strength = <2>;
>> input-enable;
>> };
>> +
>> + ts_int_n: ts-int-n {
>> + pins = "gpio125";
>> + function = "gpio";
>> + drive-strength = <8>;
>> + bias-pull-up;
>> + };
>> +
>> + ts_vddio_en: ts-vddio-en-default {
>> + pins = "gpio133";
>> + function = "gpio";
>> + bias-disable;
>> + drive-strength = <2>;
>> + output-low;
>> + };
>> };
>>
>> /*
>> --
>> 2.32.0
>>

2021-09-09 14:30:54

by Dmitry Baryshkov

[permalink] [raw]
Subject: Re: [PATCH 3/7] arm64: dts: qcom: msm8998-xperia: Add support for wcn3990 Bluetooth

On 03/09/2021 21:09, AngeloGioacchino Del Regno wrote:
> This platform uses the WCN3990 Bluetooth chip, reachable on UART-3.
>
> Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
> Reviewed-by: Marijn Suijten <[email protected]>
> ---
> .../dts/qcom/msm8998-sony-xperia-yoshino.dtsi | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi b/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi
> index 2fe53e4675d5..66b009ba72fe 100644
> --- a/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi
> +++ b/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi
> @@ -179,6 +179,23 @@ &blsp1_i2c5_sleep {
> bias-disable;
> };
>
> +&blsp1_uart3 {
> + status = "okay";
> +
> + bluetooth {
> + compatible = "qcom,wcn3990-bt";
> +
> + vddio-supply = <&vreg_s4a_1p8>;
> + vddxo-supply = <&vreg_l7a_1p8>;
> + vddrf-supply = <&vreg_l17a_1p3>;
> + vddch0-supply = <&vreg_l25a_3p3>;
> + max-speed = <3200000>;
> +
> + clocks = <&rpmcc RPM_SMD_RF_CLK2_PIN>;
> + };
> +};

There is an ongoing proposal to rework wcn3990 (bt and wifi) bindings,
so we might want to delay this a bit. Not a strict requirement, since
the changes would be backwards-compatible.


--
With best wishes
Dmitry

Subject: Re: [PATCH 3/7] arm64: dts: qcom: msm8998-xperia: Add support for wcn3990 Bluetooth

Il 09/09/21 15:19, Dmitry Baryshkov ha scritto:
> On 03/09/2021 21:09, AngeloGioacchino Del Regno wrote:
>> This platform uses the WCN3990 Bluetooth chip, reachable on UART-3.
>>
>> Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
>> Reviewed-by: Marijn Suijten <[email protected]>
>> ---
>>   .../dts/qcom/msm8998-sony-xperia-yoshino.dtsi   | 17 +++++++++++++++++
>>   1 file changed, 17 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi
>> b/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi
>> index 2fe53e4675d5..66b009ba72fe 100644
>> --- a/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi
>> +++ b/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi
>> @@ -179,6 +179,23 @@ &blsp1_i2c5_sleep {
>>       bias-disable;
>>   };
>> +&blsp1_uart3 {
>> +    status = "okay";
>> +
>> +    bluetooth {
>> +        compatible = "qcom,wcn3990-bt";
>> +
>> +        vddio-supply = <&vreg_s4a_1p8>;
>> +        vddxo-supply = <&vreg_l7a_1p8>;
>> +        vddrf-supply = <&vreg_l17a_1p3>;
>> +        vddch0-supply = <&vreg_l25a_3p3>;
>> +        max-speed = <3200000>;
>> +
>> +        clocks = <&rpmcc RPM_SMD_RF_CLK2_PIN>;
>> +    };
>> +};
>
> There is an ongoing proposal to rework wcn3990 (bt and wifi) bindings, so we might
> want to delay this a bit. Not a strict requirement, since the changes would be
> backwards-compatible.
>
>

Delaying this patch is not a problem on my side - but if the changes are backwards
compatible, do we really have reasons to delay it?

In any case, I trust your judgement on this: if you want to delay it, I will send
the wcn3990 support after the rework.

Cheers,
- Angelo