diff options
author | Alan Jenkins <alan-jenkins@tuffmail.co.uk> | 2009-12-03 02:44:56 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-12-09 15:54:31 -0500 |
commit | 487186880d31821eaaba0cc1f27d5a581c56981d (patch) | |
tree | 491f01909c942acf36a965d183d90b34d7907dde /drivers | |
parent | eacec3031d1f444a618cf2d023d52f088cf82a7e (diff) |
eeepc-laptop: fix value of pwm1_enable to match documentation
Documentation/hwmon/sysfs-interface tells us that automatic fan speed
control should be represented by a value of 2 or above for pwm1_enable.
Fix eeepc_get_fan_ctrl() to return 2 for automatic fan control.
Setting "1" for manual control is already consistent with the
documentation, so this remains unchanged.
Let's preserve the ABI for this specific driver, so that writing "0"
will still invoke automatic control.
(The documentation says setting "0" should leave the fan at full speed
all the time. This mode is not directly supported by our hardware. Full
speed is rather noisy on my 701 and the automatic control has never used
it. If you really want this e.g. to prolong the life of an EeePC used
as a server, you can always use manual mode. hwmon has always been
fairly machine-specific, and you're in a tiny minority (or elite :-).
I'm sure you're smart enough to notice that the fan doesn't turn on to
full speed when you try this mode, either by ear or checking
fan_input1.
We could even claim to be honouring the spirit of the documentation.
"0" really means "safe mode". EeePCs default to automatic mode, ie that
is what Asus will actually test. Since we do not provide any way to
tamper with the temperature threshold, automatic mode _is_ the safe
option).
Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/platform/x86/eeepc-laptop.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c index 1c04c877b824..6c982d6c3a54 100644 --- a/drivers/platform/x86/eeepc-laptop.c +++ b/drivers/platform/x86/eeepc-laptop.c | |||
@@ -935,7 +935,10 @@ static int eeepc_get_fan_ctrl(void) | |||
935 | int value = 0; | 935 | int value = 0; |
936 | 936 | ||
937 | read_acpi_int(NULL, EEEPC_EC_FAN_CTRL, &value); | 937 | read_acpi_int(NULL, EEEPC_EC_FAN_CTRL, &value); |
938 | return ((value & 0x02 ? 1 : 0)); | 938 | if (value & 0x02) |
939 | return 1; /* manual */ | ||
940 | else | ||
941 | return 2; /* automatic */ | ||
939 | } | 942 | } |
940 | 943 | ||
941 | static void eeepc_set_fan_ctrl(int manual) | 944 | static void eeepc_set_fan_ctrl(int manual) |
@@ -943,7 +946,7 @@ static void eeepc_set_fan_ctrl(int manual) | |||
943 | int value = 0; | 946 | int value = 0; |
944 | 947 | ||
945 | read_acpi_int(NULL, EEEPC_EC_FAN_CTRL, &value); | 948 | read_acpi_int(NULL, EEEPC_EC_FAN_CTRL, &value); |
946 | if (manual) | 949 | if (manual == 1) |
947 | value |= 0x02; | 950 | value |= 0x02; |
948 | else | 951 | else |
949 | value &= ~0x02; | 952 | value &= ~0x02; |