Skip to content

Commit 3a85c10

Browse files
tlebgregkh
authored andcommitted
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>
1 parent 668cc6b commit 3a85c10

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

drivers/usb/cdns3/host.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,16 @@ static void cdns_host_exit(struct cdns *cdns)
138138
cdns_drd_host_off(cdns);
139139
}
140140

141+
static int cdns_host_resume(struct cdns *cdns, bool power_lost)
142+
{
143+
struct usb_hcd *hcd = platform_get_drvdata(cdns->host_dev);
144+
struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd);
145+
146+
priv->power_lost = power_lost;
147+
148+
return 0;
149+
}
150+
141151
int cdns_host_init(struct cdns *cdns)
142152
{
143153
struct cdns_role_driver *rdrv;
@@ -148,6 +158,7 @@ int cdns_host_init(struct cdns *cdns)
148158

149159
rdrv->start = __cdns_host_init;
150160
rdrv->stop = cdns_host_exit;
161+
rdrv->resume = cdns_host_resume;
151162
rdrv->state = CDNS_ROLE_STATE_INACTIVE;
152163
rdrv->name = "host";
153164

0 commit comments

Comments
 (0)