]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
sunxi: usb: Drop AXP-sepcific VBUS detection and drive logic
authorPaul Kocialkowski <contact@paulk.fr>
Sun, 22 Mar 2015 17:07:10 +0000 (18:07 +0100)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 8 Sep 2015 19:47:13 +0000 (21:47 +0200)
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>
arch/arm/cpu/armv7/sunxi/usbc.c
configs/Ippo_q8h_v1_2_defconfig
configs/Ippo_q8h_v5_defconfig
drivers/usb/musb-new/sunxi.c

index 524f25ce839cec711e67b2a8c0d4fa293cc0a82a..f4f7217a6d448e7e32a8dac25d441ca134e634ce 100644 (file)
@@ -80,12 +80,6 @@ static struct sunxi_usbc_hcd {
 
 static int enabled_hcd_count;
 
-static bool use_axp_drivebus(int index)
-{
-       return index == 0 &&
-              strcmp(CONFIG_USB0_VBUS_PIN, "axp_drivebus") == 0;
-}
-
 void *sunxi_usbc_get_io_base(int index)
 {
        switch (index) {
@@ -102,9 +96,6 @@ void *sunxi_usbc_get_io_base(int index)
 
 static int get_vbus_gpio(int index)
 {
-       if (use_axp_drivebus(index))
-               return -1;
-
        switch (index) {
        case 0: return sunxi_name_to_gpio(CONFIG_USB0_VBUS_PIN);
        case 1: return sunxi_name_to_gpio(CONFIG_USB1_VBUS_PIN);
@@ -258,10 +249,6 @@ void sunxi_usbc_vbus_enable(int index)
 {
        struct sunxi_usbc_hcd *sunxi_usbc = &sunxi_usbc_hcd[index];
 
-#ifdef AXP_DRIVEBUS
-       if (use_axp_drivebus(index))
-               axp_drivebus_enable();
-#endif
        if (sunxi_usbc->gpio_vbus != -1)
                gpio_direction_output(sunxi_usbc->gpio_vbus, 1);
 }
@@ -270,10 +257,6 @@ void sunxi_usbc_vbus_disable(int index)
 {
        struct sunxi_usbc_hcd *sunxi_usbc = &sunxi_usbc_hcd[index];
 
-#ifdef AXP_DRIVEBUS
-       if (use_axp_drivebus(index))
-               axp_drivebus_disable();
-#endif
        if (sunxi_usbc->gpio_vbus != -1)
                gpio_direction_output(sunxi_usbc->gpio_vbus, 0);
 }
index 0c88edd40c1342c6f2a9f4d3aef9f2f10f88f195..e003b4ccc62db234e227b27d581f8616e160408d 100644 (file)
@@ -2,8 +2,8 @@ CONFIG_SPL=y
 CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=5"
 CONFIG_FDTFILE="sun8i-a23-ippo-q8h-v1.2.dtb"
 CONFIG_USB_MUSB_SUNXI=y
-CONFIG_USB0_VBUS_PIN="axp_drivebus"
-CONFIG_USB0_VBUS_DET="axp_vbus_detect"
+CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
+CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
 CONFIG_VIDEO_LCD_MODE="x:800,y:480,depth:18,pclk_khz:33000,le:87,ri:167,up:31,lo:13,hs:1,vs:1,sync:3,vmode:0"
 CONFIG_VIDEO_LCD_DCLK_PHASE=0
 CONFIG_VIDEO_LCD_POWER="PH7"
index 16ba03ba2a70a7756053e73df7d70027227faa59..87d898e98389bb8c055bcbde818e79fd8d15cfcd 100644 (file)
@@ -2,8 +2,8 @@ CONFIG_SPL=y
 CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=5"
 CONFIG_FDTFILE="sun8i-a23-ippo-q8h-v5.dtb"
 CONFIG_USB_MUSB_SUNXI=y
-CONFIG_USB0_VBUS_PIN="axp_drivebus"
-CONFIG_USB0_VBUS_DET="axp_vbus_detect"
+CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
+CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
 CONFIG_VIDEO_LCD_MODE="x:800,y:480,depth:18,pclk_khz:33000,le:87,ri:168,up:31,lo:13,hs:1,vs:1,sync:3,vmode:0"
 CONFIG_VIDEO_LCD_DCLK_PHASE=0
 CONFIG_VIDEO_LCD_POWER="PH7"
index 90aaec60d51e2a1dde5da5fd13ba87561baa1681..80499442f10b2f33622cd2dddbdf6997fb980b06 100644 (file)
@@ -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");