Another input update for 2.6.15
Subsystems (3)
Hi Linus,
Please do a pull from:
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/dtor/input.git/
or
master.kernel.org:/pub/scm/linux/kernel/git/dtor/input.git/
The main feature is psmouse resync patch which should make PS/2 mice useable with cheap KVMs that reset mice when switching between boxes. Also there is a fix for OOps in PID code, build for for powerpc and HID tweaks to make new USB-based keyboards behave like older ADB ones.
Changelog:
Input: i8042 - add Sony Vaio FSC-115b to MUX blacklist (Vojtech)
Input: HID - add support for Cherry Cymotion keyboard (Vojtech)
Input: HID - fix an oops in PID initialization code
Input: psmouse - attempt to re-synchronize mouse every 5 seconds
Input: HID - add more simulation usages
Input: wacom - fix compile on PowerPC
Input: HID - add support for fn key on Apple PowerBooks (Michael Hanselmann)
Diffstat:
input/mouse/alps.c | 38 +++++ input/mouse/logips2pp.c | 2 input/mouse/psmouse-base.c | 316 +++++++++++++++++++++++++++++++++--------- input/mouse/psmouse.h | 9 + input/mouse/synaptics.c | 2 input/serio/i8042-x86ia64io.h | 7 usb/input/Kconfig | 10 + usb/input/hid-core.c | 30 +++ usb/input/hid-input.c | 179 +++++++++++++++++++++++ usb/input/hid.h | 30 ++- usb/input/pid.c | 2 usb/input/wacom.c | 14 - 12 files changed, 551 insertions(+), 88 deletions(-)
Thanks!
--
Dmitry
[git pull 2/7] HID: Add support for Cherry Cymotion keyboard
From: Vojtech Pavlik <[email protected]>
Input: HID - add support for Cherry Cymotion keyboard
The Cherry Cymotion is a special Linux keyboard made by Cherry, with only one little problem: it doesn't work with Linux. This patch (originally by hexten.net, cleaned up by me) makes it work including all the special keys.
---
drivers/usb/input/hid-core.c | 22 ++++++++++++++++++++++ drivers/usb/input/hid-input.c | 8 ++++++++ drivers/usb/input/hid.h | 1 + 3 files changed, 31 insertions(+)
drivers/usb/input/hid-core.c +22 -0
@@ -1450,6 +1450,9 @@ void hid_init_reports(struct hid_device#define USB_VENDOR_ID_APPLE 0x05ac#define USB_DEVICE_ID_APPLE_POWERMOUSE 0x0304 +#define USB_VENDOR_ID_CHERRY 0x046a +#define USB_DEVICE_ID_CHERRY_CYMOTION 0x0023 +/* * Alphabetically sorted blacklist by quirk type. */
@@ -1580,6 +1583,8 @@ static const struct hid_blacklist { { USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_RUMBLEPAD, HID_QUIRK_BADPAD }, { USB_VENDOR_ID_TOPMAX, USB_DEVICE_ID_TOPMAX_COBRAPAD, HID_QUIRK_BADPAD }, + { USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_CYMOTION, HID_QUIRK_CYMOTION }, + { 0, 0 } };
@@ -1626,6 +1631,20 @@ static void hid_free_buffers(struct usb_usb_buffer_free (dev, hid->bufsize, hid->ctrlbuf, hid->ctrlbuf_dma); } +/* +* Cherry Cymotion keyboard have an invalid HID report descriptor, +* that needs fixing before we can parse it. +*/ + +static void hid_fixup_cymotion_descriptor (char *rdesc,int rsize) +{ +if (rsize >=17 && rdesc[11 ] ==0x3c && rdesc[12 ] ==0x02 ) { +info ("Fixing up Cherry Cymotion report descriptor" ); + rdesc[11 ] = rdesc[16 ] =0xff ; + rdesc[12 ] = rdesc[17 ] =0x03 ; + } +} +static struct hid_device *usb_hid_configure (struct usb_interface *intf) {struct usb_host_interface *interface = intf->cur_altsetting;
@@ -1673,6 +1692,9 @@ static struct hid_device *usb_hid_configreturn NULL ; } +if ((quirks &HID_QUIRK_CYMOTION )) +hid_fixup_cymotion_descriptor (rdesc, rsize); +#ifdef DEBUG_DATA printk(KERN_DEBUG __FILE__ ": report descriptor (size %u, read %d) = ", rsize, n);for (n =0 ; n < rsize; n++)
drivers/usb/input/hid-input.c +8 -0
@@ -289,11 +289,19 @@ static void hidinput_configure_usage(strcase 0x226 :map_key_clear (KEY_STOP );break ;case 0x227 :map_key_clear (KEY_REFRESH );break ;case 0x22a :map_key_clear (KEY_BOOKMARKS );break ; +case 0x233 :map_key_clear (KEY_SCROLLUP );break ; +case 0x234 :map_key_clear (KEY_SCROLLDOWN );break ;case 0x238 :map_rel (REL_HWHEEL );break ;case 0x279 :map_key_clear (KEY_REDO );break ;case 0x289 :map_key_clear (KEY_REPLY );break ;case 0x28b :map_key_clear (KEY_FORWARDMAIL );break ;case 0x28c :map_key_clear (KEY_SEND );break ; + +/* Reported on a Cherry Cymotion keyboard */ +case 0x301 :map_key_clear (KEY_PROG1 );break ; +case 0x302 :map_key_clear (KEY_PROG2 );break ; +case 0x303 :map_key_clear (KEY_PROG3 );break ; +default : goto ignore; }break ;
drivers/usb/input/hid.h +1 -0
@@ -246,6 +246,7 @@ struct hid_item {#define HID_QUIRK_2WHEEL_MOUSE_HACK_5 0x100#define HID_QUIRK_2WHEEL_MOUSE_HACK_ON 0x200#define HID_QUIRK_2WHEEL_POWERMOUSE 0x400 +#define HID_QUIRK_CYMOTION 0x800/* * This is the global environment of the parser. This information is
[git pull 1/7] Add Sony Vaio FSC-115b to i8042 MUX blacklist
In reply to Dmitry TorokhovFrom: Vojtech Pavlik <[email protected]>
Input: i8042 - add Sony Vaio FSC-115b to MUX blacklist
---
drivers/input/serio/i8042-x86ia64io.h | 7 +++++++ 1 files changed, 7 insertions(+)
drivers/input/serio/i8042-x86ia64io.h +7 -0
@@ -173,6 +173,13 @@ static struct dmi_system_id __initdata i DMI_MATCH(DMI_PRODUCT_NAME, "PC-MM20 Series"), }, }, + { + .ident = "Sony Vaio FS-115b", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), + DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FS115B"), + }, + }, { } };
[git pull 4/7] psmouse: attempt to re-synchronize mouse every 5 seconds
In reply to Dmitry TorokhovInput: psmouse - attempt to re-synchronize mouse every 5 seconds
This should help driver to deal vith KVMs that reset mice when switching between boxes.
---
drivers/input/mouse/alps.c | 38 ++++ drivers/input/mouse/logips2pp.c | 2 drivers/input/mouse/psmouse-base.c | 316 +++++++++++++++++++++++++++++-------- drivers/input/mouse/psmouse.h | 9 - drivers/input/mouse/synaptics.c | 2 5 files changed, 301 insertions(+), 66 deletions(-)
drivers/input/mouse/psmouse.h +8 -1
@@ -7,7 +7,7 @@#define PSMOUSE_CMD_GETINFO 0x03e9#define PSMOUSE_CMD_SETSTREAM 0x00ea#define PSMOUSE_CMD_SETPOLL 0x00f0 -#define PSMOUSE_CMD_POLL 0x03eb +#define PSMOUSE_CMD_POLL 0x00eb/* caller sets number of bytes to receive */ #define PSMOUSE_CMD_GETID 0x02f2#define PSMOUSE_CMD_SETRATE 0x10f3#define PSMOUSE_CMD_ENABLE 0x00f4
@@ -23,6 +23,7 @@enum psmouse_state {PSMOUSE_IGNORE ,PSMOUSE_INITIALIZING , +PSMOUSE_RESYNCING ,PSMOUSE_CMD_MODE ,PSMOUSE_ACTIVATED , };
@@ -38,15 +39,19 @@ struct psmouse {void *private;struct input_dev *dev;struct ps2dev ps2dev; +struct work_struct resync_work;char *vendor;char *name;unsigned char packet[8 ]; +unsigned char badbyte;unsigned char pktcnt;unsigned char pktsize;unsigned char type; +unsigned char acks_disable_command;unsigned int model;unsigned long last;unsigned long out_of_sync; +unsigned long num_resyncs;enum psmouse_state state;char devname[64 ];char phys[32 ];
@@ -54,6 +59,7 @@ struct psmouse {unsigned int rate;unsigned int resolution;unsigned int resetafter; +unsigned int resync_time;unsigned int smartscroll;/* Logitech only */ psmouse_ret_t (*protocol_handler)(struct psmouse *psmouse,struct pt_regs *regs);
@@ -62,6 +68,7 @@ struct psmouse {int (*reconnect)(struct psmouse *psmouse);void (*disconnect)(struct psmouse *psmouse); +int (*poll)(struct psmouse *psmouse);void (*pt_activate)(struct psmouse *psmouse);void (*pt_deactivate)(struct psmouse *psmouse);
drivers/input/mouse/psmouse-base.c +252 -64
432 lines not on this page · raw message
drivers/input/mouse/logips2pp.c +1 -1
@@ -117,7 +117,7 @@ static int ps2pp_cmd(struct psmouse *psmif (psmouse_sliced_command (psmouse, command))return -1 ; -if (ps2_command (&psmouse->ps2dev, param,PSMOUSE_CMD_POLL )) +if (ps2_command (&psmouse->ps2dev, param,PSMOUSE_CMD_POLL |0x0300 ))return -1 ;return 0 ;
drivers/input/mouse/alps.c +38 -0
@@ -348,6 +348,40 @@ static int alps_tap_mode(struct psmousereturn 0 ; } +/* +* alps_poll() - poll the touchpad for current motion packet. +* Used in resync. +*/ +static int alps_poll (struct psmouse *psmouse) +{ +struct alps_data *priv = psmouse->private; +unsigned char buf[6 ]; +int poll_failed; + +if (priv->i->flags &ALPS_PASS ) +alps_passthrough_mode (psmouse,1 ); + + poll_failed =ps2_command (&psmouse->ps2dev, buf, +PSMOUSE_CMD_POLL | (psmouse->pktsize <<8 )) <0 ; + +if (priv->i->flags &ALPS_PASS ) +alps_passthrough_mode (psmouse,0 ); + +if (poll_failed || (buf[0 ] & priv->i->mask0) != priv->i->byte0) +return -1 ; + +if ((psmouse->badbyte &0xc8 ) ==0x08 ) { +/* +* Poll the track stick ... +*/ +if (ps2_command (&psmouse->ps2dev, buf,PSMOUSE_CMD_POLL | (3 <<8 ))) +return -1 ; + } + +memcpy (psmouse->packet, buf,sizeof (buf)); +return 0 ; +} +static int alps_reconnect (struct psmouse *psmouse) {struct alps_data *priv = psmouse->private;
@@ -451,10 +485,14 @@ int alps_init(struct psmouse *psmouse)input_register_device (priv->dev2); psmouse->protocol_handler = alps_process_byte; + psmouse->poll = alps_poll; psmouse->disconnect = alps_disconnect; psmouse->reconnect = alps_reconnect; psmouse->pktsize =6 ; +/* We are having trouble resyncing ALPS touchpads so disable it for now */ + psmouse->resync_time =0 ; +return 0 ; init_fail:
drivers/input/mouse/synaptics.c +2 -0
@@ -652,6 +652,8 @@ int synaptics_init(struct psmouse *psmou psmouse->disconnect = synaptics_disconnect; psmouse->reconnect = synaptics_reconnect; psmouse->pktsize =6 ; +/* Synaptics can usually stay in sync without extra help */ + psmouse->resync_time =0 ;if (SYN_CAP_PASS_THROUGH (priv->capabilities))synaptics_pt_create (psmouse);
[git pull 5/7] HID: add more simulation usages
In reply to Dmitry TorokhovInput: HID - add more simulation usages
---
drivers/usb/input/hid-input.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletion(-)
drivers/usb/input/hid-input.c +4 -1
@@ -135,8 +135,11 @@ static void hidinput_configure_usage(strcase HID_UP_SIMULATION :switch (usage->hid &0xffff ) { -case 0xba :map_abs (ABS_RUDDER );break ; +case 0xba :map_abs (ABS_RUDDER );break ;case 0xbb :map_abs (ABS_THROTTLE );break ; +case 0xc4 :map_abs (ABS_GAS );break ; +case 0xc5 :map_abs (ABS_BRAKE );break ; +case 0xc8 :map_abs (ABS_WHEEL );break ;default : goto ignore; }break ;
[git pull 3/7] HID: fix an oops in PID initialization code
In reply to Dmitry TorokhovInput: HID - fix an oops in PID initialization code
---
drivers/usb/input/pid.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-)
drivers/usb/input/pid.c +1 -1
@@ -259,7 +259,7 @@ static int hid_pid_upload_effect(structint hid_pid_init (struct hid_device *hid) {struct hid_ff_pid *private; - struct hid_input *hidinput = list_entry(&hid->inputs, struct hid_input, list); + struct hid_input *hidinput = list_entry(hid->inputs.next, struct hid_input, list);struct input_dev *input_dev = hidinput->input; private = hid->ff_private =kzalloc (sizeof (struct hid_ff_pid ),GFP_KERNEL );
[git pull 6/7] Wacom: fix compile on PowerPC
In reply to Dmitry TorokhovInput: wacom - fix compile on PowerPC
Rename G4 (new Graphire4) to WACOM_G4 to avoid clashes on PowerPC
---
drivers/usb/input/wacom.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-)
drivers/usb/input/wacom.c +7 -7
@@ -95,7 +95,7 @@ MODULE_LICENSE(DRIVER_LICENSE);enum {PENPARTNER =0 ,GRAPHIRE , -G4 , +WACOM_G4 ,PL ,INTUOS ,INTUOS3 ,
@@ -373,7 +373,7 @@ static void wacom_graphire_irq(struct urcase 2 :/* Mouse with wheel */ input_report_key (dev,BTN_MIDDLE , data[1 ] &0x04 ); -if (wacom->features->type ==G4 ) { +if (wacom->features->type ==WACOM_G4 ) { rw = data[7 ] &0x04 ? -(data[7 ] &0x03 ) : (data[7 ] &0x03 );input_report_rel (dev,REL_WHEEL , rw); }else
@@ -385,7 +385,7 @@ static void wacom_graphire_irq(struct ur id =CURSOR_DEVICE_ID ;input_report_key (dev,BTN_LEFT , data[1 ] &0x01 );input_report_key (dev,BTN_RIGHT , data[1 ] &0x02 ); -if (wacom->features->type ==G4 ) +if (wacom->features->type ==WACOM_G4 )input_report_abs (dev,ABS_DISTANCE , data[6 ]);else input_report_abs (dev,ABS_DISTANCE , data[7 ]);
@@ -410,7 +410,7 @@ static void wacom_graphire_irq(struct urinput_sync (dev);/* send pad data */ -if (wacom->features->type ==G4 ) { +if (wacom->features->type ==WACOM_G4 ) {/* fist time sending pad data */ if (wacom->tool[1 ] !=BTN_TOOL_FINGER ) { wacom->id[1 ] =0 ;
@@ -713,8 +713,8 @@ static struct wacom_features wacom_featu { "Wacom Graphire2 5x7", 8, 13918, 10206, 511, 32, GRAPHIRE, wacom_graphire_irq }, { "Wacom Graphire3", 8, 10208, 7424, 511, 32, GRAPHIRE, wacom_graphire_irq }, { "Wacom Graphire3 6x8", 8, 16704, 12064, 511, 32, GRAPHIRE, wacom_graphire_irq }, - { "Wacom Graphire4 4x5", 8, 10208, 7424, 511, 32, G4, wacom_graphire_irq }, - { "Wacom Graphire4 6x8", 8, 16704, 12064, 511, 32, G4, wacom_graphire_irq }, + { "Wacom Graphire4 4x5", 8, 10208, 7424, 511, 32, WACOM_G4, wacom_graphire_irq }, + { "Wacom Graphire4 6x8", 8, 16704, 12064, 511, 32, WACOM_G4, wacom_graphire_irq }, { "Wacom Volito", 8, 5104, 3712, 511, 32, GRAPHIRE, wacom_graphire_irq }, { "Wacom PenStation2", 8, 3250, 2320, 255, 32, GRAPHIRE, wacom_graphire_irq }, { "Wacom Volito2 4x5", 8, 5104, 3712, 511, 32, GRAPHIRE, wacom_graphire_irq },
@@ -859,7 +859,7 @@ static int wacom_probe(struct usb_interfinput_set_abs_params (input_dev,ABS_PRESSURE ,0 , wacom->features->pressure_max,0 ,0 );switch (wacom->features->type) { -case G4 : +case WACOM_G4 : input_dev->evbit[0 ] |=BIT (EV_MSC ); input_dev->mscbit[0 ] |=BIT (MSC_SERIAL ); input_dev->keybit[LONG (BTN_DIGI )] |=BIT (BTN_TOOL_FINGER );
[git pull 7/7] HID: add support for fn key on Apple PowerBooks
In reply to Dmitry TorokhovFrom: Michael Hanselmann <[email protected]>
Input: HID - add support for fn key on Apple PowerBooks
This patch implements support for the fn key on Apple PowerBooks using USB based keyboards and makes them behave like their ADB counterparts.
---
drivers/usb/input/Kconfig | 10 ++ drivers/usb/input/hid-core.c | 8 ++ drivers/usb/input/hid-input.c | 166 +++++++++++++++++++++++++++++++++++++++++- drivers/usb/input/hid.h | 31 ++++--- 4 files changed, 201 insertions(+), 14 deletions(-)
drivers/usb/input/hid-core.c +8 -0
@@ -1585,6 +1585,14 @@ static const struct hid_blacklist { { USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_CYMOTION, HID_QUIRK_CYMOTION }, + { USB_VENDOR_ID_APPLE, 0x020E, HID_QUIRK_POWERBOOK_HAS_FN }, + { USB_VENDOR_ID_APPLE, 0x020F, HID_QUIRK_POWERBOOK_HAS_FN }, + { USB_VENDOR_ID_APPLE, 0x0214, HID_QUIRK_POWERBOOK_HAS_FN }, + { USB_VENDOR_ID_APPLE, 0x0215, HID_QUIRK_POWERBOOK_HAS_FN }, + { USB_VENDOR_ID_APPLE, 0x0216, HID_QUIRK_POWERBOOK_HAS_FN }, + { USB_VENDOR_ID_APPLE, 0x030A, HID_QUIRK_POWERBOOK_HAS_FN }, + { USB_VENDOR_ID_APPLE, 0x030B, HID_QUIRK_POWERBOOK_HAS_FN }, + { 0, 0 } };
drivers/usb/input/hid.h +19 -12
@@ -235,18 +235,20 @@ struct hid_item {* HID device quirks. */ -#define HID_QUIRK_INVERT 0x001 -#define HID_QUIRK_NOTOUCH 0x002 -#define HID_QUIRK_IGNORE 0x004 -#define HID_QUIRK_NOGET 0x008 -#define HID_QUIRK_HIDDEV 0x010 -#define HID_QUIRK_BADPAD 0x020 -#define HID_QUIRK_MULTI_INPUT 0x040 -#define HID_QUIRK_2WHEEL_MOUSE_HACK_7 0x080 -#define HID_QUIRK_2WHEEL_MOUSE_HACK_5 0x100 -#define HID_QUIRK_2WHEEL_MOUSE_HACK_ON 0x200 -#define HID_QUIRK_2WHEEL_POWERMOUSE 0x400 -#define HID_QUIRK_CYMOTION 0x800 +#define HID_QUIRK_INVERT 0x00000001 +#define HID_QUIRK_NOTOUCH 0x00000002 +#define HID_QUIRK_IGNORE 0x00000004 +#define HID_QUIRK_NOGET 0x00000008 +#define HID_QUIRK_HIDDEV 0x00000010 +#define HID_QUIRK_BADPAD 0x00000020 +#define HID_QUIRK_MULTI_INPUT 0x00000040 +#define HID_QUIRK_2WHEEL_MOUSE_HACK_7 0x00000080 +#define HID_QUIRK_2WHEEL_MOUSE_HACK_5 0x00000100 +#define HID_QUIRK_2WHEEL_MOUSE_HACK_ON 0x00000200 +#define HID_QUIRK_2WHEEL_POWERMOUSE 0x00000400 +#define HID_QUIRK_CYMOTION 0x00000800 +#define HID_QUIRK_POWERBOOK_HAS_FN 0x00001000 +#define HID_QUIRK_POWERBOOK_FN_ON 0x00002000/* * This is the global environment of the parser. This information is
@@ -432,6 +434,11 @@ struct hid_device { /* device repovoid (*ff_exit)(struct hid_device *);/* Called by hid_exit_ff(hid) */ int (*ff_event)(struct hid_device *hid,struct input_dev *input,unsigned int type,unsigned int code,int value); + +#ifdef CONFIG_USB_HIDINPUT_POWERBOOK +unsigned long pb_pressed_fn[NBITS (KEY_MAX )]; +unsigned long pb_pressed_numlock[NBITS (KEY_MAX )]; +#endif };#define HID_GLOBAL_STACK_SIZE 4
drivers/usb/input/hid-input.c +164 -2
190 lines not on this page · raw message
drivers/usb/input/Kconfig +10 -0
@@ -37,6 +37,16 @@ config USB_HIDINPUT If unsure, say Y. +config USB_HIDINPUT_POWERBOOK + bool "Enable support for iBook/PowerBook special keys" + default n + depends on USB_HIDINPUT + help + Say Y here if you want support for the special keys (Fn, Numlock) on + Apple iBooks and PowerBooks. + + If unsure, say N. + config HID_FF bool "Force feedback support (EXPERIMENTAL)" depends on USB_HIDINPUT && EXPERIMENTAL
Quoted 15 lines · Dmitry Torokhov
Hi Linus,
Please do a pull from:
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/dtor/input.git/
or
master.kernel.org:/pub/scm/linux/kernel/git/dtor/input.git/The main feature is psmouse resync patch which should make PS/2 mice useable with cheap KVMs that reset mice when switching between boxes. Also there is a fix for OOps in PID code, build for for powerpc and HID tweaks to make new USB-based keyboards behave like older ADB ones.
Changelog:
Quoted 7 lines
Input: i8042 - add Sony Vaio FSC-115b to MUX blacklist (Vojtech)
Input: HID - add support for Cherry Cymotion keyboard (Vojtech)
Input: HID - fix an oops in PID initialization code
Input: psmouse - attempt to re-synchronize mouse every 5 seconds
Input: HID - add more simulation usages
Input: wacom - fix compile on PowerPC
Input: HID - add support for fn key on Apple PowerBooks (Michael Hanselmann)
Thanks for ccing me, the patches look all OK to me.
Signature · 2 lines
Vojtech Pavlik SuSE Labs, SuSE CR