Skip to content

Commit 435cc11

Browse files
shimodaygregkh
authored andcommitted
usb: host: xhci-plat: set resume_quirk() for R-Car controllers
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 <[email protected]> Signed-off-by: Mathias Nyman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 98c0a3f commit 435cc11

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

drivers/usb/host/xhci-plat.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,18 +103,21 @@ static const struct xhci_plat_priv xhci_plat_renesas_rcar_gen2 = {
103103
.firmware_name = XHCI_RCAR_FIRMWARE_NAME_V1,
104104
.init_quirk = xhci_rcar_init_quirk,
105105
.plat_start = xhci_rcar_start,
106+
.resume_quirk = xhci_rcar_resume_quirk,
106107
};
107108

108109
static const struct xhci_plat_priv xhci_plat_renesas_rcar_gen3 = {
109110
.firmware_name = XHCI_RCAR_FIRMWARE_NAME_V2,
110111
.init_quirk = xhci_rcar_init_quirk,
111112
.plat_start = xhci_rcar_start,
113+
.resume_quirk = xhci_rcar_resume_quirk,
112114
};
113115

114116
static const struct xhci_plat_priv xhci_plat_renesas_rcar_r8a7796 = {
115117
.firmware_name = XHCI_RCAR_FIRMWARE_NAME_V3,
116118
.init_quirk = xhci_rcar_init_quirk,
117119
.plat_start = xhci_rcar_start,
120+
.resume_quirk = xhci_rcar_resume_quirk,
118121
};
119122

120123
static const struct of_device_id usb_xhci_of_match[] = {

drivers/usb/host/xhci-rcar.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,3 +198,14 @@ int xhci_rcar_init_quirk(struct usb_hcd *hcd)
198198

199199
return xhci_rcar_download_firmware(hcd);
200200
}
201+
202+
int xhci_rcar_resume_quirk(struct usb_hcd *hcd)
203+
{
204+
int ret;
205+
206+
ret = xhci_rcar_download_firmware(hcd);
207+
if (!ret)
208+
xhci_rcar_start(hcd);
209+
210+
return ret;
211+
}

drivers/usb/host/xhci-rcar.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#if IS_ENABLED(CONFIG_USB_XHCI_RCAR)
1919
void xhci_rcar_start(struct usb_hcd *hcd);
2020
int xhci_rcar_init_quirk(struct usb_hcd *hcd);
21+
int xhci_rcar_resume_quirk(struct usb_hcd *hcd);
2122
#else
2223
static inline void xhci_rcar_start(struct usb_hcd *hcd)
2324
{
@@ -27,5 +28,10 @@ static inline int xhci_rcar_init_quirk(struct usb_hcd *hcd)
2728
{
2829
return 0;
2930
}
31+
32+
static inline int xhci_rcar_resume_quirk(struct usb_hcd *hcd)
33+
{
34+
return 0;
35+
}
3036
#endif
3137
#endif /* _XHCI_RCAR_H */

0 commit comments

Comments
 (0)