diff options
author | Hans de Goede <hdegoede@redhat.com> | 2015-07-08 16:44:22 +0200 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2015-08-08 16:26:19 +0200 |
commit | c9f8947e66042b49bba358d4bce531da3bd440be (patch) | |
tree | 8c1785ba6f2a8ea1aa9e771c31616d282692f353 /arch/arm | |
parent | 960caeba8f76baffc7201b7535de964f406d48b3 (diff) | |
download | u-boot-imx-c9f8947e66042b49bba358d4bce531da3bd440be.zip u-boot-imx-c9f8947e66042b49bba358d4bce531da3bd440be.tar.gz u-boot-imx-c9f8947e66042b49bba358d4bce531da3bd440be.tar.bz2 |
sunxi: usb-phy: Never power off the usb ports
USB devices are not really designed to get the power bounced off and on
at them. Esp. USB powered harddisks do not like this.
Currently we power off the USB ports both on a "usb reset" and when
booting the kernel, causing the usb-power to bounce off and then back
on again.
This patch removes the powering off calls, fixing the undesirable power
bouncing.
Note this requires some special handling for the OTG port:
1) We must skip the external vbus check if we've already enabled our own
vbus to avoid false positives
2) If on an usb reset we no longer detect that the id-pin is grounded, turn
off vbus as that means an external vbus may be present now
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/cpu/armv7/sunxi/usb_phy.c | 7 | ||||
-rw-r--r-- | arch/arm/include/asm/arch-sunxi/usb_phy.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv7/sunxi/usb_phy.c b/arch/arm/cpu/armv7/sunxi/usb_phy.c index 4d63a74..b7ca5d4 100644 --- a/arch/arm/cpu/armv7/sunxi/usb_phy.c +++ b/arch/arm/cpu/armv7/sunxi/usb_phy.c @@ -232,6 +232,13 @@ void sunxi_usb_phy_power_off(int index) gpio_set_value(phy->gpio_vbus, 0); } +int sunxi_usb_phy_power_is_on(int index) +{ + struct sunxi_usb_phy *phy = &sunxi_usb_phy[index]; + + return phy->power_on_count > 0; +} + int sunxi_usb_phy_vbus_detect(int index) { struct sunxi_usb_phy *phy = &sunxi_usb_phy[index]; diff --git a/arch/arm/include/asm/arch-sunxi/usb_phy.h b/arch/arm/include/asm/arch-sunxi/usb_phy.h index cef6c98..6a14cad 100644 --- a/arch/arm/include/asm/arch-sunxi/usb_phy.h +++ b/arch/arm/include/asm/arch-sunxi/usb_phy.h @@ -16,6 +16,7 @@ void sunxi_usb_phy_init(int index); void sunxi_usb_phy_exit(int index); void sunxi_usb_phy_power_on(int index); void sunxi_usb_phy_power_off(int index); +int sunxi_usb_phy_power_is_on(int index); int sunxi_usb_phy_vbus_detect(int index); int sunxi_usb_phy_id_detect(int index); void sunxi_usb_phy_enable_squelch_detect(int index, int enable); |