diff options
-rw-r--r-- | drivers/acpi/ibm_acpi.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/acpi/ibm_acpi.c b/drivers/acpi/ibm_acpi.c index faf78d3eac2d..b6ad2ed5fd6c 100644 --- a/drivers/acpi/ibm_acpi.c +++ b/drivers/acpi/ibm_acpi.c | |||
@@ -354,6 +354,11 @@ enum { /* Fan control constants */ | |||
354 | fan_status_offset = 0x2f, /* EC register 0x2f */ | 354 | fan_status_offset = 0x2f, /* EC register 0x2f */ |
355 | fan_rpm_offset = 0x84, /* EC register 0x84: LSB, 0x85 MSB (RPM) | 355 | fan_rpm_offset = 0x84, /* EC register 0x84: LSB, 0x85 MSB (RPM) |
356 | * 0x84 must be read before 0x85 */ | 356 | * 0x84 must be read before 0x85 */ |
357 | |||
358 | IBMACPI_FAN_EC_DISENGAGED = 0x40, /* EC mode: tachometer | ||
359 | * disengaged */ | ||
360 | IBMACPI_FAN_EC_AUTO = 0x80, /* EC mode: auto fan | ||
361 | * control */ | ||
357 | }; | 362 | }; |
358 | 363 | ||
359 | static int ibm_thinkpad_ec_found; | 364 | static int ibm_thinkpad_ec_found; |
@@ -1910,8 +1915,9 @@ static int fan_read(char *p) | |||
1910 | if ((rc = fan_get_status(&status)) < 0) | 1915 | if ((rc = fan_get_status(&status)) < 0) |
1911 | return rc; | 1916 | return rc; |
1912 | 1917 | ||
1913 | len += sprintf(p + len, "level:\t\t%d\n", status); | 1918 | len += sprintf(p + len, "status:\t\t%s\n" |
1914 | 1919 | "level:\t\t%d\n", | |
1920 | (status != 0) ? "enabled" : "disabled", status); | ||
1915 | break; | 1921 | break; |
1916 | 1922 | ||
1917 | case IBMACPI_FAN_RD_TPEC: | 1923 | case IBMACPI_FAN_RD_TPEC: |
@@ -1919,12 +1925,21 @@ static int fan_read(char *p) | |||
1919 | if ((rc = fan_get_status(&status)) < 0) | 1925 | if ((rc = fan_get_status(&status)) < 0) |
1920 | return rc; | 1926 | return rc; |
1921 | 1927 | ||
1922 | len += sprintf(p + len, "status:\t\t%s\n", enabled(status, 7)); | 1928 | len += sprintf(p + len, "status:\t\t%s\n", |
1929 | (status != 0) ? "enabled" : "disabled"); | ||
1923 | 1930 | ||
1924 | if ((rc = fan_get_speed(&speed)) < 0) | 1931 | if ((rc = fan_get_speed(&speed)) < 0) |
1925 | return rc; | 1932 | return rc; |
1926 | 1933 | ||
1927 | len += sprintf(p + len, "speed:\t\t%d\n", speed); | 1934 | len += sprintf(p + len, "speed:\t\t%d\n", speed); |
1935 | |||
1936 | if (status & IBMACPI_FAN_EC_DISENGAGED) | ||
1937 | /* Disengaged mode takes precedence */ | ||
1938 | len += sprintf(p + len, "level:\t\tdisengaged\n"); | ||
1939 | else if (status & IBMACPI_FAN_EC_AUTO) | ||
1940 | len += sprintf(p + len, "level:\t\tauto\n"); | ||
1941 | else | ||
1942 | len += sprintf(p + len, "level:\t\t%d\n", status); | ||
1928 | break; | 1943 | break; |
1929 | 1944 | ||
1930 | case IBMACPI_FAN_NONE: | 1945 | case IBMACPI_FAN_NONE: |