* [PATCH] tc1100-wmi: fix state reporting
@ 2008-12-25 2:45 Krzysztof Kosiński
2008-12-25 7:55 ` Carlos Corbacho
0 siblings, 1 reply; 4+ messages in thread
From: Krzysztof Kosiński @ 2008-12-25 2:45 UTC (permalink / raw)
To: linux-kernel; +Cc: carlos
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=UTF-8, Size: 1276 bytes --]
This small patch fixes the state reported when reading the files in/sys/devices/platofrm/tc1100-wmi/*. The first change fixes alwaysreturning 0 from the files in sysfs. The second one fixes jogdialstate reprting to match with the commands used to set it (e.g. nowafter "echo 0 > /sys/devices/platofrm/tc1100-wmi/jogdial", "cat/sys/devices/platofrm/tc1100-wmi/jogdial" will return 0 instead of 1).
Please CC any replies to me (I'm not subscribed).Regards, Krzysztof KosiÅski
--- linux-2.6.27/drivers/misc/tc1100-wmi.c 2008-10-10 00:13:53.000000000 +0200+++ linux/drivers/misc/tc1100-wmi.c 2008-12-25 02:58:48.000000000 +0100@@ -95,9 +95,8 @@ return -ENODEV;
obj = (union acpi_object *) result.pointer;- if (obj && obj->type == ACPI_TYPE_BUFFER &&- obj->buffer.length == sizeof(u32)) {- tmp = *((u32 *) obj->buffer.pointer);+ if (obj && obj->type == ACPI_TYPE_INTEGER) {+ tmp = obj->integer.value; } else { tmp = 0; }@@ -110,7 +109,7 @@ *out = (tmp == 3) ? 1 : 0; return 0; case TC1100_INSTANCE_JOGDIAL:- *out = (tmp == 1) ? 1 : 0;+ *out = (tmp == 1) ? 0 : 1; return 0; default: return -ENODEV;ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] tc1100-wmi: fix state reporting
2008-12-25 2:45 [PATCH] tc1100-wmi: fix state reporting Krzysztof Kosiński
@ 2008-12-25 7:55 ` Carlos Corbacho
2008-12-25 13:30 ` Krzysztof Kosiński
0 siblings, 1 reply; 4+ messages in thread
From: Carlos Corbacho @ 2008-12-25 7:55 UTC (permalink / raw)
To: Krzysztof Kosiński; +Cc: linux-kernel, linux-acpi, Len Brown
[Adding CC's]
On Thursday 25 December 2008 02:45:25 Krzysztof Kosiński wrote:
> This small patch fixes the state reported when reading the files in
> /sys/devices/platofrm/tc1100-wmi/*. The first change fixes always
> returning 0 from the files in sysfs. The second one fixes jogdial
> state reprting to match with the commands used to set it (e.g. now
> after "echo 0 > /sys/devices/platofrm/tc1100-wmi/jogdial", "cat
> /sys/devices/platofrm/tc1100-wmi/jogdial" will return 0 instead of 1).
>
> Please CC any replies to me (I'm not subscribed).
> Regards, Krzysztof Kosiński
Can you resend this with a Signed-off-by, so I can ACK it and Len can merge
it.
Also, please add to your description of this patch that it fixes Bug 12286.
-Carlos
> --- linux-2.6.27/drivers/misc/tc1100-wmi.c 2008-10-10 00:13:53.000000000
> +0200 +++ linux/drivers/misc/tc1100-wmi.c 2008-12-25 02:58:48.000000000
> +0100 @@ -95,9 +95,8 @@
> return -ENODEV;
>
> obj = (union acpi_object *) result.pointer;
> - if (obj && obj->type == ACPI_TYPE_BUFFER &&
> - obj->buffer.length == sizeof(u32)) {
> - tmp = *((u32 *) obj->buffer.pointer);
> + if (obj && obj->type == ACPI_TYPE_INTEGER) {
> + tmp = obj->integer.value;
> } else {
> tmp = 0;
> }
> @@ -110,7 +109,7 @@
> *out = (tmp == 3) ? 1 : 0;
> return 0;
> case TC1100_INSTANCE_JOGDIAL:
> - *out = (tmp == 1) ? 1 : 0;
> + *out = (tmp == 1) ? 0 : 1;
> return 0;
> default:
> return -ENODEV;
--
E-Mail: carlos@strangeworlds.co.uk
Web: strangeworlds.co.uk
GPG Key ID: 0x23EE722D
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] tc1100-wmi: fix state reporting
2008-12-25 7:55 ` Carlos Corbacho
@ 2008-12-25 13:30 ` Krzysztof Kosiński
2008-12-25 17:58 ` Carlos Corbacho
0 siblings, 1 reply; 4+ messages in thread
From: Krzysztof Kosiński @ 2008-12-25 13:30 UTC (permalink / raw)
To: linux-kernel; +Cc: Carlos Corbacho, linux-acpi, Len Brown
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=UTF-8, Size: 1463 bytes --]
(Resend)This small patch fixes the state reported when reading the files in/sys/devices/platofrm/tc1100-wmi/*. The first change fixes alwaysreturning 0 from the files in sysfs. The second one fixes jogdialstate reporting to match with the commands used to set it (e.g. nowafter "echo 0 > /sys/devices/platofrm/tc1100-wmi/jogdial", "cat/sys/devices/platofrm/tc1100-wmi/jogdial" will return 0 instead of 1).Fixes bug #12286.
Signed-off-by: Krzysztof KosiÅski <tweenk.pl@gmail.com>
--- linux-2.6.27/drivers/misc/tc1100-wmi.c 2008-10-1000:13:53.000000000 +0200+++ linux/drivers/misc/tc1100-wmi.c 2008-12-25 02:58:48.000000000 +0100@@ -95,9 +95,8 @@ return -ENODEV;
obj = (union acpi_object *) result.pointer;- if (obj && obj->type == ACPI_TYPE_BUFFER &&- obj->buffer.length == sizeof(u32)) {- tmp = *((u32 *) obj->buffer.pointer);+ if (obj && obj->type == ACPI_TYPE_INTEGER) {+ tmp = obj->integer.value; } else { tmp = 0; }@@ -110,7 +109,7 @@ *out = (tmp == 3) ? 1 : 0; return 0; case TC1100_INSTANCE_JOGDIAL:- *out = (tmp == 1) ? 1 : 0;+ *out = (tmp == 1) ? 0 : 1; return 0; default: return -ENODEV;ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] tc1100-wmi: fix state reporting
2008-12-25 13:30 ` Krzysztof Kosiński
@ 2008-12-25 17:58 ` Carlos Corbacho
0 siblings, 0 replies; 4+ messages in thread
From: Carlos Corbacho @ 2008-12-25 17:58 UTC (permalink / raw)
To: Krzysztof Kosiński; +Cc: linux-kernel, linux-acpi, Len Brown
Len, please apply.
On Thursday 25 December 2008 13:30:46 Krzysztof Kosiński wrote:
> (Resend)
> This small patch fixes the state reported when reading the files in
> /sys/devices/platofrm/tc1100-wmi/*. The first change fixes always
> returning 0 from the files in sysfs. The second one fixes jogdial
> state reporting to match with the commands used to set it (e.g. now
> after "echo 0 > /sys/devices/platofrm/tc1100-wmi/jogdial", "cat
> /sys/devices/platofrm/tc1100-wmi/jogdial" will return 0 instead of 1).
> Fixes bug #12286.
>
> Signed-off-by: Krzysztof Kosiński <tweenk.pl@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
>
> --- linux-2.6.27/drivers/misc/tc1100-wmi.c 2008-10-10
> 00:13:53.000000000 +0200
> +++ linux/drivers/misc/tc1100-wmi.c 2008-12-25 02:58:48.000000000 +0100
> @@ -95,9 +95,8 @@
> return -ENODEV;
>
> obj = (union acpi_object *) result.pointer;
> - if (obj && obj->type == ACPI_TYPE_BUFFER &&
> - obj->buffer.length == sizeof(u32)) {
> - tmp = *((u32 *) obj->buffer.pointer);
> + if (obj && obj->type == ACPI_TYPE_INTEGER) {
> + tmp = obj->integer.value;
> } else {
> tmp = 0;
> }
> @@ -110,7 +109,7 @@
> *out = (tmp == 3) ? 1 : 0;
> return 0;
> case TC1100_INSTANCE_JOGDIAL:
> - *out = (tmp == 1) ? 1 : 0;
> + *out = (tmp == 1) ? 0 : 1;
> return 0;
> default:
> return -ENODEV;
--
E-Mail: carlos@strangeworlds.co.uk
Web: strangeworlds.co.uk
GPG Key ID: 0x23EE722D
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-12-25 17:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-25 2:45 [PATCH] tc1100-wmi: fix state reporting Krzysztof Kosiński
2008-12-25 7:55 ` Carlos Corbacho
2008-12-25 13:30 ` Krzysztof Kosiński
2008-12-25 17:58 ` Carlos Corbacho
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®