]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/phy/phy-core.c
phy: Add reset callback
[mirror_ubuntu-bionic-kernel.git] / drivers / phy / phy-core.c
index 8eca906b6e70b463b63a49998f55f8813d54dc92..a268f4d6f3e9002e753d18ecabab123feed37a29 100644 (file)
@@ -357,6 +357,21 @@ int phy_set_mode(struct phy *phy, enum phy_mode mode)
 }
 EXPORT_SYMBOL_GPL(phy_set_mode);
 
+int phy_reset(struct phy *phy)
+{
+       int ret;
+
+       if (!phy || !phy->ops->reset)
+               return 0;
+
+       mutex_lock(&phy->mutex);
+       ret = phy->ops->reset(phy);
+       mutex_unlock(&phy->mutex);
+
+       return ret;
+}
+EXPORT_SYMBOL_GPL(phy_reset);
+
 /**
  * _of_phy_get() - lookup and obtain a reference to a phy by phandle
  * @np: device_node for which to get the phy