diff options
| author | Armin Wolf <W_Armin@gmx.de> | 2024-05-10 22:12:42 +0200 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2024-05-28 11:53:35 +0200 |
| commit | 35c50d853adc0808996b269ec0d3bd9bcc042770 (patch) | |
| tree | 8cb943833bd9a4b2eee1f7feac9c867c0258a72a /drivers/acpi/fan.h | |
| parent | 1613e604df0cd359cf2a7fbd9be7a0bcfacfabd0 (diff) | |
ACPI: fan: Add hwmon support
Currently, the driver does only support a custom sysfs
interface to allow userspace to read the fan speed.
Add support for the standard hwmon interface so users
can read the fan speed with standard tools like "sensors".
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/fan.h')
| -rw-r--r-- | drivers/acpi/fan.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/acpi/fan.h b/drivers/acpi/fan.h index f89d19c922dc..db25a3898af7 100644 --- a/drivers/acpi/fan.h +++ b/drivers/acpi/fan.h @@ -10,6 +10,8 @@ #ifndef _ACPI_FAN_H_ #define _ACPI_FAN_H_ +#include <linux/kconfig.h> + #define ACPI_FAN_DEVICE_IDS \ {"INT3404", }, /* Fan */ \ {"INTC1044", }, /* Fan for Tiger Lake generation */ \ @@ -57,4 +59,11 @@ struct acpi_fan { int acpi_fan_get_fst(struct acpi_device *device, struct acpi_fan_fst *fst); int acpi_fan_create_attributes(struct acpi_device *device); void acpi_fan_delete_attributes(struct acpi_device *device); + +#if IS_REACHABLE(CONFIG_HWMON) +int devm_acpi_fan_create_hwmon(struct acpi_device *device); +#else +static inline int devm_acpi_fan_create_hwmon(struct acpi_device *device) { return 0; }; +#endif + #endif |