aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-08-27 18:23:53 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-08-27 18:23:53 -0400
commit7c38405ca7bde60e6d3cffb87a086fc7a805a85c (patch)
tree7d1c7e36038f968f750bdbd7c5db7cc20365d72b /drivers/usb
parente21eba05afd288a227320f797864ddd859397eed (diff)
Revert "usb: ehci/ohci-exynos: Fix PHY getting sequence"
This reverts commit 039368901ad0a6476c7ecf0cfe4f84d735e30135. Vivek writes: We not longer need this patch, since we have planned to remove the usb-phy drivers for samsung [1], we have completely deleted the support for the the same from ohci-exynos and ehci-exynos drivers too [2]. Sorry for the confusion, but this patch can be dropped and instead we can pick the patches in [2]. [1] http://www.mail-archive.com/linux-samsung-soc@vger.kernel.org/msg35774.html [2] https://www.mail-archive.com/linux-samsung-soc@vger.kernel.org/msg35695.html https://www.mail-archive.com/linux-samsung-soc@vger.kernel.org/msg35696.html Cc: Sachin Kamat <sachin.kamat@samsung.com> Cc: Vivek Gautam <gautam.vivek@samsung.com> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Jingoo Han <jg1.han@samsung.com> Cc: Sachin Kamat <sachin.kamat@samsung.com> Cc: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/host/ehci-exynos.c40
-rw-r--r--drivers/usb/host/ohci-exynos.c47
2 files changed, 45 insertions, 42 deletions
diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c
index 2eed9a4f89a9..cda0a2f5c467 100644
--- a/drivers/usb/host/ehci-exynos.c
+++ b/drivers/usb/host/ehci-exynos.c
@@ -62,6 +62,18 @@ static int exynos_ehci_get_phy(struct device *dev,
62 int phy_number; 62 int phy_number;
63 int ret = 0; 63 int ret = 0;
64 64
65 exynos_ehci->phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2);
66 if (IS_ERR(exynos_ehci->phy)) {
67 ret = PTR_ERR(exynos_ehci->phy);
68 if (ret != -ENXIO && ret != -ENODEV) {
69 dev_err(dev, "no usb2 phy configured\n");
70 return ret;
71 }
72 dev_dbg(dev, "Failed to get usb2 phy\n");
73 } else {
74 exynos_ehci->otg = exynos_ehci->phy->otg;
75 }
76
65 for_each_available_child_of_node(dev->of_node, child) { 77 for_each_available_child_of_node(dev->of_node, child) {
66 ret = of_property_read_u32(child, "reg", &phy_number); 78 ret = of_property_read_u32(child, "reg", &phy_number);
67 if (ret) { 79 if (ret) {
@@ -78,27 +90,15 @@ static int exynos_ehci_get_phy(struct device *dev,
78 90
79 phy = devm_of_phy_get(dev, child, NULL); 91 phy = devm_of_phy_get(dev, child, NULL);
80 of_node_put(child); 92 of_node_put(child);
81 if (IS_ERR(phy)) 93 if (IS_ERR(phy)) {
82 /* Lets fallback to older USB-PHYs */ 94 ret = PTR_ERR(phy);
83 goto usb_phy_old; 95 if (ret != -ENOSYS && ret != -ENODEV) {
84 exynos_ehci->phy_g[phy_number] = phy; 96 dev_err(dev, "no usb2 phy configured\n");
85 /* Make the older PHYs unavailable */ 97 return ret;
86 exynos_ehci->phy = ERR_PTR(-ENXIO); 98 }
87 } 99 dev_dbg(dev, "Failed to get usb2 phy\n");
88
89 return 0;
90
91usb_phy_old:
92 exynos_ehci->phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2);
93 if (IS_ERR(exynos_ehci->phy)) {
94 ret = PTR_ERR(exynos_ehci->phy);
95 if (ret != -ENXIO && ret != -ENODEV) {
96 dev_err(dev, "no usb2 phy configured\n");
97 return ret;
98 } 100 }
99 dev_dbg(dev, "Failed to get usb2 phy\n"); 101 exynos_ehci->phy_g[phy_number] = phy;
100 } else {
101 exynos_ehci->otg = exynos_ehci->phy->otg;
102 } 102 }
103 103
104 return ret; 104 return ret;
diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c
index 7c48e3f3146b..a72ab8fe8cd3 100644
--- a/drivers/usb/host/ohci-exynos.c
+++ b/drivers/usb/host/ohci-exynos.c
@@ -51,12 +51,27 @@ static int exynos_ohci_get_phy(struct device *dev,
51 int phy_number; 51 int phy_number;
52 int ret = 0; 52 int ret = 0;
53 53
54 exynos_ohci->phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2);
55 if (IS_ERR(exynos_ohci->phy)) {
56 ret = PTR_ERR(exynos_ohci->phy);
57 if (ret != -ENXIO && ret != -ENODEV) {
58 dev_err(dev, "no usb2 phy configured\n");
59 return ret;
60 }
61 dev_dbg(dev, "Failed to get usb2 phy\n");
62 } else {
63 exynos_ohci->otg = exynos_ohci->phy->otg;
64 }
65
54 /* 66 /*
55 * Getting generic phy: 67 * Getting generic phy:
56 * We are keeping both types of phys as a part of transiting OHCI 68 * We are keeping both types of phys as a part of transiting OHCI
57 * to generic phy framework, so as to maintain backward compatibilty 69 * to generic phy framework, so as to maintain backward compatibilty
58 * with old DTB too. 70 * with old DTB.
59 * We fallback to older USB-PHYs when we fail to get generic PHYs. 71 * If there are existing devices using DTB files built from them,
72 * to remove the support for old bindings in this driver,
73 * we need to make sure that such devices have their DTBs
74 * updated to ones built from new DTS.
60 */ 75 */
61 for_each_available_child_of_node(dev->of_node, child) { 76 for_each_available_child_of_node(dev->of_node, child) {
62 ret = of_property_read_u32(child, "reg", &phy_number); 77 ret = of_property_read_u32(child, "reg", &phy_number);
@@ -74,27 +89,15 @@ static int exynos_ohci_get_phy(struct device *dev,
74 89
75 phy = devm_of_phy_get(dev, child, NULL); 90 phy = devm_of_phy_get(dev, child, NULL);
76 of_node_put(child); 91 of_node_put(child);
77 if (IS_ERR(phy)) 92 if (IS_ERR(phy)) {
78 /* Lets fallback to older USB-PHYs */ 93 ret = PTR_ERR(phy);
79 goto usb_phy_old; 94 if (ret != -ENOSYS && ret != -ENODEV) {
80 exynos_ohci->phy_g[phy_number] = phy; 95 dev_err(dev, "no usb2 phy configured\n");
81 /* Make the older PHYs unavailable */ 96 return ret;
82 exynos_ohci->phy = ERR_PTR(-ENXIO); 97 }
83 } 98 dev_dbg(dev, "Failed to get usb2 phy\n");
84
85 return 0;
86
87usb_phy_old:
88 exynos_ohci->phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2);
89 if (IS_ERR(exynos_ohci->phy)) {
90 ret = PTR_ERR(exynos_ohci->phy);
91 if (ret != -ENXIO && ret != -ENODEV) {
92 dev_err(dev, "no usb2 phy configured\n");
93 return ret;
94 } 99 }
95 dev_dbg(dev, "Failed to get usb2 phy\n"); 100 exynos_ohci->phy_g[phy_number] = phy;
96 } else {
97 exynos_ohci->otg = exynos_ohci->phy->otg;
98 } 101 }
99 102
100 return ret; 103 return ret;