diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-19 16:31:34 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-19 16:31:34 -0500 |
commit | d43a338e395371733a80ec473b40baac5f74d768 (patch) | |
tree | d4c01b62865bed1af2463d7a4eb4cb25ca46c66e | |
parent | cb4aaf46c0283dd79ab2e8b8b165c0bf13ab6194 (diff) | |
parent | 62b529a7b9c11880a8820494a25db0e2ecdf3bed (diff) |
Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/dtor/input
* 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/dtor/input:
Input: remove obsolete setup parameters from input drivers
Input: HIL - fix improper call to release_region()
Input: hid-lgff - treat devices as joysticks unless told otherwise
Input: HID - add support for Logitech Formula Force EX
Input: gpio-keys - switch to common GPIO API
Input: do not lock device when showing name, phys and uniq
Input: i8042 - let serio bus suspend ports
Input: psmouse - properly reset mouse on shutdown/suspend
-rw-r--r-- | drivers/input/input.c | 17 | ||||
-rw-r--r-- | drivers/input/joystick/amijoy.c | 2 | ||||
-rw-r--r-- | drivers/input/joystick/analog.c | 2 | ||||
-rw-r--r-- | drivers/input/joystick/db9.c | 4 | ||||
-rw-r--r-- | drivers/input/joystick/gamecon.c | 6 | ||||
-rw-r--r-- | drivers/input/joystick/turbografx.c | 4 | ||||
-rw-r--r-- | drivers/input/keyboard/Kconfig | 6 | ||||
-rw-r--r-- | drivers/input/keyboard/atkbd.c | 4 | ||||
-rw-r--r-- | drivers/input/keyboard/gpio_keys.c | 15 | ||||
-rw-r--r-- | drivers/input/keyboard/hilkbd.c | 2 | ||||
-rw-r--r-- | drivers/input/mouse/inport.c | 2 | ||||
-rw-r--r-- | drivers/input/mouse/logibm.c | 2 | ||||
-rw-r--r-- | drivers/input/mouse/psmouse-base.c | 34 | ||||
-rw-r--r-- | drivers/input/mouse/psmouse.h | 1 | ||||
-rw-r--r-- | drivers/input/mouse/synaptics.c | 1 | ||||
-rw-r--r-- | drivers/input/serio/i8042.c | 63 | ||||
-rw-r--r-- | drivers/input/serio/serio.c | 36 | ||||
-rw-r--r-- | drivers/usb/input/Kconfig | 6 | ||||
-rw-r--r-- | drivers/usb/input/hid-ff.c | 3 | ||||
-rw-r--r-- | drivers/usb/input/hid-lgff.c | 12 | ||||
-rw-r--r-- | include/linux/serio.h | 6 |
21 files changed, 124 insertions, 104 deletions
diff --git a/drivers/input/input.c b/drivers/input/input.c index efa1b1f75393..a9a706f8fff9 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c | |||
@@ -588,18 +588,9 @@ static inline void input_proc_exit(void) { } | |||
588 | static ssize_t input_dev_show_##name(struct class_device *dev, char *buf) \ | 588 | static ssize_t input_dev_show_##name(struct class_device *dev, char *buf) \ |
589 | { \ | 589 | { \ |
590 | struct input_dev *input_dev = to_input_dev(dev); \ | 590 | struct input_dev *input_dev = to_input_dev(dev); \ |
591 | int retval; \ | ||
592 | \ | 591 | \ |
593 | retval = mutex_lock_interruptible(&input_dev->mutex); \ | 592 | return scnprintf(buf, PAGE_SIZE, "%s\n", \ |
594 | if (retval) \ | 593 | input_dev->name ? input_dev->name : ""); \ |
595 | return retval; \ | ||
596 | \ | ||
597 | retval = scnprintf(buf, PAGE_SIZE, \ | ||
598 | "%s\n", input_dev->name ? input_dev->name : ""); \ | ||
599 | \ | ||
600 | mutex_unlock(&input_dev->mutex); \ | ||
601 | \ | ||
602 | return retval; \ | ||
603 | } \ | 594 | } \ |
604 | static CLASS_DEVICE_ATTR(name, S_IRUGO, input_dev_show_##name, NULL); | 595 | static CLASS_DEVICE_ATTR(name, S_IRUGO, input_dev_show_##name, NULL); |
605 | 596 | ||
@@ -1049,10 +1040,6 @@ void input_unregister_device(struct input_dev *dev) | |||
1049 | sysfs_remove_group(&dev->cdev.kobj, &input_dev_id_attr_group); | 1040 | sysfs_remove_group(&dev->cdev.kobj, &input_dev_id_attr_group); |
1050 | sysfs_remove_group(&dev->cdev.kobj, &input_dev_attr_group); | 1041 | sysfs_remove_group(&dev->cdev.kobj, &input_dev_attr_group); |
1051 | 1042 | ||
1052 | mutex_lock(&dev->mutex); | ||
1053 | dev->name = dev->phys = dev->uniq = NULL; | ||
1054 | mutex_unlock(&dev->mutex); | ||
1055 | |||
1056 | class_device_unregister(&dev->cdev); | 1043 | class_device_unregister(&dev->cdev); |
1057 | 1044 | ||
1058 | input_wakeup_procfs_readers(); | 1045 | input_wakeup_procfs_readers(); |
diff --git a/drivers/input/joystick/amijoy.c b/drivers/input/joystick/amijoy.c index e608691b5a61..b0f5541ec3e6 100644 --- a/drivers/input/joystick/amijoy.c +++ b/drivers/input/joystick/amijoy.c | |||
@@ -50,8 +50,6 @@ static int amijoy[2] = { 0, 1 }; | |||
50 | module_param_array_named(map, amijoy, uint, NULL, 0); | 50 | module_param_array_named(map, amijoy, uint, NULL, 0); |
51 | MODULE_PARM_DESC(map, "Map of attached joysticks in form of <a>,<b> (default is 0,1)"); | 51 | MODULE_PARM_DESC(map, "Map of attached joysticks in form of <a>,<b> (default is 0,1)"); |
52 | 52 | ||
53 | __obsolete_setup("amijoy="); | ||
54 | |||
55 | static int amijoy_used; | 53 | static int amijoy_used; |
56 | static DEFINE_MUTEX(amijoy_mutex); | 54 | static DEFINE_MUTEX(amijoy_mutex); |
57 | static struct input_dev *amijoy_dev[2]; | 55 | static struct input_dev *amijoy_dev[2]; |
diff --git a/drivers/input/joystick/analog.c b/drivers/input/joystick/analog.c index 7ef68456d7d6..51f1e4bfff3e 100644 --- a/drivers/input/joystick/analog.c +++ b/drivers/input/joystick/analog.c | |||
@@ -58,8 +58,6 @@ static int analog_options[ANALOG_PORTS]; | |||
58 | module_param_array_named(map, js, charp, &js_nargs, 0); | 58 | module_param_array_named(map, js, charp, &js_nargs, 0); |
59 | MODULE_PARM_DESC(map, "Describes analog joysticks type/capabilities"); | 59 | MODULE_PARM_DESC(map, "Describes analog joysticks type/capabilities"); |
60 | 60 | ||
61 | __obsolete_setup("js="); | ||
62 | |||
63 | /* | 61 | /* |
64 | * Times, feature definitions. | 62 | * Times, feature definitions. |
65 | */ | 63 | */ |
diff --git a/drivers/input/joystick/db9.c b/drivers/input/joystick/db9.c index 5080e15c6d30..b41bd2eb37dd 100644 --- a/drivers/input/joystick/db9.c +++ b/drivers/input/joystick/db9.c | |||
@@ -59,10 +59,6 @@ MODULE_PARM_DESC(dev2, "Describes second attached device (<parport#>,<type>)"); | |||
59 | module_param_array_named(dev3, db9[2].args, int, &db9[2].nargs, 0); | 59 | module_param_array_named(dev3, db9[2].args, int, &db9[2].nargs, 0); |
60 | MODULE_PARM_DESC(dev3, "Describes third attached device (<parport#>,<type>)"); | 60 | MODULE_PARM_DESC(dev3, "Describes third attached device (<parport#>,<type>)"); |
61 | 61 | ||
62 | __obsolete_setup("db9="); | ||
63 | __obsolete_setup("db9_2="); | ||
64 | __obsolete_setup("db9_3="); | ||
65 | |||
66 | #define DB9_ARG_PARPORT 0 | 62 | #define DB9_ARG_PARPORT 0 |
67 | #define DB9_ARG_MODE 1 | 63 | #define DB9_ARG_MODE 1 |
68 | 64 | ||
diff --git a/drivers/input/joystick/gamecon.c b/drivers/input/joystick/gamecon.c index fe12aa37393d..711e4b3e9e61 100644 --- a/drivers/input/joystick/gamecon.c +++ b/drivers/input/joystick/gamecon.c | |||
@@ -60,10 +60,6 @@ MODULE_PARM_DESC(map2, "Describes second set of devices"); | |||
60 | module_param_array_named(map3, gc[2].args, int, &gc[2].nargs, 0); | 60 | module_param_array_named(map3, gc[2].args, int, &gc[2].nargs, 0); |
61 | MODULE_PARM_DESC(map3, "Describes third set of devices"); | 61 | MODULE_PARM_DESC(map3, "Describes third set of devices"); |
62 | 62 | ||
63 | __obsolete_setup("gc="); | ||
64 | __obsolete_setup("gc_2="); | ||
65 | __obsolete_setup("gc_3="); | ||
66 | |||
67 | /* see also gs_psx_delay parameter in PSX support section */ | 63 | /* see also gs_psx_delay parameter in PSX support section */ |
68 | 64 | ||
69 | #define GC_SNES 1 | 65 | #define GC_SNES 1 |
@@ -403,8 +399,6 @@ static int gc_psx_delay = GC_PSX_DELAY; | |||
403 | module_param_named(psx_delay, gc_psx_delay, uint, 0); | 399 | module_param_named(psx_delay, gc_psx_delay, uint, 0); |
404 | MODULE_PARM_DESC(psx_delay, "Delay when accessing Sony PSX controller (usecs)"); | 400 | MODULE_PARM_DESC(psx_delay, "Delay when accessing Sony PSX controller (usecs)"); |
405 | 401 | ||
406 | __obsolete_setup("gc_psx_delay="); | ||
407 | |||
408 | static short gc_psx_abs[] = { ABS_X, ABS_Y, ABS_RX, ABS_RY, ABS_HAT0X, ABS_HAT0Y }; | 402 | static short gc_psx_abs[] = { ABS_X, ABS_Y, ABS_RX, ABS_RY, ABS_HAT0X, ABS_HAT0Y }; |
409 | static short gc_psx_btn[] = { BTN_TL, BTN_TR, BTN_TL2, BTN_TR2, BTN_A, BTN_B, BTN_X, BTN_Y, | 403 | static short gc_psx_btn[] = { BTN_TL, BTN_TR, BTN_TL2, BTN_TR2, BTN_A, BTN_B, BTN_X, BTN_Y, |
410 | BTN_START, BTN_SELECT, BTN_THUMBL, BTN_THUMBR }; | 404 | BTN_START, BTN_SELECT, BTN_THUMBL, BTN_THUMBR }; |
diff --git a/drivers/input/joystick/turbografx.c b/drivers/input/joystick/turbografx.c index 5570fd5487c7..037d3487fcc7 100644 --- a/drivers/input/joystick/turbografx.c +++ b/drivers/input/joystick/turbografx.c | |||
@@ -60,10 +60,6 @@ MODULE_PARM_DESC(map2, "Describes second set of devices"); | |||
60 | module_param_array_named(map3, tgfx[2].args, int, &tgfx[2].nargs, 0); | 60 | module_param_array_named(map3, tgfx[2].args, int, &tgfx[2].nargs, 0); |
61 | MODULE_PARM_DESC(map3, "Describes third set of devices"); | 61 | MODULE_PARM_DESC(map3, "Describes third set of devices"); |
62 | 62 | ||
63 | __obsolete_setup("tgfx="); | ||
64 | __obsolete_setup("tgfx_2="); | ||
65 | __obsolete_setup("tgfx_3="); | ||
66 | |||
67 | #define TGFX_REFRESH_TIME HZ/100 /* 10 ms */ | 63 | #define TGFX_REFRESH_TIME HZ/100 /* 10 ms */ |
68 | 64 | ||
69 | #define TGFX_TRIGGER 0x08 | 65 | #define TGFX_TRIGGER 0x08 |
diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig index 1b81a72e19d9..64509689fa65 100644 --- a/drivers/input/keyboard/Kconfig +++ b/drivers/input/keyboard/Kconfig | |||
@@ -215,11 +215,11 @@ config KEYBOARD_AAED2000 | |||
215 | module will be called aaed2000_kbd. | 215 | module will be called aaed2000_kbd. |
216 | 216 | ||
217 | config KEYBOARD_GPIO | 217 | config KEYBOARD_GPIO |
218 | tristate "Buttons on CPU GPIOs (PXA)" | 218 | tristate "Buttons on CPU GPIOs (PXA)" |
219 | depends on ARCH_PXA | 219 | depends on (ARCH_SA1100 || ARCH_PXA || ARCH_S3C2410) |
220 | help | 220 | help |
221 | This driver implements support for buttons connected | 221 | This driver implements support for buttons connected |
222 | directly to GPIO pins of PXA CPUs. | 222 | directly to GPIO pins of SA1100, PXA or S3C24xx CPUs. |
223 | 223 | ||
224 | Say Y here if your device has buttons connected | 224 | Say Y here if your device has buttons connected |
225 | directly to GPIO pins of the CPU. | 225 | directly to GPIO pins of the CPU. |
diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c index c621a9177a56..663877076bc7 100644 --- a/drivers/input/keyboard/atkbd.c +++ b/drivers/input/keyboard/atkbd.c | |||
@@ -63,10 +63,6 @@ static int atkbd_extra; | |||
63 | module_param_named(extra, atkbd_extra, bool, 0); | 63 | module_param_named(extra, atkbd_extra, bool, 0); |
64 | MODULE_PARM_DESC(extra, "Enable extra LEDs and keys on IBM RapidAcces, EzKey and similar keyboards"); | 64 | MODULE_PARM_DESC(extra, "Enable extra LEDs and keys on IBM RapidAcces, EzKey and similar keyboards"); |
65 | 65 | ||
66 | __obsolete_setup("atkbd_set="); | ||
67 | __obsolete_setup("atkbd_reset"); | ||
68 | __obsolete_setup("atkbd_softrepeat="); | ||
69 | |||
70 | /* | 66 | /* |
71 | * Scancode to keycode tables. These are just the default setting, and | 67 | * Scancode to keycode tables. These are just the default setting, and |
72 | * are loadable via an userland utility. | 68 | * are loadable via an userland utility. |
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index 7ad479e4e3b3..fa03a00b4c6d 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #include <linux/input.h> | 24 | #include <linux/input.h> |
25 | #include <linux/irq.h> | 25 | #include <linux/irq.h> |
26 | 26 | ||
27 | #include <asm/arch/pxa-regs.h> | 27 | #include <asm/gpio.h> |
28 | #include <asm/arch/hardware.h> | 28 | #include <asm/arch/hardware.h> |
29 | 29 | ||
30 | #include <asm/hardware/gpio_keys.h> | 30 | #include <asm/hardware/gpio_keys.h> |
@@ -38,8 +38,8 @@ static irqreturn_t gpio_keys_isr(int irq, void *dev_id) | |||
38 | 38 | ||
39 | for (i = 0; i < pdata->nbuttons; i++) { | 39 | for (i = 0; i < pdata->nbuttons; i++) { |
40 | int gpio = pdata->buttons[i].gpio; | 40 | int gpio = pdata->buttons[i].gpio; |
41 | if (irq == IRQ_GPIO(gpio)) { | 41 | if (irq == gpio_to_irq(gpio)) { |
42 | int state = ((GPLR(gpio) & GPIO_bit(gpio)) ? 1 : 0) ^ (pdata->buttons[i].active_low); | 42 | int state = (gpio_get_value(gpio) ? 1 : 0) ^ (pdata->buttons[i].active_low); |
43 | 43 | ||
44 | input_report_key(input, pdata->buttons[i].keycode, state); | 44 | input_report_key(input, pdata->buttons[i].keycode, state); |
45 | input_sync(input); | 45 | input_sync(input); |
@@ -75,14 +75,15 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev) | |||
75 | 75 | ||
76 | for (i = 0; i < pdata->nbuttons; i++) { | 76 | for (i = 0; i < pdata->nbuttons; i++) { |
77 | int code = pdata->buttons[i].keycode; | 77 | int code = pdata->buttons[i].keycode; |
78 | int irq = IRQ_GPIO(pdata->buttons[i].gpio); | 78 | int irq = gpio_to_irq(pdata->buttons[i].gpio); |
79 | 79 | ||
80 | set_irq_type(irq, IRQ_TYPE_EDGE_BOTH); | 80 | set_irq_type(irq, IRQ_TYPE_EDGE_BOTH); |
81 | error = request_irq(irq, gpio_keys_isr, IRQF_SAMPLE_RANDOM, | 81 | error = request_irq(irq, gpio_keys_isr, IRQF_SAMPLE_RANDOM, |
82 | pdata->buttons[i].desc ? pdata->buttons[i].desc : "gpio_keys", | 82 | pdata->buttons[i].desc ? pdata->buttons[i].desc : "gpio_keys", |
83 | pdev); | 83 | pdev); |
84 | if (error) { | 84 | if (error) { |
85 | printk(KERN_ERR "gpio-keys: unable to claim irq %d; error %d\n", irq, ret); | 85 | printk(KERN_ERR "gpio-keys: unable to claim irq %d; error %d\n", |
86 | irq, error); | ||
86 | goto fail; | 87 | goto fail; |
87 | } | 88 | } |
88 | set_bit(code, input->keybit); | 89 | set_bit(code, input->keybit); |
@@ -98,7 +99,7 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev) | |||
98 | 99 | ||
99 | fail: | 100 | fail: |
100 | for (i = i - 1; i >= 0; i--) | 101 | for (i = i - 1; i >= 0; i--) |
101 | free_irq(IRQ_GPIO(pdata->buttons[i].gpio), pdev); | 102 | free_irq(gpio_to_irq(pdata->buttons[i].gpio), pdev); |
102 | 103 | ||
103 | input_free_device(input); | 104 | input_free_device(input); |
104 | 105 | ||
@@ -112,7 +113,7 @@ static int __devexit gpio_keys_remove(struct platform_device *pdev) | |||
112 | int i; | 113 | int i; |
113 | 114 | ||
114 | for (i = 0; i < pdata->nbuttons; i++) { | 115 | for (i = 0; i < pdata->nbuttons; i++) { |
115 | int irq = IRQ_GPIO(pdata->buttons[i].gpio); | 116 | int irq = gpio_to_irq(pdata->buttons[i].gpio); |
116 | free_irq(irq, pdev); | 117 | free_irq(irq, pdev); |
117 | } | 118 | } |
118 | 119 | ||
diff --git a/drivers/input/keyboard/hilkbd.c b/drivers/input/keyboard/hilkbd.c index 255a6ec75a48..4de4dc297d50 100644 --- a/drivers/input/keyboard/hilkbd.c +++ b/drivers/input/keyboard/hilkbd.c | |||
@@ -294,8 +294,10 @@ err3: | |||
294 | disable_irq(HIL_IRQ); | 294 | disable_irq(HIL_IRQ); |
295 | free_irq(HIL_IRQ, hil_dev.dev_id); | 295 | free_irq(HIL_IRQ, hil_dev.dev_id); |
296 | err2: | 296 | err2: |
297 | #if defined(CONFIG_HP300) | ||
297 | release_region(HILBASE + HIL_DATA, 2); | 298 | release_region(HILBASE + HIL_DATA, 2); |
298 | err1: | 299 | err1: |
300 | #endif | ||
299 | input_free_device(hil_dev.dev); | 301 | input_free_device(hil_dev.dev); |
300 | hil_dev.dev = NULL; | 302 | hil_dev.dev = NULL; |
301 | return err; | 303 | return err; |
diff --git a/drivers/input/mouse/inport.c b/drivers/input/mouse/inport.c index 701ebd5473cf..79b624fe8994 100644 --- a/drivers/input/mouse/inport.c +++ b/drivers/input/mouse/inport.c | |||
@@ -84,8 +84,6 @@ static int inport_irq = INPORT_IRQ; | |||
84 | module_param_named(irq, inport_irq, uint, 0); | 84 | module_param_named(irq, inport_irq, uint, 0); |
85 | MODULE_PARM_DESC(irq, "IRQ number (5=default)"); | 85 | MODULE_PARM_DESC(irq, "IRQ number (5=default)"); |
86 | 86 | ||
87 | __obsolete_setup("inport_irq="); | ||
88 | |||
89 | static struct input_dev *inport_dev; | 87 | static struct input_dev *inport_dev; |
90 | 88 | ||
91 | static irqreturn_t inport_interrupt(int irq, void *dev_id) | 89 | static irqreturn_t inport_interrupt(int irq, void *dev_id) |
diff --git a/drivers/input/mouse/logibm.c b/drivers/input/mouse/logibm.c index db205995bffd..26c3b2e2ca94 100644 --- a/drivers/input/mouse/logibm.c +++ b/drivers/input/mouse/logibm.c | |||
@@ -75,8 +75,6 @@ static int logibm_irq = LOGIBM_IRQ; | |||
75 | module_param_named(irq, logibm_irq, uint, 0); | 75 | module_param_named(irq, logibm_irq, uint, 0); |
76 | MODULE_PARM_DESC(irq, "IRQ number (5=default)"); | 76 | MODULE_PARM_DESC(irq, "IRQ number (5=default)"); |
77 | 77 | ||
78 | __obsolete_setup("logibm_irq="); | ||
79 | |||
80 | static struct input_dev *logibm_dev; | 78 | static struct input_dev *logibm_dev; |
81 | 79 | ||
82 | static irqreturn_t logibm_interrupt(int irq, void *dev_id) | 80 | static irqreturn_t logibm_interrupt(int irq, void *dev_id) |
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index a0e4a033e2db..0fe5869d7d4c 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c | |||
@@ -93,12 +93,6 @@ static struct attribute_group psmouse_attribute_group = { | |||
93 | .attrs = psmouse_attributes, | 93 | .attrs = psmouse_attributes, |
94 | }; | 94 | }; |
95 | 95 | ||
96 | __obsolete_setup("psmouse_noext"); | ||
97 | __obsolete_setup("psmouse_resolution="); | ||
98 | __obsolete_setup("psmouse_smartscroll="); | ||
99 | __obsolete_setup("psmouse_resetafter="); | ||
100 | __obsolete_setup("psmouse_rate="); | ||
101 | |||
102 | /* | 96 | /* |
103 | * psmouse_mutex protects all operations changing state of mouse | 97 | * psmouse_mutex protects all operations changing state of mouse |
104 | * (connecting, disconnecting, changing rate or resolution via | 98 | * (connecting, disconnecting, changing rate or resolution via |
@@ -987,8 +981,36 @@ static void psmouse_resync(struct work_struct *work) | |||
987 | static void psmouse_cleanup(struct serio *serio) | 981 | static void psmouse_cleanup(struct serio *serio) |
988 | { | 982 | { |
989 | struct psmouse *psmouse = serio_get_drvdata(serio); | 983 | struct psmouse *psmouse = serio_get_drvdata(serio); |
984 | struct psmouse *parent = NULL; | ||
985 | |||
986 | mutex_lock(&psmouse_mutex); | ||
987 | |||
988 | if (serio->parent && serio->id.type == SERIO_PS_PSTHRU) { | ||
989 | parent = serio_get_drvdata(serio->parent); | ||
990 | psmouse_deactivate(parent); | ||
991 | } | ||
992 | |||
993 | psmouse_deactivate(psmouse); | ||
994 | |||
995 | if (psmouse->cleanup) | ||
996 | psmouse->cleanup(psmouse); | ||
990 | 997 | ||
991 | psmouse_reset(psmouse); | 998 | psmouse_reset(psmouse); |
999 | |||
1000 | /* | ||
1001 | * Some boxes, such as HP nx7400, get terribly confused if mouse | ||
1002 | * is not fully enabled before suspending/shutting down. | ||
1003 | */ | ||
1004 | ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_ENABLE); | ||
1005 | |||
1006 | if (parent) { | ||
1007 | if (parent->pt_deactivate) | ||
1008 | parent->pt_deactivate(parent); | ||
1009 | |||
1010 | psmouse_activate(parent); | ||
1011 | } | ||
1012 | |||
1013 | mutex_unlock(&psmouse_mutex); | ||
992 | } | 1014 | } |
993 | 1015 | ||
994 | /* | 1016 | /* |
diff --git a/drivers/input/mouse/psmouse.h b/drivers/input/mouse/psmouse.h index 1b74cae8a556..cf1de95b6f27 100644 --- a/drivers/input/mouse/psmouse.h +++ b/drivers/input/mouse/psmouse.h | |||
@@ -68,6 +68,7 @@ struct psmouse { | |||
68 | 68 | ||
69 | int (*reconnect)(struct psmouse *psmouse); | 69 | int (*reconnect)(struct psmouse *psmouse); |
70 | void (*disconnect)(struct psmouse *psmouse); | 70 | void (*disconnect)(struct psmouse *psmouse); |
71 | void (*cleanup)(struct psmouse *psmouse); | ||
71 | int (*poll)(struct psmouse *psmouse); | 72 | int (*poll)(struct psmouse *psmouse); |
72 | 73 | ||
73 | void (*pt_activate)(struct psmouse *psmouse); | 74 | void (*pt_activate)(struct psmouse *psmouse); |
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index 49ac696d6cff..f0f9413d762c 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c | |||
@@ -652,6 +652,7 @@ int synaptics_init(struct psmouse *psmouse) | |||
652 | psmouse->set_rate = synaptics_set_rate; | 652 | psmouse->set_rate = synaptics_set_rate; |
653 | psmouse->disconnect = synaptics_disconnect; | 653 | psmouse->disconnect = synaptics_disconnect; |
654 | psmouse->reconnect = synaptics_reconnect; | 654 | psmouse->reconnect = synaptics_reconnect; |
655 | psmouse->cleanup = synaptics_reset; | ||
655 | psmouse->pktsize = 6; | 656 | psmouse->pktsize = 6; |
656 | /* Synaptics can usually stay in sync without extra help */ | 657 | /* Synaptics can usually stay in sync without extra help */ |
657 | psmouse->resync_time = 0; | 658 | psmouse->resync_time = 0; |
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c index c3fdfc1f342a..ec195a36e8f6 100644 --- a/drivers/input/serio/i8042.c +++ b/drivers/input/serio/i8042.c | |||
@@ -76,13 +76,6 @@ module_param_named(debug, i8042_debug, bool, 0600); | |||
76 | MODULE_PARM_DESC(debug, "Turn i8042 debugging mode on and off"); | 76 | MODULE_PARM_DESC(debug, "Turn i8042 debugging mode on and off"); |
77 | #endif | 77 | #endif |
78 | 78 | ||
79 | __obsolete_setup("i8042_noaux"); | ||
80 | __obsolete_setup("i8042_nomux"); | ||
81 | __obsolete_setup("i8042_unlock"); | ||
82 | __obsolete_setup("i8042_reset"); | ||
83 | __obsolete_setup("i8042_direct"); | ||
84 | __obsolete_setup("i8042_dumbkbd"); | ||
85 | |||
86 | #include "i8042.h" | 79 | #include "i8042.h" |
87 | 80 | ||
88 | static DEFINE_SPINLOCK(i8042_lock); | 81 | static DEFINE_SPINLOCK(i8042_lock); |
@@ -724,7 +717,7 @@ static int i8042_controller_init(void) | |||
724 | if (~i8042_read_status() & I8042_STR_KEYLOCK) { | 717 | if (~i8042_read_status() & I8042_STR_KEYLOCK) { |
725 | if (i8042_unlock) | 718 | if (i8042_unlock) |
726 | i8042_ctr |= I8042_CTR_IGNKEYLOCK; | 719 | i8042_ctr |= I8042_CTR_IGNKEYLOCK; |
727 | else | 720 | else |
728 | printk(KERN_WARNING "i8042.c: Warning: Keylock active.\n"); | 721 | printk(KERN_WARNING "i8042.c: Warning: Keylock active.\n"); |
729 | } | 722 | } |
730 | spin_unlock_irqrestore(&i8042_lock, flags); | 723 | spin_unlock_irqrestore(&i8042_lock, flags); |
@@ -791,27 +784,6 @@ static void i8042_controller_reset(void) | |||
791 | 784 | ||
792 | 785 | ||
793 | /* | 786 | /* |
794 | * Here we try to reset everything back to a state in which the BIOS will be | ||
795 | * able to talk to the hardware when rebooting. | ||
796 | */ | ||
797 | |||
798 | static void i8042_controller_cleanup(void) | ||
799 | { | ||
800 | int i; | ||
801 | |||
802 | /* | ||
803 | * Reset anything that is connected to the ports. | ||
804 | */ | ||
805 | |||
806 | for (i = 0; i < I8042_NUM_PORTS; i++) | ||
807 | if (i8042_ports[i].serio) | ||
808 | serio_cleanup(i8042_ports[i].serio); | ||
809 | |||
810 | i8042_controller_reset(); | ||
811 | } | ||
812 | |||
813 | |||
814 | /* | ||
815 | * i8042_panic_blink() will flash the keyboard LEDs and is called when | 787 | * i8042_panic_blink() will flash the keyboard LEDs and is called when |
816 | * kernel panics. Flashing LEDs is useful for users running X who may | 788 | * kernel panics. Flashing LEDs is useful for users running X who may |
817 | * not see the console and will help distingushing panics from "real" | 789 | * not see the console and will help distingushing panics from "real" |
@@ -857,13 +829,22 @@ static long i8042_panic_blink(long count) | |||
857 | 829 | ||
858 | #undef DELAY | 830 | #undef DELAY |
859 | 831 | ||
832 | #ifdef CONFIG_PM | ||
860 | /* | 833 | /* |
861 | * Here we try to restore the original BIOS settings | 834 | * Here we try to restore the original BIOS settings. We only want to |
835 | * do that once, when we really suspend, not when we taking memory | ||
836 | * snapshot for swsusp (in this case we'll perform required cleanup | ||
837 | * as part of shutdown process). | ||
862 | */ | 838 | */ |
863 | 839 | ||
864 | static int i8042_suspend(struct platform_device *dev, pm_message_t state) | 840 | static int i8042_suspend(struct platform_device *dev, pm_message_t state) |
865 | { | 841 | { |
866 | i8042_controller_cleanup(); | 842 | if (dev->dev.power.power_state.event != state.event) { |
843 | if (state.event == PM_EVENT_SUSPEND) | ||
844 | i8042_controller_reset(); | ||
845 | |||
846 | dev->dev.power.power_state = state; | ||
847 | } | ||
867 | 848 | ||
868 | return 0; | 849 | return 0; |
869 | } | 850 | } |
@@ -877,6 +858,12 @@ static int i8042_resume(struct platform_device *dev) | |||
877 | { | 858 | { |
878 | int error; | 859 | int error; |
879 | 860 | ||
861 | /* | ||
862 | * Do not bother with restoring state if we haven't suspened yet | ||
863 | */ | ||
864 | if (dev->dev.power.power_state.event == PM_EVENT_ON) | ||
865 | return 0; | ||
866 | |||
880 | error = i8042_controller_check(); | 867 | error = i8042_controller_check(); |
881 | if (error) | 868 | if (error) |
882 | return error; | 869 | return error; |
@@ -886,9 +873,12 @@ static int i8042_resume(struct platform_device *dev) | |||
886 | return error; | 873 | return error; |
887 | 874 | ||
888 | /* | 875 | /* |
889 | * Restore pre-resume CTR value and disable all ports | 876 | * Restore original CTR value and disable all ports |
890 | */ | 877 | */ |
891 | 878 | ||
879 | i8042_ctr = i8042_initial_ctr; | ||
880 | if (i8042_direct) | ||
881 | i8042_ctr &= ~I8042_CTR_XLATE; | ||
892 | i8042_ctr |= I8042_CTR_AUXDIS | I8042_CTR_KBDDIS; | 882 | i8042_ctr |= I8042_CTR_AUXDIS | I8042_CTR_KBDDIS; |
893 | i8042_ctr &= ~(I8042_CTR_AUXINT | I8042_CTR_KBDINT); | 883 | i8042_ctr &= ~(I8042_CTR_AUXINT | I8042_CTR_KBDINT); |
894 | if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR)) { | 884 | if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR)) { |
@@ -909,8 +899,11 @@ static int i8042_resume(struct platform_device *dev) | |||
909 | 899 | ||
910 | i8042_interrupt(0, NULL); | 900 | i8042_interrupt(0, NULL); |
911 | 901 | ||
902 | dev->dev.power.power_state = PMSG_ON; | ||
903 | |||
912 | return 0; | 904 | return 0; |
913 | } | 905 | } |
906 | #endif /* CONFIG_PM */ | ||
914 | 907 | ||
915 | /* | 908 | /* |
916 | * We need to reset the 8042 back to original mode on system shutdown, | 909 | * We need to reset the 8042 back to original mode on system shutdown, |
@@ -919,7 +912,7 @@ static int i8042_resume(struct platform_device *dev) | |||
919 | 912 | ||
920 | static void i8042_shutdown(struct platform_device *dev) | 913 | static void i8042_shutdown(struct platform_device *dev) |
921 | { | 914 | { |
922 | i8042_controller_cleanup(); | 915 | i8042_controller_reset(); |
923 | } | 916 | } |
924 | 917 | ||
925 | static int __devinit i8042_create_kbd_port(void) | 918 | static int __devinit i8042_create_kbd_port(void) |
@@ -1154,9 +1147,11 @@ static struct platform_driver i8042_driver = { | |||
1154 | }, | 1147 | }, |
1155 | .probe = i8042_probe, | 1148 | .probe = i8042_probe, |
1156 | .remove = __devexit_p(i8042_remove), | 1149 | .remove = __devexit_p(i8042_remove), |
1150 | .shutdown = i8042_shutdown, | ||
1151 | #ifdef CONFIG_PM | ||
1157 | .suspend = i8042_suspend, | 1152 | .suspend = i8042_suspend, |
1158 | .resume = i8042_resume, | 1153 | .resume = i8042_resume, |
1159 | .shutdown = i8042_shutdown, | 1154 | #endif |
1160 | }; | 1155 | }; |
1161 | 1156 | ||
1162 | static int __init i8042_init(void) | 1157 | static int __init i8042_init(void) |
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c index 17c8c63cbe1a..a15e531ec755 100644 --- a/drivers/input/serio/serio.c +++ b/drivers/input/serio/serio.c | |||
@@ -778,6 +778,19 @@ static int serio_driver_remove(struct device *dev) | |||
778 | return 0; | 778 | return 0; |
779 | } | 779 | } |
780 | 780 | ||
781 | static void serio_cleanup(struct serio *serio) | ||
782 | { | ||
783 | if (serio->drv && serio->drv->cleanup) | ||
784 | serio->drv->cleanup(serio); | ||
785 | } | ||
786 | |||
787 | static void serio_shutdown(struct device *dev) | ||
788 | { | ||
789 | struct serio *serio = to_serio_port(dev); | ||
790 | |||
791 | serio_cleanup(serio); | ||
792 | } | ||
793 | |||
781 | static void serio_attach_driver(struct serio_driver *drv) | 794 | static void serio_attach_driver(struct serio_driver *drv) |
782 | { | 795 | { |
783 | int error; | 796 | int error; |
@@ -910,11 +923,25 @@ static int serio_uevent(struct device *dev, char **envp, int num_envp, char *buf | |||
910 | 923 | ||
911 | #endif /* CONFIG_HOTPLUG */ | 924 | #endif /* CONFIG_HOTPLUG */ |
912 | 925 | ||
926 | #ifdef CONFIG_PM | ||
927 | static int serio_suspend(struct device *dev, pm_message_t state) | ||
928 | { | ||
929 | if (dev->power.power_state.event != state.event) { | ||
930 | if (state.event == PM_EVENT_SUSPEND) | ||
931 | serio_cleanup(to_serio_port(dev)); | ||
932 | |||
933 | dev->power.power_state = state; | ||
934 | } | ||
935 | |||
936 | return 0; | ||
937 | } | ||
938 | |||
913 | static int serio_resume(struct device *dev) | 939 | static int serio_resume(struct device *dev) |
914 | { | 940 | { |
915 | struct serio *serio = to_serio_port(dev); | 941 | struct serio *serio = to_serio_port(dev); |
916 | 942 | ||
917 | if (serio_reconnect_driver(serio)) { | 943 | if (dev->power.power_state.event != PM_EVENT_ON && |
944 | serio_reconnect_driver(serio)) { | ||
918 | /* | 945 | /* |
919 | * Driver re-probing can take a while, so better let kseriod | 946 | * Driver re-probing can take a while, so better let kseriod |
920 | * deal with it. | 947 | * deal with it. |
@@ -922,8 +949,11 @@ static int serio_resume(struct device *dev) | |||
922 | serio_rescan(serio); | 949 | serio_rescan(serio); |
923 | } | 950 | } |
924 | 951 | ||
952 | dev->power.power_state = PMSG_ON; | ||
953 | |||
925 | return 0; | 954 | return 0; |
926 | } | 955 | } |
956 | #endif /* CONFIG_PM */ | ||
927 | 957 | ||
928 | /* called from serio_driver->connect/disconnect methods under serio_mutex */ | 958 | /* called from serio_driver->connect/disconnect methods under serio_mutex */ |
929 | int serio_open(struct serio *serio, struct serio_driver *drv) | 959 | int serio_open(struct serio *serio, struct serio_driver *drv) |
@@ -974,7 +1004,11 @@ static struct bus_type serio_bus = { | |||
974 | .uevent = serio_uevent, | 1004 | .uevent = serio_uevent, |
975 | .probe = serio_driver_probe, | 1005 | .probe = serio_driver_probe, |
976 | .remove = serio_driver_remove, | 1006 | .remove = serio_driver_remove, |
1007 | .shutdown = serio_shutdown, | ||
1008 | #ifdef CONFIG_PM | ||
1009 | .suspend = serio_suspend, | ||
977 | .resume = serio_resume, | 1010 | .resume = serio_resume, |
1011 | #endif | ||
978 | }; | 1012 | }; |
979 | 1013 | ||
980 | static int __init serio_init(void) | 1014 | static int __init serio_init(void) |
diff --git a/drivers/usb/input/Kconfig b/drivers/usb/input/Kconfig index 2e71d3cca198..69a9f3b6d0a9 100644 --- a/drivers/usb/input/Kconfig +++ b/drivers/usb/input/Kconfig | |||
@@ -58,13 +58,17 @@ config HID_PID | |||
58 | devices. | 58 | devices. |
59 | 59 | ||
60 | config LOGITECH_FF | 60 | config LOGITECH_FF |
61 | bool "Logitech WingMan *3D support" | 61 | bool "Logitech devices support" |
62 | depends on HID_FF | 62 | depends on HID_FF |
63 | select INPUT_FF_MEMLESS if USB_HID | 63 | select INPUT_FF_MEMLESS if USB_HID |
64 | help | 64 | help |
65 | Say Y here if you have one of these devices: | 65 | Say Y here if you have one of these devices: |
66 | - Logitech WingMan Cordless RumblePad | 66 | - Logitech WingMan Cordless RumblePad |
67 | - Logitech WingMan Cordless RumblePad 2 | ||
67 | - Logitech WingMan Force 3D | 68 | - Logitech WingMan Force 3D |
69 | - Logitech Formula Force EX | ||
70 | - Logitech MOMO Force wheel | ||
71 | |||
68 | and if you want to enable force feedback for them. | 72 | and if you want to enable force feedback for them. |
69 | Note: if you say N here, this device will still be supported, but without | 73 | Note: if you say N here, this device will still be supported, but without |
70 | force feedback. | 74 | force feedback. |
diff --git a/drivers/usb/input/hid-ff.c b/drivers/usb/input/hid-ff.c index bc7f8e6f8c97..e431faaa6abc 100644 --- a/drivers/usb/input/hid-ff.c +++ b/drivers/usb/input/hid-ff.c | |||
@@ -54,9 +54,10 @@ struct hid_ff_initializer { | |||
54 | static struct hid_ff_initializer inits[] = { | 54 | static struct hid_ff_initializer inits[] = { |
55 | #ifdef CONFIG_LOGITECH_FF | 55 | #ifdef CONFIG_LOGITECH_FF |
56 | { 0x46d, 0xc211, hid_lgff_init }, /* Logitech Cordless rumble pad */ | 56 | { 0x46d, 0xc211, hid_lgff_init }, /* Logitech Cordless rumble pad */ |
57 | { 0x46d, 0xc219, hid_lgff_init }, /* Logitech Cordless rumble pad 2 */ | ||
57 | { 0x46d, 0xc283, hid_lgff_init }, /* Logitech Wingman Force 3d */ | 58 | { 0x46d, 0xc283, hid_lgff_init }, /* Logitech Wingman Force 3d */ |
59 | { 0x46d, 0xc294, hid_lgff_init }, /* Logitech Formula Force EX */ | ||
58 | { 0x46d, 0xc295, hid_lgff_init }, /* Logitech MOMO force wheel */ | 60 | { 0x46d, 0xc295, hid_lgff_init }, /* Logitech MOMO force wheel */ |
59 | { 0x46d, 0xc219, hid_lgff_init }, /* Logitech Cordless rumble pad 2 */ | ||
60 | { 0x46d, 0xca03, hid_lgff_init }, /* Logitech MOMO force wheel */ | 61 | { 0x46d, 0xca03, hid_lgff_init }, /* Logitech MOMO force wheel */ |
61 | #endif | 62 | #endif |
62 | #ifdef CONFIG_PANTHERLORD_FF | 63 | #ifdef CONFIG_PANTHERLORD_FF |
diff --git a/drivers/usb/input/hid-lgff.c b/drivers/usb/input/hid-lgff.c index 4df0968f852e..e6f3af3e66d1 100644 --- a/drivers/usb/input/hid-lgff.c +++ b/drivers/usb/input/hid-lgff.c | |||
@@ -52,8 +52,9 @@ static const struct dev_type devices[] = { | |||
52 | { 0x046d, 0xc211, ff_rumble }, | 52 | { 0x046d, 0xc211, ff_rumble }, |
53 | { 0x046d, 0xc219, ff_rumble }, | 53 | { 0x046d, 0xc219, ff_rumble }, |
54 | { 0x046d, 0xc283, ff_joystick }, | 54 | { 0x046d, 0xc283, ff_joystick }, |
55 | { 0x046d, 0xc294, ff_joystick }, | ||
56 | { 0x046d, 0xc295, ff_joystick }, | ||
55 | { 0x046d, 0xca03, ff_joystick }, | 57 | { 0x046d, 0xca03, ff_joystick }, |
56 | { 0x0000, 0x0000, ff_joystick } | ||
57 | }; | 58 | }; |
58 | 59 | ||
59 | static int hid_lgff_play(struct input_dev *dev, void *data, struct ff_effect *effect) | 60 | static int hid_lgff_play(struct input_dev *dev, void *data, struct ff_effect *effect) |
@@ -105,8 +106,9 @@ int hid_lgff_init(struct hid_device* hid) | |||
105 | struct input_dev *dev = hidinput->input; | 106 | struct input_dev *dev = hidinput->input; |
106 | struct hid_report *report; | 107 | struct hid_report *report; |
107 | struct hid_field *field; | 108 | struct hid_field *field; |
109 | const signed short *ff_bits = ff_joystick; | ||
108 | int error; | 110 | int error; |
109 | int i, j; | 111 | int i; |
110 | 112 | ||
111 | /* Find the report to use */ | 113 | /* Find the report to use */ |
112 | if (list_empty(report_list)) { | 114 | if (list_empty(report_list)) { |
@@ -130,12 +132,14 @@ int hid_lgff_init(struct hid_device* hid) | |||
130 | for (i = 0; i < ARRAY_SIZE(devices); i++) { | 132 | for (i = 0; i < ARRAY_SIZE(devices); i++) { |
131 | if (dev->id.vendor == devices[i].idVendor && | 133 | if (dev->id.vendor == devices[i].idVendor && |
132 | dev->id.product == devices[i].idProduct) { | 134 | dev->id.product == devices[i].idProduct) { |
133 | for (j = 0; devices[i].ff[j] >= 0; j++) | 135 | ff_bits = devices[i].ff; |
134 | set_bit(devices[i].ff[j], dev->ffbit); | ||
135 | break; | 136 | break; |
136 | } | 137 | } |
137 | } | 138 | } |
138 | 139 | ||
140 | for (i = 0; ff_bits[i] >= 0; i++) | ||
141 | set_bit(ff_bits[i], dev->ffbit); | ||
142 | |||
139 | error = input_ff_create_memless(dev, NULL, hid_lgff_play); | 143 | error = input_ff_create_memless(dev, NULL, hid_lgff_play); |
140 | if (error) | 144 | if (error) |
141 | return error; | 145 | return error; |
diff --git a/include/linux/serio.h b/include/linux/serio.h index ac2c70e7f760..1ebf0455e224 100644 --- a/include/linux/serio.h +++ b/include/linux/serio.h | |||
@@ -108,12 +108,6 @@ static inline void serio_drv_write_wakeup(struct serio *serio) | |||
108 | serio->drv->write_wakeup(serio); | 108 | serio->drv->write_wakeup(serio); |
109 | } | 109 | } |
110 | 110 | ||
111 | static inline void serio_cleanup(struct serio *serio) | ||
112 | { | ||
113 | if (serio->drv && serio->drv->cleanup) | ||
114 | serio->drv->cleanup(serio); | ||
115 | } | ||
116 | |||
117 | /* | 111 | /* |
118 | * Use the following functions to manipulate serio's per-port | 112 | * Use the following functions to manipulate serio's per-port |
119 | * driver-specific data. | 113 | * driver-specific data. |