Re: patch to add readonly support for T60 wireless killswitch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Wed, 21 Feb 2007 12:04:52 -0200
schrieb Henrique de Moraes Holschuh <hmh@xxxxxxxxxx>:

> 3. Triple check the DSDTs to make sure the kill switch is not
> exported in higher level.

_SB.PCIO.LPC.EC.GSTS seems to be the switch. I wrote another patch
using that. Models without this DSDT should see "not supported".

Henning
--- drivers/acpi/ibm_acpi.c.orig	2007-02-21 13:35:07.000000000 +0100
+++ drivers/acpi/ibm_acpi.c	2007-02-21 22:41:38.000000000 +0100
@@ -1602,6 +1602,19 @@
 	return 0;
 }
 
+static int killswitch_read(char *p)
+{
+	int state, len = 0;
+
+	if (!acpi_evalf(ec_handle, &state, "GSTS", "d")) {
+		len += sprintf(p + len, "status:\t\tnot supported\n");
+	} else {
+		len += sprintf(p + len, "status:\t\t%s\n", enabled(~state,0));
+	}
+
+	return len;
+}
+
 static struct ibm_struct ibms[] = {
 	{
 	 .name = "driver",
@@ -1714,6 +1727,11 @@
 	 .write = fan_write,
 	 .experimental = 1,
 	 },
+	{
+	 .name = "killswitch",
+	 .read = killswitch_read,
+	 .experimental = 1,
+	 },
 };
 
 static int dispatch_read(char *page, char **start, off_t off, int count,
@@ -1962,6 +1980,7 @@
 IBM_PARAM(brightness);
 IBM_PARAM(volume);
 IBM_PARAM(fan);
+IBM_PARAM(killswitch);
 
 static void acpi_ibm_exit(void)
 {
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
ibm-acpi-devel mailing list
ibm-acpi-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel

[Index of Archives]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Photo]     [Yosemite Photos]     [Yosemite Advice]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux