* [patch 9/9] asus_acpi: Invert read of wled proc file to show correct state of LED
@ 2006-01-06 6:31 akpm-3NddpPZAyC0
[not found] ` <200601060631.k066VEgJ008147-bipKiLWnuIsyyg0EjBt7GtHuzzzSOjJt@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: akpm-3NddpPZAyC0 @ 2006-01-06 6:31 UTC (permalink / raw)
To: len.brown-ral2JQCrhuEAvxtiuMwx3w
Cc: linux-acpi-u79uwXL29TY76Z2rM5mHXA, akpm-3NddpPZAyC0,
bcollins-GeWIH/nMZzLQT0dZR+AlfA
From: Ben Collins <bcollins-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org>
User with this equipment stated that writes to this file worked correctly,
but that reads were showing inverted state (1 for off, 0 for on).
Following the same style for reads, introduced an invert flag to read_led,
and used it for wled.
Signed-off-by: Ben Collins <bcollins-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Andrew Morton <akpm-3NddpPZAyC0@public.gmane.org>
---
drivers/acpi/asus_acpi.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff -puN drivers/acpi/asus_acpi.c~asus_acpi-invert-read-of-wled-proc-file-to-show-correct drivers/acpi/asus_acpi.c
--- devel/drivers/acpi/asus_acpi.c~asus_acpi-invert-read-of-wled-proc-file-to-show-correct 2006-01-05 22:28:55.000000000 -0800
+++ devel-akpm/drivers/acpi/asus_acpi.c 2006-01-05 22:28:55.000000000 -0800
@@ -490,13 +490,13 @@ proc_read_info(char *page, char **start,
*/
/* Generic LED functions */
-static int read_led(const char *ledname, int ledmask)
+static int read_led(const char *ledname, int ledmask, int invert)
{
if (ledname) {
int led_status;
if (read_acpi_int(NULL, ledname, &led_status))
- return led_status;
+ return (invert) ? !led_status : led_status;
else
printk(KERN_WARNING "Asus ACPI: Error reading LED "
"status\n");
@@ -552,7 +552,7 @@ proc_read_mled(char *page, char **start,
void *data)
{
return sprintf(page, "%d\n",
- read_led(hotk->methods->mled_status, MLED_ON));
+ read_led(hotk->methods->mled_status, MLED_ON, 0));
}
static int
@@ -570,7 +570,7 @@ proc_read_wled(char *page, char **start,
void *data)
{
return sprintf(page, "%d\n",
- read_led(hotk->methods->wled_status, WLED_ON));
+ read_led(hotk->methods->wled_status, WLED_ON, 1));
}
static int
@@ -588,7 +588,7 @@ proc_read_tled(char *page, char **start,
void *data)
{
return sprintf(page, "%d\n",
- read_led(hotk->methods->tled_status, TLED_ON));
+ read_led(hotk->methods->tled_status, TLED_ON, 0));
}
static int
_
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-01-06 15:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-06 6:31 [patch 9/9] asus_acpi: Invert read of wled proc file to show correct state of LED akpm-3NddpPZAyC0
[not found] ` <200601060631.k066VEgJ008147-bipKiLWnuIsyyg0EjBt7GtHuzzzSOjJt@public.gmane.org>
2006-01-06 14:28 ` Karol Kozimor
[not found] ` <20060106142853.GA20618-DETuoxkZsSqrDJvtcaxF/A@public.gmane.org>
2006-01-06 15:19 ` Ben Collins
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox