Skip to contentSkip to conversation

external ulpi vbus control

PATCH In review Conor Dooley 2 participants 4 messages May 31, 2024 – Jun 1, 2024

Subsystems (5)
lore
Share & tools
lore

Conor Dooley

author maintainer
#0 lore raw

cover external ulpi vbus control

A customer sent me a patch adding a dt property to enable external vbus control as their phy didn't support it*. I was surprised to see that none of the other musb drivers made any use of this, but there is handling in the musb core for it - made me feel like I was missing something as to why it was not used by other drivers.

I've vendor prefixed the property for now, but I figure there may well be a bunch of other potential users since this isn't just an musb thing, given that there's a snps,ulpi-ext-vbus-drv used by an xHCI IP.

This is my third attempt to send these patches. I cannot find them on lore from either of my previous attempts, so I'm gonna treat this as v1. I think must've tried to send it from my kernel.org account from Microchip's corp network and that failed. Either way, apologies if this is #3 you've got from me..

* they didn't want to be identified, but said it was okay to post.

CC Conor Dooley <[email protected]>
CC Daire McNamara <[email protected]>
CC Greg Kroah-Hartman <[email protected]>
CC Rob Herring <[email protected]>
CC Krzysztof Kozlowski <[email protected]>
CC Bin Liu <[email protected]>

Conor Dooley (2):
dt-bindings: musb: mpfs: add ULPI external vbus support
usb: musb: mpfs: detect UPLI external vbus control requirement from DT

 .../devicetree/bindings/usb/microchip,mpfs-musb.yaml       | 7 +++++++
 drivers/usb/musb/mpfs.c                                    | 2 ++
 2 files changed, 9 insertions(+)
Signature · 1 line
2.43.2
author maintainer
#1 lore raw

PATCH 1/2 dt-bindings: musb: mpfs: add ULPI external vbus support

Add a property to allow configuring the musb controller on PolarFire SoC to use an external vbus for ULPI PHYs.

---
 .../devicetree/bindings/usb/microchip,mpfs-musb.yaml       | 7 +++++++
 1 file changed, 7 insertions(+)
Documentation/devicetree/bindings/usb/microchip,mpfs-musb.yaml +7 -0
index c5e9ce2e7bc2a..27b909de49922 100644
@@ -34,6 +34,13 @@ properties:
   clocks:
     maxItems: 1
 
+  microchip,ext-vbus-drv:
+    description:
+      Some ULPI USB PHYs do not support an internal VBUS supply and driving
+      the CPEN pin requires the configuration of the UPLI_USE__EXTVBUS
+      bit in ULPI_BUSCONTROL.
+    $ref: /schemas/types.yaml#/definitions/flag
+
 required:
   - compatible
   - reg
Signature · 1 line
2.43.2
author maintainer
#3 lore raw

PATCH 2/2 usb: musb: mpfs: detect UPLI external vbus control requirement from DT

In reply to Conor Dooley

The musb driver core already supports external vbus control for ULPI PHYs, but none of the drivers actually enable it. A customer reported needing this for their device, and now that a DT property for detecting this configuration exists, read the property to enable the feature.

---
 drivers/usb/musb/mpfs.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/usb/musb/mpfs.c +2 -0
index f0f56df388355..29c7e5cdb230e 100644
@@ -190,6 +190,8 @@ static int mpfs_probe(struct platform_device *pdev)
 	pdata->config = &mpfs_musb_hdrc_config;
 	pdata->platform_ops = &mpfs_ops;
 
+	pdata->extvbus = device_property_read_bool(dev, "microchip,ext-vbus-drv");
+
 	pdata->mode = usb_get_dr_mode(dev);
 	if (pdata->mode == USB_DR_MODE_UNKNOWN) {
 		dev_info(dev, "No dr_mode property found, defaulting to otg\n");
Signature · 1 line
2.43.2