summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Troast <ntroast@codeaurora.org>2016-12-08 14:23:27 -0800
committerNicholas Troast <ntroast@codeaurora.org>2017-01-26 13:40:24 -0800
commit5a3b006e3e01ed40bf07205cabee73648f382a28 (patch)
tree87fc3aaa59cb52c2b1c92c8e43968f79d72b3e33
parent314869eb56763d34f91d5483b0d510267894fadd (diff)
smb138x-charger: enable stacked diode
A part of the ADC circuit does not work as expected which causes die temp inaccuracies. Enable the stacked diode circuit to bypass the non-working circuit which fixes the die temp accuracy. Change-Id: I2537ecd9190d3260396a847d3fd907634f874eb7 Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
-rw-r--r--drivers/power/supply/qcom/smb138x-charger.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/power/supply/qcom/smb138x-charger.c b/drivers/power/supply/qcom/smb138x-charger.c
index ed76a585ed03..c836e780fc86 100644
--- a/drivers/power/supply/qcom/smb138x-charger.c
+++ b/drivers/power/supply/qcom/smb138x-charger.c
@@ -39,6 +39,9 @@
#define DEAD_TIME_MASK GENMASK(7, 4)
#define HIGH_DEAD_TIME_MASK GENMASK(7, 4)
+#define SMB2CHG_DC_TM_SREFGEN (DCIN_BASE + 0xE2)
+#define STACKED_DIODE_EN_BIT BIT(2)
+
enum {
OOB_COMP_WA_BIT = BIT(0),
};
@@ -1216,6 +1219,13 @@ static int smb138x_slave_probe(struct smb138x *chip)
goto cleanup;
}
+ /* enable stacked diode */
+ rc = smblib_write(chg, SMB2CHG_DC_TM_SREFGEN, STACKED_DIODE_EN_BIT);
+ if (rc < 0) {
+ pr_err("Couldn't enable stacked diode rc=%d\n", rc);
+ return rc;
+ }
+
rc = smb138x_init_parallel_psy(chip);
if (rc < 0) {
pr_err("Couldn't initialize parallel psy rc=%d\n", rc);