summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>2017-04-19 16:55:47 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-04-19 19:59:17 +0200
commit98c0a3ffa30c4b389257f7e7ee80ab9e90b78924 (patch)
tree3a3e03c70d1ec5aafae8570d4c58d2fd6acd80f9 /drivers
parent835e4241e714fbd659838618466766b132823da3 (diff)
downloadlinux-98c0a3ffa30c4b389257f7e7ee80ab9e90b78924.tar.gz
linux-98c0a3ffa30c4b389257f7e7ee80ab9e90b78924.tar.bz2
linux-98c0a3ffa30c4b389257f7e7ee80ab9e90b78924.zip
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 <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/host/xhci-plat.c15
-rw-r--r--drivers/usb/host/xhci-plat.h1
2 files changed, 16 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index fd2a440f6f78..8ab517f94b24 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -55,6 +55,16 @@ static int xhci_priv_init_quirk(struct usb_hcd *hcd)
return priv->init_quirk(hcd);
}
+static int xhci_priv_resume_quirk(struct usb_hcd *hcd)
+{
+ struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd);
+
+ if (!priv->resume_quirk)
+ return 0;
+
+ return priv->resume_quirk(hcd);
+}
+
static void xhci_plat_quirks(struct device *dev, struct xhci_hcd *xhci)
{
/*
@@ -369,10 +379,15 @@ static int xhci_plat_resume(struct device *dev)
{
struct usb_hcd *hcd = dev_get_drvdata(dev);
struct xhci_hcd *xhci = hcd_to_xhci(hcd);
+ int ret;
if (!device_may_wakeup(dev) && !IS_ERR(xhci->clk))
clk_prepare_enable(xhci->clk);
+ ret = xhci_priv_resume_quirk(hcd);
+ if (ret)
+ return ret;
+
return xhci_resume(xhci, 0);
}
#endif /* CONFIG_PM_SLEEP */
diff --git a/drivers/usb/host/xhci-plat.h b/drivers/usb/host/xhci-plat.h
index 9af0cb48053f..29b227895b07 100644
--- a/drivers/usb/host/xhci-plat.h
+++ b/drivers/usb/host/xhci-plat.h
@@ -17,6 +17,7 @@ struct xhci_plat_priv {
const char *firmware_name;
void (*plat_start)(struct usb_hcd *);
int (*init_quirk)(struct usb_hcd *);
+ int (*resume_quirk)(struct usb_hcd *);
};
#define hcd_to_xhci_priv(h) ((struct xhci_plat_priv *)hcd_to_xhci(h)->priv)