Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef __ACPI_ACPI_THERMAL_H
0003 #define __ACPI_ACPI_THERMAL_H
0004 
0005 #include <asm/ioctl.h>
0006 
0007 #define ACPI_THERMAL_MAGIC 's'
0008 
0009 #define ACPI_THERMAL_GET_TRT_LEN _IOR(ACPI_THERMAL_MAGIC, 1, unsigned long)
0010 #define ACPI_THERMAL_GET_ART_LEN _IOR(ACPI_THERMAL_MAGIC, 2, unsigned long)
0011 #define ACPI_THERMAL_GET_TRT_COUNT _IOR(ACPI_THERMAL_MAGIC, 3, unsigned long)
0012 #define ACPI_THERMAL_GET_ART_COUNT _IOR(ACPI_THERMAL_MAGIC, 4, unsigned long)
0013 
0014 #define ACPI_THERMAL_GET_TRT    _IOR(ACPI_THERMAL_MAGIC, 5, unsigned long)
0015 #define ACPI_THERMAL_GET_ART    _IOR(ACPI_THERMAL_MAGIC, 6, unsigned long)
0016 
0017 struct art {
0018     acpi_handle source;
0019     acpi_handle target;
0020     struct_group(data,
0021         u64 weight;
0022         u64 ac0_max;
0023         u64 ac1_max;
0024         u64 ac2_max;
0025         u64 ac3_max;
0026         u64 ac4_max;
0027         u64 ac5_max;
0028         u64 ac6_max;
0029         u64 ac7_max;
0030         u64 ac8_max;
0031         u64 ac9_max;
0032     );
0033 } __packed;
0034 
0035 struct trt {
0036     acpi_handle source;
0037     acpi_handle target;
0038     u64 influence;
0039     u64 sample_period;
0040     u64 reserved1;
0041     u64 reserved2;
0042     u64 reserved3;
0043     u64 reserved4;
0044 } __packed;
0045 
0046 #define ACPI_NR_ART_ELEMENTS 13
0047 /* for usrspace */
0048 union art_object {
0049     struct {
0050         char source_device[8]; /* ACPI single name */
0051         char target_device[8]; /* ACPI single name */
0052         struct_group(data,
0053             u64 weight;
0054             u64 ac0_max_level;
0055             u64 ac1_max_level;
0056             u64 ac2_max_level;
0057             u64 ac3_max_level;
0058             u64 ac4_max_level;
0059             u64 ac5_max_level;
0060             u64 ac6_max_level;
0061             u64 ac7_max_level;
0062             u64 ac8_max_level;
0063             u64 ac9_max_level;
0064         );
0065     };
0066     u64 __data[ACPI_NR_ART_ELEMENTS];
0067 };
0068 
0069 union trt_object {
0070     struct {
0071         char source_device[8]; /* ACPI single name */
0072         char target_device[8]; /* ACPI single name */
0073         u64 influence;
0074         u64 sample_period;
0075         u64 reserved[4];
0076     };
0077     u64 __data[8];
0078 };
0079 
0080 #ifdef __KERNEL__
0081 int acpi_thermal_rel_misc_device_add(acpi_handle handle);
0082 int acpi_thermal_rel_misc_device_remove(acpi_handle handle);
0083 int acpi_parse_art(acpi_handle handle, int *art_count, struct art **arts,
0084         bool create_dev);
0085 int acpi_parse_trt(acpi_handle handle, int *trt_count, struct trt **trts,
0086         bool create_dev);
0087 #endif
0088 
0089 #endif /* __ACPI_ACPI_THERMAL_H */