diff mbox series

[3/6] arm64: dts: qcom: use main pmk8350.dtsi for sc8280xp platform

Message ID 20230329000833.2507594-4-dmitry.baryshkov@linaro.org (mailing list archive)
State Handled Elsewhere
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 existing PMK8350_SID and switch sc8280xp-pmics to use
pmk8350.dtsi to reduce duplication and possible discrepancies.

For example, this changes sc8280xp platforms to use qcom,pmk8350-pon
for the pon device compatibility rather than the incorrect
qcom,pm8998-pon.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 arch/arm64/boot/dts/qcom/pmk8350.dtsi         |  9 +++
 arch/arm64/boot/dts/qcom/sc8280xp-crd.dts     |  6 +-
 .../qcom/sc8280xp-lenovo-thinkpad-x13s.dts    | 30 ++++-----
 arch/arm64/boot/dts/qcom/sc8280xp-pmics.dtsi  | 67 ++-----------------
 4 files changed, 31 insertions(+), 81 deletions(-)

Comments

Konrad Dybcio March 29, 2023, 12:27 a.m. UTC | #1
On 29.03.2023 02:08, Dmitry Baryshkov wrote:
> Employ existing PMK8350_SID and switch sc8280xp-pmics to use
> pmk8350.dtsi to reduce duplication and possible discrepancies.
> 
> For example, this changes sc8280xp platforms to use qcom,pmk8350-pon
> for the pon device compatibility rather than the incorrect
> qcom,pm8998-pon.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
Bit of a loaded patch..

This could probably go like:

1. outer join 8280 on pmk8350 (for feature parity)
2. rename all labels in 8280 to 8350 (for 3.)
3. switch over to the actual 8350 file, remove 8280 (with Fixes:)

[...]

> +#define PMK8350_SID 0
> +#include "pmk8350.dtsi"
> +#undef PMK8350_SID
Not sure if this undef is necessary

With or without all that though, the goal lgtm..

Konrad

>  
> +&spmi_bus {
>  	pmc8280_1: pmic@1 {
>  		compatible = "qcom,pm8350", "qcom,spmi-pmic";
>  		reg = <0x1 SPMI_USID>;
Konrad Dybcio March 29, 2023, 12:29 a.m. UTC | #2
On 29.03.2023 02:27, Konrad Dybcio wrote:
> 
> 
> On 29.03.2023 02:08, Dmitry Baryshkov wrote:
>> Employ existing PMK8350_SID and switch sc8280xp-pmics to use
>> pmk8350.dtsi to reduce duplication and possible discrepancies.
>>
>> For example, this changes sc8280xp platforms to use qcom,pmk8350-pon
>> for the pon device compatibility rather than the incorrect
>> qcom,pm8998-pon.
>>
>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>> ---
> Bit of a loaded patch..
> 
> This could probably go like:
> 
> 1. outer join 8280 on pmk8350 (for feature parity)
> 2. rename all labels in 8280 to 8350 (for 3.)
> 3. switch over to the actual 8350 file, remove 8280 (with Fixes:)
> 
> [...]
> 
>> +#define PMK8350_SID 0
>> +#include "pmk8350.dtsi"
>> +#undef PMK8350_SID
> Not sure if this undef is necessary
It looks like it would be for multiple instances though

Konrad
> 
> With or without all that though, the goal lgtm..
> 
> Konrad
> 
>>  
>> +&spmi_bus {
>>  	pmc8280_1: pmic@1 {
>>  		compatible = "qcom,pm8350", "qcom,spmi-pmic";
>>  		reg = <0x1 SPMI_USID>;
Konrad Dybcio March 29, 2023, 12:35 a.m. UTC | #3
On 29.03.2023 02:29, Konrad Dybcio wrote:
> 
> 
> On 29.03.2023 02:27, Konrad Dybcio wrote:
>>
>>
>> On 29.03.2023 02:08, Dmitry Baryshkov wrote:
>>> Employ existing PMK8350_SID and switch sc8280xp-pmics to use
>>> pmk8350.dtsi to reduce duplication and possible discrepancies.
>>>
>>> For example, this changes sc8280xp platforms to use qcom,pmk8350-pon
>>> for the pon device compatibility rather than the incorrect
>>> qcom,pm8998-pon.
>>>
>>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>>> ---
>> Bit of a loaded patch..
>>
>> This could probably go like:
>>
>> 1. outer join 8280 on pmk8350 (for feature parity)
>> 2. rename all labels in 8280 to 8350 (for 3.)
>> 3. switch over to the actual 8350 file, remove 8280 (with Fixes:)
>>
>> [...]
>>
>>> +#define PMK8350_SID 0
>>> +#include "pmk8350.dtsi"
>>> +#undef PMK8350_SID
>> Not sure if this undef is necessary
> It looks like it would be for multiple instances though
> 
> Konrad
Also, it'd be a good idea to use interrupt-parent, as:

1) it would be a regression for OpenBSD and friends to remove it
2) the interrupts=<> is dangerously long with SPMI

Konrad
>>
>> With or without all that though, the goal lgtm..
>>
>> Konrad
>>
>>>  
>>> +&spmi_bus {
>>>  	pmc8280_1: pmic@1 {
>>>  		compatible = "qcom,pm8350", "qcom,spmi-pmic";
>>>  		reg = <0x1 SPMI_USID>;
Dmitry Baryshkov March 29, 2023, 11:54 a.m. UTC | #4
On Wed, 29 Mar 2023 at 03:35, Konrad Dybcio <konrad.dybcio@linaro.org> wrote:
>
>
>
> On 29.03.2023 02:29, Konrad Dybcio wrote:
> >
> >
> > On 29.03.2023 02:27, Konrad Dybcio wrote:
> >>
> >>
> >> On 29.03.2023 02:08, Dmitry Baryshkov wrote:
> >>> Employ existing PMK8350_SID and switch sc8280xp-pmics to use
> >>> pmk8350.dtsi to reduce duplication and possible discrepancies.
> >>>
> >>> For example, this changes sc8280xp platforms to use qcom,pmk8350-pon
> >>> for the pon device compatibility rather than the incorrect
> >>> qcom,pm8998-pon.
> >>>
> >>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> >>> ---
> >> Bit of a loaded patch..
> >>
> >> This could probably go like:
> >>
> >> 1. outer join 8280 on pmk8350 (for feature parity)
> >> 2. rename all labels in 8280 to 8350 (for 3.)
> >> 3. switch over to the actual 8350 file, remove 8280 (with Fixes:)
> >>
> >> [...]
> >>
> >>> +#define PMK8350_SID 0
> >>> +#include "pmk8350.dtsi"
> >>> +#undef PMK8350_SID
> >> Not sure if this undef is necessary
> > It looks like it would be for multiple instances though
> >
> > Konrad
> Also, it'd be a good idea to use interrupt-parent, as:
>
> 1) it would be a regression for OpenBSD and friends to remove it

Ack, I forgot about interrupts/interrupts-extended. I'll fix that for v2.

> 2) the interrupts=<> is dangerously long with SPMI

I don't think we can do anything about this.

>
> Konrad
> >>
> >> With or without all that though, the goal lgtm..
> >>
> >> Konrad
> >>
> >>>
> >>> +&spmi_bus {
> >>>     pmc8280_1: pmic@1 {
> >>>             compatible = "qcom,pm8350", "qcom,spmi-pmic";
> >>>             reg = <0x1 SPMI_USID>;
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/qcom/pmk8350.dtsi b/arch/arm64/boot/dts/qcom/pmk8350.dtsi
index 455ffffb5f5c..26e40dbfc173 100644
--- a/arch/arm64/boot/dts/qcom/pmk8350.dtsi
+++ b/arch/arm64/boot/dts/qcom/pmk8350.dtsi
@@ -66,6 +66,15 @@  pmk8350_rtc: rtc@6100 {
 			status = "disabled";
 		};
 
+		pmk8350_sdam_6: nvram@8500 {
+			compatible = "qcom,spmi-sdam";
+			reg = <0x8500>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges = <0 0x8500 0x100>;
+			status = "disabled";
+		};
+
 		pmk8350_gpios: gpio@b000 {
 			compatible = "qcom,pmk8350-gpio", "qcom,spmi-gpio";
 			reg = <0xb000>;
diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-crd.dts b/arch/arm64/boot/dts/qcom/sc8280xp-crd.dts
index d7b537284990..d32594b5a4e7 100644
--- a/arch/arm64/boot/dts/qcom/sc8280xp-crd.dts
+++ b/arch/arm64/boot/dts/qcom/sc8280xp-crd.dts
@@ -559,18 +559,18 @@  &pmc8280c_lpg {
 	status = "okay";
 };
 
-&pmk8280_pon_pwrkey {
+&pmk8350_pon_pwrkey {
 	status = "okay";
 };
 
-&pmk8280_rtc {
+&pmk8350_rtc {
 	nvmem-cells = <&rtc_offset>;
 	nvmem-cell-names = "offset";
 
 	status = "okay";
 };
 
-&pmk8280_sdam_6 {
+&pmk8350_sdam_6 {
 	status = "okay";
 
 	rtc_offset: rtc-offset@bc {
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 590400985055..7d61108daede 100644
--- a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
+++ b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
@@ -275,7 +275,7 @@  thermal-zones {
 		skin-temp-thermal {
 			polling-delay-passive = <250>;
 			polling-delay = <0>;
-			thermal-sensors = <&pmk8280_adc_tm 5>;
+			thermal-sensors = <&pmk8350_adc_tm 5>;
 
 			trips {
 				skin_temp_alert0: trip-point0 {
@@ -729,12 +729,12 @@  &pmc8280c_lpg {
 	status = "okay";
 };
 
-&pmk8280_adc_tm {
+&pmk8350_adc_tm {
 	status = "okay";
 
 	sys-therm@0 {
 		reg = <0>;
-		io-channels = <&pmk8280_vadc PM8350_ADC7_AMUX_THM1_100K_PU(1)>;
+		io-channels = <&pmk8350_vadc PM8350_ADC7_AMUX_THM1_100K_PU(1)>;
 		qcom,hw-settle-time-us = <200>;
 		qcom,avg-samples = <2>;
 		qcom,ratiometric;
@@ -742,7 +742,7 @@  sys-therm@0 {
 
 	sys-therm@1 {
 		reg = <1>;
-		io-channels = <&pmk8280_vadc PM8350_ADC7_AMUX_THM2_100K_PU(1)>;
+		io-channels = <&pmk8350_vadc PM8350_ADC7_AMUX_THM2_100K_PU(1)>;
 		qcom,hw-settle-time-us = <200>;
 		qcom,avg-samples = <2>;
 		qcom,ratiometric;
@@ -750,7 +750,7 @@  sys-therm@1 {
 
 	sys-therm@2 {
 		reg = <2>;
-		io-channels = <&pmk8280_vadc PM8350_ADC7_AMUX_THM3_100K_PU(1)>;
+		io-channels = <&pmk8350_vadc PM8350_ADC7_AMUX_THM3_100K_PU(1)>;
 		qcom,hw-settle-time-us = <200>;
 		qcom,avg-samples = <2>;
 		qcom,ratiometric;
@@ -758,7 +758,7 @@  sys-therm@2 {
 
 	sys-therm@3 {
 		reg = <3>;
-		io-channels = <&pmk8280_vadc PM8350_ADC7_AMUX_THM4_100K_PU(1)>;
+		io-channels = <&pmk8350_vadc PM8350_ADC7_AMUX_THM4_100K_PU(1)>;
 		qcom,hw-settle-time-us = <200>;
 		qcom,avg-samples = <2>;
 		qcom,ratiometric;
@@ -766,7 +766,7 @@  sys-therm@3 {
 
 	sys-therm@4 {
 		reg = <4>;
-		io-channels = <&pmk8280_vadc PM8350_ADC7_AMUX_THM1_100K_PU(3)>;
+		io-channels = <&pmk8350_vadc PM8350_ADC7_AMUX_THM1_100K_PU(3)>;
 		qcom,hw-settle-time-us = <200>;
 		qcom,avg-samples = <2>;
 		qcom,ratiometric;
@@ -774,7 +774,7 @@  sys-therm@4 {
 
 	sys-therm@5 {
 		reg = <5>;
-		io-channels = <&pmk8280_vadc PM8350_ADC7_AMUX_THM2_100K_PU(3)>;
+		io-channels = <&pmk8350_vadc PM8350_ADC7_AMUX_THM2_100K_PU(3)>;
 		qcom,hw-settle-time-us = <200>;
 		qcom,avg-samples = <2>;
 		qcom,ratiometric;
@@ -782,7 +782,7 @@  sys-therm@5 {
 
 	sys-therm@6 {
 		reg = <6>;
-		io-channels = <&pmk8280_vadc PM8350_ADC7_AMUX_THM3_100K_PU(3)>;
+		io-channels = <&pmk8350_vadc PM8350_ADC7_AMUX_THM3_100K_PU(3)>;
 		qcom,hw-settle-time-us = <200>;
 		qcom,avg-samples = <2>;
 		qcom,ratiometric;
@@ -790,29 +790,29 @@  sys-therm@6 {
 
 	sys-therm@7 {
 		reg = <7>;
-		io-channels = <&pmk8280_vadc PM8350_ADC7_AMUX_THM4_100K_PU(3)>;
+		io-channels = <&pmk8350_vadc PM8350_ADC7_AMUX_THM4_100K_PU(3)>;
 		qcom,hw-settle-time-us = <200>;
 		qcom,avg-samples = <2>;
 		qcom,ratiometric;
 	};
 };
 
-&pmk8280_pon_pwrkey {
+&pmk8350_pon_pwrkey {
 	status = "okay";
 };
 
-&pmk8280_pon_resin {
+&pmk8350_pon_resin {
 	status = "okay";
 };
 
-&pmk8280_rtc {
+&pmk8350_rtc {
 	nvmem-cells = <&rtc_offset>;
 	nvmem-cell-names = "offset";
 
 	status = "okay";
 };
 
-&pmk8280_sdam_6 {
+&pmk8350_sdam_6 {
 	status = "okay";
 
 	rtc_offset: rtc-offset@bc {
@@ -820,7 +820,7 @@  rtc_offset: rtc-offset@bc {
 	};
 };
 
-&pmk8280_vadc {
+&pmk8350_vadc {
 	status = "okay";
 
 	pmic-die-temp@3 {
diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-pmics.dtsi b/arch/arm64/boot/dts/qcom/sc8280xp-pmics.dtsi
index c35e7f6bd657..781fb6448a52 100644
--- a/arch/arm64/boot/dts/qcom/sc8280xp-pmics.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc8280xp-pmics.dtsi
@@ -51,70 +51,11 @@  trip1 {
 	};
 };
 
-&spmi_bus {
-	pmk8280: pmic@0 {
-		compatible = "qcom,pmk8350", "qcom,spmi-pmic";
-		reg = <0x0 SPMI_USID>;
-		#address-cells = <1>;
-		#size-cells = <0>;
-
-		pmk8280_pon: pon@1300 {
-			compatible = "qcom,pm8998-pon";
-			reg = <0x1300>;
-
-			pmk8280_pon_pwrkey: pwrkey {
-				compatible = "qcom,pmk8350-pwrkey";
-				interrupts-extended = <&spmi_bus 0x0 0x13 0x7 IRQ_TYPE_EDGE_BOTH>;
-				linux,code = <KEY_POWER>;
-				status = "disabled";
-			};
-
-			pmk8280_pon_resin: resin {
-				compatible = "qcom,pmk8350-resin";
-				interrupts-extended = <&spmi_bus 0x0 0x13 0x6 IRQ_TYPE_EDGE_BOTH>;
-				status = "disabled";
-			};
-		};
-
-		pmk8280_vadc: adc@3100 {
-			compatible = "qcom,spmi-adc7";
-			reg = <0x3100>;
-			interrupts-extended = <&spmi_bus 0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
-			#address-cells = <1>;
-			#size-cells = <0>;
-			#io-channel-cells = <1>;
-			status = "disabled";
-		};
-
-		pmk8280_adc_tm: adc-tm@3400 {
-			compatible = "qcom,spmi-adc-tm5-gen2";
-			reg = <0x3400>;
-			interrupts-extended = <&spmi_bus 0x0 0x34 0x0 IRQ_TYPE_EDGE_RISING>;
-			#address-cells = <1>;
-			#size-cells = <0>;
-			#thermal-sensor-cells = <1>;
-			status = "disabled";
-		};
-
-		pmk8280_rtc: rtc@6100 {
-			compatible = "qcom,pmk8350-rtc";
-			reg = <0x6100>, <0x6200>;
-			reg-names = "rtc", "alarm";
-			interrupts = <0x0 0x62 0x1 IRQ_TYPE_EDGE_RISING>;
-			wakeup-source;
-			status = "disabled";
-		};
-
-		pmk8280_sdam_6: nvram@8500 {
-			compatible = "qcom,spmi-sdam";
-			reg = <0x8500>;
-			#address-cells = <1>;
-			#size-cells = <1>;
-			ranges = <0 0x8500 0x100>;
-			status = "disabled";
-		};
-	};
+#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>;