mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
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>
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
#define PHY_TX_AMPLITUDE_TUNE 0x20
|
||||
#define PHY_TX_SLEWRATE_TUNE 0x22
|
||||
#define PHY_DISCON_TH_SEL 0x2a
|
||||
#define PHY_SQUELCH_DETECT 0x3c
|
||||
|
||||
#define PHYCTL_DATA BIT(7)
|
||||
#define OTGCTL_ROUTE_MUSB BIT(0)
|
||||
@@ -383,6 +384,11 @@ int sun4i_usb_phy_id_detect(struct phy *phy)
|
||||
return gpio_get_value(usb_phy->gpio_id_det);
|
||||
}
|
||||
|
||||
void sun4i_usb_phy_set_squelch_detect(struct phy *phy, bool enabled)
|
||||
{
|
||||
sun4i_usb_phy_write(phy, PHY_SQUELCH_DETECT, enabled ? 0 : 2, 2);
|
||||
}
|
||||
|
||||
static struct phy_ops sun4i_usb_phy_ops = {
|
||||
.of_xlate = sun4i_usb_phy_xlate,
|
||||
.init = sun4i_usb_phy_init,
|
||||
|
||||
Reference in New Issue
Block a user