Skip to content

Commit effdf2b

Browse files
jwrdegoedegregkh
authored andcommitted
extcon: axp288: Use vbus-valid instead of -present to determine cable presence
[ Upstream commit 5757aca10146061befd168dab37fb0db1ccd8f73 ] The vbus-present bit in the power status register also gets set to 1 when a usb-host cable (id-pin shorted to ground) is plugged in and a 5v boost converter is supplying 5v to the otg usb bus. This causes a "disconnect or unknown or ID event" warning in dmesg as well as the extcon device to report the last detected charger cable type as being connected even though none is connected. This commit switches to checking the vbus-valid bit instead, which is only 1 when both vbus is present and the vbus-path is enabled in the vbus-path control register (the vbus-path gets disabled when a usb-host cable is detected, to avoid the pmic drawing power from the 5v boost converter). Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 5603b10 commit effdf2b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/extcon/extcon-axp288.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ static int axp288_handle_chrg_det_event(struct axp288_extcon_info *info)
168168
return ret;
169169
}
170170

171-
vbus_attach = (pwr_stat & PS_STAT_VBUS_PRESENT);
171+
vbus_attach = (pwr_stat & PS_STAT_VBUS_VALID);
172172
if (!vbus_attach)
173173
goto notify_otg;
174174

0 commit comments

Comments
 (0)