fan.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * ACPI fan device IDs are shared between the fan driver and the device power
  4. * management code.
  5. *
  6. * Add new device IDs before the generic ACPI fan one.
  7. */
  8. #ifndef _ACPI_FAN_H_
  9. #define _ACPI_FAN_H_
  10. #define ACPI_FAN_DEVICE_IDS \
  11. {"INT3404", }, /* Fan */ \
  12. {"INTC1044", }, /* Fan for Tiger Lake generation */ \
  13. {"INTC1048", }, /* Fan for Alder Lake generation */ \
  14. {"INTC1063", }, /* Fan for Meteor Lake generation */ \
  15. {"INTC10A2", }, /* Fan for Raptor Lake generation */ \
  16. {"PNP0C0B", } /* Generic ACPI fan */
  17. #define ACPI_FPS_NAME_LEN 20
  18. struct acpi_fan_fps {
  19. u64 control;
  20. u64 trip_point;
  21. u64 speed;
  22. u64 noise_level;
  23. u64 power;
  24. char name[ACPI_FPS_NAME_LEN];
  25. struct device_attribute dev_attr;
  26. };
  27. struct acpi_fan_fif {
  28. u8 revision;
  29. u8 fine_grain_ctrl;
  30. u8 step_size;
  31. u8 low_speed_notification;
  32. };
  33. struct acpi_fan_fst {
  34. u64 revision;
  35. u64 control;
  36. u64 speed;
  37. };
  38. struct acpi_fan {
  39. bool acpi4;
  40. struct acpi_fan_fif fif;
  41. struct acpi_fan_fps *fps;
  42. int fps_count;
  43. struct thermal_cooling_device *cdev;
  44. struct device_attribute fst_speed;
  45. struct device_attribute fine_grain_control;
  46. };
  47. int acpi_fan_get_fst(struct acpi_device *device, struct acpi_fan_fst *fst);
  48. int acpi_fan_create_attributes(struct acpi_device *device);
  49. void acpi_fan_delete_attributes(struct acpi_device *device);
  50. #endif