stm32mp_pmic2.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright (c) 2024, STMicroelectronics - All Rights Reserved
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef STM32MP_PMIC2_H
  7. #define STM32MP_PMIC2_H
  8. #include <stdbool.h>
  9. #include <drivers/st/regulator.h>
  10. #include <platform_def.h>
  11. /*
  12. * dt_pmic_status - Check PMIC status from device tree
  13. *
  14. * Returns the status of the PMIC (secure, non-secure), or a negative value on
  15. * error
  16. */
  17. int dt_pmic_status(void);
  18. /*
  19. * initialize_pmic_i2c - Initialize I2C for the PMIC control
  20. *
  21. * Returns true if PMIC is available, false if not found, panics on errors
  22. */
  23. bool initialize_pmic_i2c(void);
  24. /*
  25. * initialize_pmic - Main PMIC initialization function, called at platform init
  26. *
  27. * Panics on errors
  28. */
  29. void initialize_pmic(void);
  30. /*
  31. * stpmic2_set_prop - Set PMIC2 proprietary property
  32. *
  33. * Returns non zero on errors
  34. */
  35. int stpmic2_set_prop(const struct regul_description *desc, uint16_t prop, uint32_t value);
  36. /*
  37. * pmic_switch_off - switch off the platform with PMIC
  38. *
  39. * Panics on errors
  40. */
  41. void pmic_switch_off(void);
  42. #endif /* STM32MP_PMIC2_H */