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> |
Simon Glass | 9758973 | 2020-05-10 11:40:02 -0600 | [diff] [blame] | 8 | #include <init.h> |
Simon Glass | 0f2af88 | 2020-05-10 11:40:05 -0600 | [diff] [blame] | 9 | #include <log.h> |
Kever Yang | 9fbe17c | 2019-03-28 11:01:23 +0800 | [diff] [blame] | 10 | #include <asm/arch-rockchip/periph.h> |
Kever Yang | b139529 | 2016-08-24 12:02:22 +0800 | [diff] [blame] | 11 | #include <power/regulator.h> |
Kever Yang | 0d3d783 | 2016-07-19 21:16:59 +0800 | [diff] [blame] | 12 | |
Kever Yang | 804c9f1 | 2019-07-22 20:02:18 +0800 | [diff] [blame] | 13 | #ifndef CONFIG_SPL_BUILD |
14 | int board_early_init_f(void) | ||||
Kever Yang | 0d3d783 | 2016-07-19 21:16:59 +0800 | [diff] [blame] | 15 | { |
Mark Kettenis | c741f53 | 2019-06-21 22:57:20 +0200 | [diff] [blame] | 16 | struct udevice *regulator; |
Kever Yang | 6d26c06 | 2016-08-16 17:58:13 +0800 | [diff] [blame] | 17 | int ret; |
18 | |||||
Kever Yang | b139529 | 2016-08-24 12:02:22 +0800 | [diff] [blame] | 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); | ||||
Kever Yang | 804c9f1 | 2019-07-22 20:02:18 +0800 | [diff] [blame] | 26 | if (ret) |
27 | debug("%s vcc5v0-host-en set fail! ret %d\n", __func__, ret); | ||||
Kever Yang | b139529 | 2016-08-24 12:02:22 +0800 | [diff] [blame] | 28 | |
Kever Yang | 6d26c06 | 2016-08-16 17:58:13 +0800 | [diff] [blame] | 29 | out: |
Kever Yang | 0d3d783 | 2016-07-19 21:16:59 +0800 | [diff] [blame] | 30 | return 0; |
31 | } | ||||
Kever Yang | 804c9f1 | 2019-07-22 20:02:18 +0800 | [diff] [blame] | 32 | #endif |