diff options
author | Krzysztof Kosiński <tweenk.pl@gmail.com> | 2009-03-19 18:22:31 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-04-03 12:03:27 -0400 |
commit | 07de5bdb7bad607e29dc17c345717403a76a334c (patch) | |
tree | 944d7898e8fb41ce2f30836d64264f1572ebbc1b /drivers/platform | |
parent | a59d1637eb0e0a37ee0e5c92800c60abe3624e24 (diff) |
tc1100-wmi: Fix state reporting
The tc1100-wmi driver should print the current states of wireless LAN and
jogdial brightness control when "cat /sys/devices/platform/tc1100-wmi/wireless"
and "cat /sys/devices/platform/tc1100-wmi/jogdial" are executed, respectively.
What actually happens is that both of those commands print 0 regardless of the
hardware state. The cause is that wmi_query_block returns an ACPI_TYPE_INTEGER
rather than ACPI_TYPE_BUFFER as the driver assumes. Additionally, the driver
intends to return a jogdial state that is inverted with respect to the commands
required to set it (e.g. it intends to return 1 after the jogdial file was
written with 0).
This patch fixes both of those issues - the commands to query the
state now work, and should return the same state that was written.
http://bugzilla.kernel.org/show_bug.cgi?id=12286
Signed-off-by: Krzysztof Kosiński <tweenk.pl@gmail.com>
Acked-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/tc1100-wmi.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/platform/x86/tc1100-wmi.c b/drivers/platform/x86/tc1100-wmi.c index b4a4aa9ee482..44166003d4ef 100644 --- a/drivers/platform/x86/tc1100-wmi.c +++ b/drivers/platform/x86/tc1100-wmi.c | |||
@@ -94,9 +94,8 @@ static int get_state(u32 *out, u8 instance) | |||
94 | return -ENODEV; | 94 | return -ENODEV; |
95 | 95 | ||
96 | obj = (union acpi_object *) result.pointer; | 96 | obj = (union acpi_object *) result.pointer; |
97 | if (obj && obj->type == ACPI_TYPE_BUFFER && | 97 | if (obj && obj->type == ACPI_TYPE_INTEGER) { |
98 | obj->buffer.length == sizeof(u32)) { | 98 | tmp = obj->integer.value; |
99 | tmp = *((u32 *) obj->buffer.pointer); | ||
100 | } else { | 99 | } else { |
101 | tmp = 0; | 100 | tmp = 0; |
102 | } | 101 | } |
@@ -109,7 +108,7 @@ static int get_state(u32 *out, u8 instance) | |||
109 | *out = (tmp == 3) ? 1 : 0; | 108 | *out = (tmp == 3) ? 1 : 0; |
110 | return 0; | 109 | return 0; |
111 | case TC1100_INSTANCE_JOGDIAL: | 110 | case TC1100_INSTANCE_JOGDIAL: |
112 | *out = (tmp == 1) ? 1 : 0; | 111 | *out = (tmp == 1) ? 0 : 1; |
113 | return 0; | 112 | return 0; |
114 | default: | 113 | default: |
115 | return -ENODEV; | 114 | return -ENODEV; |