Skip to content

Commit 668cc6b

Browse files
tlebgregkh
authored andcommitted
usb: host: xhci-plat: allow upper layers to signal power loss
Now that xhci_resume() exposes a power_lost boolean argument, expose that to all xhci-plat implementations. They are free to set it from wherever they want: - Their own resume() callback. - The xhci_plat_priv::resume_quirk() callback. Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com> Link: https://lore.kernel.org/r/20250205-s2r-cdns-v7-8-13658a271c3c@bootlin.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 34cca0c commit 668cc6b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

drivers/usb/host/xhci-plat.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,7 @@ static int xhci_plat_suspend(struct device *dev)
482482
static int xhci_plat_resume_common(struct device *dev, bool power_lost)
483483
{
484484
struct usb_hcd *hcd = dev_get_drvdata(dev);
485+
struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd);
485486
struct xhci_hcd *xhci = hcd_to_xhci(hcd);
486487
int ret;
487488

@@ -501,7 +502,7 @@ static int xhci_plat_resume_common(struct device *dev, bool power_lost)
501502
if (ret)
502503
goto disable_clks;
503504

504-
ret = xhci_resume(xhci, power_lost, false);
505+
ret = xhci_resume(xhci, power_lost || priv->power_lost, false);
505506
if (ret)
506507
goto disable_clks;
507508

drivers/usb/host/xhci-plat.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ struct usb_hcd;
1515
struct xhci_plat_priv {
1616
const char *firmware_name;
1717
unsigned long long quirks;
18+
bool power_lost;
1819
void (*plat_start)(struct usb_hcd *);
1920
int (*init_quirk)(struct usb_hcd *);
2021
int (*suspend_quirk)(struct usb_hcd *);

0 commit comments

Comments
 (0)