summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2015-03-22 18:07:10 +0100
committerHans de Goede <hdegoede@redhat.com>2015-04-15 16:17:17 +0200
commit5eaacb4340f7be10cf83e076529747fa70c85907 (patch)
tree4c28eeec02f73ae935187d1766b3542241a48fc0 /drivers/usb
parentf7c7ab636ab2c81d9fb1def7256c94b998c7298f (diff)
downloadu-boot-imx-5eaacb4340f7be10cf83e076529747fa70c85907.zip
u-boot-imx-5eaacb4340f7be10cf83e076529747fa70c85907.tar.gz
u-boot-imx-5eaacb4340f7be10cf83e076529747fa70c85907.tar.bz2
sunxi: usb: Drop AXP-sepcific VBUS detection and drive logic
VBUS detection and enable is now be used with virtual AXP GPIOs, so all the USB code has to use GPIO in every case and let sunxi_gpio do the heavy lifting. Signed-off-by: Paul Kocialkowski <contact@paulk.fr> Acked-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/musb-new/sunxi.c48
1 files changed, 19 insertions, 29 deletions
diff --git a/drivers/usb/musb-new/sunxi.c b/drivers/usb/musb-new/sunxi.c
index 90aaec6..8049944 100644
--- a/drivers/usb/musb-new/sunxi.c
+++ b/drivers/usb/musb-new/sunxi.c
@@ -238,38 +238,28 @@ static int sunxi_musb_init(struct musb *musb)
if (is_host_enabled(musb)) {
int vbus_det = sunxi_name_to_gpio(CONFIG_USB0_VBUS_DET);
-#ifdef AXP_VBUS_DETECT
- if (!strcmp(CONFIG_USB0_VBUS_DET, "axp_vbus_detect")) {
- err = axp_get_vbus();
- if (err < 0)
- return err;
- } else {
-#endif
- if (vbus_det == -1) {
- eprintf("Error invalid Vusb-det pin\n");
- return -EINVAL;
- }
-
- err = gpio_request(vbus_det, "vbus0_det");
- if (err)
- return err;
-
- err = gpio_direction_input(vbus_det);
- if (err) {
- gpio_free(vbus_det);
- return err;
- }
-
- err = gpio_get_value(vbus_det);
- if (err < 0) {
- gpio_free(vbus_det);
- return -EIO;
- }
+ if (vbus_det == -1) {
+ eprintf("Error invalid Vusb-det pin\n");
+ return -EINVAL;
+ }
+
+ err = gpio_request(vbus_det, "vbus0_det");
+ if (err)
+ return err;
+ err = gpio_direction_input(vbus_det);
+ if (err) {
gpio_free(vbus_det);
-#ifdef AXP_VBUS_DETECT
+ return err;
}
-#endif
+
+ err = gpio_get_value(vbus_det);
+ if (err < 0) {
+ gpio_free(vbus_det);
+ return -EIO;
+ }
+
+ gpio_free(vbus_det);
if (err) {
eprintf("Error: A charger is plugged into the OTG\n");