1 From 8e10548f7f4814e530857d2049d6af6bc78add53 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <pali@kernel.org>
3 Date: Thu, 3 Feb 2022 22:44:43 +0100
4 Subject: [PATCH 2/3] Revert "usb: host: xhci: mvebu: make USB 3.0 PHY optional
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>
25 Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
26 Link: https://lore.kernel.org/r/20220203214444.1508-5-kabel@kernel.org
27 Signed-off-by: Vinod Koul <vkoul@kernel.org>
29 drivers/usb/host/xhci-mvebu.c | 42 -----------------------------------
30 drivers/usb/host/xhci-mvebu.h | 6 -----
31 drivers/usb/host/xhci-plat.c | 20 +----------------
32 drivers/usb/host/xhci-plat.h | 1 -
33 4 files changed, 1 insertion(+), 68 deletions(-)
35 --- a/drivers/usb/host/xhci-mvebu.c
36 +++ b/drivers/usb/host/xhci-mvebu.c
38 #include <linux/mbus.h>
40 #include <linux/platform_device.h>
41 -#include <linux/phy/phy.h>
43 #include <linux/usb.h>
44 #include <linux/usb/hcd.h>
45 @@ -74,47 +73,6 @@ int xhci_mvebu_mbus_init_quirk(struct us
50 -int xhci_mvebu_a3700_plat_setup(struct usb_hcd *hcd)
52 - struct xhci_hcd *xhci = hcd_to_xhci(hcd);
53 - struct device *dev = hcd->self.controller;
57 - /* Old bindings miss the PHY handle */
58 - phy = of_phy_get(dev->of_node, "usb3-phy");
59 - if (IS_ERR(phy) && PTR_ERR(phy) == -EPROBE_DEFER)
60 - return -EPROBE_DEFER;
61 - else if (IS_ERR(phy))
64 - ret = phy_init(phy);
68 - ret = phy_set_mode(phy, PHY_MODE_USB_HOST_SS);
72 - ret = phy_power_on(phy);
73 - if (ret == -EOPNOTSUPP) {
74 - /* Skip initializatin of XHCI PHY when it is unsupported by firmware */
75 - dev_warn(dev, "PHY unsupported by firmware\n");
76 - xhci->quirks |= XHCI_SKIP_PHY_INIT;
91 int xhci_mvebu_a3700_init_quirk(struct usb_hcd *hcd)
93 --- a/drivers/usb/host/xhci-mvebu.h
94 +++ b/drivers/usb/host/xhci-mvebu.h
95 @@ -12,18 +12,12 @@ struct usb_hcd;
97 #if IS_ENABLED(CONFIG_USB_XHCI_MVEBU)
98 int xhci_mvebu_mbus_init_quirk(struct usb_hcd *hcd);
99 -int xhci_mvebu_a3700_plat_setup(struct usb_hcd *hcd);
100 int xhci_mvebu_a3700_init_quirk(struct usb_hcd *hcd);
102 static inline int xhci_mvebu_mbus_init_quirk(struct usb_hcd *hcd)
107 -static inline int xhci_mvebu_a3700_plat_setup(struct usb_hcd *hcd)
112 static inline int xhci_mvebu_a3700_init_quirk(struct usb_hcd *hcd)
114 --- a/drivers/usb/host/xhci-plat.c
115 +++ b/drivers/usb/host/xhci-plat.c
116 @@ -44,16 +44,6 @@ static void xhci_priv_plat_start(struct
117 priv->plat_start(hcd);
120 -static int xhci_priv_plat_setup(struct usb_hcd *hcd)
122 - struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd);
124 - if (!priv->plat_setup)
127 - return priv->plat_setup(hcd);
130 static int xhci_priv_init_quirk(struct usb_hcd *hcd)
132 struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd);
133 @@ -121,7 +111,6 @@ static const struct xhci_plat_priv xhci_
136 static const struct xhci_plat_priv xhci_plat_marvell_armada3700 = {
137 - .plat_setup = xhci_mvebu_a3700_plat_setup,
138 .init_quirk = xhci_mvebu_a3700_init_quirk,
141 @@ -344,14 +333,7 @@ static int xhci_plat_probe(struct platfo
143 hcd->tpl_support = of_usb_host_tpl_support(sysdev->of_node);
144 xhci->shared_hcd->tpl_support = hcd->tpl_support;
147 - ret = xhci_priv_plat_setup(hcd);
149 - goto disable_usb_phy;
152 - if ((xhci->quirks & XHCI_SKIP_PHY_INIT) || (priv && (priv->quirks & XHCI_SKIP_PHY_INIT)))
153 + if (priv && (priv->quirks & XHCI_SKIP_PHY_INIT))
154 hcd->skip_phy_initialization = 1;
156 if (priv && (priv->quirks & XHCI_SG_TRB_CACHE_SIZE_QUIRK))
157 --- a/drivers/usb/host/xhci-plat.h
158 +++ b/drivers/usb/host/xhci-plat.h
159 @@ -15,7 +15,6 @@ struct usb_hcd;
160 struct xhci_plat_priv {
161 const char *firmware_name;
162 unsigned long long quirks;
163 - int (*plat_setup)(struct usb_hcd *);
164 void (*plat_start)(struct usb_hcd *);
165 int (*init_quirk)(struct usb_hcd *);
166 int (*suspend_quirk)(struct usb_hcd *);