Skip to content

Commit e17b02d

Browse files
marcel-hamergregkh
authored andcommitted
usb: dwc3: omap: improve extcon initialization
When extcon is used in combination with dwc3, it is assumed that the dwc3 registers are untouched and as such are only configured if VBUS is valid or ID is tied to ground. In case VBUS is not valid or ID is floating, the registers are not configured as such during driver initialization, causing a wrong default state during boot. If the registers are not in a default state, because they are for instance touched by a boot loader, this can cause for a kernel error. Signed-off-by: Marcel Hamer <marcel@solidxs.se> Link: https://lore.kernel.org/r/20210427122118.1948340-1-marcel@solidxs.se Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent b9a0866 commit e17b02d

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

drivers/usb/dwc3/dwc3-omap.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,8 +437,13 @@ static int dwc3_omap_extcon_register(struct dwc3_omap *omap)
437437

438438
if (extcon_get_state(edev, EXTCON_USB) == true)
439439
dwc3_omap_set_mailbox(omap, OMAP_DWC3_VBUS_VALID);
440+
else
441+
dwc3_omap_set_mailbox(omap, OMAP_DWC3_VBUS_OFF);
442+
440443
if (extcon_get_state(edev, EXTCON_USB_HOST) == true)
441444
dwc3_omap_set_mailbox(omap, OMAP_DWC3_ID_GROUND);
445+
else
446+
dwc3_omap_set_mailbox(omap, OMAP_DWC3_ID_FLOAT);
442447

443448
omap->edev = edev;
444449
}

0 commit comments

Comments
 (0)