f1197343f0
Add additional attributes, which helps in implementing algorithm in the user space to optimize fan control. These attributes are presented in the same directory as the existing performance state attributes. Additional attributes: 1. Support of fine grain control Publish support of presence of fine grain control so that fan speed can be tuned correctly. This attribute is called "fine_grain_control". 2. fan speed Publish the actual fan rpm in sysfs. Knowing fan rpm is helpful to reduce noise level and use passive control instead. Also fan performance may not be same over time, so the same control value may not be enough to run the fan at a speed. So a feedback value of speed is helpful. This sysfs attribute is called "fan_speed_rpm". Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
59 lines
1.3 KiB
C
59 lines
1.3 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
|
/*
|
|
* ACPI fan device IDs are shared between the fan driver and the device power
|
|
* management code.
|
|
*
|
|
* Add new device IDs before the generic ACPI fan one.
|
|
*/
|
|
|
|
#ifndef _ACPI_FAN_H_
|
|
#define _ACPI_FAN_H_
|
|
|
|
#define ACPI_FAN_DEVICE_IDS \
|
|
{"INT3404", }, /* Fan */ \
|
|
{"INTC1044", }, /* Fan for Tiger Lake generation */ \
|
|
{"INTC1048", }, /* Fan for Alder Lake generation */ \
|
|
{"INTC10A2", }, /* Fan for Raptor Lake generation */ \
|
|
{"PNP0C0B", } /* Generic ACPI fan */
|
|
|
|
#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 {
|
|
bool acpi4;
|
|
struct acpi_fan_fif fif;
|
|
struct acpi_fan_fps *fps;
|
|
int fps_count;
|
|
struct thermal_cooling_device *cdev;
|
|
struct device_attribute fst_speed;
|
|
struct device_attribute fine_grain_control;
|
|
};
|
|
|
|
int acpi_fan_get_fst(struct acpi_device *device, struct acpi_fan_fst *fst);
|
|
int acpi_fan_create_attributes(struct acpi_device *device);
|
|
void acpi_fan_delete_attributes(struct acpi_device *device);
|
|
#endif
|