public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [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

* Re: [patch 9/9] asus_acpi: Invert read of wled proc file to show correct state of LED
       [not found] ` <200601060631.k066VEgJ008147-bipKiLWnuIsyyg0EjBt7GtHuzzzSOjJt@public.gmane.org>
@ 2006-01-06 14:28   ` Karol Kozimor
       [not found]     ` <20060106142853.GA20618-DETuoxkZsSqrDJvtcaxF/A@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Karol Kozimor @ 2006-01-06 14:28 UTC (permalink / raw)
  To: akpm-3NddpPZAyC0
  Cc: len.brown-ral2JQCrhuEAvxtiuMwx3w,
	linux-acpi-u79uwXL29TY76Z2rM5mHXA,
	bcollins-GeWIH/nMZzLQT0dZR+AlfA

Thus wrote akpm-3NddpPZAyC0@public.gmane.org:
> 
> 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.

Any background on this patch? I've never received such reports, so it must
be model-specific and require a model-specific work around.
Best regards,

-- 
Karol 'sziwan' Kozimor
sziwan-DETuoxkZsSqrDJvtcaxF/A@public.gmane.org
-
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

* Re: [patch 9/9] asus_acpi: Invert read of wled proc file to show correct state of LED
       [not found]     ` <20060106142853.GA20618-DETuoxkZsSqrDJvtcaxF/A@public.gmane.org>
@ 2006-01-06 15:19       ` Ben Collins
  0 siblings, 0 replies; 3+ messages in thread
From: Ben Collins @ 2006-01-06 15:19 UTC (permalink / raw)
  To: Karol Kozimor
  Cc: akpm-3NddpPZAyC0, len.brown-ral2JQCrhuEAvxtiuMwx3w,
	linux-acpi-u79uwXL29TY76Z2rM5mHXA

On Fri, 2006-01-06 at 15:28 +0100, Karol Kozimor wrote:
> Thus wrote akpm-3NddpPZAyC0@public.gmane.org:
> > 
> > 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.
> 
> Any background on this patch? I've never received such reports, so it must
> be model-specific and require a model-specific work around.
> Best regards,

http://bugzilla.ubuntu.com/show_bug.cgi?id=10770

-- 
   Ben Collins <ben.collins-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org>
   Developer
   Ubuntu Linux

-
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