sonypi driver update
PATCH 1/1 sonypi driver update
Hi,
Some VAIO users are unable to use APM and/or ACPI to inquire their laptops' power status.
The attached patch makes this information available through the sonypi driver (query AC adaptor and battery information). You will need an updated spicctrl to use the new ioctls from
http://www.alcove-labs.org/en/software/sonypi/.
Marcelo, please apply.
Stelian.
Documentation/sonypi.txt +2 -1
@@ -25,7 +25,8 @@ can be downloaded at: <http://www.alcove-labs.org/en/software/sonypi/> This driver supports also some ioctl commands for setting the LCD screen -brightness (some more commands may be added in the future). +brightness and querying the batteries charge information (some more +commands may be added in the future). This driver can also be used to set the camera controls on Picturebook series (brightness, contrast etc), and is used by the video4linux driver for the
drivers/char/sonypi.c +73 -33
122 lines not on this page · raw message
drivers/char/sonypi.h +1 -1
@@ -35,7 +35,7 @@#ifdef __KERNEL__#define SONYPI_DRIVER_MAJORVERSION 1 -#define SONYPI_DRIVER_MINORVERSION 8 +#define SONYPI_DRIVER_MINORVERSION 9#include <linux/types.h> #include <linux/pci.h>
include/linux/sonypi.h +15 -3
@@ -75,9 +75,21 @@#define SONYPI_EVENT_LID_OPENED 37 -/* brightness etc. ioctls */ -#define SONYPI_IOCGBRT _IOR('v', 0, __u8) -#define SONYPI_IOCSBRT _IOW('v', 0, __u8) +/* get/set brightness */ +#define SONYPI_IOCGBRT _IOR('v', 0, __u8) +#define SONYPI_IOCSBRT _IOW('v', 0, __u8) + +/* get battery full capacity/remaining capacity */ +#define SONYPI_IOCGBAT1CAP _IOR('v', 2, __u16) +#define SONYPI_IOCGBAT1REM _IOR('v', 3, __u16) +#define SONYPI_IOCGBAT2CAP _IOR('v', 4, __u16) +#define SONYPI_IOCGBAT2REM _IOR('v', 5, __u16) + +/* get battery flags: battery1/battery2/ac adapter present */ +#define SONYPI_BFLAGS_B1 0x01 +#define SONYPI_BFLAGS_B2 0x02 +#define SONYPI_BFLAGS_AC 0x04 +#define SONYPI_IOCGBATFLAGS _IOR('v', 7, __u8)#ifdef __KERNEL__
Signature · 4 lines
Stelian Pop <[email protected]> |---------------- Free Software Engineer -----------------| | Alcôve - http://www.alcove.com - Tel: +33 1 49 22 68 00 | |------------- Alcôve, liberating software ---------------|