stm32mp_pmic.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * Copyright (c) 2017-2022, STMicroelectronics - All Rights Reserved
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef STM32MP_PMIC_H
  7. #define STM32MP_PMIC_H
  8. #include <stdbool.h>
  9. #include <platform_def.h>
  10. /*
  11. * dt_pmic_status - Check PMIC status from device tree
  12. *
  13. * Returns the status of the PMIC (secure, non-secure), or a negative value on
  14. * error
  15. */
  16. int dt_pmic_status(void);
  17. /*
  18. * initialize_pmic_i2c - Initialize I2C for the PMIC control
  19. *
  20. * Returns true if PMIC is available, false if not found, panics on errors
  21. */
  22. bool initialize_pmic_i2c(void);
  23. /*
  24. * initialize_pmic - Main PMIC initialization function, called at platform init
  25. *
  26. * Panics on errors
  27. */
  28. void initialize_pmic(void);
  29. #if DEBUG
  30. void print_pmic_info_and_debug(void);
  31. #else
  32. static inline void print_pmic_info_and_debug(void)
  33. {
  34. }
  35. #endif
  36. /*
  37. * pmic_ddr_power_init - Initialize regulators required for DDR
  38. *
  39. * Returns 0 on success, and negative values on errors
  40. */
  41. int pmic_ddr_power_init(enum ddr_type ddr_type);
  42. /*
  43. * pmic_voltages_init - Update voltages for platform init
  44. *
  45. * Returns 0 on success, and negative values on errors
  46. */
  47. int pmic_voltages_init(void);
  48. #endif /* STM32MP_PMIC_H */