Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Kever Yang | 0d3d783 | 2016-07-19 21:16:59 +0800 | [diff] [blame] | 2 | /* |
3 | * (C) Copyright 2016 Rockchip Electronics Co., Ltd | ||||
Kever Yang | 0d3d783 | 2016-07-19 21:16:59 +0800 | [diff] [blame] | 4 | */ |
Philipp Tomsich | 3df6626 | 2017-09-29 19:27:54 +0200 | [diff] [blame] | 5 | |
Kever Yang | 0d3d783 | 2016-07-19 21:16:59 +0800 | [diff] [blame] | 6 | #include <common.h> |
Kever Yang | 6d26c06 | 2016-08-16 17:58:13 +0800 | [diff] [blame] | 7 | #include <dm.h> |
Kever Yang | 9fbe17c | 2019-03-28 11:01:23 +0800 | [diff] [blame] | 8 | #include <asm/arch-rockchip/periph.h> |
Kever Yang | b139529 | 2016-08-24 12:02:22 +0800 | [diff] [blame] | 9 | #include <power/regulator.h> |
Kever Yang | 0d3d783 | 2016-07-19 21:16:59 +0800 | [diff] [blame] | 10 | |
Kever Yang | 804c9f1 | 2019-07-22 20:02:18 +0800 | [diff] [blame] | 11 | #ifndef CONFIG_SPL_BUILD |
12 | int board_early_init_f(void) | ||||
Kever Yang | 0d3d783 | 2016-07-19 21:16:59 +0800 | [diff] [blame] | 13 | { |
Mark Kettenis | c741f53 | 2019-06-21 22:57:20 +0200 | [diff] [blame] | 14 | struct udevice *regulator; |
Kever Yang | 6d26c06 | 2016-08-16 17:58:13 +0800 | [diff] [blame] | 15 | int ret; |
16 | |||||
Kever Yang | b139529 | 2016-08-24 12:02:22 +0800 | [diff] [blame] | 17 | ret = regulator_get_by_platname("vcc5v0_host", ®ulator); |
18 | if (ret) { | ||||
19 | debug("%s vcc5v0_host init fail! ret %d\n", __func__, ret); | ||||
20 | goto out; | ||||
21 | } | ||||
22 | |||||
23 | ret = regulator_set_enable(regulator, true); | ||||
Kever Yang | 804c9f1 | 2019-07-22 20:02:18 +0800 | [diff] [blame] | 24 | if (ret) |
25 | debug("%s vcc5v0-host-en set fail! ret %d\n", __func__, ret); | ||||
Kever Yang | b139529 | 2016-08-24 12:02:22 +0800 | [diff] [blame] | 26 | |
Kever Yang | 6d26c06 | 2016-08-16 17:58:13 +0800 | [diff] [blame] | 27 | out: |
Kever Yang | 0d3d783 | 2016-07-19 21:16:59 +0800 | [diff] [blame] | 28 | return 0; |
29 | } | ||||
Kever Yang | 804c9f1 | 2019-07-22 20:02:18 +0800 | [diff] [blame] | 30 | #endif |