summaryrefslogtreecommitdiffstats
path: root/drivers/extcon/extcon-axp288.c
diff options
context:
space:
mode:
authorBaolin Wang <baolin.wang@linaro.org>2016-12-21 01:51:26 -0500
committerChanwoo Choi <cw00.choi@samsung.com>2017-01-08 20:04:11 -0500
commit5298b8365832e13158e41e205a31a9505eef4c94 (patch)
tree6250931e7e423296fa7dbd4826bc16c4f67242df /drivers/extcon/extcon-axp288.c
parentdb6228612ce297949621a62e9d2331ee55016778 (diff)
extcon: axp288: Set EXTCON_USB when EXTCON_CHG_USB_SDP was set
According to the documentation, we should set the EXTCON_USB when one SDP charger connector was reported. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Diffstat (limited to 'drivers/extcon/extcon-axp288.c')
-rw-r--r--drivers/extcon/extcon-axp288.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/extcon/extcon-axp288.c b/drivers/extcon/extcon-axp288.c
index 3e145e2a4860..f4fd03e58e37 100644
--- a/drivers/extcon/extcon-axp288.c
+++ b/drivers/extcon/extcon-axp288.c
@@ -96,6 +96,7 @@ static const unsigned int axp288_extcon_cables[] = {
96 EXTCON_CHG_USB_SDP, 96 EXTCON_CHG_USB_SDP,
97 EXTCON_CHG_USB_CDP, 97 EXTCON_CHG_USB_CDP,
98 EXTCON_CHG_USB_DCP, 98 EXTCON_CHG_USB_DCP,
99 EXTCON_USB,
99 EXTCON_NONE, 100 EXTCON_NONE,
100}; 101};
101 102
@@ -206,8 +207,15 @@ no_vbus:
206 : EXTCON_GPIO_MUX_SEL_PMIC); 207 : EXTCON_GPIO_MUX_SEL_PMIC);
207 208
208 extcon_set_state_sync(info->edev, info->previous_cable, false); 209 extcon_set_state_sync(info->edev, info->previous_cable, false);
210 if (info->previous_cable == EXTCON_CHG_USB_SDP)
211 extcon_set_state_sync(info->edev, EXTCON_USB, false);
212
209 if (vbus_attach) { 213 if (vbus_attach) {
210 extcon_set_state_sync(info->edev, cable, vbus_attach); 214 extcon_set_state_sync(info->edev, cable, vbus_attach);
215 if (cable == EXTCON_CHG_USB_SDP)
216 extcon_set_state_sync(info->edev, EXTCON_USB,
217 vbus_attach);
218
211 info->previous_cable = cable; 219 info->previous_cable = cable;
212 } 220 }
213 221