Linux Audio

Check our new training course

Loading...
v6.13.7
 1/* SPDX-License-Identifier: GPL-2.0-only */
 2
 3/*
 4 * ACPI fan device IDs are shared between the fan driver and the device power
 5 * management code.
 6 *
 7 * Add new device IDs before the generic ACPI fan one.
 8 */
 9
10#ifndef _ACPI_FAN_H_
11#define _ACPI_FAN_H_
12
13#include <linux/kconfig.h>
14
15#define ACPI_FAN_DEVICE_IDS	\
16	{"INT3404", }, /* Fan */ \
17	{"INTC1044", }, /* Fan for Tiger Lake generation */ \
18	{"INTC1048", }, /* Fan for Alder Lake generation */ \
19	{"INTC1063", }, /* Fan for Meteor Lake generation */ \
20	{"INTC106A", }, /* Fan for Lunar Lake generation */ \
21	{"INTC10A2", }, /* Fan for Raptor Lake generation */ \
22	{"PNP0C0B", } /* Generic ACPI fan */
23
24#define ACPI_FPS_NAME_LEN	20
25
26struct acpi_fan_fps {
27	u64 control;
28	u64 trip_point;
29	u64 speed;
30	u64 noise_level;
31	u64 power;
32	char name[ACPI_FPS_NAME_LEN];
33	struct device_attribute dev_attr;
34};
35
36struct acpi_fan_fif {
37	u8 revision;
38	u8 fine_grain_ctrl;
39	u8 step_size;
40	u8 low_speed_notification;
41};
42
43struct acpi_fan_fst {
44	u64 revision;
45	u64 control;
46	u64 speed;
47};
48
49struct acpi_fan {
50	bool acpi4;
51	struct acpi_fan_fif fif;
52	struct acpi_fan_fps *fps;
53	int fps_count;
54	struct thermal_cooling_device *cdev;
55	struct device_attribute fst_speed;
56	struct device_attribute fine_grain_control;
57};
58
59int acpi_fan_get_fst(struct acpi_device *device, struct acpi_fan_fst *fst);
60int acpi_fan_create_attributes(struct acpi_device *device);
61void acpi_fan_delete_attributes(struct acpi_device *device);
62
63#if IS_REACHABLE(CONFIG_HWMON)
64int devm_acpi_fan_create_hwmon(struct acpi_device *device);
65#else
66static inline int devm_acpi_fan_create_hwmon(struct acpi_device *device) { return 0; };
67#endif
68
69#endif
v6.2
 1/* SPDX-License-Identifier: GPL-2.0-only */
 2
 3/*
 4 * ACPI fan device IDs are shared between the fan driver and the device power
 5 * management code.
 6 *
 7 * Add new device IDs before the generic ACPI fan one.
 8 */
 9
10#ifndef _ACPI_FAN_H_
11#define _ACPI_FAN_H_
12
 
 
13#define ACPI_FAN_DEVICE_IDS	\
14	{"INT3404", }, /* Fan */ \
15	{"INTC1044", }, /* Fan for Tiger Lake generation */ \
16	{"INTC1048", }, /* Fan for Alder Lake generation */ \
17	{"INTC1063", }, /* Fan for Meteor Lake generation */ \
 
18	{"INTC10A2", }, /* Fan for Raptor Lake generation */ \
19	{"PNP0C0B", } /* Generic ACPI fan */
20
21#define ACPI_FPS_NAME_LEN	20
22
23struct acpi_fan_fps {
24	u64 control;
25	u64 trip_point;
26	u64 speed;
27	u64 noise_level;
28	u64 power;
29	char name[ACPI_FPS_NAME_LEN];
30	struct device_attribute dev_attr;
31};
32
33struct acpi_fan_fif {
34	u8 revision;
35	u8 fine_grain_ctrl;
36	u8 step_size;
37	u8 low_speed_notification;
38};
39
40struct acpi_fan_fst {
41	u64 revision;
42	u64 control;
43	u64 speed;
44};
45
46struct acpi_fan {
47	bool acpi4;
48	struct acpi_fan_fif fif;
49	struct acpi_fan_fps *fps;
50	int fps_count;
51	struct thermal_cooling_device *cdev;
52	struct device_attribute fst_speed;
53	struct device_attribute fine_grain_control;
54};
55
56int acpi_fan_get_fst(struct acpi_device *device, struct acpi_fan_fst *fst);
57int acpi_fan_create_attributes(struct acpi_device *device);
58void acpi_fan_delete_attributes(struct acpi_device *device);
 
 
 
 
 
 
 
59#endif