usb: dwc3: omap: improve extcon initialization
authorMarcel Hamer <marcel@solidxs.se>
Tue, 27 Apr 2021 12:21:18 +0000 (14:21 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 May 2021 08:57:40 +0000 (10:57 +0200)
commitec9486091c2e2e8068259d3c3711046bad56f544
treee04bfb2bc389489d7f934a571113066f2441a1cb
parent0b948f3c2149680b38757257d37406777338b0dc
usb: dwc3: omap: improve extcon initialization

commit e17b02d4970913233d543c79c9c66e72cac05bdd upstream.

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>
drivers/usb/dwc3/dwc3-omap.c