mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-21 23:36:57 +07:00
d8ba819124
Issue description: On some pmics, the policy enable for thermal alerts refers to different bit fields of the same registers, whereas on other pmics, the policy enable refers to the same bit field on different registers. Previous implementation did not provide the flexibility for supporting the first approach. Solution: Modified the policy enable function to take bit field as well. The use of bit field is left to the pmic specific opregion driver. Signed-off-by: Yegnesh Iyer <yegnesh.s.iyer@intel.com> Signed-off-by: Bin Gao <bin.gao@intel.com> Reviewed-by: Aaron Lu <aaron.lu@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
26 lines
888 B
C
26 lines
888 B
C
#ifndef __INTEL_PMIC_H
|
|
#define __INTEL_PMIC_H
|
|
|
|
struct pmic_table {
|
|
int address; /* operation region address */
|
|
int reg; /* corresponding thermal register */
|
|
int bit; /* control bit for power */
|
|
};
|
|
|
|
struct intel_pmic_opregion_data {
|
|
int (*get_power)(struct regmap *r, int reg, int bit, u64 *value);
|
|
int (*update_power)(struct regmap *r, int reg, int bit, bool on);
|
|
int (*get_raw_temp)(struct regmap *r, int reg);
|
|
int (*update_aux)(struct regmap *r, int reg, int raw_temp);
|
|
int (*get_policy)(struct regmap *r, int reg, int bit, u64 *value);
|
|
int (*update_policy)(struct regmap *r, int reg, int bit, int enable);
|
|
struct pmic_table *power_table;
|
|
int power_table_count;
|
|
struct pmic_table *thermal_table;
|
|
int thermal_table_count;
|
|
};
|
|
|
|
int intel_pmic_install_opregion_handler(struct device *dev, acpi_handle handle, struct regmap *regmap, struct intel_pmic_opregion_data *d);
|
|
|
|
#endif
|