summaryrefslogtreecommitdiff
path: root/drivers/phy
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2023-03-17 12:31:47 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2023-03-20 16:05:12 +0100
commit226f325973fc830f5ee93f64db9994d5f8602de7 (patch)
tree5dc650a8bd5704138905f01af201bdebe09ff1b4 /drivers/phy
parentcb0927332cb0f7e7a2dd9b631124389c2ada76d6 (diff)
downloadbarebox-226f325973fc830f5ee93f64db9994d5f8602de7.tar.gz
phy: Add mode setting support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/phy')
-rw-r--r--drivers/phy/phy-core.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
index a5dd32e666..1a23f35b95 100644
--- a/drivers/phy/phy-core.c
+++ b/drivers/phy/phy-core.c
@@ -203,6 +203,21 @@ int phy_power_off(struct phy *phy)
return 0;
}
+int phy_set_mode_ext(struct phy *phy, enum phy_mode mode, int submode)
+{
+ int ret;
+
+ if (!phy || !phy->ops->set_mode)
+ return 0;
+
+ ret = phy->ops->set_mode(phy, mode, submode);
+ if (!ret)
+ phy->attrs.mode = mode;
+
+ return ret;
+}
+EXPORT_SYMBOL_GPL(phy_set_mode_ext);
+
struct usb_phy *phy_to_usbphy(struct phy *phy)
{
if (!phy)