blob: 095afc96952ee5acf03b19df763343f121e91ff7 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Aaron Lub1eea852014-11-24 17:21:54 +08002#ifndef __INTEL_PMIC_H
3#define __INTEL_PMIC_H
4
5struct pmic_table {
6 int address; /* operation region address */
7 int reg; /* corresponding thermal register */
8 int bit; /* control bit for power */
9};
10
11struct intel_pmic_opregion_data {
12 int (*get_power)(struct regmap *r, int reg, int bit, u64 *value);
13 int (*update_power)(struct regmap *r, int reg, int bit, bool on);
14 int (*get_raw_temp)(struct regmap *r, int reg);
15 int (*update_aux)(struct regmap *r, int reg, int raw_temp);
Bin Gaod8ba8192016-06-23 17:45:35 -070016 int (*get_policy)(struct regmap *r, int reg, int bit, u64 *value);
17 int (*update_policy)(struct regmap *r, int reg, int bit, int enable);
Aaron Lub1eea852014-11-24 17:21:54 +080018 struct pmic_table *power_table;
19 int power_table_count;
20 struct pmic_table *thermal_table;
21 int thermal_table_count;
22};
23
24int intel_pmic_install_opregion_handler(struct device *dev, acpi_handle handle, struct regmap *regmap, struct intel_pmic_opregion_data *d);
25
26#endif