Some platforms have an USB OTG port fully (or partially) controlled by
GPIOs:
(1) USB ID is connected directly to GPIO
Optionally:
(2) VBUS is enabled by a GPIO (when ID is grounded)
Can't the host driver still control Vbus?
I can't a clean way for host driver to control VBUS considering it
depends on USB ID.
(3) Platform has 2 USB controllers connected to same port: one for
device and one for host role. D+/- are switched between phys
by GPIO.
As per initial version, this driver has the duty to control whether
USB-Host cable is plugged in or not:
- If yes, OTG port is configured for host role
- If no, by standard, the OTG port is configured for device role
Signed-off-by: David Cohen <david.a.cohen@xxxxxxxxxxxxxxx>
---
Hi,
Some Intel Bay Trail boards have an unusual way to handle the USB OTG port:
- The USB ID pin is connected directly to GPIO on SoC
- When in host role, VBUS is provided by enabling a GPIO
- Device and host roles are supported by 2 independent controllers with D+/-
pins from port switched between different phys according a GPIO level.
The ACPI table describes this USB port as a (virtual) device with all the
necessary GPIOs. This driver implements support to this virtual device as an
extcon class driver. All drivers that depend on the USB OTG port state (USB phy,
PMIC, charge detection) will listen to extcon events.
It's very close to my setup on R-Car R8A7791 based boards. :-)
I have already submitted Maxim MAX3355 OTG chip GPIO-based driver.
Hm. I'll look for it. Thanks for pointing.
Comments are welcome.
Br, David
+static int __init vuport_init(void)
+{
+ return platform_driver_register(&vuport_driver);
+}
+subsys_initcall(vuport_init);
Hm, why?
We have drivers that depend on this one during their probe.
Br, David