stm32mp_pmic.h 1014 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright (c) 2017-2024, 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_voltages_init - Update voltages for platform init
  38. *
  39. * Returns 0 on success, and negative values on errors
  40. */
  41. int pmic_voltages_init(void);
  42. #endif /* STM32MP_PMIC_H */