diff options
author | Jagan Teki <jagan@amarulasolutions.com> | 2018-05-07 13:03:37 +0530 |
---|---|---|
committer | Jagan Teki <jagan@amarulasolutions.com> | 2018-05-28 16:40:43 +0530 |
commit | aa29b11b3fdeaedb9689e89e467e6bbd036780ac (patch) | |
tree | 7fa2303d653682ed99a61a6499812763832cfb7c /drivers/usb/musb-new/sunxi.c | |
parent | 237050fc62c8313a50cd3618dbb21638a818f0bb (diff) |
phy: sun4i-usb: Add a sunxi specific function for setting squelch-detect
The sunxi otg phy has a bug where it wrongly detects a high speed squelch
when reset on the root port gets de-asserted with a lo-speed device.
The workaround for this is to disable squelch detect before de-asserting
reset, and re-enabling it after the reset de-assert is done. Add a sunxi
specific phy function to allow the sunxi-musb glue to do this.
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Jun Nie <jun.nie@linaro.org>
Diffstat (limited to 'drivers/usb/musb-new/sunxi.c')
-rw-r--r-- | drivers/usb/musb-new/sunxi.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/usb/musb-new/sunxi.c b/drivers/usb/musb-new/sunxi.c index a33ebe5caf..5728a3f384 100644 --- a/drivers/usb/musb-new/sunxi.c +++ b/drivers/usb/musb-new/sunxi.c @@ -304,10 +304,26 @@ static int sunxi_musb_init(struct musb *musb) return 0; } +static void sunxi_musb_pre_root_reset_end(struct musb *musb) +{ + struct sunxi_glue *glue = to_sunxi_glue(musb->controller); + + sun4i_usb_phy_set_squelch_detect(glue->phy, false); +} + +static void sunxi_musb_post_root_reset_end(struct musb *musb) +{ + struct sunxi_glue *glue = to_sunxi_glue(musb->controller); + + sun4i_usb_phy_set_squelch_detect(glue->phy, true); +} + static const struct musb_platform_ops sunxi_musb_ops = { .init = sunxi_musb_init, .enable = sunxi_musb_enable, .disable = sunxi_musb_disable, + .pre_root_reset_end = sunxi_musb_pre_root_reset_end, + .post_root_reset_end = sunxi_musb_post_root_reset_end, }; /* Allwinner OTG supports up to 5 endpoints */ |