#ifndef _ACPI_FAN_H_
#define _ACPI_FAN_H_
#include <linux/kconfig.h>
#include <linux/limits.h>
#define ACPI_FAN_DEVICE_IDS \
{"INT3404", }, \
{"INTC1044", }, \
{"INTC1048", }, \
{"INTC1063", }, \
{"INTC106A", }, \
{"INTC10A2", }, \
{"INTC10D6", }, \
{"INTC10FE", }, \
{"INTC10F5", }, \
{"PNP0C0B", }
#define ACPI_FPS_NAME_LEN 20
struct acpi_fan_fps {
u64 control;
u64 trip_point;
u64 speed;
u64 noise_level;
u64 power;
char name[ACPI_FPS_NAME_LEN];
struct device_attribute dev_attr;
};
struct acpi_fan_fif {
u8 revision;
u8 fine_grain_ctrl;
u8 step_size;
u8 low_speed_notification;
};
struct acpi_fan_fst {
u64 revision;
u64 control;
u64 speed;
};
struct acpi_fan {
acpi_handle handle;
bool acpi4;
bool has_fst;
struct acpi_fan_fif fif;
struct acpi_fan_fps *fps;
int fps_count;
u32 fan_trip_granularity;
#if IS_REACHABLE(CONFIG_HWMON)
struct device *hdev;
#endif
struct thermal_cooling_device *cdev;
struct device_attribute fst_speed;
struct device_attribute fine_grain_control;
};
static inline bool acpi_fan_speed_valid(u64 speed)
{
return speed < U32_MAX;
}
static inline bool acpi_fan_power_valid(u64 power)
{
return power < U32_MAX;
}
int acpi_fan_get_fst(acpi_handle handle, struct acpi_fan_fst *fst);
int acpi_fan_create_attributes(struct acpi_device *device);
void acpi_fan_delete_attributes(struct acpi_device *device);
#if IS_REACHABLE(CONFIG_HWMON)
int devm_acpi_fan_create_hwmon(struct device *dev);
void acpi_fan_notify_hwmon(struct device *dev);
#else
static inline int devm_acpi_fan_create_hwmon(struct device *dev) { return 0; };
static inline void acpi_fan_notify_hwmon(struct device *dev) { };
#endif
#endif