Skip to contentSkip to conversation

asus_acpi: Invert read of wled proc file to show correct state of LED

PATCH In review [email protected] 3 participants 3 messages Jan 6, 2006 2 messages not in the archive ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 9/9 asus_acpi: Invert read of wled proc file to show correct state of LED

From: Ben Collins <bcollins-GeWIH/[email protected]>

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.

---

 drivers/acpi/asus_acpi.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
drivers/acpi/asus_acpi.c renamed from drivers/acpi/asus_acpi.c~asus_acpi-invert-read-of-wled-proc-file-to-show-correct +5 -5
diff -puN drivers/acpi/asus_acpi.c~asus_acpi-invert-read-of-wled-proc-file-to-show-correct 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

_
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
In reply to a message not in the archive

Thus wrote [email protected]:

Quoted 7 lines

From: Ben Collins <bcollins-GeWIH/[email protected]>

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,

Signature · 6 lines
Karol 'sziwan' Kozimor
sziwan-DETuoxkZsSqrDJvtcaxF/[email protected]
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#4 lore raw
In reply to a message not in the archive
Quoted 4 lines · Karol Kozimor

Thus wrote [email protected]:

Quoted 3 lines

From: Ben Collins <bcollins-GeWIH/[email protected]>

Quoted 8 lines
Quoted 4 lines

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

Signature · 8 lines
   Ben Collins <ben.collins-GeWIH/[email protected]>
   Developer
   Ubuntu Linux

-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html