mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
phy: Add set_mode callback
The initial use for this is for PHYs that have a mode related to USB OTG. There are several SoCs (e.g. TI OMAP and DA8xx) that have a mode setting in the USB PHY to override OTG VBUS and ID signals. Of course, the enum can be expaned in the future to include modes for other types of PHYs as well. Suggested-by: Kishon Vijay Abraham I <[email protected]> Signed-off-by: David Lechner <[email protected]>
This commit is contained in:
parent
65048f4dd9
commit
300eb0139c
2 changed files with 32 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue