Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+125 -105
+2 -15
drivers/input/input.c
··· 588 588 static ssize_t input_dev_show_##name(struct class_device *dev, char *buf) \ 589 589 { \ 590 590 struct input_dev *input_dev = to_input_dev(dev); \ 591 - int retval; \ 592 591 \ 593 - retval = mutex_lock_interruptible(&input_dev->mutex); \ 594 - if (retval) \ 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; \ 592 + return scnprintf(buf, PAGE_SIZE, "%s\n", \ 593 + input_dev->name ? input_dev->name : ""); \ 603 594 } \ 604 595 static CLASS_DEVICE_ATTR(name, S_IRUGO, input_dev_show_##name, NULL); 605 596 ··· 1039 1048 sysfs_remove_group(&dev->cdev.kobj, &input_dev_caps_attr_group); 1040 1049 sysfs_remove_group(&dev->cdev.kobj, &input_dev_id_attr_group); 1041 1050 sysfs_remove_group(&dev->cdev.kobj, &input_dev_attr_group); 1042 - 1043 - mutex_lock(&dev->mutex); 1044 - dev->name = dev->phys = dev->uniq = NULL; 1045 - mutex_unlock(&dev->mutex); 1046 1051 1047 1052 class_device_unregister(&dev->cdev); 1048 1053
-2
drivers/input/joystick/amijoy.c
··· 50 50 module_param_array_named(map, amijoy, uint, NULL, 0); 51 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 53 static int amijoy_used; 56 54 static DEFINE_MUTEX(amijoy_mutex); 57 55 static struct input_dev *amijoy_dev[2];
-2
drivers/input/joystick/analog.c
··· 58 58 module_param_array_named(map, js, charp, &js_nargs, 0); 59 59 MODULE_PARM_DESC(map, "Describes analog joysticks type/capabilities"); 60 60 61 - __obsolete_setup("js="); 62 - 63 61 /* 64 62 * Times, feature definitions. 65 63 */
-4
drivers/input/joystick/db9.c
··· 59 59 module_param_array_named(dev3, db9[2].args, int, &db9[2].nargs, 0); 60 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 62 #define DB9_ARG_PARPORT 0 67 63 #define DB9_ARG_MODE 1 68 64
-6
drivers/input/joystick/gamecon.c
··· 60 60 module_param_array_named(map3, gc[2].args, int, &gc[2].nargs, 0); 61 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 63 /* see also gs_psx_delay parameter in PSX support section */ 68 64 69 65 #define GC_SNES 1 ··· 398 402 static int gc_psx_delay = GC_PSX_DELAY; 399 403 module_param_named(psx_delay, gc_psx_delay, uint, 0); 400 404 MODULE_PARM_DESC(psx_delay, "Delay when accessing Sony PSX controller (usecs)"); 401 - 402 - __obsolete_setup("gc_psx_delay="); 403 405 404 406 static short gc_psx_abs[] = { ABS_X, ABS_Y, ABS_RX, ABS_RY, ABS_HAT0X, ABS_HAT0Y }; 405 407 static short gc_psx_btn[] = { BTN_TL, BTN_TR, BTN_TL2, BTN_TR2, BTN_A, BTN_B, BTN_X, BTN_Y,
-4
drivers/input/joystick/turbografx.c
··· 60 60 module_param_array_named(map3, tgfx[2].args, int, &tgfx[2].nargs, 0); 61 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 63 #define TGFX_REFRESH_TIME HZ/100 /* 10 ms */ 68 64 69 65 #define TGFX_TRIGGER 0x08
+3 -3
drivers/input/keyboard/Kconfig
··· 215 215 module will be called aaed2000_kbd. 216 216 217 217 config KEYBOARD_GPIO 218 - tristate "Buttons on CPU GPIOs (PXA)" 219 - depends on ARCH_PXA 218 + tristate "Buttons on CPU GPIOs (PXA)" 219 + depends on (ARCH_SA1100 || ARCH_PXA || ARCH_S3C2410) 220 220 help 221 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 224 Say Y here if your device has buttons connected 225 225 directly to GPIO pins of the CPU.
-4
drivers/input/keyboard/atkbd.c
··· 63 63 module_param_named(extra, atkbd_extra, bool, 0); 64 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 67 * Scancode to keycode tables. These are just the default setting, and 72 68 * are loadable via an userland utility.
+8 -7
drivers/input/keyboard/gpio_keys.c
··· 24 24 #include <linux/input.h> 25 25 #include <linux/irq.h> 26 26 27 - #include <asm/arch/pxa-regs.h> 27 + #include <asm/gpio.h> 28 28 #include <asm/arch/hardware.h> 29 29 30 30 #include <asm/hardware/gpio_keys.h> ··· 38 38 39 39 for (i = 0; i < pdata->nbuttons; i++) { 40 40 int gpio = pdata->buttons[i].gpio; 41 - if (irq == IRQ_GPIO(gpio)) { 42 - int state = ((GPLR(gpio) & GPIO_bit(gpio)) ? 1 : 0) ^ (pdata->buttons[i].active_low); 41 + if (irq == gpio_to_irq(gpio)) { 42 + int state = (gpio_get_value(gpio) ? 1 : 0) ^ (pdata->buttons[i].active_low); 43 43 44 44 input_report_key(input, pdata->buttons[i].keycode, state); 45 45 input_sync(input); ··· 75 75 76 76 for (i = 0; i < pdata->nbuttons; i++) { 77 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 80 set_irq_type(irq, IRQ_TYPE_EDGE_BOTH); 81 81 error = request_irq(irq, gpio_keys_isr, IRQF_SAMPLE_RANDOM, 82 82 pdata->buttons[i].desc ? pdata->buttons[i].desc : "gpio_keys", 83 83 pdev); 84 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 87 goto fail; 87 88 } 88 89 set_bit(code, input->keybit); ··· 99 98 100 99 fail: 101 100 for (i = i - 1; i >= 0; i--) 102 - free_irq(IRQ_GPIO(pdata->buttons[i].gpio), pdev); 101 + free_irq(gpio_to_irq(pdata->buttons[i].gpio), pdev); 103 102 104 103 input_free_device(input); 105 104 ··· 113 112 int i; 114 113 115 114 for (i = 0; i < pdata->nbuttons; i++) { 116 - int irq = IRQ_GPIO(pdata->buttons[i].gpio); 115 + int irq = gpio_to_irq(pdata->buttons[i].gpio); 117 116 free_irq(irq, pdev); 118 117 } 119 118
+2
drivers/input/keyboard/hilkbd.c
··· 294 294 disable_irq(HIL_IRQ); 295 295 free_irq(HIL_IRQ, hil_dev.dev_id); 296 296 err2: 297 + #if defined(CONFIG_HP300) 297 298 release_region(HILBASE + HIL_DATA, 2); 298 299 err1: 300 + #endif 299 301 input_free_device(hil_dev.dev); 300 302 hil_dev.dev = NULL; 301 303 return err;
-2
drivers/input/mouse/inport.c
··· 84 84 module_param_named(irq, inport_irq, uint, 0); 85 85 MODULE_PARM_DESC(irq, "IRQ number (5=default)"); 86 86 87 - __obsolete_setup("inport_irq="); 88 - 89 87 static struct input_dev *inport_dev; 90 88 91 89 static irqreturn_t inport_interrupt(int irq, void *dev_id)
-2
drivers/input/mouse/logibm.c
··· 75 75 module_param_named(irq, logibm_irq, uint, 0); 76 76 MODULE_PARM_DESC(irq, "IRQ number (5=default)"); 77 77 78 - __obsolete_setup("logibm_irq="); 79 - 80 78 static struct input_dev *logibm_dev; 81 79 82 80 static irqreturn_t logibm_interrupt(int irq, void *dev_id)
+28 -6
drivers/input/mouse/psmouse-base.c
··· 93 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 97 * psmouse_mutex protects all operations changing state of mouse 104 98 * (connecting, disconnecting, changing rate or resolution via ··· 981 987 static void psmouse_cleanup(struct serio *serio) 982 988 { 983 989 struct psmouse *psmouse = serio_get_drvdata(serio); 990 + struct psmouse *parent = NULL; 991 + 992 + mutex_lock(&psmouse_mutex); 993 + 994 + if (serio->parent && serio->id.type == SERIO_PS_PSTHRU) { 995 + parent = serio_get_drvdata(serio->parent); 996 + psmouse_deactivate(parent); 997 + } 998 + 999 + psmouse_deactivate(psmouse); 1000 + 1001 + if (psmouse->cleanup) 1002 + psmouse->cleanup(psmouse); 984 1003 985 1004 psmouse_reset(psmouse); 1005 + 1006 + /* 1007 + * Some boxes, such as HP nx7400, get terribly confused if mouse 1008 + * is not fully enabled before suspending/shutting down. 1009 + */ 1010 + ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_ENABLE); 1011 + 1012 + if (parent) { 1013 + if (parent->pt_deactivate) 1014 + parent->pt_deactivate(parent); 1015 + 1016 + psmouse_activate(parent); 1017 + } 1018 + 1019 + mutex_unlock(&psmouse_mutex); 986 1020 } 987 1021 988 1022 /*
+1
drivers/input/mouse/psmouse.h
··· 68 68 69 69 int (*reconnect)(struct psmouse *psmouse); 70 70 void (*disconnect)(struct psmouse *psmouse); 71 + void (*cleanup)(struct psmouse *psmouse); 71 72 int (*poll)(struct psmouse *psmouse); 72 73 73 74 void (*pt_activate)(struct psmouse *psmouse);
+1
drivers/input/mouse/synaptics.c
··· 652 652 psmouse->set_rate = synaptics_set_rate; 653 653 psmouse->disconnect = synaptics_disconnect; 654 654 psmouse->reconnect = synaptics_reconnect; 655 + psmouse->cleanup = synaptics_reset; 655 656 psmouse->pktsize = 6; 656 657 /* Synaptics can usually stay in sync without extra help */ 657 658 psmouse->resync_time = 0;
+29 -34
drivers/input/serio/i8042.c
··· 76 76 MODULE_PARM_DESC(debug, "Turn i8042 debugging mode on and off"); 77 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 79 #include "i8042.h" 87 80 88 81 static DEFINE_SPINLOCK(i8042_lock); ··· 717 724 if (~i8042_read_status() & I8042_STR_KEYLOCK) { 718 725 if (i8042_unlock) 719 726 i8042_ctr |= I8042_CTR_IGNKEYLOCK; 720 - else 727 + else 721 728 printk(KERN_WARNING "i8042.c: Warning: Keylock active.\n"); 722 729 } 723 730 spin_unlock_irqrestore(&i8042_lock, flags); ··· 784 791 785 792 786 793 /* 787 - * Here we try to reset everything back to a state in which the BIOS will be 788 - * able to talk to the hardware when rebooting. 789 - */ 790 - 791 - static void i8042_controller_cleanup(void) 792 - { 793 - int i; 794 - 795 - /* 796 - * Reset anything that is connected to the ports. 797 - */ 798 - 799 - for (i = 0; i < I8042_NUM_PORTS; i++) 800 - if (i8042_ports[i].serio) 801 - serio_cleanup(i8042_ports[i].serio); 802 - 803 - i8042_controller_reset(); 804 - } 805 - 806 - 807 - /* 808 794 * i8042_panic_blink() will flash the keyboard LEDs and is called when 809 795 * kernel panics. Flashing LEDs is useful for users running X who may 810 796 * not see the console and will help distingushing panics from "real" ··· 829 857 830 858 #undef DELAY 831 859 860 + #ifdef CONFIG_PM 832 861 /* 833 - * Here we try to restore the original BIOS settings 862 + * Here we try to restore the original BIOS settings. We only want to 863 + * do that once, when we really suspend, not when we taking memory 864 + * snapshot for swsusp (in this case we'll perform required cleanup 865 + * as part of shutdown process). 834 866 */ 835 867 836 868 static int i8042_suspend(struct platform_device *dev, pm_message_t state) 837 869 { 838 - i8042_controller_cleanup(); 870 + if (dev->dev.power.power_state.event != state.event) { 871 + if (state.event == PM_EVENT_SUSPEND) 872 + i8042_controller_reset(); 873 + 874 + dev->dev.power.power_state = state; 875 + } 839 876 840 877 return 0; 841 878 } ··· 858 877 { 859 878 int error; 860 879 880 + /* 881 + * Do not bother with restoring state if we haven't suspened yet 882 + */ 883 + if (dev->dev.power.power_state.event == PM_EVENT_ON) 884 + return 0; 885 + 861 886 error = i8042_controller_check(); 862 887 if (error) 863 888 return error; ··· 873 886 return error; 874 887 875 888 /* 876 - * Restore pre-resume CTR value and disable all ports 889 + * Restore original CTR value and disable all ports 877 890 */ 878 891 892 + i8042_ctr = i8042_initial_ctr; 893 + if (i8042_direct) 894 + i8042_ctr &= ~I8042_CTR_XLATE; 879 895 i8042_ctr |= I8042_CTR_AUXDIS | I8042_CTR_KBDDIS; 880 896 i8042_ctr &= ~(I8042_CTR_AUXINT | I8042_CTR_KBDINT); 881 897 if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR)) { ··· 899 909 900 910 i8042_interrupt(0, NULL); 901 911 912 + dev->dev.power.power_state = PMSG_ON; 913 + 902 914 return 0; 903 915 } 916 + #endif /* CONFIG_PM */ 904 917 905 918 /* 906 919 * We need to reset the 8042 back to original mode on system shutdown, ··· 912 919 913 920 static void i8042_shutdown(struct platform_device *dev) 914 921 { 915 - i8042_controller_cleanup(); 922 + i8042_controller_reset(); 916 923 } 917 924 918 925 static int __devinit i8042_create_kbd_port(void) ··· 1147 1154 }, 1148 1155 .probe = i8042_probe, 1149 1156 .remove = __devexit_p(i8042_remove), 1157 + .shutdown = i8042_shutdown, 1158 + #ifdef CONFIG_PM 1150 1159 .suspend = i8042_suspend, 1151 1160 .resume = i8042_resume, 1152 - .shutdown = i8042_shutdown, 1161 + #endif 1153 1162 }; 1154 1163 1155 1164 static int __init i8042_init(void)
+35 -1
drivers/input/serio/serio.c
··· 778 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 794 static void serio_attach_driver(struct serio_driver *drv) 782 795 { 783 796 int error; ··· 923 910 924 911 #endif /* CONFIG_HOTPLUG */ 925 912 913 + #ifdef CONFIG_PM 914 + static int serio_suspend(struct device *dev, pm_message_t state) 915 + { 916 + if (dev->power.power_state.event != state.event) { 917 + if (state.event == PM_EVENT_SUSPEND) 918 + serio_cleanup(to_serio_port(dev)); 919 + 920 + dev->power.power_state = state; 921 + } 922 + 923 + return 0; 924 + } 925 + 926 926 static int serio_resume(struct device *dev) 927 927 { 928 928 struct serio *serio = to_serio_port(dev); 929 929 930 - if (serio_reconnect_driver(serio)) { 930 + if (dev->power.power_state.event != PM_EVENT_ON && 931 + serio_reconnect_driver(serio)) { 931 932 /* 932 933 * Driver re-probing can take a while, so better let kseriod 933 934 * deal with it. ··· 949 922 serio_rescan(serio); 950 923 } 951 924 925 + dev->power.power_state = PMSG_ON; 926 + 952 927 return 0; 953 928 } 929 + #endif /* CONFIG_PM */ 954 930 955 931 /* called from serio_driver->connect/disconnect methods under serio_mutex */ 956 932 int serio_open(struct serio *serio, struct serio_driver *drv) ··· 1004 974 .uevent = serio_uevent, 1005 975 .probe = serio_driver_probe, 1006 976 .remove = serio_driver_remove, 977 + .shutdown = serio_shutdown, 978 + #ifdef CONFIG_PM 979 + .suspend = serio_suspend, 1007 980 .resume = serio_resume, 981 + #endif 1008 982 }; 1009 983 1010 984 static int __init serio_init(void)
+5 -1
drivers/usb/input/Kconfig
··· 58 58 devices. 59 59 60 60 config LOGITECH_FF 61 - bool "Logitech WingMan *3D support" 61 + bool "Logitech devices support" 62 62 depends on HID_FF 63 63 select INPUT_FF_MEMLESS if USB_HID 64 64 help 65 65 Say Y here if you have one of these devices: 66 66 - Logitech WingMan Cordless RumblePad 67 + - Logitech WingMan Cordless RumblePad 2 67 68 - Logitech WingMan Force 3D 69 + - Logitech Formula Force EX 70 + - Logitech MOMO Force wheel 71 + 68 72 and if you want to enable force feedback for them. 69 73 Note: if you say N here, this device will still be supported, but without 70 74 force feedback.
+3 -2
drivers/usb/input/hid-ff.c
··· 54 54 static struct hid_ff_initializer inits[] = { 55 55 #ifdef CONFIG_LOGITECH_FF 56 56 { 0x46d, 0xc211, hid_lgff_init }, /* Logitech Cordless rumble pad */ 57 - { 0x46d, 0xc283, hid_lgff_init }, /* Logitech Wingman Force 3d */ 58 - { 0x46d, 0xc295, hid_lgff_init }, /* Logitech MOMO force wheel */ 59 57 { 0x46d, 0xc219, hid_lgff_init }, /* Logitech Cordless rumble pad 2 */ 58 + { 0x46d, 0xc283, hid_lgff_init }, /* Logitech Wingman Force 3d */ 59 + { 0x46d, 0xc294, hid_lgff_init }, /* Logitech Formula Force EX */ 60 + { 0x46d, 0xc295, hid_lgff_init }, /* Logitech MOMO force wheel */ 60 61 { 0x46d, 0xca03, hid_lgff_init }, /* Logitech MOMO force wheel */ 61 62 #endif 62 63 #ifdef CONFIG_PANTHERLORD_FF
+8 -4
drivers/usb/input/hid-lgff.c
··· 52 52 { 0x046d, 0xc211, ff_rumble }, 53 53 { 0x046d, 0xc219, ff_rumble }, 54 54 { 0x046d, 0xc283, ff_joystick }, 55 + { 0x046d, 0xc294, ff_joystick }, 56 + { 0x046d, 0xc295, ff_joystick }, 55 57 { 0x046d, 0xca03, ff_joystick }, 56 - { 0x0000, 0x0000, ff_joystick } 57 58 }; 58 59 59 60 static int hid_lgff_play(struct input_dev *dev, void *data, struct ff_effect *effect) ··· 106 105 struct input_dev *dev = hidinput->input; 107 106 struct hid_report *report; 108 107 struct hid_field *field; 108 + const signed short *ff_bits = ff_joystick; 109 109 int error; 110 - int i, j; 110 + int i; 111 111 112 112 /* Find the report to use */ 113 113 if (list_empty(report_list)) { ··· 132 130 for (i = 0; i < ARRAY_SIZE(devices); i++) { 133 131 if (dev->id.vendor == devices[i].idVendor && 134 132 dev->id.product == devices[i].idProduct) { 135 - for (j = 0; devices[i].ff[j] >= 0; j++) 136 - set_bit(devices[i].ff[j], dev->ffbit); 133 + ff_bits = devices[i].ff; 137 134 break; 138 135 } 139 136 } 137 + 138 + for (i = 0; ff_bits[i] >= 0; i++) 139 + set_bit(ff_bits[i], dev->ffbit); 140 140 141 141 error = input_ff_create_memless(dev, NULL, hid_lgff_play); 142 142 if (error)
-6
include/linux/serio.h
··· 108 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 112 * Use the following functions to manipulate serio's per-port 119 113 * driver-specific data.