diff mbox series

[5/6] arm64: dts: qcom: sc8280xp*: use pm8350.dtsi

Message ID 20230329000833.2507594-6-dmitry.baryshkov@linaro.org
State New
Headers show
Series arm64: dts: qcom: sc8280xp: remove duplication in PMIC declarations | expand

Commit Message

Dmitry Baryshkov March 29, 2023, 12:08 a.m. UTC
Employ PM8350_SID and switch sc8280xp-pmics to use pm8350.dtsi to reduce
duplication and possible discrepancies.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 arch/arm64/boot/dts/qcom/sc8280xp-crd.dts     | 12 +--
 .../qcom/sc8280xp-lenovo-thinkpad-x13s.dts    | 12 +--
 arch/arm64/boot/dts/qcom/sc8280xp-pmics.dtsi  | 98 ++-----------------
 3 files changed, 19 insertions(+), 103 deletions(-)
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-crd.dts b/arch/arm64/boot/dts/qcom/sc8280xp-crd.dts
index d32594b5a4e7..58a14c39633b 100644
--- a/arch/arm64/boot/dts/qcom/sc8280xp-crd.dts
+++ b/arch/arm64/boot/dts/qcom/sc8280xp-crd.dts
@@ -25,7 +25,7 @@  aliases {
 	backlight: backlight {
 		compatible = "pwm-backlight";
 		pwms = <&pmc8280c_lpg 3 1000000>;
-		enable-gpios = <&pmc8280_1_gpios 8 GPIO_ACTIVE_HIGH>;
+		enable-gpios = <&pm8350_1_gpios 8 GPIO_ACTIVE_HIGH>;
 		power-supply = <&vreg_edp_bl>;
 
 		pinctrl-names = "default";
@@ -137,7 +137,7 @@  vreg_edp_bl: regulator-edp-bl {
 		regulator-min-microvolt = <3600000>;
 		regulator-max-microvolt = <3600000>;
 
-		gpio = <&pmc8280_1_gpios 9 GPIO_ACTIVE_HIGH>;
+		gpio = <&pm8350_1_gpios 9 GPIO_ACTIVE_HIGH>;
 		enable-active-high;
 
 		pinctrl-names = "default";
@@ -167,7 +167,7 @@  vreg_misc_3p3: regulator-misc-3p3 {
 		regulator-min-microvolt = <3300000>;
 		regulator-max-microvolt = <3300000>;
 
-		gpio = <&pmc8280_1_gpios 1 GPIO_ACTIVE_HIGH>;
+		gpio = <&pm8350_1_gpios 1 GPIO_ACTIVE_HIGH>;
 		enable-active-high;
 
 		pinctrl-names = "default";
@@ -200,7 +200,7 @@  vreg_wwan: regulator-wwan {
 		regulator-min-microvolt = <3300000>;
 		regulator-max-microvolt = <3300000>;
 
-		gpio = <&pmc8280_2_gpios 1 GPIO_ACTIVE_HIGH>;
+		gpio = <&pm8350_3_gpios 1 GPIO_ACTIVE_HIGH>;
 		enable-active-high;
 
 		pinctrl-names = "default";
@@ -686,7 +686,7 @@  &xo_board_clk {
 
 /* PINCTRL - additions to nodes defined in sc8280xp.dtsi */
 
-&pmc8280_1_gpios {
+&pm8350_1_gpios {
 	edp_bl_en: edp-bl-en-state {
 		pins = "gpio8";
 		function = "normal";
@@ -703,7 +703,7 @@  misc_3p3_reg_en: misc-3p3-reg-en-state {
 	};
 };
 
-&pmc8280_2_gpios {
+&pm8350_3_gpios {
 	wwan_sw_en: wwan-sw-en-state {
 		pins = "gpio1";
 		function = "normal";
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 7d61108daede..023ccb7725ef 100644
--- a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
+++ b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
@@ -55,7 +55,7 @@  wcd938x: audio-codec {
 	backlight: backlight {
 		compatible = "pwm-backlight";
 		pwms = <&pmc8280c_lpg 3 1000000>;
-		enable-gpios = <&pmc8280_1_gpios 8 GPIO_ACTIVE_HIGH>;
+		enable-gpios = <&pm8350_1_gpios 8 GPIO_ACTIVE_HIGH>;
 		power-supply = <&vreg_edp_bl>;
 
 		pinctrl-names = "default";
@@ -178,7 +178,7 @@  vreg_edp_bl: regulator-edp-bl {
 		regulator-min-microvolt = <3600000>;
 		regulator-max-microvolt = <3600000>;
 
-		gpio = <&pmc8280_1_gpios 9 GPIO_ACTIVE_HIGH>;
+		gpio = <&pm8350_1_gpios 9 GPIO_ACTIVE_HIGH>;
 		enable-active-high;
 
 		pinctrl-names = "default";
@@ -194,7 +194,7 @@  vreg_misc_3p3: regulator-misc-3p3 {
 		regulator-min-microvolt = <3300000>;
 		regulator-max-microvolt = <3300000>;
 
-		gpio = <&pmc8280_1_gpios 1 GPIO_ACTIVE_HIGH>;
+		gpio = <&pm8350_1_gpios 1 GPIO_ACTIVE_HIGH>;
 		enable-active-high;
 
 		pinctrl-names = "default";
@@ -253,7 +253,7 @@  vreg_wwan: regulator-wwan {
 		regulator-min-microvolt = <3300000>;
 		regulator-max-microvolt = <3300000>;
 
-		gpio = <&pmc8280_2_gpios 1 GPIO_ACTIVE_HIGH>;
+		gpio = <&pm8350_3_gpios 1 GPIO_ACTIVE_HIGH>;
 		enable-active-high;
 
 		pinctrl-names = "default";
@@ -1148,7 +1148,7 @@  &lpass_tlmm {
 	status = "okay";
 };
 
-&pmc8280_1_gpios {
+&pm8350_1_gpios {
 	edp_bl_en: edp-bl-en-state {
 		pins = "gpio8";
 		function = "normal";
@@ -1165,7 +1165,7 @@  misc_3p3_reg_en: misc-3p3-reg-en-state {
 	};
 };
 
-&pmc8280_2_gpios {
+&pm8350_3_gpios {
 	wwan_sw_en: wwan-sw-en-state {
 		pins = "gpio1";
 		function = "normal";
diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-pmics.dtsi b/arch/arm64/boot/dts/qcom/sc8280xp-pmics.dtsi
index 781fb6448a52..505bb8f9a13c 100644
--- a/arch/arm64/boot/dts/qcom/sc8280xp-pmics.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc8280xp-pmics.dtsi
@@ -7,79 +7,19 @@ 
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/spmi/spmi.h>
 
-/ {
-	thermal-zones {
-		pm8280_1_thermal: pm8280-1-thermal {
-			polling-delay-passive = <100>;
-			polling-delay = <0>;
-			thermal-sensors = <&pm8280_1_temp_alarm>;
-
-			trips {
-				trip0 {
-					temperature = <95000>;
-					hysteresis = <0>;
-					type = "passive";
-				};
-
-				trip1 {
-					temperature = <115000>;
-					hysteresis = <0>;
-					type = "critical";
-				};
-			};
-		};
-
-		pm8280_2_thermal: pm8280-2-thermal {
-			polling-delay-passive = <100>;
-			polling-delay = <0>;
-			thermal-sensors = <&pm8280_2_temp_alarm>;
-
-			trips {
-				trip0 {
-					temperature = <95000>;
-					hysteresis = <0>;
-					type = "passive";
-				};
-
-				trip1 {
-					temperature = <115000>;
-					hysteresis = <0>;
-					type = "critical";
-				};
-			};
-		};
-	};
-};
-
 #define PMK8350_SID 0
 #include "pmk8350.dtsi"
 #undef PMK8350_SID
 
-&spmi_bus {
-	pmc8280_1: pmic@1 {
-		compatible = "qcom,pm8350", "qcom,spmi-pmic";
-		reg = <0x1 SPMI_USID>;
-		#address-cells = <1>;
-		#size-cells = <0>;
+#define PM8350_SID 1
+#include "pm8350.dtsi"
+#undef PM8350_SID
 
-		pm8280_1_temp_alarm: temp-alarm@a00 {
-			compatible = "qcom,spmi-temp-alarm";
-			reg = <0xa00>;
-			interrupts-extended = <&spmi_bus 0x1 0xa 0x0 IRQ_TYPE_EDGE_BOTH>;
-			#thermal-sensor-cells = <0>;
-		};
-
-		pmc8280_1_gpios: gpio@8800 {
-			compatible = "qcom,pm8350-gpio", "qcom,spmi-gpio";
-			reg = <0x8800>;
-			gpio-controller;
-			gpio-ranges = <&pmc8280_1_gpios 0 0 10>;
-			#gpio-cells = <2>;
-			interrupt-controller;
-			#interrupt-cells = <2>;
-		};
-	};
+#define PM8350_SID 3
+#include "pm8350.dtsi"
+#undef PM8350_SID
 
+&spmi_bus {
 	pmc8280c: pmic@2 {
 		compatible = "qcom,pm8350c", "qcom,spmi-pmic";
 		reg = <0x2 SPMI_USID>;
@@ -108,30 +48,6 @@  pmc8280c_lpg: pwm {
 		};
 	};
 
-	pmc8280_2: pmic@3 {
-		compatible = "qcom,pm8350", "qcom,spmi-pmic";
-		reg = <0x3 SPMI_USID>;
-		#address-cells = <1>;
-		#size-cells = <0>;
-
-		pm8280_2_temp_alarm: temp-alarm@a00 {
-			compatible = "qcom,spmi-temp-alarm";
-			reg = <0xa00>;
-			interrupts-extended = <&spmi_bus 0x2 0xa 0x0 IRQ_TYPE_EDGE_BOTH>;
-			#thermal-sensor-cells = <0>;
-		};
-
-		pmc8280_2_gpios: gpio@8800 {
-			compatible = "qcom,pm8350-gpio", "qcom,spmi-gpio";
-			reg = <0x8800>;
-			gpio-controller;
-			gpio-ranges = <&pmc8280_2_gpios 0 0 10>;
-			#gpio-cells = <2>;
-			interrupt-controller;
-			#interrupt-cells = <2>;
-		};
-	};
-
 	pmr735a: pmic@4 {
 		compatible = "qcom,pmr735a", "qcom,spmi-pmic";
 		reg = <0x4 SPMI_USID>;