diff options
author | Théo Lebrun <theo.lebrun@bootlin.com> | 2025-02-05 18:36:54 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-03-14 09:18:03 +0100 |
commit | 3a85c10115407588fad696d6c121d54cd5ba5d72 (patch) | |
tree | fb7ab79f9988f5e337da577b7ffc5a0e9398f48e | |
parent | 668cc6bc1178ac94a6ff0eba3a9e8be59f89c318 (diff) |
usb: host: cdns3: forward lost power information to xhci
cdns3-plat can know if power was lost across system-wide suspend.
Forward that information:
- Grab the lost_power bool from cdns_role_driver::resume(). Store it
into the power_lost field in struct xhci_plat_priv.
- xhci-plat will call xhci_resume() with that value (ORed to whether we
are in a hibernation restore).
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
Link: https://lore.kernel.org/r/20250205-s2r-cdns-v7-9-13658a271c3c@bootlin.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/cdns3/host.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/usb/cdns3/host.c b/drivers/usb/cdns3/host.c index 7ba760ee62e3..f0df114c2b53 100644 --- a/drivers/usb/cdns3/host.c +++ b/drivers/usb/cdns3/host.c @@ -138,6 +138,16 @@ static void cdns_host_exit(struct cdns *cdns) cdns_drd_host_off(cdns); } +static int cdns_host_resume(struct cdns *cdns, bool power_lost) +{ + struct usb_hcd *hcd = platform_get_drvdata(cdns->host_dev); + struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd); + + priv->power_lost = power_lost; + + return 0; +} + int cdns_host_init(struct cdns *cdns) { struct cdns_role_driver *rdrv; @@ -148,6 +158,7 @@ int cdns_host_init(struct cdns *cdns) rdrv->start = __cdns_host_init; rdrv->stop = cdns_host_exit; + rdrv->resume = cdns_host_resume; rdrv->state = CDNS_ROLE_STATE_INACTIVE; rdrv->name = "host"; |