power: qpnp-fg-gen4: Fix enabling parallel current measurement
'Commit 1b7e5a86 ("power: qpnp-fg-gen4: Enable parallel charging current measurement")' modified BATT_INFO_FG_CNV_CHAR_CFG to enable parallel charging current measurement which is essential for calculating state of charge (SOC) accurately. However, if SMB_MEASURE_EN_BIT is set when FG HW is in the middle of ADC conversions, it can cause ADC to get locked up without an end of conversion (EOC). Hence that change got reverted. Re-enable parallel current measurement as follows. - Configure PEEK_MUX to output ALG active signal on MEM_ATTN interrupt - Wait for MEM_ATTN interrupt - Modify SMB_MEASURE_EN_BIT in BATT_INFO_FG_CNV_CHAR_CFG Also, configure SMB_MEASURE_EN_BIT dynamically so that parallel current summing gets enabled upon charger insertion and disabled upon charger removal or charge termination. Change-Id: I81289127eeda0af66e11da3290d1b596301becda Signed-off-by:Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Loading
Please register or sign in to comment