evb-rk3399.c 628 B

1234567891011121314151617181920212223242526272829303132
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * (C) Copyright 2016 Rockchip Electronics Co., Ltd
  4. */
  5. #include <common.h>
  6. #include <dm.h>
  7. #include <init.h>
  8. #include <log.h>
  9. #include <asm/arch-rockchip/periph.h>
  10. #include <power/regulator.h>
  11. #ifndef CONFIG_SPL_BUILD
  12. int board_early_init_f(void)
  13. {
  14. struct udevice *regulator;
  15. int ret;
  16. ret = regulator_get_by_platname("vcc5v0_host", &regulator);
  17. if (ret) {
  18. debug("%s vcc5v0_host init fail! ret %d\n", __func__, ret);
  19. goto out;
  20. }
  21. ret = regulator_set_enable(regulator, true);
  22. if (ret)
  23. debug("%s vcc5v0-host-en set fail! ret %d\n", __func__, ret);
  24. out:
  25. return 0;
  26. }
  27. #endif