Skip to content

Commit 98c0a3f

Browse files
shimodaygregkh
authored andcommitted
usb: host: xhci-plat: add resume_quirk()
This patch adds resume_quirk() to do platform specific process in resume timing. Signed-off-by: Yoshihiro Shimoda <[email protected]> Signed-off-by: Mathias Nyman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 835e424 commit 98c0a3f

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

drivers/usb/host/xhci-plat.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,16 @@ static int xhci_priv_init_quirk(struct usb_hcd *hcd)
5555
return priv->init_quirk(hcd);
5656
}
5757

58+
static int xhci_priv_resume_quirk(struct usb_hcd *hcd)
59+
{
60+
struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd);
61+
62+
if (!priv->resume_quirk)
63+
return 0;
64+
65+
return priv->resume_quirk(hcd);
66+
}
67+
5868
static void xhci_plat_quirks(struct device *dev, struct xhci_hcd *xhci)
5969
{
6070
/*
@@ -369,10 +379,15 @@ static int xhci_plat_resume(struct device *dev)
369379
{
370380
struct usb_hcd *hcd = dev_get_drvdata(dev);
371381
struct xhci_hcd *xhci = hcd_to_xhci(hcd);
382+
int ret;
372383

373384
if (!device_may_wakeup(dev) && !IS_ERR(xhci->clk))
374385
clk_prepare_enable(xhci->clk);
375386

387+
ret = xhci_priv_resume_quirk(hcd);
388+
if (ret)
389+
return ret;
390+
376391
return xhci_resume(xhci, 0);
377392
}
378393
#endif /* CONFIG_PM_SLEEP */

drivers/usb/host/xhci-plat.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ struct xhci_plat_priv {
1717
const char *firmware_name;
1818
void (*plat_start)(struct usb_hcd *);
1919
int (*init_quirk)(struct usb_hcd *);
20+
int (*resume_quirk)(struct usb_hcd *);
2021
};
2122

2223
#define hcd_to_xhci_priv(h) ((struct xhci_plat_priv *)hcd_to_xhci(h)->priv)

0 commit comments

Comments
 (0)