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>
|
|
|
|
#include <dm/pinctrl.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
|
|
|
|
|
|
|
int board_init(void)
|
|
|
|
{
|
2019-06-21 20:57:20 +00:00
|
|
|
struct udevice *regulator;
|
2016-08-16 09:58:13 +00:00
|
|
|
int ret;
|
|
|
|
|
2017-04-12 04:00:06 +00:00
|
|
|
ret = regulators_enable_boot_on(false);
|
2016-09-23 07:57:20 +00:00
|
|
|
if (ret)
|
2017-04-12 04:00:06 +00:00
|
|
|
debug("%s: Cannot enable boot on regulator\n", __func__);
|
2016-09-23 07:57:20 +00:00
|
|
|
|
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);
|
|
|
|
if (ret) {
|
|
|
|
debug("%s vcc5v0-host-en set fail!\n", __func__);
|
|
|
|
goto out;
|
|
|
|
}
|
|
|
|
|
2016-08-16 09:58:13 +00:00
|
|
|
out:
|
2016-07-19 13:16:59 +00:00
|
|
|
return 0;
|
|
|
|
}
|