sonypi and input subsystem integration
PATCH 1/1 sonypi and input subsystem integration
Hi,
The attached patch makes the sonypi driver forward the VAIO jogdial events directly to the input subsystem as mouse wheel events. This way one is not required anymore to have an external daemon polling /dev/sonypi if interested only in jogdial events.
This new behaviour is controlled by a module option ("useinput"), which is active by default.
John Karcz should be credited for writing and testing this patch.
Marcelo, Alan, please apply this patch to your trees.
Note: due to a limitation in the input subsytem, this patch will not work as is (the input subsystem doesn't recognise as a valid device a mouse without a left button...). Vojtech has confirmed this limitation is a bug and will send a patch against mousedev.c shortly...
Thanks,
Stelian.
===== Documentation/sonypi.txt 1.9 vs edited =====
Documentation/sonypi.txt +6 -1
@@ -44,7 +44,7 @@ to /etc/modules.conf file, when the driver is compiled as a module or by adding the following to the kernel command line (in your bootloader): - sonypi=minor[,verbose[,fnkeyinit[,camera[,compat[,mask]]]]] + sonypi=minor[,verbose[,fnkeyinit[,camera[,compat[,mask[,useinput]]]]]] where:
@@ -96,6 +96,11 @@ SONYPI_THUMBPHRASE_MASK 0x0200 SONYPI_MEYE_MASK 0x0400 SONYPI_MEMORYSTICK_MASK 0x0800 + + useinput: if set (which is the default) jogdial events are + forwarded to the input subsystem as mouse wheel + events. + Module use: -----------
===== drivers/char/sonypi.h 1.14 vs edited =====
drivers/char/sonypi.h +9 -2
@@ -37,7 +37,7 @@#ifdef __KERNEL__#define SONYPI_DRIVER_MAJORVERSION 1 -#define SONYPI_DRIVER_MINORVERSION 17 +#define SONYPI_DRIVER_MINORVERSION 18#define SONYPI_DEVICE_MODEL_TYPE1 1#define SONYPI_DEVICE_MODEL_TYPE2 2
@@ -45,6 +45,7 @@#include <linux/config.h> #include <linux/types.h> #include <linux/pci.h> +#include <linux/input.h> #include <linux/pm.h> #include <linux/acpi.h> #include "linux/sonypi.h"
@@ -334,6 +335,9 @@unsigned char buf[SONYPI_BUF_SIZE ]; }; +/* The name of the Jog Dial for the input device drivers */ +#define SONYPI_INPUTNAME "Sony VAIO Jog Dial" +struct sonypi_device {struct pci_dev *dev;u16 irq;
@@ -347,7 +351,10 @@struct sonypi_queue queue;int open_count;int model; -#if CONFIG_PM +#if defined(CONFIG_INPUT ) || defined(CONFIG_INPUT_MODULE ) +struct input_dev jog_dev; +#endif +#ifdef CONFIG_PM struct pm_dev *pm;#endif };
===== drivers/char/sonypi.c 1.12 vs edited =====
drivers/char/sonypi.c +60 -10
163 lines not on this page · raw message
Signature · 1 line
Stelian Pop <[email protected]>