Merge branch '2020-05-18-reduce-size-of-common.h'
[oweals/u-boot.git] / board / rockchip / evb_rk3399 / evb-rk3399.c
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * (C) Copyright 2016 Rockchip Electronics Co., Ltd
4  */
5
6 #include <common.h>
7 #include <dm.h>
8 #include <init.h>
9 #include <log.h>
10 #include <asm/arch-rockchip/periph.h>
11 #include <power/regulator.h>
12
13 #ifndef CONFIG_SPL_BUILD
14 int board_early_init_f(void)
15 {
16         struct udevice *regulator;
17         int ret;
18
19         ret = regulator_get_by_platname("vcc5v0_host", &regulator);
20         if (ret) {
21                 debug("%s vcc5v0_host init fail! ret %d\n", __func__, ret);
22                 goto out;
23         }
24
25         ret = regulator_set_enable(regulator, true);
26         if (ret)
27                 debug("%s vcc5v0-host-en set fail! ret %d\n", __func__, ret);
28
29 out:
30         return 0;
31 }
32 #endif