fan.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. #include <linux/kconfig.h>
  11. #define ACPI_FAN_DEVICE_IDS \
  12. {"INT3404", }, /* Fan */ \
  13. {"INTC1044", }, /* Fan for Tiger Lake generation */ \
  14. {"INTC1048", }, /* Fan for Alder Lake generation */ \
  15. {"INTC1063", }, /* Fan for Meteor Lake generation */ \
  16. {"INTC106A", }, /* Fan for Lunar Lake generation */ \
  17. {"INTC10A2", }, /* Fan for Raptor Lake generation */ \
  18. {"PNP0C0B", } /* Generic ACPI fan */
  19. #define ACPI_FPS_NAME_LEN 20
  20. struct acpi_fan_fps {
  21. u64 control;
  22. u64 trip_point;
  23. u64 speed;
  24. u64 noise_level;
  25. u64 power;
  26. char name[ACPI_FPS_NAME_LEN];
  27. struct device_attribute dev_attr;
  28. };
  29. struct acpi_fan_fif {
  30. u8 revision;
  31. u8 fine_grain_ctrl;
  32. u8 step_size;
  33. u8 low_speed_notification;
  34. };
  35. struct acpi_fan_fst {
  36. u64 revision;
  37. u64 control;
  38. u64 speed;
  39. };
  40. struct acpi_fan {
  41. bool acpi4;
  42. struct acpi_fan_fif fif;
  43. struct acpi_fan_fps *fps;
  44. int fps_count;
  45. struct thermal_cooling_device *cdev;
  46. struct device_attribute fst_speed;
  47. struct device_attribute fine_grain_control;
  48. };
  49. int acpi_fan_get_fst(struct acpi_device *device, struct acpi_fan_fst *fst);
  50. int acpi_fan_create_attributes(struct acpi_device *device);
  51. void acpi_fan_delete_attributes(struct acpi_device *device);
  52. #if IS_REACHABLE(CONFIG_HWMON)
  53. int devm_acpi_fan_create_hwmon(struct acpi_device *device);
  54. #else
  55. static inline int devm_acpi_fan_create_hwmon(struct acpi_device *device) { return 0; };
  56. #endif
  57. #endif