extcon: axp288: Fix possibly reporting 2 cables in state true
commit5d2199ea340d158587b09e2ab95908c210fd4742
authorHans de Goede <hdegoede@redhat.com>
Mon, 19 Dec 2016 00:13:09 +0000 (19 01:13 +0100)
committerChanwoo Choi <cw00.choi@samsung.com>
Mon, 9 Jan 2017 01:04:10 +0000 (9 10:04 +0900)
tree0df9f2a7c9793dc4c37eacae6424688c5101a187
parent3fe1e0e2ab509863c1e9809a085508d8bce3e079
extcon: axp288: Fix possibly reporting 2 cables in state true

When the charger type changes from e.g. SDP to CDP, without Vbus being
seen as low in between axp288_handle_chrg_det_event would set the state
for the new cable type to true, without clearing the state of the
previous cable type to false.

This commit fixes this and also gets rid of the function local static
cable variable, properly storing all drv state in the axp288_extcon_info
struct.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
drivers/extcon/extcon-axp288.c