From 4bd9556c017dad244c4280b38bded930873fce04 Mon Sep 17 00:00:00 2001 From: Cesar Santos Date: Mon, 7 Oct 2019 15:07:57 -0300 Subject: [PATCH] power: qpnp-smbcharger-mmi: Allow force higher temp limits For testing purposes and due to continuous hardware modifications, some temperature values may provide incorrect values due to thermistor positioning or calibration. Hence, performing runtime temperature limitation sets for internal testing can avoid unexpected behaviors, l(CR) charging speed limitations. Change-Id: I5016cd2ddeb7c8c3afbeb1277a208dbc80853709 Signed-off-by: Cesar Santos Reviewed-on: https://gerrit.mot.com/1432920 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Ling Jin Submit-Approved: Jira Key --- .../power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c b/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c index 332f16026cc6..90b587f07dfd 100644 --- a/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c +++ b/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c @@ -706,10 +706,12 @@ static ssize_t force_max_chrg_temp_store(struct device *dev, return -ENODEV; } - if ((mode >= MIN_MAX_TEMP_C) && (mode <= MAX_TEMP_C)) - mmi_chip->max_chrg_temp = mode; - else - mmi_chip->max_chrg_temp = MAX_TEMP_C; + // MMI_STOPSHIP revert this commit later: safer to have limits. Temporary for Burton EVT1 + if ((mode < MIN_MAX_TEMP_C) || (mode > MAX_TEMP_C)) + pr_warn("New value %d is outside of suggested limits: min %d, max %d", + mode, MIN_MAX_TEMP_C, MAX_TEMP_C); + + mmi_chip->max_chrg_temp = mode; return r ? r : count; }