aboutsummaryrefslogtreecommitdiffstats
path: root/patches.renesas/0202-usb-host-xhci-plat-add-resume_quirk.patch
blob: 2b496318143cd5f3d6a9876448a4ec349b2ae69c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
From 851c48ee8cb0166ef723eb677d6b4120956215d4 Mon Sep 17 00:00:00 2001
From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Date: Wed, 19 Apr 2017 16:55:47 +0300
Subject: [PATCH 202/286] 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>
(cherry picked from commit 98c0a3ffa30c4b389257f7e7ee80ab9e90b78924)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 drivers/usb/host/xhci-plat.c |   15 +++++++++++++++
 drivers/usb/host/xhci-plat.h |    1 +
 2 files changed, 16 insertions(+)

--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -54,6 +54,16 @@ static int xhci_priv_init_quirk(struct u
 	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)
 {
 	/*
@@ -350,10 +360,15 @@ static int xhci_plat_resume(struct devic
 {
 	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 */
--- 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)