Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Aaron Lu | b1eea85 | 2014-11-24 17:21:54 +0800 | [diff] [blame] | 2 | #ifndef __INTEL_PMIC_H |
| 3 | #define __INTEL_PMIC_H |
| 4 | |
| 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 | |
| 11 | struct 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 Gao | d8ba819 | 2016-06-23 17:45:35 -0700 | [diff] [blame] | 16 | 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); |
Hans de Goede | 7b5618f | 2019-01-07 12:15:53 +0100 | [diff] [blame] | 18 | int (*exec_mipi_pmic_seq_element)(struct regmap *r, u16 i2c_address, |
| 19 | u32 reg_address, u32 value, u32 mask); |
Aaron Lu | b1eea85 | 2014-11-24 17:21:54 +0800 | [diff] [blame] | 20 | struct pmic_table *power_table; |
| 21 | int power_table_count; |
| 22 | struct pmic_table *thermal_table; |
| 23 | int thermal_table_count; |
Hans de Goede | 429188f | 2019-01-07 12:15:55 +0100 | [diff] [blame] | 24 | /* For generic exec_mipi_pmic_seq_element handling */ |
| 25 | int pmic_i2c_address; |
Aaron Lu | b1eea85 | 2014-11-24 17:21:54 +0800 | [diff] [blame] | 26 | }; |
| 27 | |
| 28 | int intel_pmic_install_opregion_handler(struct device *dev, acpi_handle handle, struct regmap *regmap, struct intel_pmic_opregion_data *d); |
| 29 | |
| 30 | #endif |