Bug 12286

Summary: [Patch] tc1100-wmi: sysfs entries always 0
Product: Drivers Reporter: Krzysztof Kosiński (tweenk.pl)
Component: PlatformAssignee: acpi_platform-drivers (acpi_platform-drivers)
Status: CLOSED CODE_FIX    
Severity: normal CC: lenb
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.27 Subsystem:
Regression: No Bisected commit-id:
Attachments: Fix state querying in tc1100-wmi
Fix state querying in tc1100-wmi (v2)

Description Krzysztof Kosiński 2008-12-24 17:44:33 UTC
Latest working kernel version: 2.6.22
Earliest failing kernel version: 2.6.25
Distribution: Ubuntu

Problem Description:
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).
Comment 1 Krzysztof Kosiński 2008-12-24 17:48:02 UTC
Created attachment 19476 [details]
Fix state querying in tc1100-wmi

This patch fixes both issues: querying state by catting /sys/devices/platform/tc1100-wmi/* works again, like it did in the old out-of-tree driver. Additionally, after "echo 0 > /sys/devices/platform/tc1100-wmi/jogdial", "cat /sys/devices/platform/tc1100-wmi/jogdial" prints 0 instead of 1.
Comment 2 Krzysztof Kosiński 2008-12-24 18:01:37 UTC
Created attachment 19477 [details]
Fix state querying in tc1100-wmi (v2)

Resend in unified format (sorry)
Comment 3 Alan 2009-03-19 10:39:51 UTC
This one seems to have been overlooked - can you post the patch with a Signed-off-by: line as per Documentation/SubmittingPatches to linux-kernel@vger.kernel.org and I'll make sure it gets followed up
Comment 4 Krzysztof Kosiński 2009-03-19 15:24:36 UTC
I have posted it some time ago, and Carlos Corbacho sent it to somebody else to apply - I thought it was already in the tree. I sent it again today.
Comment 5 Len Brown 2009-03-28 01:42:19 UTC
applied to acpi-test tree
Comment 6 Len Brown 2009-04-07 02:59:59 UTC
shipped in 2.6.30 merge window (2.6.29-git14)

closed.

commit 07de5bdb7bad607e29dc17c345717403a76a334c
Author: Krzysztof Kosiński <tweenk.pl@gmail.com>
Date:   Thu Mar 19 23:22:31 2009 +0100

    tc1100-wmi: Fix state reporting