summaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb-new
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2015-04-16 12:51:23 -0400
committerTom Rini <trini@konsulko.com>2015-04-16 12:51:23 -0400
commit20913018fbce5a2e3c93b6eeb56e67460e29542c (patch)
tree9888a4ca3c9124ac4a298ebea270e4163560c56b /drivers/usb/musb-new
parenta32d27912961040230320268d6cde80e9442dc33 (diff)
parent6c739c5d8a3466f8ef2f8543636484957bcca6ee (diff)
downloadu-boot-20913018fbce5a2e3c93b6eeb56e67460e29542c.tar.gz
u-boot-20913018fbce5a2e3c93b6eeb56e67460e29542c.tar.xz
u-boot-20913018fbce5a2e3c93b6eeb56e67460e29542c.zip
Merge branch 'master' of http://git.denx.de/u-boot-sunxi
Diffstat (limited to 'drivers/usb/musb-new')
-rw-r--r--drivers/usb/musb-new/sunxi.c45
1 files changed, 6 insertions, 39 deletions
diff --git a/drivers/usb/musb-new/sunxi.c b/drivers/usb/musb-new/sunxi.c
index 90aaec60d5..c9a6a16b89 100644
--- a/drivers/usb/musb-new/sunxi.c
+++ b/drivers/usb/musb-new/sunxi.c
@@ -235,52 +235,19 @@ static int sunxi_musb_init(struct musb *musb)
pr_debug("%s():\n", __func__);
- 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;
- }
-
- gpio_free(vbus_det);
-#ifdef AXP_VBUS_DETECT
- }
-#endif
+ err = sunxi_usbc_request_resources(0);
+ if (err)
+ return err;
+ if (is_host_enabled(musb)) {
+ err = sunxi_usbc_vbus_detect(0);
if (err) {
eprintf("Error: A charger is plugged into the OTG\n");
+ sunxi_usbc_free_resources(0);
return -EIO;
}
}
- err = sunxi_usbc_request_resources(0);
- if (err)
- return err;
-
musb->isr = sunxi_musb_interrupt;
sunxi_usbc_enable(0);