intel_pmic.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __INTEL_PMIC_H
  3. #define __INTEL_PMIC_H
  4. #include <acpi/acpi_lpat.h>
  5. struct pmic_table {
  6. int address; /* operation region address */
  7. int reg; /* corresponding thermal register */
  8. int bit; /* control bit for power */
  9. };
  10. struct intel_pmic_opregion_data {
  11. int (*get_power)(struct regmap *r, int reg, int bit, u64 *value);
  12. int (*update_power)(struct regmap *r, int reg, int bit, bool on);
  13. int (*get_raw_temp)(struct regmap *r, int reg);
  14. int (*update_aux)(struct regmap *r, int reg, int raw_temp);
  15. int (*get_policy)(struct regmap *r, int reg, int bit, u64 *value);
  16. int (*update_policy)(struct regmap *r, int reg, int bit, int enable);
  17. int (*exec_mipi_pmic_seq_element)(struct regmap *r, u16 i2c_address,
  18. u32 reg_address, u32 value, u32 mask);
  19. int (*lpat_raw_to_temp)(struct acpi_lpat_conversion_table *lpat_table,
  20. int raw);
  21. struct pmic_table *power_table;
  22. int power_table_count;
  23. struct pmic_table *thermal_table;
  24. int thermal_table_count;
  25. /* For generic exec_mipi_pmic_seq_element handling */
  26. int pmic_i2c_address;
  27. };
  28. int intel_pmic_install_opregion_handler(struct device *dev, acpi_handle handle,
  29. struct regmap *regmap,
  30. const struct intel_pmic_opregion_data *d);
  31. #endif