162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 262306a36Sopenharmony_ci#ifndef __INTEL_PMIC_H 362306a36Sopenharmony_ci#define __INTEL_PMIC_H 462306a36Sopenharmony_ci 562306a36Sopenharmony_ci#include <acpi/acpi_lpat.h> 662306a36Sopenharmony_ci 762306a36Sopenharmony_cistruct pmic_table { 862306a36Sopenharmony_ci int address; /* operation region address */ 962306a36Sopenharmony_ci int reg; /* corresponding thermal register */ 1062306a36Sopenharmony_ci int bit; /* control bit for power */ 1162306a36Sopenharmony_ci}; 1262306a36Sopenharmony_ci 1362306a36Sopenharmony_cistruct intel_pmic_opregion_data { 1462306a36Sopenharmony_ci int (*get_power)(struct regmap *r, int reg, int bit, u64 *value); 1562306a36Sopenharmony_ci int (*update_power)(struct regmap *r, int reg, int bit, bool on); 1662306a36Sopenharmony_ci int (*get_raw_temp)(struct regmap *r, int reg); 1762306a36Sopenharmony_ci int (*update_aux)(struct regmap *r, int reg, int raw_temp); 1862306a36Sopenharmony_ci int (*get_policy)(struct regmap *r, int reg, int bit, u64 *value); 1962306a36Sopenharmony_ci int (*update_policy)(struct regmap *r, int reg, int bit, int enable); 2062306a36Sopenharmony_ci int (*exec_mipi_pmic_seq_element)(struct regmap *r, u16 i2c_address, 2162306a36Sopenharmony_ci u32 reg_address, u32 value, u32 mask); 2262306a36Sopenharmony_ci int (*lpat_raw_to_temp)(struct acpi_lpat_conversion_table *lpat_table, 2362306a36Sopenharmony_ci int raw); 2462306a36Sopenharmony_ci struct pmic_table *power_table; 2562306a36Sopenharmony_ci int power_table_count; 2662306a36Sopenharmony_ci struct pmic_table *thermal_table; 2762306a36Sopenharmony_ci int thermal_table_count; 2862306a36Sopenharmony_ci /* For generic exec_mipi_pmic_seq_element handling */ 2962306a36Sopenharmony_ci int pmic_i2c_address; 3062306a36Sopenharmony_ci}; 3162306a36Sopenharmony_ci 3262306a36Sopenharmony_ciint intel_pmic_install_opregion_handler(struct device *dev, acpi_handle handle, 3362306a36Sopenharmony_ci struct regmap *regmap, 3462306a36Sopenharmony_ci const struct intel_pmic_opregion_data *d); 3562306a36Sopenharmony_ci 3662306a36Sopenharmony_ci#endif 37