]> git.sur5r.net Git - u-boot/blobdiff - drivers/usb/host/xhci-exynos5.c
usb: dwc3: add dwc3 folder from linux kernel to u-boot
[u-boot] / drivers / usb / host / xhci-exynos5.c
index 1146d101de40901d5789c342c3716a2f2a1b7aaf..3f86fdca8973cb901e88d109e9d65e0f63f86e21 100644 (file)
@@ -40,7 +40,7 @@ struct exynos_xhci {
        struct exynos_usb3_phy *usb3_phy;
        struct xhci_hccr *hcd;
        struct dwc3 *dwc3_reg;
-       struct fdt_gpio_state vbus_gpio;
+       struct gpio_desc vbus_gpio;
 };
 
 static struct exynos_xhci exynos;
@@ -69,7 +69,8 @@ static int exynos_usb3_parse_dt(const void *blob, struct exynos_xhci *exynos)
        exynos->hcd = (struct xhci_hccr *)addr;
 
        /* Vbus gpio */
-       fdtdec_decode_gpio(blob, node, "samsung,vbus-gpio", &exynos->vbus_gpio);
+       gpio_request_by_name_nodev(blob, node, "samsung,vbus-gpio", 0,
+                                  &exynos->vbus_gpio, GPIOD_IS_OUT);
 
        depth = 0;
        node = fdtdec_next_compatible_subnode(blob, node,
@@ -181,7 +182,7 @@ static void exynos5_usb3_phy_exit(struct exynos_usb3_phy *phy)
        set_usbdrd_phy_ctrl(POWER_USB_DRD_PHY_CTRL_DISABLE);
 }
 
-void dwc3_set_mode(struct dwc3 *dwc3_reg, u32 mode)
+static void dwc3_set_mode(struct dwc3 *dwc3_reg, u32 mode)
 {
        clrsetbits_le32(&dwc3_reg->g_ctl,
                        DWC3_GCTL_PRTCAPDIR(DWC3_GCTL_PRTCAP_OTG),
@@ -298,8 +299,8 @@ int xhci_hcd_init(int index, struct xhci_hccr **hccr, struct xhci_hcor **hcor)
 
 #ifdef CONFIG_OF_CONTROL
        /* setup the Vbus gpio here */
-       if (!fdtdec_setup_gpio(&ctx->vbus_gpio))
-               gpio_direction_output(ctx->vbus_gpio.gpio, 1);
+       if (dm_gpio_is_valid(&ctx->vbus_gpio))
+               dm_gpio_set_value(&ctx->vbus_gpio, 1);
 #endif
 
        ret = exynos_xhci_core_init(ctx);