diff options
author | Daniel Mack <zonque@gmail.com> | 2014-04-16 11:11:16 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2014-04-21 11:21:24 -0400 |
commit | a31a942a148e0083ce560ffeb54fb60e06ab7201 (patch) | |
tree | 61b9882c9d76d86f19f9bf3c7fd9d7206cef0e0b /drivers/usb | |
parent | 2656c9e28125e96bee212f146cc3f2419fd3ffef (diff) |
usb: phy: am335x-control: wait 1ms after power-up transitions
Tests have shown that when a power-up transition is followed by other
PHY operations too quickly, the USB port appears dead. Waiting 1ms fixes
this problem.
Signed-off-by: Daniel Mack <zonque@gmail.com>
Cc: stable@vger.kernel.org [3.14]
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/phy/phy-am335x-control.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/usb/phy/phy-am335x-control.c b/drivers/usb/phy/phy-am335x-control.c index d75196ad5f2f..35b6083b7999 100644 --- a/drivers/usb/phy/phy-am335x-control.c +++ b/drivers/usb/phy/phy-am335x-control.c | |||
@@ -3,6 +3,7 @@ | |||
3 | #include <linux/err.h> | 3 | #include <linux/err.h> |
4 | #include <linux/of.h> | 4 | #include <linux/of.h> |
5 | #include <linux/io.h> | 5 | #include <linux/io.h> |
6 | #include <linux/delay.h> | ||
6 | #include "am35x-phy-control.h" | 7 | #include "am35x-phy-control.h" |
7 | 8 | ||
8 | struct am335x_control_usb { | 9 | struct am335x_control_usb { |
@@ -86,6 +87,14 @@ static void am335x_phy_power(struct phy_control *phy_ctrl, u32 id, bool on) | |||
86 | } | 87 | } |
87 | 88 | ||
88 | writel(val, usb_ctrl->phy_reg + reg); | 89 | writel(val, usb_ctrl->phy_reg + reg); |
90 | |||
91 | /* | ||
92 | * Give the PHY ~1ms to complete the power up operation. | ||
93 | * Tests have shown unstable behaviour if other USB PHY related | ||
94 | * registers are written too shortly after such a transition. | ||
95 | */ | ||
96 | if (on) | ||
97 | mdelay(1); | ||
89 | } | 98 | } |
90 | 99 | ||
91 | static const struct phy_control ctrl_am335x = { | 100 | static const struct phy_control ctrl_am335x = { |