extcon: axp288: Set EXTCON_USB when EXTCON_CHG_USB_SDP was set
authorBaolin Wang <baolin.wang@linaro.org>
Wed, 21 Dec 2016 06:51:26 +0000 (15:51 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Mon, 9 Jan 2017 01:04:11 +0000 (10:04 +0900)
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>
drivers/extcon/extcon-axp288.c

index 3e145e2a486098d1e006e452cfa78e9ac6ce573f..f4fd03e58e37292235284506433b3d5efc928b90 100644 (file)
@@ -96,6 +96,7 @@ static const unsigned int axp288_extcon_cables[] = {
        EXTCON_CHG_USB_SDP,
        EXTCON_CHG_USB_CDP,
        EXTCON_CHG_USB_DCP,
+       EXTCON_USB,
        EXTCON_NONE,
 };
 
@@ -206,8 +207,15 @@ no_vbus:
                                        : EXTCON_GPIO_MUX_SEL_PMIC);
 
        extcon_set_state_sync(info->edev, info->previous_cable, false);
+       if (info->previous_cable == EXTCON_CHG_USB_SDP)
+               extcon_set_state_sync(info->edev, EXTCON_USB, false);
+
        if (vbus_attach) {
                extcon_set_state_sync(info->edev, cable, vbus_attach);
+               if (cable == EXTCON_CHG_USB_SDP)
+                       extcon_set_state_sync(info->edev, EXTCON_USB,
+                                               vbus_attach);
+
                info->previous_cable = cable;
        }