From 309c39366147fe2bf155e5f1fb6816965c88e8ba Mon Sep 17 00:00:00 2001 From: Minghao Zhang Date: Wed, 4 Sep 2024 20:18:41 +0530 Subject: [PATCH 1/2] dt-bindings: thermal: Add a new property for bcl pmic5 This changes adds a new property for bcl pmic5 to enable a BCL peripheral based on different battery types and Rsense types. Change-Id: I68c1369319db598ccfd38faa09075aed113da7f2 Signed-off-by: Minghao Zhang --- bindings/thermal/qcom-bcl-pmic5.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/bindings/thermal/qcom-bcl-pmic5.yaml b/bindings/thermal/qcom-bcl-pmic5.yaml index 1ee636ab..a0c67869 100644 --- a/bindings/thermal/qcom-bcl-pmic5.yaml +++ b/bindings/thermal/qcom-bcl-pmic5.yaml @@ -54,6 +54,20 @@ properties: - const: bcl-lvl1 - const: bcl-lvl2 + qcom,bcl-mon-vbat-only: + type: boolean + description: | + When this flag is defined, the BCL driver will only monitor + Vbat or both Ibat and Vbat based on runtime battery type and + Rsense input. + + qcom,bcl-mon-ibat-only: + type: boolean + description: | + When this flag is defined, the BCL driver will only monitor + Ibat or don't monitor anything based on runtime battery type + and Rsense input. + qcom,pmic7-threshold: type: boolean description: | @@ -79,5 +93,6 @@ examples: <0x2 0x42 0x1 IRQ_TYPE_NONE>; interrupt-names = "bcl-lvl0", "bcl-lvl1"; + qcom,bcl-mon-vbat-only; qcom,pmic7-threshold; }; From d0020aef6feb9f001353dfdd23edb5ed40572fb3 Mon Sep 17 00:00:00 2001 From: Minghao Zhang Date: Fri, 6 Sep 2024 14:54:41 +0530 Subject: [PATCH 2/2] ARM: dts: qcom: Add BCL2 node and thermal zone mitigations for sun This change adds to enable BCL2 node; adds bcl thermal zone mitigations and cooling maps for pmih010x. Change-Id: I4e4cef9a1d7064afd32ee1422bb2e5a23a31689a Signed-off-by: Minghao Zhang --- qcom/pmih010x.dtsi | 14 ++++ qcom/sun-qrd-sku1.dtsi | 149 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 163 insertions(+) diff --git a/qcom/pmih010x.dtsi b/qcom/pmih010x.dtsi index 6f31c3c3..42ae38ea 100644 --- a/qcom/pmih010x.dtsi +++ b/qcom/pmih010x.dtsi @@ -250,6 +250,20 @@ #thermal-sensor-cells = <1>; }; + pmih010x_bcl2: bcl@4900 { + compatible = "qcom,bcl-v5"; + reg = <0x4900 0x100>; + interrupts = <0x7 0x49 0x0 IRQ_TYPE_NONE>, + <0x7 0x49 0x1 IRQ_TYPE_NONE>, + <0x7 0x49 0x2 IRQ_TYPE_NONE>; + interrupt-names = "bcl-lvl0", + "bcl-lvl1", + "bcl-lvl2"; + qcom,pmic7-threshold; + #thermal-sensor-cells = <1>; + status = "disabled"; + }; + bcl_soc: bcl-soc { compatible = "qcom,msm-bcl-soc"; #thermal-sensor-cells = <0>; diff --git a/qcom/sun-qrd-sku1.dtsi b/qcom/sun-qrd-sku1.dtsi index 5123f1a8..c80165b4 100644 --- a/qcom/sun-qrd-sku1.dtsi +++ b/qcom/sun-qrd-sku1.dtsi @@ -96,3 +96,152 @@ &ibat_lvl1 { temperature = <7000>; }; + +&pmih010x_bcl { + qcom,bcl-mon-vbat-only; + status = "okay"; +}; + +&pmih010x_bcl2 { + qcom,bcl-mon-ibat-only; + status = "okay"; +}; + +&thermal_zones { + pmih010x-ibat2-lvl0 { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&pmih010x_bcl2 0>; + + trips { + ibat2_lvl0:ibat2-lvl0 { + temperature = <6500>; + hysteresis = <200>; + type = "passive"; + }; + }; + }; + + pmih010x-ibat2-lvl1 { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&pmih010x_bcl2 1>; + + trips { + ibat2_lvl1:ibat2-lvl1 { + temperature = <7000>; + hysteresis = <200>; + type = "passive"; + }; + }; + }; + + pmih010x-bcl2-lvl0 { + polling-delay-passive = <50>; + polling-delay = <0>; + thermal-sensors = <&pmih010x_bcl2 5>; + + trips { + thermal-engine-trip { + temperature = <100>; + hysteresis = <0>; + type = "passive"; + }; + + thermal-hal-trip { + temperature = <100>; + hysteresis = <0>; + type = "passive"; + }; + + b_bcl2_lvl0: b-bcl2-lvl0 { + temperature = <1>; + hysteresis = <1>; + type = "passive"; + }; + }; + + cooling-maps { + lbat2_modem0 { + trip = <&b_bcl2_lvl0>; + cooling-device = <&modem_bcl 1 1>; + }; + + lbat2_gpu0 { + trip = <&b_bcl2_lvl0>; + cooling-device = <&msm_gpu 1 1>; + }; + }; + }; + + pmih010x-bcl2-lvl1 { + polling-delay-passive = <50>; + polling-delay = <0>; + thermal-sensors = <&pmih010x_bcl2 6>; + + trips { + thermal-engine-trip { + temperature = <100>; + hysteresis = <0>; + type = "passive"; + }; + + thermal-hal-trip { + temperature = <100>; + hysteresis = <0>; + type = "passive"; + }; + + b_bcl2_lvl1: b-bcl2-lvl1 { + temperature = <1>; + hysteresis = <1>; + type = "passive"; + }; + }; + + cooling-maps { + lbat2_modem1 { + trip = <&b_bcl2_lvl1>; + cooling-device = <&modem_bcl 2 2>; + }; + + lbat2_gpu1 { + trip = <&b_bcl2_lvl1>; + cooling-device = <&msm_gpu 2 2>; + }; + }; + }; + + pmih010x-bcl2-lvl2 { + polling-delay-passive = <50>; + polling-delay = <0>; + thermal-sensors = <&pmih010x_bcl2 7>; + + trips { + thermal-engine-trip { + temperature = <100>; + hysteresis = <0>; + type = "passive"; + }; + + thermal-hal-trip { + temperature = <100>; + hysteresis = <0>; + type = "passive"; + }; + + b_bcl2_lvl2: b-bcl2-lvl2 { + temperature = <1>; + hysteresis = <1>; + type = "passive"; + }; + }; + + cooling-maps { + lbat2_gpu2 { + trip = <&b_bcl2_lvl2>; + cooling-device = <&msm_gpu 3 3>; + }; + }; + }; +};