]> git.sur5r.net Git - u-boot/blobdiff - drivers/phy/allwinner/phy-sun4i-usb.c
phy: sun4i-usb: Add a sunxi specific function for setting squelch-detect
[u-boot] / drivers / phy / allwinner / phy-sun4i-usb.c
index 4194a1500779556ff86e298d7301c1165ad949b2..2b3cf48025cd1377d84d62bb56f9f113be8663e1 100644 (file)
@@ -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,