mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-12-20 10:13:09 +00:00
83d290c56f
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
60 lines
1.1 KiB
C
60 lines
1.1 KiB
C
// SPDX-License-Identifier: GPL-2.0+
|
|
/*
|
|
* Copyright (C) 2015, Google, Inc
|
|
*/
|
|
|
|
#include <common.h>
|
|
#include <dm.h>
|
|
#include <asm/gpio.h>
|
|
#include <dm/device-internal.h>
|
|
#include <dm/uclass-internal.h>
|
|
|
|
#define GPIO_BANKE_NAME "gpioe"
|
|
|
|
int misc_init_r(void)
|
|
{
|
|
struct udevice *dev;
|
|
struct gpio_desc desc;
|
|
int ret;
|
|
|
|
/*
|
|
* Turn on USB VBUS for the two USB ports on the board.
|
|
* Each port's VBUS is controlled by a GPIO pin.
|
|
*/
|
|
|
|
ret = uclass_find_device_by_name(UCLASS_GPIO, GPIO_BANKE_NAME, &dev);
|
|
if (ret) {
|
|
debug("%s: GPIO %s device cannot be not found (ret=%d)\n",
|
|
__func__, GPIO_BANKE_NAME, ret);
|
|
return ret;
|
|
}
|
|
|
|
ret = device_probe(dev);
|
|
if (ret) {
|
|
debug("%s: GPIO %s device probe failed (ret=%d)\n",
|
|
__func__, GPIO_BANKE_NAME, ret);
|
|
return ret;
|
|
}
|
|
|
|
desc.dev = dev;
|
|
desc.flags = GPIOD_IS_OUT;
|
|
|
|
/* GPIO E8 controls the bottom port */
|
|
desc.offset = 8;
|
|
|
|
ret = dm_gpio_request(&desc, "usb_host_en0");
|
|
if (ret)
|
|
return ret;
|
|
dm_gpio_set_value(&desc, 1);
|
|
|
|
/* GPIO E9 controls the upper port */
|
|
desc.offset = 9;
|
|
|
|
ret = dm_gpio_request(&desc, "usb_host_en1");
|
|
if (ret)
|
|
return ret;
|
|
|
|
dm_gpio_set_value(&desc, 1);
|
|
|
|
return 0;
|
|
}
|