2021-05-14 19:08:51 +00:00
|
|
|
/* 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.
|
|
|
|
*/
|
2022-02-11 16:09:28 +00:00
|
|
|
|
|
|
|
#ifndef _ACPI_FAN_H_
|
|
|
|
#define _ACPI_FAN_H_
|
|
|
|
|
2024-05-10 20:12:42 +00:00
|
|
|
#include <linux/kconfig.h>
|
|
|
|
|
2021-05-14 19:08:51 +00:00
|
|
|
#define ACPI_FAN_DEVICE_IDS \
|
|
|
|
{"INT3404", }, /* Fan */ \
|
|
|
|
{"INTC1044", }, /* Fan for Tiger Lake generation */ \
|
|
|
|
{"INTC1048", }, /* Fan for Alder Lake generation */ \
|
2022-05-23 17:46:30 +00:00
|
|
|
{"INTC1063", }, /* Fan for Meteor Lake generation */ \
|
2024-04-05 12:18:19 +00:00
|
|
|
{"INTC106A", }, /* Fan for Lunar Lake generation */ \
|
2022-01-14 23:24:33 +00:00
|
|
|
{"INTC10A2", }, /* Fan for Raptor Lake generation */ \
|
2021-05-14 19:08:51 +00:00
|
|
|
{"PNP0C0B", } /* Generic ACPI fan */
|
2022-02-11 16:09:28 +00:00
|
|
|
|
|
|
|
#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 {
|
2022-02-11 16:09:29 +00:00
|
|
|
u8 revision;
|
|
|
|
u8 fine_grain_ctrl;
|
|
|
|
u8 step_size;
|
|
|
|
u8 low_speed_notification;
|
2022-02-11 16:09:28 +00:00
|
|
|
};
|
|
|
|
|
2022-02-11 23:27:42 +00:00
|
|
|
struct acpi_fan_fst {
|
|
|
|
u64 revision;
|
|
|
|
u64 control;
|
|
|
|
u64 speed;
|
|
|
|
};
|
|
|
|
|
2022-02-11 16:09:28 +00:00
|
|
|
struct acpi_fan {
|
|
|
|
bool acpi4;
|
|
|
|
struct acpi_fan_fif fif;
|
|
|
|
struct acpi_fan_fps *fps;
|
|
|
|
int fps_count;
|
|
|
|
struct thermal_cooling_device *cdev;
|
2022-02-11 16:09:31 +00:00
|
|
|
struct device_attribute fst_speed;
|
|
|
|
struct device_attribute fine_grain_control;
|
2022-02-11 16:09:28 +00:00
|
|
|
};
|
|
|
|
|
2022-02-11 16:09:31 +00:00
|
|
|
int acpi_fan_get_fst(struct acpi_device *device, struct acpi_fan_fst *fst);
|
2022-02-11 16:09:28 +00:00
|
|
|
int acpi_fan_create_attributes(struct acpi_device *device);
|
|
|
|
void acpi_fan_delete_attributes(struct acpi_device *device);
|
2024-05-10 20:12:42 +00:00
|
|
|
|
|
|
|
#if IS_REACHABLE(CONFIG_HWMON)
|
|
|
|
int devm_acpi_fan_create_hwmon(struct acpi_device *device);
|
|
|
|
#else
|
|
|
|
static inline int devm_acpi_fan_create_hwmon(struct acpi_device *device) { return 0; };
|
|
|
|
#endif
|
|
|
|
|
2022-02-11 16:09:28 +00:00
|
|
|
#endif
|