1 From 9f0dfb279b1dd505d5e10b10e4a78a62030978d8 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <pali@kernel.org>
3 Date: Thu, 23 Sep 2021 19:40:06 +0200
4 Subject: [PATCH] Revert "usb: host: xhci: mvebu: make USB 3.0 PHY optional for
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
10 This reverts commit 3241929b67d28c83945d3191c6816a3271fd6b85.
12 Armada 3720 phy driver (phy-mvebu-a3700-comphy.c) does not return
13 -EOPNOTSUPP from phy_power_on() callback anymore.
15 So remove XHCI_SKIP_PHY_INIT flag from xhci_mvebu_a3700_plat_setup() and
16 then also whole xhci_mvebu_a3700_plat_setup() function which is there just
17 to handle -EOPNOTSUPP for XHCI_SKIP_PHY_INIT.
19 xhci plat_setup callback is not used by any other xhci plat driver, so
20 remove this callback completely.
22 Signed-off-by: Pali Rohár <pali@kernel.org>
23 Signed-off-by: Marek Behún <kabel@kernel.org>
24 Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>
26 drivers/usb/host/xhci-mvebu.c | 42 -----------------------------------
27 drivers/usb/host/xhci-mvebu.h | 6 -----
28 drivers/usb/host/xhci-plat.c | 20 +----------------
29 drivers/usb/host/xhci-plat.h | 1 -
30 4 files changed, 1 insertion(+), 68 deletions(-)
32 --- a/drivers/usb/host/xhci-mvebu.c
33 +++ b/drivers/usb/host/xhci-mvebu.c
35 #include <linux/mbus.h>
37 #include <linux/platform_device.h>
38 -#include <linux/phy/phy.h>
40 #include <linux/usb.h>
41 #include <linux/usb/hcd.h>
42 @@ -74,47 +73,6 @@ int xhci_mvebu_mbus_init_quirk(struct us
47 -int xhci_mvebu_a3700_plat_setup(struct usb_hcd *hcd)
49 - struct xhci_hcd *xhci = hcd_to_xhci(hcd);
50 - struct device *dev = hcd->self.controller;
54 - /* Old bindings miss the PHY handle */
55 - phy = of_phy_get(dev->of_node, "usb3-phy");
56 - if (IS_ERR(phy) && PTR_ERR(phy) == -EPROBE_DEFER)
57 - return -EPROBE_DEFER;
58 - else if (IS_ERR(phy))
61 - ret = phy_init(phy);
65 - ret = phy_set_mode(phy, PHY_MODE_USB_HOST_SS);
69 - ret = phy_power_on(phy);
70 - if (ret == -EOPNOTSUPP) {
71 - /* Skip initializatin of XHCI PHY when it is unsupported by firmware */
72 - dev_warn(dev, "PHY unsupported by firmware\n");
73 - xhci->quirks |= XHCI_SKIP_PHY_INIT;
88 int xhci_mvebu_a3700_init_quirk(struct usb_hcd *hcd)
90 --- a/drivers/usb/host/xhci-mvebu.h
91 +++ b/drivers/usb/host/xhci-mvebu.h
92 @@ -12,18 +12,12 @@ struct usb_hcd;
94 #if IS_ENABLED(CONFIG_USB_XHCI_MVEBU)
95 int xhci_mvebu_mbus_init_quirk(struct usb_hcd *hcd);
96 -int xhci_mvebu_a3700_plat_setup(struct usb_hcd *hcd);
97 int xhci_mvebu_a3700_init_quirk(struct usb_hcd *hcd);
99 static inline int xhci_mvebu_mbus_init_quirk(struct usb_hcd *hcd)
104 -static inline int xhci_mvebu_a3700_plat_setup(struct usb_hcd *hcd)
109 static inline int xhci_mvebu_a3700_init_quirk(struct usb_hcd *hcd)
111 --- a/drivers/usb/host/xhci-plat.c
112 +++ b/drivers/usb/host/xhci-plat.c
113 @@ -44,16 +44,6 @@ static void xhci_priv_plat_start(struct
114 priv->plat_start(hcd);
117 -static int xhci_priv_plat_setup(struct usb_hcd *hcd)
119 - struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd);
121 - if (!priv->plat_setup)
124 - return priv->plat_setup(hcd);
127 static int xhci_priv_init_quirk(struct usb_hcd *hcd)
129 struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd);
130 @@ -121,7 +111,6 @@ static const struct xhci_plat_priv xhci_
133 static const struct xhci_plat_priv xhci_plat_marvell_armada3700 = {
134 - .plat_setup = xhci_mvebu_a3700_plat_setup,
135 .init_quirk = xhci_mvebu_a3700_init_quirk,
138 @@ -341,14 +330,7 @@ static int xhci_plat_probe(struct platfo
140 hcd->tpl_support = of_usb_host_tpl_support(sysdev->of_node);
141 xhci->shared_hcd->tpl_support = hcd->tpl_support;
144 - ret = xhci_priv_plat_setup(hcd);
146 - goto disable_usb_phy;
149 - if ((xhci->quirks & XHCI_SKIP_PHY_INIT) || (priv && (priv->quirks & XHCI_SKIP_PHY_INIT)))
150 + if (priv && (priv->quirks & XHCI_SKIP_PHY_INIT))
151 hcd->skip_phy_initialization = 1;
153 if (priv && (priv->quirks & XHCI_SG_TRB_CACHE_SIZE_QUIRK))
154 --- a/drivers/usb/host/xhci-plat.h
155 +++ b/drivers/usb/host/xhci-plat.h
157 struct xhci_plat_priv {
158 const char *firmware_name;
159 unsigned long long quirks;
160 - int (*plat_setup)(struct usb_hcd *);
161 void (*plat_start)(struct usb_hcd *);
162 int (*init_quirk)(struct usb_hcd *);
163 int (*suspend_quirk)(struct usb_hcd *);