power: qpnp-smb5: Add lock for USBIN VADC reads

The USBIN_V ADC voltage can be read by multiple clients
which could lead to a race while storing/re-storing the
ADC_EN register and end up incorrectly configuring it.
This can lead to the charger ADC channels being completely
disabled and mis-triggering the thermal regulation impacting
ICL.

Fix it by adding a mutex while accessing it.

Change-Id: I6ca2f48dec2ff57e9395bfefc8c843c2e0650442
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
2 files changed