Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef __INTEL_PMIC_H
0003 #define __INTEL_PMIC_H
0004 
0005 #include <acpi/acpi_lpat.h>
0006 
0007 struct pmic_table {
0008     int address;    /* operation region address */
0009     int reg;    /* corresponding thermal register */
0010     int bit;    /* control bit for power */
0011 };
0012 
0013 struct intel_pmic_opregion_data {
0014     int (*get_power)(struct regmap *r, int reg, int bit, u64 *value);
0015     int (*update_power)(struct regmap *r, int reg, int bit, bool on);
0016     int (*get_raw_temp)(struct regmap *r, int reg);
0017     int (*update_aux)(struct regmap *r, int reg, int raw_temp);
0018     int (*get_policy)(struct regmap *r, int reg, int bit, u64 *value);
0019     int (*update_policy)(struct regmap *r, int reg, int bit, int enable);
0020     int (*exec_mipi_pmic_seq_element)(struct regmap *r, u16 i2c_address,
0021                       u32 reg_address, u32 value, u32 mask);
0022     int (*lpat_raw_to_temp)(struct acpi_lpat_conversion_table *lpat_table,
0023                 int raw);
0024     struct pmic_table *power_table;
0025     int power_table_count;
0026     struct pmic_table *thermal_table;
0027     int thermal_table_count;
0028     /* For generic exec_mipi_pmic_seq_element handling */
0029     int pmic_i2c_address;
0030 };
0031 
0032 int intel_pmic_install_opregion_handler(struct device *dev, acpi_handle handle,
0033                     struct regmap *regmap,
0034                     const struct intel_pmic_opregion_data *d);
0035 
0036 #endif