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