1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2015, Google, Inc
9 #include <dm/device-internal.h>
10 #include <dm/uclass-internal.h>
12 #define GPIO_BANKE_NAME "gpioe"
17 struct gpio_desc desc;
21 * Turn on USB VBUS for the two USB ports on the board.
22 * Each port's VBUS is controlled by a GPIO pin.
25 ret = uclass_find_device_by_name(UCLASS_GPIO, GPIO_BANKE_NAME, &dev);
27 debug("%s: GPIO %s device cannot be not found (ret=%d)\n",
28 __func__, GPIO_BANKE_NAME, ret);
32 ret = device_probe(dev);
34 debug("%s: GPIO %s device probe failed (ret=%d)\n",
35 __func__, GPIO_BANKE_NAME, ret);
40 desc.flags = GPIOD_IS_OUT;
42 /* GPIO E8 controls the bottom port */
45 ret = dm_gpio_request(&desc, "usb_host_en0");
48 dm_gpio_set_value(&desc, 1);
50 /* GPIO E9 controls the upper port */
53 ret = dm_gpio_request(&desc, "usb_host_en1");
57 dm_gpio_set_value(&desc, 1);