acpi_thermal_rel.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __ACPI_ACPI_THERMAL_H
  3. #define __ACPI_ACPI_THERMAL_H
  4. #include <asm/ioctl.h>
  5. #define ACPI_THERMAL_MAGIC 's'
  6. #define ACPI_THERMAL_GET_TRT_LEN _IOR(ACPI_THERMAL_MAGIC, 1, unsigned long)
  7. #define ACPI_THERMAL_GET_ART_LEN _IOR(ACPI_THERMAL_MAGIC, 2, unsigned long)
  8. #define ACPI_THERMAL_GET_TRT_COUNT _IOR(ACPI_THERMAL_MAGIC, 3, unsigned long)
  9. #define ACPI_THERMAL_GET_ART_COUNT _IOR(ACPI_THERMAL_MAGIC, 4, unsigned long)
  10. #define ACPI_THERMAL_GET_TRT _IOR(ACPI_THERMAL_MAGIC, 5, unsigned long)
  11. #define ACPI_THERMAL_GET_ART _IOR(ACPI_THERMAL_MAGIC, 6, unsigned long)
  12. struct art {
  13. acpi_handle source;
  14. acpi_handle target;
  15. u64 weight;
  16. u64 ac0_max;
  17. u64 ac1_max;
  18. u64 ac2_max;
  19. u64 ac3_max;
  20. u64 ac4_max;
  21. u64 ac5_max;
  22. u64 ac6_max;
  23. u64 ac7_max;
  24. u64 ac8_max;
  25. u64 ac9_max;
  26. } __packed;
  27. struct trt {
  28. acpi_handle source;
  29. acpi_handle target;
  30. u64 influence;
  31. u64 sample_period;
  32. u64 reserved1;
  33. u64 reserved2;
  34. u64 reserved3;
  35. u64 reserved4;
  36. } __packed;
  37. #define ACPI_NR_ART_ELEMENTS 13
  38. /* for usrspace */
  39. union art_object {
  40. struct {
  41. char source_device[8]; /* ACPI single name */
  42. char target_device[8]; /* ACPI single name */
  43. u64 weight;
  44. u64 ac0_max_level;
  45. u64 ac1_max_level;
  46. u64 ac2_max_level;
  47. u64 ac3_max_level;
  48. u64 ac4_max_level;
  49. u64 ac5_max_level;
  50. u64 ac6_max_level;
  51. u64 ac7_max_level;
  52. u64 ac8_max_level;
  53. u64 ac9_max_level;
  54. };
  55. u64 __data[ACPI_NR_ART_ELEMENTS];
  56. };
  57. union trt_object {
  58. struct {
  59. char source_device[8]; /* ACPI single name */
  60. char target_device[8]; /* ACPI single name */
  61. u64 influence;
  62. u64 sample_period;
  63. u64 reserved[4];
  64. };
  65. u64 __data[8];
  66. };
  67. #ifdef __KERNEL__
  68. int acpi_thermal_rel_misc_device_add(acpi_handle handle);
  69. int acpi_thermal_rel_misc_device_remove(acpi_handle handle);
  70. int acpi_parse_art(acpi_handle handle, int *art_count, struct art **arts,
  71. bool create_dev);
  72. int acpi_parse_trt(acpi_handle handle, int *trt_count, struct trt **trts,
  73. bool create_dev);
  74. #endif
  75. #endif /* __ACPI_ACPI_THERMAL_H */