From 41dba13c5b543475697817aa039b7d96f4c6c255 Mon Sep 17 00:00:00 2001 From: Albert I Date: Fri, 22 May 2020 14:11:52 +0800 Subject: [PATCH] sakura-daisy: Update default and thermal mitigation charging currents Default values brought up from 3.18 don't go fairly well with 4.9 as device could go and heat up beyond 45 degrees Celcius and eventually stop charging due to how bad thermal mitigation voltages were set. In drivers/power/supply/qcom/qpnp-smbcharger.c: Make sure it's set like this: static int smbchg_default_hvdcp_icl_ma = 2000; static int smbchg_default_dcp_icl_ma = 2000; As Xiaomi uses default value of 2A on stock. It's rated at 2A max, if open your phone, it says it in the label. This should help mitigating this issue. [ TogoFire: Adapt to sakura-daisy ] Signed-off-by: Albert I Change-Id: Idbb707de69c44d0e122e82bf8b34b888020ddaae Signed-off-by: TogoFire --- arch/arm64/boot/dts/qcom/sakura/sakura-qrd.dtsi | 2 +- drivers/power/supply/qcom/qpnp-smbcharger.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/sakura/sakura-qrd.dtsi b/arch/arm64/boot/dts/qcom/sakura/sakura-qrd.dtsi index 561f8f5f2e6fe..1f769ae8ab196 100644 --- a/arch/arm64/boot/dts/qcom/sakura/sakura-qrd.dtsi +++ b/arch/arm64/boot/dts/qcom/sakura/sakura-qrd.dtsi @@ -350,7 +350,7 @@ /delete-property/ qcom,chg-led-support; /delete-property/ qcom,external-typec; /delete-property/ qcom,typec-psy-name; - qcom,thermal-mitigation = <3000 2500 2000 2000 1000 1000 0>; + qcom,thermal-mitigation = <1500 1200 900 600 300 0>; }; &pmi8950_fg { diff --git a/drivers/power/supply/qcom/qpnp-smbcharger.c b/drivers/power/supply/qcom/qpnp-smbcharger.c index efc79ee4d3831..04a44772359ec 100644 --- a/drivers/power/supply/qcom/qpnp-smbcharger.c +++ b/drivers/power/supply/qcom/qpnp-smbcharger.c @@ -453,7 +453,7 @@ module_param_named( int, 00600 ); -static int smbchg_default_hvdcp_icl_ma = 2500; +static int smbchg_default_hvdcp_icl_ma = 2000; module_param_named( default_hvdcp_icl_ma, smbchg_default_hvdcp_icl_ma, int, 00600