Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Kever Yang | a381bcf | 2016-07-19 21:16:59 +0800 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2016 Rockchip Electronics Co., Ltd |
Kever Yang | a381bcf | 2016-07-19 21:16:59 +0800 | [diff] [blame] | 4 | */ |
Philipp Tomsich | fb74064 | 2017-09-29 19:27:54 +0200 | [diff] [blame] | 5 | |
Kever Yang | a381bcf | 2016-07-19 21:16:59 +0800 | [diff] [blame] | 6 | #include <common.h> |
Kever Yang | ad05138 | 2016-08-16 17:58:13 +0800 | [diff] [blame] | 7 | #include <dm.h> |
Simon Glass | 691d719 | 2020-05-10 11:40:02 -0600 | [diff] [blame] | 8 | #include <init.h> |
Simon Glass | f7ae49f | 2020-05-10 11:40:05 -0600 | [diff] [blame] | 9 | #include <log.h> |
Kever Yang | 15f09a1 | 2019-03-28 11:01:23 +0800 | [diff] [blame] | 10 | #include <asm/arch-rockchip/periph.h> |
Kever Yang | 05c6e30 | 2016-08-24 12:02:22 +0800 | [diff] [blame] | 11 | #include <power/regulator.h> |
Kever Yang | a381bcf | 2016-07-19 21:16:59 +0800 | [diff] [blame] | 12 | |
Kever Yang | 54b012f | 2019-07-22 20:02:18 +0800 | [diff] [blame] | 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", ®ulator); |
| 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 | } |
Kever Yang | 54b012f | 2019-07-22 20:02:18 +0800 | [diff] [blame] | 32 | #endif |