|
Takashi Iwai |
75ab01 |
From e17b02d4970913233d543c79c9c66e72cac05bdd Mon Sep 17 00:00:00 2001
|
|
Takashi Iwai |
75ab01 |
From: Marcel Hamer <marcel@solidxs.se>
|
|
Takashi Iwai |
75ab01 |
Date: Tue, 27 Apr 2021 14:21:18 +0200
|
|
Takashi Iwai |
75ab01 |
Subject: [PATCH] usb: dwc3: omap: improve extcon initialization
|
|
Takashi Iwai |
75ab01 |
Git-commit: e17b02d4970913233d543c79c9c66e72cac05bdd
|
|
Takashi Iwai |
75ab01 |
Patch-mainline: v5.13-rc2
|
|
Takashi Iwai |
75ab01 |
References: git-fixes
|
|
Takashi Iwai |
75ab01 |
|
|
Takashi Iwai |
75ab01 |
When extcon is used in combination with dwc3, it is assumed that the dwc3
|
|
Takashi Iwai |
75ab01 |
registers are untouched and as such are only configured if VBUS is valid
|
|
Takashi Iwai |
75ab01 |
or ID is tied to ground.
|
|
Takashi Iwai |
75ab01 |
|
|
Takashi Iwai |
75ab01 |
In case VBUS is not valid or ID is floating, the registers are not
|
|
Takashi Iwai |
75ab01 |
configured as such during driver initialization, causing a wrong
|
|
Takashi Iwai |
75ab01 |
default state during boot.
|
|
Takashi Iwai |
75ab01 |
|
|
Takashi Iwai |
75ab01 |
If the registers are not in a default state, because they are for
|
|
Takashi Iwai |
75ab01 |
instance touched by a boot loader, this can cause for a kernel error.
|
|
Takashi Iwai |
75ab01 |
|
|
Takashi Iwai |
75ab01 |
Signed-off-by: Marcel Hamer <marcel@solidxs.se>
|
|
Takashi Iwai |
75ab01 |
Link: https://lore.kernel.org/r/20210427122118.1948340-1-marcel@solidxs.se
|
|
Takashi Iwai |
75ab01 |
Cc: stable <stable@vger.kernel.org>
|
|
Takashi Iwai |
75ab01 |
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
Takashi Iwai |
75ab01 |
Acked-by: Takashi Iwai <tiwai@suse.de>
|
|
Takashi Iwai |
75ab01 |
|
|
Takashi Iwai |
75ab01 |
---
|
|
Takashi Iwai |
75ab01 |
drivers/usb/dwc3/dwc3-omap.c | 5 +++++
|
|
Takashi Iwai |
75ab01 |
1 file changed, 5 insertions(+)
|
|
Takashi Iwai |
75ab01 |
|
|
Takashi Iwai |
75ab01 |
diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
|
|
Takashi Iwai |
75ab01 |
index 3db17806e92e..e196673f5c64 100644
|
|
Takashi Iwai |
75ab01 |
--- a/drivers/usb/dwc3/dwc3-omap.c
|
|
Takashi Iwai |
75ab01 |
+++ b/drivers/usb/dwc3/dwc3-omap.c
|
|
Takashi Iwai |
75ab01 |
@@ -437,8 +437,13 @@ static int dwc3_omap_extcon_register(struct dwc3_omap *omap)
|
|
Takashi Iwai |
75ab01 |
|
|
Takashi Iwai |
75ab01 |
if (extcon_get_state(edev, EXTCON_USB) == true)
|
|
Takashi Iwai |
75ab01 |
dwc3_omap_set_mailbox(omap, OMAP_DWC3_VBUS_VALID);
|
|
Takashi Iwai |
75ab01 |
+ else
|
|
Takashi Iwai |
75ab01 |
+ dwc3_omap_set_mailbox(omap, OMAP_DWC3_VBUS_OFF);
|
|
Takashi Iwai |
75ab01 |
+
|
|
Takashi Iwai |
75ab01 |
if (extcon_get_state(edev, EXTCON_USB_HOST) == true)
|
|
Takashi Iwai |
75ab01 |
dwc3_omap_set_mailbox(omap, OMAP_DWC3_ID_GROUND);
|
|
Takashi Iwai |
75ab01 |
+ else
|
|
Takashi Iwai |
75ab01 |
+ dwc3_omap_set_mailbox(omap, OMAP_DWC3_ID_FLOAT);
|
|
Takashi Iwai |
75ab01 |
|
|
Takashi Iwai |
75ab01 |
omap->edev = edev;
|
|
Takashi Iwai |
75ab01 |
}
|
|
Takashi Iwai |
75ab01 |
--
|
|
Takashi Iwai |
75ab01 |
2.26.2
|
|
Takashi Iwai |
75ab01 |
|