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