All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Collins <bcollins@ubuntu.com>
To: linux-kernel@vger.kernel.org
Cc: Ben Collins <bcollins@ubuntu.com>
Subject: [PATCH 1/2] asus_acpi: Invert read of wled proc file to show correct state of LED.
Date: Tue, 13 Dec 2005 13:23:12 -0500	[thread overview]
Message-ID: <1134498192250-git-send-email-bcollins@ubuntu.com> (raw)
In-Reply-To: <113449813159-git-send-email-bcollins@ubuntu.com>

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@ubuntu.com>

---

 drivers/acpi/asus_acpi.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

applies-to: f7e55af855531331113cbddb98688f3901d48425
d23291aeab378d85b93eda31f043a41449a5b474
diff --git a/drivers/acpi/asus_acpi.c b/drivers/acpi/asus_acpi.c
index fec895a..20e53c4 100644
--- a/drivers/acpi/asus_acpi.c
+++ b/drivers/acpi/asus_acpi.c
@@ -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
---
0.99.9k



  reply	other threads:[~2005-12-13 18:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-13 18:22 [PATCH 0/2] Sync Ubuntu patches Ben Collins
2005-12-13 18:23 ` Ben Collins [this message]
2005-12-13 18:24   ` [PATCH 2/2] ide/sis5513: Add support for 965 chipset Ben Collins
2005-12-13 18:38     ` Bartlomiej Zolnierkiewicz
2005-12-13 19:30       ` Ben Collins
2005-12-13 19:57         ` Bartlomiej Zolnierkiewicz
2005-12-13 20:41           ` Ben Collins
2005-12-13 21:06             ` Bartlomiej Zolnierkiewicz
2005-12-13 23:39               ` Ben Collins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1134498192250-git-send-email-bcollins@ubuntu.com \
    --to=bcollins@ubuntu.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.