]> www.infradead.org Git - users/jedix/linux-maple.git/commit
usb: dwc2: Implement recovery after PM domain off
authorStefan Wahren <wahrenst@gmx.net>
Mon, 17 Feb 2025 13:41:32 +0000 (14:41 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Feb 2025 14:15:54 +0000 (15:15 +0100)
commitba6e518d136b25b340ddedb97a79db5642e4ed7f
tree124618833a10c1a1830df5a9c42c6bb70357bd46
parent8b7a1b3da2e290bcbe8024519c86ddf1aa2096e8
usb: dwc2: Implement recovery after PM domain off

According to the dt-bindings there are some platforms, which have a
dedicated USB power domain for DWC2 IP core supply. If the power domain
is switched off during system suspend then all USB register will lose
their settings.

Use GUSBCFG_TOUTCAL as a canary to detect that the power domain has
been powered off during suspend. Since the GOTGCTL_CURMODE_HOST doesn't
match on all platform with the current mode, additionally backup
GINTSTS. This works reliable to decide which registers should be
restored.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20250217134132.36786-4-wahrenst@gmx.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc2/core.c
drivers/usb/dwc2/core.h
drivers/usb/dwc2/platform.c