From 5889409334012fe09123b66d050f714a02a2229a Mon Sep 17 00:00:00 2001 From: Yonghua Yan Date: Tue, 28 May 2019 23:25:33 +0800 Subject: [PATCH] power: Disable HW JEITA for PMI632 As the h/w JEITA is enable by default, which will impact the thermal charge profile in qpnp-smbcharger-mmi driver, so disable it. Since the h/w JEITA is not used, and mmi thermal charge profile is used, the battery health in qpnp-smbcharger-mmi driver should be used as the battery health property. Change-Id: I53b8a7739f6c94307e076aad6e9234a3149db494 Signed-off-by: Yonghua Yan Reviewed-on: https://gerrit.mot.com/1362570 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Kenneth Kessler Submit-Approved: Jira Key --- drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c b/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c index 4b3b53763672..cbafe9b9a2d6 100644 --- a/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c +++ b/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c @@ -3055,6 +3055,12 @@ static int batt_get_prop(struct power_supply *psy, case POWER_SUPPLY_PROP_CYCLE_COUNT: val->intval = chip->cycles / 100; break; + case POWER_SUPPLY_PROP_HEALTH: + if (chip->max_main_psy && chip->max_flip_psy) + val->intval = chip->sm_param[MAIN_BATT].batt_health; + else + val->intval = chip->sm_param[BASE_BATT].batt_health; + break; case POWER_SUPPLY_PROP_TEMP: if (chip->max_main_psy && chip->max_flip_psy) { union power_supply_propval main_psy_val; @@ -3549,7 +3555,10 @@ static int smb_mmi_probe(struct platform_device *pdev) if (smblib_masked_write_mmi(chip, LEGACY_CABLE_CFG_REG, 0xFF, 0)) mmi_err(chip, "SMBMMI: Could Not set Legacy Cable CFG\n"); + } + if (chip->smb_version == PM8150B_SUBTYPE || + chip->smb_version == PMI632_SUBTYPE) { /* Ensure SW JEITA is DISABLED */ pval.intval = 0; power_supply_set_property(chip->qcom_psy,