mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-03-16 23:07:00 +00:00
phy: sun4i-usb: Do not drive VBUS with external VBUS present
It is possible to use host-side USB with externally-provided VBUS. For example, some USB OTG cables have an extra power input which powers both the board and the USB peripheral. To support this setup, skip enabling the VBUS switch/regulator if VBUS voltage is already present. This behavior matches the Linux PHY driver. Signed-off-by: Samuel Holland <samuel@sholland.org> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
This commit is contained in:
parent
09cbd3858f
commit
df202d996d
1 changed files with 6 additions and 0 deletions
|
@ -224,6 +224,12 @@ static int sun4i_usb_phy_power_on(struct phy *phy)
|
|||
initial_usb_scan_delay = 0;
|
||||
}
|
||||
|
||||
/* For phy0 only turn on Vbus if we don't have an ext. Vbus */
|
||||
if (phy->id == 0 && sun4i_usb_phy_vbus_detect(phy)) {
|
||||
dev_warn(phy->dev, "External vbus detected, not enabling our own vbus\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (dm_gpio_is_valid(&usb_phy->gpio_vbus))
|
||||
dm_gpio_set_value(&usb_phy->gpio_vbus, 1);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue