usb: host: xhci-plat: set resume_quirk() for R-Car controllers
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Wed, 19 Apr 2017 13:55:48 +0000 (16:55 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Apr 2017 17:59:17 +0000 (19:59 +0200)
This patch sets resume_quirk() for R-Car controllers to re-download
the firmware in resume timing. Otherwise, if the controller's power
is down in suspend timing, the firmware in the controller goes away,
and then the controller doesn't work after resume.

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-rcar.c
drivers/usb/host/xhci-rcar.h

index 8ab517f94b245bbe9ff883c24d970d29331b7b95..057571fab5992c7c13c0f583ef865be0a246a593 100644 (file)
@@ -103,18 +103,21 @@ static const struct xhci_plat_priv xhci_plat_renesas_rcar_gen2 = {
        .firmware_name = XHCI_RCAR_FIRMWARE_NAME_V1,
        .init_quirk = xhci_rcar_init_quirk,
        .plat_start = xhci_rcar_start,
+       .resume_quirk = xhci_rcar_resume_quirk,
 };
 
 static const struct xhci_plat_priv xhci_plat_renesas_rcar_gen3 = {
        .firmware_name = XHCI_RCAR_FIRMWARE_NAME_V2,
        .init_quirk = xhci_rcar_init_quirk,
        .plat_start = xhci_rcar_start,
+       .resume_quirk = xhci_rcar_resume_quirk,
 };
 
 static const struct xhci_plat_priv xhci_plat_renesas_rcar_r8a7796 = {
        .firmware_name = XHCI_RCAR_FIRMWARE_NAME_V3,
        .init_quirk = xhci_rcar_init_quirk,
        .plat_start = xhci_rcar_start,
+       .resume_quirk = xhci_rcar_resume_quirk,
 };
 
 static const struct of_device_id usb_xhci_of_match[] = {
index d28df386e780bd04608ad199535ee326119b932c..07278228214b80066df2ea32a5828fdf1066f34d 100644 (file)
@@ -198,3 +198,14 @@ int xhci_rcar_init_quirk(struct usb_hcd *hcd)
 
        return xhci_rcar_download_firmware(hcd);
 }
+
+int xhci_rcar_resume_quirk(struct usb_hcd *hcd)
+{
+       int ret;
+
+       ret = xhci_rcar_download_firmware(hcd);
+       if (!ret)
+               xhci_rcar_start(hcd);
+
+       return ret;
+}
index d2ffe20401cf9f372bbcc0be4a7443e0e3b92b60..d247951147a1b9b99772bbd0093667c3f5976634 100644 (file)
@@ -18,6 +18,7 @@
 #if IS_ENABLED(CONFIG_USB_XHCI_RCAR)
 void xhci_rcar_start(struct usb_hcd *hcd);
 int xhci_rcar_init_quirk(struct usb_hcd *hcd);
+int xhci_rcar_resume_quirk(struct usb_hcd *hcd);
 #else
 static inline void xhci_rcar_start(struct usb_hcd *hcd)
 {
@@ -27,5 +28,10 @@ static inline int xhci_rcar_init_quirk(struct usb_hcd *hcd)
 {
        return 0;
 }
+
+static inline int xhci_rcar_resume_quirk(struct usb_hcd *hcd)
+{
+       return 0;
+}
 #endif
 #endif /* _XHCI_RCAR_H */