Linux Audio

Check our new training course

Linux debugging, profiling, tracing and performance analysis training

Mar 24-27, 2025, special US time zones
Register
Loading...
  1/* SPDX-License-Identifier: GPL-2.0 */
  2#ifndef __ACPI_ACPI_THERMAL_H
  3#define __ACPI_ACPI_THERMAL_H
  4
  5#include <asm/ioctl.h>
  6
  7#define ACPI_THERMAL_MAGIC 's'
  8
  9#define ACPI_THERMAL_GET_TRT_LEN _IOR(ACPI_THERMAL_MAGIC, 1, unsigned long)
 10#define ACPI_THERMAL_GET_ART_LEN _IOR(ACPI_THERMAL_MAGIC, 2, unsigned long)
 11#define ACPI_THERMAL_GET_TRT_COUNT _IOR(ACPI_THERMAL_MAGIC, 3, unsigned long)
 12#define ACPI_THERMAL_GET_ART_COUNT _IOR(ACPI_THERMAL_MAGIC, 4, unsigned long)
 13
 14#define ACPI_THERMAL_GET_TRT	_IOR(ACPI_THERMAL_MAGIC, 5, unsigned long)
 15#define ACPI_THERMAL_GET_ART	_IOR(ACPI_THERMAL_MAGIC, 6, unsigned long)
 16
 17/*
 18 * ACPI_THERMAL_GET_PSVT_COUNT = Number of PSVT entries
 19 * ACPI_THERMAL_GET_PSVT_LEN = Total return data size (PSVT count x each
 20 * PSVT entry size)
 21 * ACPI_THERMAL_GET_PSVT = Get the data as an array of psvt_objects
 22 */
 23#define ACPI_THERMAL_GET_PSVT_LEN _IOR(ACPI_THERMAL_MAGIC, 7, unsigned long)
 24#define ACPI_THERMAL_GET_PSVT_COUNT _IOR(ACPI_THERMAL_MAGIC, 8, unsigned long)
 25#define ACPI_THERMAL_GET_PSVT	_IOR(ACPI_THERMAL_MAGIC, 9, unsigned long)
 26
 27struct art {
 28	acpi_handle source;
 29	acpi_handle target;
 30	struct_group(data,
 31		u64 weight;
 32		u64 ac0_max;
 33		u64 ac1_max;
 34		u64 ac2_max;
 35		u64 ac3_max;
 36		u64 ac4_max;
 37		u64 ac5_max;
 38		u64 ac6_max;
 39		u64 ac7_max;
 40		u64 ac8_max;
 41		u64 ac9_max;
 42	);
 43} __packed;
 44
 45struct trt {
 46	acpi_handle source;
 47	acpi_handle target;
 48	u64 influence;
 49	u64 sample_period;
 50	u64 reserved1;
 51	u64 reserved2;
 52	u64 reserved3;
 53	u64 reserved4;
 54} __packed;
 55
 56#define ACPI_NR_PSVT_ELEMENTS	12
 57#define ACPI_PSVT_CONTROL_KNOB	7
 58#define ACPI_LIMIT_STR_MAX_LEN	8
 59
 60struct psvt {
 61	acpi_handle source;
 62	acpi_handle target;
 63	u64 priority;
 64	u64 sample_period;
 65	u64 passive_temp;
 66	u64 source_domain;
 67	u64 control_knob;
 68	union {
 69		/* For limit_type = ACPI_TYPE_INTEGER */
 70		u64 integer;
 71		/* For limit_type = ACPI_TYPE_STRING */
 72		char string[ACPI_LIMIT_STR_MAX_LEN];
 73		char *str_ptr;
 74	} limit;
 75	u64 step_size;
 76	u64 limit_coeff;
 77	u64 unlimit_coeff;
 78	/* Spec calls this field reserved, so we borrow it for type info */
 79	u64 control_knob_type; /* ACPI_TYPE_STRING or ACPI_TYPE_INTEGER */
 80} __packed;
 81
 82#define ACPI_NR_ART_ELEMENTS 13
 83/* for usrspace */
 84union art_object {
 85	struct {
 86		char source_device[8]; /* ACPI single name */
 87		char target_device[8]; /* ACPI single name */
 88		struct_group(data,
 89			u64 weight;
 90			u64 ac0_max_level;
 91			u64 ac1_max_level;
 92			u64 ac2_max_level;
 93			u64 ac3_max_level;
 94			u64 ac4_max_level;
 95			u64 ac5_max_level;
 96			u64 ac6_max_level;
 97			u64 ac7_max_level;
 98			u64 ac8_max_level;
 99			u64 ac9_max_level;
100		);
101	};
102	u64 __data[ACPI_NR_ART_ELEMENTS];
103};
104
105union trt_object {
106	struct {
107		char source_device[8]; /* ACPI single name */
108		char target_device[8]; /* ACPI single name */
109		u64 influence;
110		u64 sample_period;
111		u64 reserved[4];
112	};
113	u64 __data[8];
114};
115
116union psvt_object {
117	struct {
118		char source_device[8];
119		char target_device[8];
120		u64 priority;
121		u64 sample_period;
122		u64 passive_temp;
123		u64 source_domain;
124		u64 control_knob;
125		union {
126			u64 integer;
127			char string[ACPI_LIMIT_STR_MAX_LEN];
128		} limit;
129		u64 step_size;
130		u64 limit_coeff;
131		u64 unlimit_coeff;
132		u64 control_knob_type;
133	};
134	u64 __data[ACPI_NR_PSVT_ELEMENTS];
135};
136
137#ifdef __KERNEL__
138int acpi_thermal_rel_misc_device_add(acpi_handle handle);
139int acpi_thermal_rel_misc_device_remove(acpi_handle handle);
140int acpi_parse_art(acpi_handle handle, int *art_count, struct art **arts,
141		bool create_dev);
142int acpi_parse_trt(acpi_handle handle, int *trt_count, struct trt **trts,
143		bool create_dev);
144#endif
145
146#endif /* __ACPI_ACPI_THERMAL_H */
 1/* SPDX-License-Identifier: GPL-2.0 */
 2#ifndef __ACPI_ACPI_THERMAL_H
 3#define __ACPI_ACPI_THERMAL_H
 4
 5#include <asm/ioctl.h>
 6
 7#define ACPI_THERMAL_MAGIC 's'
 8
 9#define ACPI_THERMAL_GET_TRT_LEN _IOR(ACPI_THERMAL_MAGIC, 1, unsigned long)
10#define ACPI_THERMAL_GET_ART_LEN _IOR(ACPI_THERMAL_MAGIC, 2, unsigned long)
11#define ACPI_THERMAL_GET_TRT_COUNT _IOR(ACPI_THERMAL_MAGIC, 3, unsigned long)
12#define ACPI_THERMAL_GET_ART_COUNT _IOR(ACPI_THERMAL_MAGIC, 4, unsigned long)
13
14#define ACPI_THERMAL_GET_TRT	_IOR(ACPI_THERMAL_MAGIC, 5, unsigned long)
15#define ACPI_THERMAL_GET_ART	_IOR(ACPI_THERMAL_MAGIC, 6, unsigned long)
16
 
 
 
 
 
 
 
 
 
 
17struct art {
18	acpi_handle source;
19	acpi_handle target;
20	u64 weight;
21	u64 ac0_max;
22	u64 ac1_max;
23	u64 ac2_max;
24	u64 ac3_max;
25	u64 ac4_max;
26	u64 ac5_max;
27	u64 ac6_max;
28	u64 ac7_max;
29	u64 ac8_max;
30	u64 ac9_max;
 
 
31} __packed;
32
33struct trt {
34	acpi_handle source;
35	acpi_handle target;
36	u64 influence;
37	u64 sample_period;
38	u64 reserved1;
39	u64 reserved2;
40	u64 reserved3;
41	u64 reserved4;
42} __packed;
43
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44#define ACPI_NR_ART_ELEMENTS 13
45/* for usrspace */
46union art_object {
47	struct {
48		char source_device[8]; /* ACPI single name */
49		char target_device[8]; /* ACPI single name */
50		u64 weight;
51		u64 ac0_max_level;
52		u64 ac1_max_level;
53		u64 ac2_max_level;
54		u64 ac3_max_level;
55		u64 ac4_max_level;
56		u64 ac5_max_level;
57		u64 ac6_max_level;
58		u64 ac7_max_level;
59		u64 ac8_max_level;
60		u64 ac9_max_level;
 
 
61	};
62	u64 __data[ACPI_NR_ART_ELEMENTS];
63};
64
65union trt_object {
66	struct {
67		char source_device[8]; /* ACPI single name */
68		char target_device[8]; /* ACPI single name */
69		u64 influence;
70		u64 sample_period;
71		u64 reserved[4];
72	};
73	u64 __data[8];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74};
75
76#ifdef __KERNEL__
77int acpi_thermal_rel_misc_device_add(acpi_handle handle);
78int acpi_thermal_rel_misc_device_remove(acpi_handle handle);
79int acpi_parse_art(acpi_handle handle, int *art_count, struct art **arts,
80		bool create_dev);
81int acpi_parse_trt(acpi_handle handle, int *trt_count, struct trt **trts,
82		bool create_dev);
83#endif
84
85#endif /* __ACPI_ACPI_THERMAL_H */