patch to add readonly support for T60 wireless killswitch

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

 



Hello,

since I got acpi events from the killswitch to work with hotkey I
wanted to trigger actions on that event. The basic idea was to load
ipw3945 and start ipw3945d and wpa_supplicant when the switch is turned
off. And kill/unload when switch is enabled.

I used ecdump and found that 0x48 holds the state of the killswitch on
my T60. I wrote a simple patch which gives me /proc/ibm/killswitch
readonly access. Maybe other people can confirm that 0x48 holds the
state of the switch on other models. If that patch works for other
models (0x48 holds) hotkey could generate different events in addition
to the procfile.

The attached patch is a diff of version 0.12a from 2.6.19.

Henning
--- drivers/acpi/ibm_acpi.c.orig	2007-02-21 13:35:07.000000000 +0100
+++ drivers/acpi/ibm_acpi.c	2007-02-21 14:07:12.000000000 +0100
@@ -1602,6 +1602,22 @@
 	return 0;
 }
 
+static int killswitch_offset = 0x48;
+
+static int killswitch_read(char *p)
+{
+	int len = 0;
+	u8 status;
+
+	if (!acpi_ec_read(killswitch_offset, &status)) {
+		len += sprintf(p + len, "status:\t\tunreadable\n");
+	} else {
+		len += sprintf(p + len, "status:\t\t%s\n", enabled(~status, 1));
+	}
+
+	return len;
+}
+
 static struct ibm_struct ibms[] = {
 	{
 	 .name = "driver",
@@ -1714,6 +1730,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 +1983,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