diff options
author | Henrique de Moraes Holschuh <hmh@hmh.eng.br> | 2007-04-24 10:48:17 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2007-04-25 02:00:27 -0400 |
commit | fe98a52ce7540fb3a19d57488a08864110cf4d5c (patch) | |
tree | 8a9ba42e5a4d4ff208297cd18782aa85fef27164 /drivers/misc/thinkpad_acpi.h | |
parent | 2c37aa4e22dd55070c608290c5031f2ee93e69ce (diff) |
ACPI: thinkpad-acpi: add sysfs support to fan subdriver
Export sysfs attributes to monitor and control the internal thinkpad fan
(some thinkpads have more than one fan, but thinkpad-acpi doesn't support
the second fan yet). The sysfs interface follows the hwmon design guide
for fan devices.
Also, fix some stray "thermal" files in the fan procfs description that
have been there forever, and officially support "full-speed" as the name
for the PWM-disabled state of the fan controller to keep it in line with
the hwmon interface. It is much better a name for that mode than the
unobvious "disengaged" anyway. Change the procfs interface to also accept
full-speed as a fan level, but still report it as disengaged for backwards
compatibility.
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/misc/thinkpad_acpi.h')
-rw-r--r-- | drivers/misc/thinkpad_acpi.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/misc/thinkpad_acpi.h b/drivers/misc/thinkpad_acpi.h index e833ff3caf39..2fe4d61cc27f 100644 --- a/drivers/misc/thinkpad_acpi.h +++ b/drivers/misc/thinkpad_acpi.h | |||
@@ -349,6 +349,8 @@ enum { /* Fan control constants */ | |||
349 | 349 | ||
350 | TP_EC_FAN_FULLSPEED = 0x40, /* EC fan mode: full speed */ | 350 | TP_EC_FAN_FULLSPEED = 0x40, /* EC fan mode: full speed */ |
351 | TP_EC_FAN_AUTO = 0x80, /* EC fan mode: auto fan control */ | 351 | TP_EC_FAN_AUTO = 0x80, /* EC fan mode: auto fan control */ |
352 | |||
353 | TPACPI_FAN_LAST_LEVEL = 0x100, /* Use cached last-seen fan level */ | ||
352 | }; | 354 | }; |
353 | 355 | ||
354 | enum fan_status_access_mode { | 356 | enum fan_status_access_mode { |
@@ -375,6 +377,7 @@ static enum fan_status_access_mode fan_status_access_mode; | |||
375 | static enum fan_control_access_mode fan_control_access_mode; | 377 | static enum fan_control_access_mode fan_control_access_mode; |
376 | static enum fan_control_commands fan_control_commands; | 378 | static enum fan_control_commands fan_control_commands; |
377 | static u8 fan_control_initial_status; | 379 | static u8 fan_control_initial_status; |
380 | static u8 fan_control_desired_level; | ||
378 | static int fan_watchdog_maxinterval; | 381 | static int fan_watchdog_maxinterval; |
379 | 382 | ||
380 | struct mutex fan_mutex; | 383 | struct mutex fan_mutex; |
@@ -384,10 +387,13 @@ static acpi_handle fans_handle, gfan_handle, sfan_handle; | |||
384 | static int fan_init(struct ibm_init_struct *iibm); | 387 | static int fan_init(struct ibm_init_struct *iibm); |
385 | static void fan_exit(void); | 388 | static void fan_exit(void); |
386 | static int fan_get_status(u8 *status); | 389 | static int fan_get_status(u8 *status); |
390 | static int fan_get_status_safe(u8 *status); | ||
387 | static int fan_get_speed(unsigned int *speed); | 391 | static int fan_get_speed(unsigned int *speed); |
392 | static void fan_update_desired_level(u8 status); | ||
388 | static void fan_watchdog_fire(struct work_struct *ignored); | 393 | static void fan_watchdog_fire(struct work_struct *ignored); |
389 | static void fan_watchdog_reset(void); | 394 | static void fan_watchdog_reset(void); |
390 | static int fan_set_level(int level); | 395 | static int fan_set_level(int level); |
396 | static int fan_set_level_safe(int level); | ||
391 | static int fan_set_enable(void); | 397 | static int fan_set_enable(void); |
392 | static int fan_set_disable(void); | 398 | static int fan_set_disable(void); |
393 | static int fan_set_speed(int speed); | 399 | static int fan_set_speed(int speed); |