power: qpnp-charger: reset unsettled flag upon insertion

There could be a potential race between USB removal and userspace
code setting the input current settled property. A state where
USB was removed but input current settled property is set was observed.

Fix this by resetting input current settled property while USB is
inserted as well as USB removed.

Moreover prevent setting of this flag when USB is not present.

CRs-Fixed: 708352
Change-Id: I45196ce5ab0f7ad2b0ccefd33ba9d707f10aea55
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
1 file changed