aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@freescale.com>2012-11-08 20:44:41 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-11-15 20:44:51 -0500
commitff84f0e9f70cde6de1ba7c7f6156c8c3c98af383 (patch)
tree36ec87dec7a79ab513f71396a7c895fd21d6bcc7 /drivers/usb
parentba2d8ce9db0a61505362bb17b8899df3d3326146 (diff)
Revert "usb: otg: mxs-phy: Fix mx23 operation"
The real reason causes mx23 fail are: - Calling mxs_phy_hw_init(mxs_phy) again at connection - Error connect/disconnect nodity at hub.c The coming patch will fix above two problems, Mike Thompson tested his hardware works OK after commented out this delay setting. This reverts commit 363366cf61c544ea476f3d220f43a95cb03014f5. Signed-off-by: Peter Chen <peter.chen@freescale.com> Acked-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/otg/mxs-phy.c38
1 files changed, 3 insertions, 35 deletions
diff --git a/drivers/usb/otg/mxs-phy.c b/drivers/usb/otg/mxs-phy.c
index 88db976647cf..c1a67cb8e244 100644
--- a/drivers/usb/otg/mxs-phy.c
+++ b/drivers/usb/otg/mxs-phy.c
@@ -20,7 +20,6 @@
20#include <linux/delay.h> 20#include <linux/delay.h>
21#include <linux/err.h> 21#include <linux/err.h>
22#include <linux/io.h> 22#include <linux/io.h>
23#include <linux/workqueue.h>
24 23
25#define DRIVER_NAME "mxs_phy" 24#define DRIVER_NAME "mxs_phy"
26 25
@@ -35,16 +34,9 @@
35#define BM_USBPHY_CTRL_ENUTMILEVEL2 BIT(14) 34#define BM_USBPHY_CTRL_ENUTMILEVEL2 BIT(14)
36#define BM_USBPHY_CTRL_ENHOSTDISCONDETECT BIT(1) 35#define BM_USBPHY_CTRL_ENHOSTDISCONDETECT BIT(1)
37 36
38/*
39 * Amount of delay in miliseconds to safely enable ENHOSTDISCONDETECT bit
40 * so that connection and reset processing can be completed for the root hub.
41 */
42#define MXY_PHY_ENHOSTDISCONDETECT_DELAY 250
43
44struct mxs_phy { 37struct mxs_phy {
45 struct usb_phy phy; 38 struct usb_phy phy;
46 struct clk *clk; 39 struct clk *clk;
47 struct delayed_work enhostdiscondetect_work;
48}; 40};
49 41
50#define to_mxs_phy(p) container_of((p), struct mxs_phy, phy) 42#define to_mxs_phy(p) container_of((p), struct mxs_phy, phy)
@@ -70,7 +62,6 @@ static int mxs_phy_init(struct usb_phy *phy)
70 62
71 clk_prepare_enable(mxs_phy->clk); 63 clk_prepare_enable(mxs_phy->clk);
72 mxs_phy_hw_init(mxs_phy); 64 mxs_phy_hw_init(mxs_phy);
73 INIT_DELAYED_WORK(&mxs_phy->enhostdiscondetect_work, NULL);
74 65
75 return 0; 66 return 0;
76} 67}
@@ -85,34 +76,13 @@ static void mxs_phy_shutdown(struct usb_phy *phy)
85 clk_disable_unprepare(mxs_phy->clk); 76 clk_disable_unprepare(mxs_phy->clk);
86} 77}
87 78
88static void mxs_phy_enhostdiscondetect_delay(struct work_struct *ws)
89{
90 struct mxs_phy *mxs_phy = container_of(ws, struct mxs_phy,
91 enhostdiscondetect_work.work);
92
93 /* Enable HOSTDISCONDETECT after delay. */
94 dev_dbg(mxs_phy->phy.dev, "Setting ENHOSTDISCONDETECT\n");
95 writel_relaxed(BM_USBPHY_CTRL_ENHOSTDISCONDETECT,
96 mxs_phy->phy.io_priv + HW_USBPHY_CTRL_SET);
97}
98
99static int mxs_phy_on_connect(struct usb_phy *phy, int port) 79static int mxs_phy_on_connect(struct usb_phy *phy, int port)
100{ 80{
101 struct mxs_phy *mxs_phy = to_mxs_phy(phy);
102
103 dev_dbg(phy->dev, "Connect on port %d\n", port); 81 dev_dbg(phy->dev, "Connect on port %d\n", port);
104 82
105 mxs_phy_hw_init(mxs_phy); 83 mxs_phy_hw_init(to_mxs_phy(phy));
106 84 writel_relaxed(BM_USBPHY_CTRL_ENHOSTDISCONDETECT,
107 /* 85 phy->io_priv + HW_USBPHY_CTRL_SET);
108 * Delay enabling ENHOSTDISCONDETECT so that connection and
109 * reset processing can be completed for the root hub.
110 */
111 dev_dbg(phy->dev, "Delaying setting ENHOSTDISCONDETECT\n");
112 PREPARE_DELAYED_WORK(&mxs_phy->enhostdiscondetect_work,
113 mxs_phy_enhostdiscondetect_delay);
114 schedule_delayed_work(&mxs_phy->enhostdiscondetect_work,
115 msecs_to_jiffies(MXY_PHY_ENHOSTDISCONDETECT_DELAY));
116 86
117 return 0; 87 return 0;
118} 88}
@@ -121,8 +91,6 @@ static int mxs_phy_on_disconnect(struct usb_phy *phy, int port)
121{ 91{
122 dev_dbg(phy->dev, "Disconnect on port %d\n", port); 92 dev_dbg(phy->dev, "Disconnect on port %d\n", port);
123 93
124 /* No need to delay before clearing ENHOSTDISCONDETECT. */
125 dev_dbg(phy->dev, "Clearing ENHOSTDISCONDETECT\n");
126 writel_relaxed(BM_USBPHY_CTRL_ENHOSTDISCONDETECT, 94 writel_relaxed(BM_USBPHY_CTRL_ENHOSTDISCONDETECT,
127 phy->io_priv + HW_USBPHY_CTRL_CLR); 95 phy->io_priv + HW_USBPHY_CTRL_CLR);
128 96