summaryrefslogtreecommitdiff
path: root/drivers/phy
diff options
context:
space:
mode:
authorPatrick Delaunay <patrick.delaunay@foss.st.com>2021-09-14 15:31:16 +0300
committerPatrice Chotard <patrice.chotard@foss.st.com>2021-10-08 09:19:59 +0300
commit5b4fa85d6501e77bd6ed8e5fd1e527927f9f947d (patch)
tree755f1dfad5fa7bf0f1681093b3700bba65b240fb /drivers/phy
parente69c4143e82b848ba769e841930132f7548b5d23 (diff)
downloadu-boot-5b4fa85d6501e77bd6ed8e5fd1e527927f9f947d.tar.xz
phy: stm32-usbphyc: use connector for vbus-supply with phy-stm32-usbphyc
The vbus-supply is an optional property of sub-node connector node. and no more in the usb phyc node (in first proposed binding). This regulator for USB VBUS may be needed for host mode. See the latest kernel binding for details in Documentation/devicetree/bindings/phy/phy-stm32-usbphyc.yaml. usbphyc_port0: usb-phy@0 { reg = <0>; phy-supply = <&vdd_usb>; #phy-cells = <0>; connector { compatible = "usb-a-connector"; vbus-supply = <&vbus_sw>; }; }; Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Diffstat (limited to 'drivers/phy')
-rw-r--r--drivers/phy/phy-stm32-usbphyc.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/phy/phy-stm32-usbphyc.c b/drivers/phy/phy-stm32-usbphyc.c
index 02d859a039..c206efd28d 100644
--- a/drivers/phy/phy-stm32-usbphyc.c
+++ b/drivers/phy/phy-stm32-usbphyc.c
@@ -339,7 +339,7 @@ static int stm32_usbphyc_probe(struct udevice *dev)
{
struct stm32_usbphyc *usbphyc = dev_get_priv(dev);
struct reset_ctl reset;
- ofnode node;
+ ofnode node, connector;
int i, ret;
usbphyc->base = dev_read_addr(dev);
@@ -395,10 +395,12 @@ static int stm32_usbphyc_probe(struct udevice *dev)
return ret;
}
- ret = stm32_usbphyc_get_regulator(node, "vbus-supply",
- &usbphyc_phy->vbus);
- if (ret)
- usbphyc_phy->vbus = NULL;
+ usbphyc_phy->vbus = NULL;
+ connector = ofnode_find_subnode(node, "connector");
+ if (ofnode_valid(connector)) {
+ ret = stm32_usbphyc_get_regulator(connector, "vbus-supply",
+ &usbphyc_phy->vbus);
+ }
node = dev_read_next_subnode(node);
}