Skip to contentSkip to conversation

sonypi driver update

PATCH New Stelian Pop 1 participant 1 message Aug 26, 2003

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sonypi driver update

Hi,

Now that we are starting a new -pre cycle, here are the latest sonypi updates:
* document the fact that FX501/FX702 laptops are not supported

* add battery insert/remove events (thanks to Daniel K.)

* improve the event detection using a different port offset on 'type2' models (thanks to Daniel K.)

* now that ACPI is finally in the kernel, simplify the ACPI tests.

Marcelo, please apply.

Stelian.

===== Documentation/sonypi.txt 1.12 vs edited =====

Documentation/sonypi.txt +4 -1
@@ -8,7 +8,9 @@
 	Copyright (C) 2000 Andrew Tridgell <[email protected]>
 
 This driver enables access to the Sony Programmable I/O Control Device which
-can be found in many (all ?) Sony Vaio laptops.
+can be found in many Sony Vaio laptops. Some newer Sony laptops (seems to be
+limited to new FX series laptops, at least the FX501 and the FX702) lack a
+sonypi device and are not supported at all by this driver.
 
 It will give access (through a user space utility) to some events those laptops
 generate, like:
@@ -96,6 +98,7 @@
 				SONYPI_THUMBPHRASE_MASK 	0x0200
 				SONYPI_MEYE_MASK		0x0400
 				SONYPI_MEMORYSTICK_MASK		0x0800
+				SONYPI_BATTERY_MASK		0x1000
 
 	useinput:	if set (which is the default) jogdial events are
 			forwarded to the input subsystem as mouse wheel

===== include/linux/sonypi.h 1.9 vs edited =====

include/linux/sonypi.h +2 -0
@@ -94,6 +94,8 @@
 #define SONYPI_EVENT_MEMORYSTICK_INSERT		54
 #define SONYPI_EVENT_MEMORYSTICK_EJECT		55
 #define SONYPI_EVENT_ANYBUTTON_RELEASED		56
+#define SONYPI_EVENT_BATTERY_INSERT		57
+#define SONYPI_EVENT_BATTERY_REMOVE		58
 
 /* get/set brightness */
 #define SONYPI_IOCGBRT		_IOR('v', 0, __u8)

===== drivers/char/sonypi.h 1.17 vs edited =====

drivers/char/sonypi.h +23 -22

110 lines not on this page · raw message

===== drivers/char/sonypi.c 1.16 vs edited =====

drivers/char/sonypi.c +3 -1
@@ -308,7 +308,7 @@
 	int i, j;
 
 	v1 = inb_p(sonypi_device.ioport1);
-	v2 = inb_p(sonypi_device.ioport2);
+	v2 = inb_p(sonypi_device.ioport1 + sonypi_device.evtype_offset);
 
 	for (i = 0; sonypi_eventtypes[i].model; i++) {
 		if (sonypi_device.model != sonypi_eventtypes[i].model)
@@ -665,11 +665,13 @@
 	if (sonypi_device.model == SONYPI_DEVICE_MODEL_TYPE2) {
 		ioport_list = sonypi_type2_ioport_list;
 		sonypi_device.region_size = SONYPI_TYPE2_REGION_SIZE;
+		sonypi_device.evtype_offset = SONYPI_TYPE2_EVTYPE_OFFSET;
 		irq_list = sonypi_type2_irq_list;
 	}
 	else {
 		ioport_list = sonypi_type1_ioport_list;
 		sonypi_device.region_size = SONYPI_TYPE1_REGION_SIZE;
+		sonypi_device.evtype_offset = SONYPI_TYPE1_EVTYPE_OFFSET;
 		irq_list = sonypi_type1_irq_list;
 	}
 
Signature · 1 line
Stelian Pop <[email protected]>