2018-05-06 21:58:06 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2016-07-19 13:16:59 +00:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2016 Rockchip Electronics Co., Ltd
|
|
|
|
*/
|
2017-09-29 17:27:54 +00:00
|
|
|
|
2016-07-19 13:16:59 +00:00
|
|
|
#include <common.h>
|
2016-08-16 09:58:13 +00:00
|
|
|
#include <dm.h>
|
2019-03-28 03:01:23 +00:00
|
|
|
#include <asm/arch-rockchip/periph.h>
|
2016-08-24 04:02:22 +00:00
|
|
|
#include <power/regulator.h>
|
2016-07-19 13:16:59 +00:00
|
|
|
|
2019-07-22 12:02:18 +00:00
|
|
|
#ifndef CONFIG_SPL_BUILD
|
|
|
|
int board_early_init_f(void)
|
2016-07-19 13:16:59 +00:00
|
|
|
{
|
2019-06-21 20:57:20 +00:00
|
|
|
struct udevice *regulator;
|
2016-08-16 09:58:13 +00:00
|
|
|
int ret;
|
|
|
|
|
2016-08-24 04:02:22 +00:00
|
|
|
ret = regulator_get_by_platname("vcc5v0_host", ®ulator);
|
|
|
|
if (ret) {
|
|
|
|
debug("%s vcc5v0_host init fail! ret %d\n", __func__, ret);
|
|
|
|
goto out;
|
|
|
|
}
|
|
|
|
|
|
|
|
ret = regulator_set_enable(regulator, true);
|
2019-07-22 12:02:18 +00:00
|
|
|
if (ret)
|
|
|
|
debug("%s vcc5v0-host-en set fail! ret %d\n", __func__, ret);
|
2016-08-24 04:02:22 +00:00
|
|
|
|
2016-08-16 09:58:13 +00:00
|
|
|
out:
|
2016-07-19 13:16:59 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2019-07-22 12:02:18 +00:00
|
|
|
#endif
|