18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci#ifndef __INTEL_PMIC_H 38c2ecf20Sopenharmony_ci#define __INTEL_PMIC_H 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_cistruct pmic_table { 68c2ecf20Sopenharmony_ci int address; /* operation region address */ 78c2ecf20Sopenharmony_ci int reg; /* corresponding thermal register */ 88c2ecf20Sopenharmony_ci int bit; /* control bit for power */ 98c2ecf20Sopenharmony_ci}; 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_cistruct intel_pmic_opregion_data { 128c2ecf20Sopenharmony_ci int (*get_power)(struct regmap *r, int reg, int bit, u64 *value); 138c2ecf20Sopenharmony_ci int (*update_power)(struct regmap *r, int reg, int bit, bool on); 148c2ecf20Sopenharmony_ci int (*get_raw_temp)(struct regmap *r, int reg); 158c2ecf20Sopenharmony_ci int (*update_aux)(struct regmap *r, int reg, int raw_temp); 168c2ecf20Sopenharmony_ci int (*get_policy)(struct regmap *r, int reg, int bit, u64 *value); 178c2ecf20Sopenharmony_ci int (*update_policy)(struct regmap *r, int reg, int bit, int enable); 188c2ecf20Sopenharmony_ci int (*exec_mipi_pmic_seq_element)(struct regmap *r, u16 i2c_address, 198c2ecf20Sopenharmony_ci u32 reg_address, u32 value, u32 mask); 208c2ecf20Sopenharmony_ci struct pmic_table *power_table; 218c2ecf20Sopenharmony_ci int power_table_count; 228c2ecf20Sopenharmony_ci struct pmic_table *thermal_table; 238c2ecf20Sopenharmony_ci int thermal_table_count; 248c2ecf20Sopenharmony_ci /* For generic exec_mipi_pmic_seq_element handling */ 258c2ecf20Sopenharmony_ci int pmic_i2c_address; 268c2ecf20Sopenharmony_ci}; 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_ciint intel_pmic_install_opregion_handler(struct device *dev, acpi_handle handle, struct regmap *regmap, struct intel_pmic_opregion_data *d); 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ci#endif 31