OSDN Git Service

qcom: qpnp-smb2: Reset switcher_power_ok irq count when USBIN_UV fires
authorSubbaraman Narayanamurthy <subbaram@codeaurora.org>
Tue, 7 Feb 2017 00:33:12 +0000 (16:33 -0800)
committerSubbaraman Narayanamurthy <subbaram@codeaurora.org>
Sat, 11 Feb 2017 00:57:58 +0000 (16:57 -0800)
commit6f4dec2b0c316b241d98c15211512d96fd977b5d
tree6194cec0aa0a0c443e97b8b4b4fb4a6c0a3a1c62
parent2b9d6a362f9ae5f7e2228e3c1df9b9cf56417b7c
qcom: qpnp-smb2: Reset switcher_power_ok irq count when USBIN_UV fires

Currently when 3 switcher_power_ok interrupts are seen within a
second, the driver thinks that the switcher is reverse boosting
and suspends USB input path.

However, switcher_power_ok could happen 3 times within a second
while AICL is run from a charger collapse, a valid usecase which
ends up in an USB suspended state.

Note that AICL run caused switcher_power_ok is accompanied by an
USBIN_UV interrupt. Use that to distinguish reverse boost Vs AICL
runs. In particular, reset the switcher_power_ok interrupt count
updated by storm_watch when an USBIN_UV interrupt is seen.

Change-Id: I6817c66319f9af03ac28324a8d863876fdadafb3
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
drivers/power/supply/qcom/qpnp-smb2.c
drivers/power/supply/qcom/smb-lib.c
drivers/power/supply/qcom/smb-lib.h