]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
usb: host: xhci-plat: add resume_quirk()
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Wed, 19 Apr 2017 13:55:47 +0000 (16:55 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Apr 2017 17:59:17 +0000 (19:59 +0200)
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>
drivers/usb/host/xhci-plat.c
drivers/usb/host/xhci-plat.h

index fd2a440f6f78aa1bf009761debb679ebb460cfc7..8ab517f94b245bbe9ff883c24d970d29331b7b95 100644 (file)
@@ -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 */
index 9af0cb48053f27bd07cd3ad1d79b3a6815700fa4..29b227895b0732352765afa042819b4d0ae9c864 100644 (file)
@@ -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)