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