From 6c819a0d4d975746a2fbf99d44bf0ba3f5729d4b Mon Sep 17 00:00:00 2001 From: Shyam Kumar Thella Date: Wed, 23 Dec 2020 11:26:42 +0530 Subject: [PATCH 1/3] ARM: dts: msm: Change address-cells to 1 for pm2250 SPMI addressing in msm-5.4 uses one cell (base) and size is set default to 0x100. So change accordingly for pm2250. Change-Id: If3c6fe392434d77d3ff16a88a7b1aae6fd45b226 --- qcom/pm2250.dtsi | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/qcom/pm2250.dtsi b/qcom/pm2250.dtsi index f9b8bb82e9a0..aa231533cbf6 100644 --- a/qcom/pm2250.dtsi +++ b/qcom/pm2250.dtsi @@ -13,17 +13,17 @@ qcom,pm2250@0 { compatible = "qcom,spmi-pmic"; reg = <0 SPMI_USID>; - #address-cells = <2>; + #address-cells = <1>; #size-cells = <0>; pm2250_revid: qcom,revid@100 { compatible = "qcom,qpnp-revid"; - reg = <0x100 0x100>; + reg = <0x100>; }; qcom,power-on@800 { compatible = "qcom,qpnp-power-on"; - reg = <0x800 0x100>; + reg = <0x800>; interrupts = <0x0 0x8 0x0 IRQ_TYPE_EDGE_BOTH>, <0x0 0x8 0x1 IRQ_TYPE_EDGE_BOTH>; interrupt-names = "kpdpwr", "resin"; @@ -47,7 +47,7 @@ pm2250_tz: qcom,temp-alarm@2400 { compatible = "qcom,spmi-temp-alarm"; - reg = <0x2400 0x100>; + reg = <0x2400>; interrupts = <0x0 0x24 0x0 IRQ_TYPE_EDGE_BOTH>; io-channels = <&pm2250_vadc ADC5_DIE_TEMP>; io-channel-names = "thermal"; @@ -57,7 +57,7 @@ pm2250_vadc: vadc@3100 { compatible = "qcom,spmi-adc5-lite"; - reg = <0x3100 0x100>; + reg = <0x3100>; reg-names = "adc5-usr-base"; #address-cells = <1>; #size-cells = <0>; @@ -158,7 +158,7 @@ pm2250_gpios: pinctrl@c000 { compatible = "qcom,spmi-gpio"; - reg = <0xc000 0xa00>; + reg = <0xc000>; interrupts = <0x0 0xc0 0 IRQ_TYPE_NONE>, <0x0 0xc1 0 IRQ_TYPE_NONE>, <0x0 0xc2 0 IRQ_TYPE_NONE>, @@ -204,7 +204,7 @@ qcom,qgauge@4800 { status = "okay"; - reg = <0x4800 0x100>; + reg = <0x4800>; interrupts = <0x0 0x48 0x2 IRQ_TYPE_EDGE_RISING>, <0x0 0x48 0x3 IRQ_TYPE_EDGE_RISING>, @@ -216,7 +216,7 @@ qcom,qg-sdam@b600 { status = "okay"; - reg = <0xb600 0x100>; + reg = <0xb600>; }; }; @@ -228,7 +228,7 @@ qcom,pmic-revid = <&pm2250_revid>; qcom,chgr@1000 { - reg = <0x1000 0x100>; + reg = <0x1000>; interrupts = <0x0 0x10 0x1 IRQ_TYPE_EDGE_RISING>, <0x0 0x10 0x0 IRQ_TYPE_EDGE_RISING>, @@ -242,7 +242,7 @@ }; qcom,dcdc@1100 { - reg = <0x1100 0x100>; + reg = <0x1100>; interrupts = <0x0 0x11 0x0 IRQ_TYPE_EDGE_RISING>, <0x0 0x11 0x1 IRQ_TYPE_EDGE_RISING>, @@ -258,7 +258,7 @@ }; qcom,batif@1200 { - reg = <0x1200 0x100>; + reg = <0x1200>; interrupts = <0x0 0x12 0x0 IRQ_TYPE_EDGE_BOTH>, <0x0 0x12 0x1 IRQ_TYPE_EDGE_BOTH>, @@ -274,7 +274,7 @@ }; qcom,usb@1300 { - reg = <0x1300 0x100>; + reg = <0x1300>; interrupts = <0x0 0x13 0x0 IRQ_TYPE_EDGE_BOTH>, <0x0 0x13 0x1 IRQ_TYPE_EDGE_BOTH>, @@ -292,7 +292,7 @@ }; qcom,typec@1500 { - reg = <0x1500 0x100>; + reg = <0x1500>; interrupts = <0x0 0x15 0x0 IRQ_TYPE_EDGE_BOTH>, <0x0 0x15 0x1 IRQ_TYPE_EDGE_BOTH>, @@ -312,7 +312,7 @@ }; qcom,misc@1600 { - reg = <0x1600 0x100>; + reg = <0x1600>; interrupts = <0x0 0x16 0x0 IRQ_TYPE_EDGE_RISING>, <0x0 0x16 0x1 IRQ_TYPE_EDGE_RISING>, @@ -332,7 +332,7 @@ }; qcom,schgm-flashlite@a600 { - reg = <0xa600 0x100>; + reg = <0xa600>; interrupts = <0x0 0xa6 0x2 IRQ_TYPE_EDGE_RISING>, <0x0 0xa6 0x5 IRQ_TYPE_EDGE_RISING>, @@ -350,19 +350,19 @@ pm2250_1: qcom,pm2250@1 { compatible = "qcom,spmi-pmic"; reg = <1 SPMI_USID>; - #address-cells = <2>; + #address-cells = <1>; #size-cells = <0>; pm2250_vib: qcom,vibrator@5600 { compatible = "qcom,qpnp-vibrator-ldo"; - reg = <0x5600 0x100>; + reg = <0x5600>; qcom,vib-ldo-volt-uv = <3000000>; qcom,disable-overdrive; }; pm2250_pwm1: qcom,pwms@bc00 { compatible = "qcom,pwm-lpg"; - reg = <0xbc00 0x100>; + reg = <0xbc00>; reg-names = "lpg-base"; qcom,num-lpg-channels = <1>; #pwm-cells = <2>; @@ -370,7 +370,7 @@ pm2250_pwm2: qcom,pwms@bd00 { compatible = "qcom,pwm-lpg"; - reg = <0xbd00 0x100>; + reg = <0xbd00>; reg-names = "lpg-base"; qcom,num-lpg-channels = <1>; #pwm-cells = <2>; @@ -378,7 +378,7 @@ pm2250_pwm3: qcom,pwms@be00 { compatible = "qcom,pwm-lpg"; - reg = <0xbe00 0x100>; + reg = <0xbe00>; reg-names = "lpg-base"; qcom,num-lpg-channels = <1>; #pwm-cells = <2>; From 3606f987e7b92f7d72124fc47fa2bcafcc064c15 Mon Sep 17 00:00:00 2001 From: Shyam Kumar Thella Date: Wed, 23 Dec 2020 11:30:01 +0530 Subject: [PATCH 2/3] ARM: dts: msm: Change DT configuration for PMIC GPIO device Couple of changes required to match with GPIO driver on msm-5.4 kernel 1. Compatible string should contain PMIC name 2. Need not explicitly list down all the PMIC GPIOs. It is provided as data in match table within the driver. Change-Id: I1b661cffee893779d9233b76bf5cb15fbb19ebc3 --- qcom/pm2250.dtsi | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/qcom/pm2250.dtsi b/qcom/pm2250.dtsi index aa231533cbf6..e22694c8414d 100644 --- a/qcom/pm2250.dtsi +++ b/qcom/pm2250.dtsi @@ -157,27 +157,12 @@ pm2250_gpios: pinctrl@c000 { - compatible = "qcom,spmi-gpio"; + compatible = "qcom,pm2250-gpio"; reg = <0xc000>; - interrupts = <0x0 0xc0 0 IRQ_TYPE_NONE>, - <0x0 0xc1 0 IRQ_TYPE_NONE>, - <0x0 0xc2 0 IRQ_TYPE_NONE>, - <0x0 0xc3 0 IRQ_TYPE_NONE>, - <0x0 0xc4 0 IRQ_TYPE_NONE>, - <0x0 0xc5 0 IRQ_TYPE_NONE>, - <0x0 0xc6 0 IRQ_TYPE_NONE>, - <0x0 0xc7 0 IRQ_TYPE_NONE>, - <0x0 0xc8 0 IRQ_TYPE_NONE>, - <0x0 0xc9 0 IRQ_TYPE_NONE>; - - interrupt-names = "pm2250_gpio1", "pm2250_gpio2", - "pm2250_gpio3", "pm2250_gpio4", - "pm2250_gpio5", "pm2250_gpio6", - "pm2250_gpio7", "pm2250_gpio8", - "pm2250_gpio9", "pm2250_gpio10"; - gpio-controller; #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; }; pm2250_rtc: qcom,pm2250_rtc { From a05aab455c3a8f6c4d144434944cf6c304a285da Mon Sep 17 00:00:00 2001 From: Shyam Kumar Thella Date: Wed, 23 Dec 2020 11:33:50 +0530 Subject: [PATCH 3/3] ARM: dts: msm: Add thermal zones for pm2250 Add thermal zones required for temp-alarm driver for pm2250 Change-Id: Ib5f8de6df281fa026f01dccbfaac3762b338ab9e --- qcom/pm2250.dtsi | 30 ++++++++++++++++++++++++++++++ qcom/scuba-iot.dtsi | 2 ++ 2 files changed, 32 insertions(+) diff --git a/qcom/pm2250.dtsi b/qcom/pm2250.dtsi index e22694c8414d..7865afd38967 100644 --- a/qcom/pm2250.dtsi +++ b/qcom/pm2250.dtsi @@ -370,3 +370,33 @@ }; }; }; + +&thermal_zones { + pm2250_tz { + polling-delay-passive = <100>; + polling-delay = <0>; + thermal-governor = "step_wise"; + thermal-sensors = <&pm2250_tz>; + wake-capable-sensor; + + trips { + pm2250_trip0: trip0 { + temperature = <95000>; + hysteresis = <0>; + type = "passive"; + }; + + pm2250_trip1: trip1 { + temperature = <115000>; + hysteresis = <0>; + type = "critical"; + }; + + trip2 { + temperature = <145000>; + hysteresis = <0>; + type = "critical"; + }; + }; + }; +}; diff --git a/qcom/scuba-iot.dtsi b/qcom/scuba-iot.dtsi index 20ef7dd9fb96..3ac31cd6c8d9 100644 --- a/qcom/scuba-iot.dtsi +++ b/qcom/scuba-iot.dtsi @@ -446,6 +446,8 @@ qcom,guard-memory; }; + thermal_zones: thermal-zones { }; + qfprom: qfprom@1b40000 { compatible = "qcom,qfprom"; reg = <0x1b40000 0x7000>;