diff options
author | Kishon Vijay Abraham I <kishon@ti.com> | 2016-07-04 18:07:25 +0530 |
---|---|---|
committer | Kishon Vijay Abraham I <kishon@ti.com> | 2016-07-04 18:07:25 +0530 |
commit | 6f7d2346cb9cc1f5b8a4881f06934f1cc50f02db (patch) | |
tree | 822ce55db89fbcedfeffa9970d9678d0eebd551a /drivers/phy/phy-core.c | |
parent | phy-sun4i-usb: Fix irq free conditions to match request conditions (diff) | |
parent | phy: Add set_mode callback (diff) | |
download | linux-dev-6f7d2346cb9cc1f5b8a4881f06934f1cc50f02db.tar.xz linux-dev-6f7d2346cb9cc1f5b8a4881f06934f1cc50f02db.zip |
Merge tag 'phy-set-mode-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy into next
Add new set_mode phy ops
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Diffstat (limited to 'drivers/phy/phy-core.c')
-rw-r--r-- | drivers/phy/phy-core.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c index b72e9a3b6429..8eca906b6e70 100644 --- a/drivers/phy/phy-core.c +++ b/drivers/phy/phy-core.c @@ -342,6 +342,21 @@ int phy_power_off(struct phy *phy) } EXPORT_SYMBOL_GPL(phy_power_off); +int phy_set_mode(struct phy *phy, enum phy_mode mode) +{ + int ret; + + if (!phy || !phy->ops->set_mode) + return 0; + + mutex_lock(&phy->mutex); + ret = phy->ops->set_mode(phy, mode); + mutex_unlock(&phy->mutex); + + return ret; +} +EXPORT_SYMBOL_GPL(phy_set_mode); + /** * _of_phy_get() - lookup and obtain a reference to a phy by phandle * @np: device_node for which to get the phy |