346-v5.18-02-Revert-usb-host-xhci-mvebu-make-USB-3.0-PHY-optional.patch 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. From 8e10548f7f4814e530857d2049d6af6bc78add53 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <[email protected]>
  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
  5. for Armada 3720"
  6. MIME-Version: 1.0
  7. Content-Type: text/plain; charset=UTF-8
  8. Content-Transfer-Encoding: 8bit
  9. This reverts commit 3241929b67d28c83945d3191c6816a3271fd6b85.
  10. Armada 3720 phy driver (phy-mvebu-a3700-comphy.c) does not return
  11. -EOPNOTSUPP from phy_power_on() callback anymore.
  12. So remove XHCI_SKIP_PHY_INIT flag from xhci_mvebu_a3700_plat_setup() and
  13. then also whole xhci_mvebu_a3700_plat_setup() function which is there just
  14. to handle -EOPNOTSUPP for XHCI_SKIP_PHY_INIT.
  15. xhci plat_setup callback is not used by any other xhci plat driver, so
  16. remove this callback completely.
  17. Signed-off-by: Pali Rohár <[email protected]>
  18. Signed-off-by: Marek Behún <[email protected]>
  19. Acked-by: Miquel Raynal <[email protected]>
  20. Acked-by: Greg Kroah-Hartman <[email protected]>
  21. Link: https://lore.kernel.org/r/[email protected]
  22. Signed-off-by: Vinod Koul <[email protected]>
  23. ---
  24. drivers/usb/host/xhci-mvebu.c | 42 -----------------------------------
  25. drivers/usb/host/xhci-mvebu.h | 6 -----
  26. drivers/usb/host/xhci-plat.c | 20 +----------------
  27. drivers/usb/host/xhci-plat.h | 1 -
  28. 4 files changed, 1 insertion(+), 68 deletions(-)
  29. --- a/drivers/usb/host/xhci-mvebu.c
  30. +++ b/drivers/usb/host/xhci-mvebu.c
  31. @@ -8,7 +8,6 @@
  32. #include <linux/mbus.h>
  33. #include <linux/of.h>
  34. #include <linux/platform_device.h>
  35. -#include <linux/phy/phy.h>
  36. #include <linux/usb.h>
  37. #include <linux/usb/hcd.h>
  38. @@ -74,47 +73,6 @@ int xhci_mvebu_mbus_init_quirk(struct us
  39. return 0;
  40. }
  41. -
  42. -int xhci_mvebu_a3700_plat_setup(struct usb_hcd *hcd)
  43. -{
  44. - struct xhci_hcd *xhci = hcd_to_xhci(hcd);
  45. - struct device *dev = hcd->self.controller;
  46. - struct phy *phy;
  47. - int ret;
  48. -
  49. - /* Old bindings miss the PHY handle */
  50. - phy = of_phy_get(dev->of_node, "usb3-phy");
  51. - if (IS_ERR(phy) && PTR_ERR(phy) == -EPROBE_DEFER)
  52. - return -EPROBE_DEFER;
  53. - else if (IS_ERR(phy))
  54. - goto phy_out;
  55. -
  56. - ret = phy_init(phy);
  57. - if (ret)
  58. - goto phy_put;
  59. -
  60. - ret = phy_set_mode(phy, PHY_MODE_USB_HOST_SS);
  61. - if (ret)
  62. - goto phy_exit;
  63. -
  64. - ret = phy_power_on(phy);
  65. - if (ret == -EOPNOTSUPP) {
  66. - /* Skip initializatin of XHCI PHY when it is unsupported by firmware */
  67. - dev_warn(dev, "PHY unsupported by firmware\n");
  68. - xhci->quirks |= XHCI_SKIP_PHY_INIT;
  69. - }
  70. - if (ret)
  71. - goto phy_exit;
  72. -
  73. - phy_power_off(phy);
  74. -phy_exit:
  75. - phy_exit(phy);
  76. -phy_put:
  77. - of_phy_put(phy);
  78. -phy_out:
  79. -
  80. - return 0;
  81. -}
  82. int xhci_mvebu_a3700_init_quirk(struct usb_hcd *hcd)
  83. {
  84. --- a/drivers/usb/host/xhci-mvebu.h
  85. +++ b/drivers/usb/host/xhci-mvebu.h
  86. @@ -12,18 +12,12 @@ struct usb_hcd;
  87. #if IS_ENABLED(CONFIG_USB_XHCI_MVEBU)
  88. int xhci_mvebu_mbus_init_quirk(struct usb_hcd *hcd);
  89. -int xhci_mvebu_a3700_plat_setup(struct usb_hcd *hcd);
  90. int xhci_mvebu_a3700_init_quirk(struct usb_hcd *hcd);
  91. #else
  92. static inline int xhci_mvebu_mbus_init_quirk(struct usb_hcd *hcd)
  93. {
  94. return 0;
  95. }
  96. -
  97. -static inline int xhci_mvebu_a3700_plat_setup(struct usb_hcd *hcd)
  98. -{
  99. - return 0;
  100. -}
  101. static inline int xhci_mvebu_a3700_init_quirk(struct usb_hcd *hcd)
  102. {
  103. --- a/drivers/usb/host/xhci-plat.c
  104. +++ b/drivers/usb/host/xhci-plat.c
  105. @@ -44,16 +44,6 @@ static void xhci_priv_plat_start(struct
  106. priv->plat_start(hcd);
  107. }
  108. -static int xhci_priv_plat_setup(struct usb_hcd *hcd)
  109. -{
  110. - struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd);
  111. -
  112. - if (!priv->plat_setup)
  113. - return 0;
  114. -
  115. - return priv->plat_setup(hcd);
  116. -}
  117. -
  118. static int xhci_priv_init_quirk(struct usb_hcd *hcd)
  119. {
  120. struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd);
  121. @@ -121,7 +111,6 @@ static const struct xhci_plat_priv xhci_
  122. };
  123. static const struct xhci_plat_priv xhci_plat_marvell_armada3700 = {
  124. - .plat_setup = xhci_mvebu_a3700_plat_setup,
  125. .init_quirk = xhci_mvebu_a3700_init_quirk,
  126. };
  127. @@ -341,14 +330,7 @@ static int xhci_plat_probe(struct platfo
  128. hcd->tpl_support = of_usb_host_tpl_support(sysdev->of_node);
  129. xhci->shared_hcd->tpl_support = hcd->tpl_support;
  130. -
  131. - if (priv) {
  132. - ret = xhci_priv_plat_setup(hcd);
  133. - if (ret)
  134. - goto disable_usb_phy;
  135. - }
  136. -
  137. - if ((xhci->quirks & XHCI_SKIP_PHY_INIT) || (priv && (priv->quirks & XHCI_SKIP_PHY_INIT)))
  138. + if (priv && (priv->quirks & XHCI_SKIP_PHY_INIT))
  139. hcd->skip_phy_initialization = 1;
  140. if (priv && (priv->quirks & XHCI_SG_TRB_CACHE_SIZE_QUIRK))
  141. --- a/drivers/usb/host/xhci-plat.h
  142. +++ b/drivers/usb/host/xhci-plat.h
  143. @@ -13,7 +13,6 @@
  144. struct xhci_plat_priv {
  145. const char *firmware_name;
  146. unsigned long long quirks;
  147. - int (*plat_setup)(struct usb_hcd *);
  148. void (*plat_start)(struct usb_hcd *);
  149. int (*init_quirk)(struct usb_hcd *);
  150. int (*suspend_quirk)(struct usb_hcd *);