From 0f527600eab9ff6a09ccd3d781afe4760d8cc663 Mon Sep 17 00:00:00 2001 From: Harry Yang Date: Mon, 29 Aug 2016 11:46:43 -0700 Subject: [PATCH] qcom-charger: smb2: configure stat pin for parallel charging Currently the PMI stat pin is configured to output IRQ and SW override status. Parallel charging requires the stat pin for parallel enable status and under the control of HW, and hence the change. CRs-Fixed: 1060633 Change-Id: Ie93f874b90b5aed0a66e97186e4f1d69a1275c8b Signed-off-by: Harry Yang --- drivers/power/qcom-charger/qpnp-smb2.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/power/qcom-charger/qpnp-smb2.c b/drivers/power/qcom-charger/qpnp-smb2.c index 90a93064ca84..7a9bc242293e 100644 --- a/drivers/power/qcom-charger/qpnp-smb2.c +++ b/drivers/power/qcom-charger/qpnp-smb2.c @@ -840,6 +840,16 @@ static int smb2_init_hw(struct smb2 *chip) return rc; } + /* configure PMI stat output to enable and disable parallel charging */ + rc = smblib_masked_write(chg, STAT_CFG_REG, + STAT_PARALLEL_CFG_BIT | STAT_SW_OVERRIDE_CFG_BIT, + STAT_PARALLEL_CFG_BIT); + if (rc < 0) { + dev_err(chg->dev, + "Couldn't configure signal for parallel rc=%d\n", rc); + return rc; + } + return rc; }