diff options
Diffstat (limited to 'drivers/input')
93 files changed, 552 insertions, 144 deletions
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index 9f9816baeb97..2ee6c7a68bdc 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c | |||
| @@ -515,7 +515,7 @@ static long evdev_do_ioctl(struct file *file, unsigned int cmd, | |||
| 515 | struct input_absinfo abs; | 515 | struct input_absinfo abs; |
| 516 | struct ff_effect effect; | 516 | struct ff_effect effect; |
| 517 | int __user *ip = (int __user *)p; | 517 | int __user *ip = (int __user *)p; |
| 518 | int i, t, u, v; | 518 | unsigned int i, t, u, v; |
| 519 | int error; | 519 | int error; |
| 520 | 520 | ||
| 521 | switch (cmd) { | 521 | switch (cmd) { |
diff --git a/drivers/input/ff-core.c b/drivers/input/ff-core.c index b2f07aa1604b..03078c08309a 100644 --- a/drivers/input/ff-core.c +++ b/drivers/input/ff-core.c | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | #include <linux/module.h> | 29 | #include <linux/module.h> |
| 30 | #include <linux/mutex.h> | 30 | #include <linux/mutex.h> |
| 31 | #include <linux/sched.h> | 31 | #include <linux/sched.h> |
| 32 | #include <linux/slab.h> | ||
| 32 | 33 | ||
| 33 | /* | 34 | /* |
| 34 | * Check that the effect_id is a valid effect and whether the user | 35 | * Check that the effect_id is a valid effect and whether the user |
diff --git a/drivers/input/ff-memless.c b/drivers/input/ff-memless.c index f967008f332e..1d881c96ba8f 100644 --- a/drivers/input/ff-memless.c +++ b/drivers/input/ff-memless.c | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | 25 | ||
| 26 | #define debug(format, arg...) pr_debug("ff-memless: " format "\n", ## arg) | 26 | #define debug(format, arg...) pr_debug("ff-memless: " format "\n", ## arg) |
| 27 | 27 | ||
| 28 | #include <linux/slab.h> | ||
| 28 | #include <linux/input.h> | 29 | #include <linux/input.h> |
| 29 | #include <linux/module.h> | 30 | #include <linux/module.h> |
| 30 | #include <linux/mutex.h> | 31 | #include <linux/mutex.h> |
diff --git a/drivers/input/gameport/lightning.c b/drivers/input/gameport/lightning.c index 06ad36ed3483..85d6ee09f11f 100644 --- a/drivers/input/gameport/lightning.c +++ b/drivers/input/gameport/lightning.c | |||
| @@ -34,7 +34,6 @@ | |||
| 34 | #include <linux/module.h> | 34 | #include <linux/module.h> |
| 35 | #include <linux/init.h> | 35 | #include <linux/init.h> |
| 36 | #include <linux/gameport.h> | 36 | #include <linux/gameport.h> |
| 37 | #include <linux/slab.h> | ||
| 38 | 37 | ||
| 39 | #define L4_PORT 0x201 | 38 | #define L4_PORT 0x201 |
| 40 | #define L4_SELECT_ANALOG 0xa4 | 39 | #define L4_SELECT_ANALOG 0xa4 |
diff --git a/drivers/input/input-polldev.c b/drivers/input/input-polldev.c index 291d9393d359..10c9b0a845f0 100644 --- a/drivers/input/input-polldev.c +++ b/drivers/input/input-polldev.c | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | #include <linux/jiffies.h> | 11 | #include <linux/jiffies.h> |
| 12 | #include <linux/slab.h> | ||
| 12 | #include <linux/mutex.h> | 13 | #include <linux/mutex.h> |
| 13 | #include <linux/input-polldev.h> | 14 | #include <linux/input-polldev.h> |
| 14 | 15 | ||
diff --git a/drivers/input/input.c b/drivers/input/input.c index 41168d5f8c17..9c79bd56b51a 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include <linux/types.h> | 14 | #include <linux/types.h> |
| 15 | #include <linux/input.h> | 15 | #include <linux/input.h> |
| 16 | #include <linux/module.h> | 16 | #include <linux/module.h> |
| 17 | #include <linux/slab.h> | ||
| 17 | #include <linux/random.h> | 18 | #include <linux/random.h> |
| 18 | #include <linux/major.h> | 19 | #include <linux/major.h> |
| 19 | #include <linux/proc_fs.h> | 20 | #include <linux/proc_fs.h> |
| @@ -582,7 +583,8 @@ static int input_fetch_keycode(struct input_dev *dev, int scancode) | |||
| 582 | } | 583 | } |
| 583 | 584 | ||
| 584 | static int input_default_getkeycode(struct input_dev *dev, | 585 | static int input_default_getkeycode(struct input_dev *dev, |
| 585 | int scancode, int *keycode) | 586 | unsigned int scancode, |
| 587 | unsigned int *keycode) | ||
| 586 | { | 588 | { |
| 587 | if (!dev->keycodesize) | 589 | if (!dev->keycodesize) |
| 588 | return -EINVAL; | 590 | return -EINVAL; |
| @@ -596,7 +598,8 @@ static int input_default_getkeycode(struct input_dev *dev, | |||
| 596 | } | 598 | } |
| 597 | 599 | ||
| 598 | static int input_default_setkeycode(struct input_dev *dev, | 600 | static int input_default_setkeycode(struct input_dev *dev, |
| 599 | int scancode, int keycode) | 601 | unsigned int scancode, |
| 602 | unsigned int keycode) | ||
| 600 | { | 603 | { |
| 601 | int old_keycode; | 604 | int old_keycode; |
| 602 | int i; | 605 | int i; |
| @@ -654,12 +657,17 @@ static int input_default_setkeycode(struct input_dev *dev, | |||
| 654 | * This function should be called by anyone interested in retrieving current | 657 | * This function should be called by anyone interested in retrieving current |
| 655 | * keymap. Presently keyboard and evdev handlers use it. | 658 | * keymap. Presently keyboard and evdev handlers use it. |
| 656 | */ | 659 | */ |
| 657 | int input_get_keycode(struct input_dev *dev, int scancode, int *keycode) | 660 | int input_get_keycode(struct input_dev *dev, |
| 661 | unsigned int scancode, unsigned int *keycode) | ||
| 658 | { | 662 | { |
| 659 | if (scancode < 0) | 663 | unsigned long flags; |
| 660 | return -EINVAL; | 664 | int retval; |
| 665 | |||
| 666 | spin_lock_irqsave(&dev->event_lock, flags); | ||
| 667 | retval = dev->getkeycode(dev, scancode, keycode); | ||
| 668 | spin_unlock_irqrestore(&dev->event_lock, flags); | ||
| 661 | 669 | ||
| 662 | return dev->getkeycode(dev, scancode, keycode); | 670 | return retval; |
| 663 | } | 671 | } |
| 664 | EXPORT_SYMBOL(input_get_keycode); | 672 | EXPORT_SYMBOL(input_get_keycode); |
| 665 | 673 | ||
| @@ -672,16 +680,14 @@ EXPORT_SYMBOL(input_get_keycode); | |||
| 672 | * This function should be called by anyone needing to update current | 680 | * This function should be called by anyone needing to update current |
| 673 | * keymap. Presently keyboard and evdev handlers use it. | 681 | * keymap. Presently keyboard and evdev handlers use it. |
| 674 | */ | 682 | */ |
| 675 | int input_set_keycode(struct input_dev *dev, int scancode, int keycode) | 683 | int input_set_keycode(struct input_dev *dev, |
| 684 | unsigned int scancode, unsigned int keycode) | ||
| 676 | { | 685 | { |
| 677 | unsigned long flags; | 686 | unsigned long flags; |
| 678 | int old_keycode; | 687 | int old_keycode; |
| 679 | int retval; | 688 | int retval; |
| 680 | 689 | ||
| 681 | if (scancode < 0) | 690 | if (keycode > KEY_MAX) |
| 682 | return -EINVAL; | ||
| 683 | |||
| 684 | if (keycode < 0 || keycode > KEY_MAX) | ||
| 685 | return -EINVAL; | 691 | return -EINVAL; |
| 686 | 692 | ||
| 687 | spin_lock_irqsave(&dev->event_lock, flags); | 693 | spin_lock_irqsave(&dev->event_lock, flags); |
| @@ -1881,35 +1887,37 @@ static int input_open_file(struct inode *inode, struct file *file) | |||
| 1881 | const struct file_operations *old_fops, *new_fops = NULL; | 1887 | const struct file_operations *old_fops, *new_fops = NULL; |
| 1882 | int err; | 1888 | int err; |
| 1883 | 1889 | ||
| 1884 | lock_kernel(); | 1890 | err = mutex_lock_interruptible(&input_mutex); |
| 1891 | if (err) | ||
| 1892 | return err; | ||
| 1893 | |||
| 1885 | /* No load-on-demand here? */ | 1894 | /* No load-on-demand here? */ |
| 1886 | handler = input_table[iminor(inode) >> 5]; | 1895 | handler = input_table[iminor(inode) >> 5]; |
| 1887 | if (!handler || !(new_fops = fops_get(handler->fops))) { | 1896 | if (handler) |
| 1888 | err = -ENODEV; | 1897 | new_fops = fops_get(handler->fops); |
| 1889 | goto out; | 1898 | |
| 1890 | } | 1899 | mutex_unlock(&input_mutex); |
| 1891 | 1900 | ||
| 1892 | /* | 1901 | /* |
| 1893 | * That's _really_ odd. Usually NULL ->open means "nothing special", | 1902 | * That's _really_ odd. Usually NULL ->open means "nothing special", |
| 1894 | * not "no device". Oh, well... | 1903 | * not "no device". Oh, well... |
| 1895 | */ | 1904 | */ |
| 1896 | if (!new_fops->open) { | 1905 | if (!new_fops || !new_fops->open) { |
| 1897 | fops_put(new_fops); | 1906 | fops_put(new_fops); |
| 1898 | err = -ENODEV; | 1907 | err = -ENODEV; |
| 1899 | goto out; | 1908 | goto out; |
| 1900 | } | 1909 | } |
| 1910 | |||
| 1901 | old_fops = file->f_op; | 1911 | old_fops = file->f_op; |
| 1902 | file->f_op = new_fops; | 1912 | file->f_op = new_fops; |
| 1903 | 1913 | ||
| 1904 | err = new_fops->open(inode, file); | 1914 | err = new_fops->open(inode, file); |
| 1905 | |||
| 1906 | if (err) { | 1915 | if (err) { |
| 1907 | fops_put(file->f_op); | 1916 | fops_put(file->f_op); |
| 1908 | file->f_op = fops_get(old_fops); | 1917 | file->f_op = fops_get(old_fops); |
| 1909 | } | 1918 | } |
| 1910 | fops_put(old_fops); | 1919 | fops_put(old_fops); |
| 1911 | out: | 1920 | out: |
| 1912 | unlock_kernel(); | ||
| 1913 | return err; | 1921 | return err; |
| 1914 | } | 1922 | } |
| 1915 | 1923 | ||
diff --git a/drivers/input/joystick/db9.c b/drivers/input/joystick/db9.c index 523959484753..8e7de5c7754f 100644 --- a/drivers/input/joystick/db9.c +++ b/drivers/input/joystick/db9.c | |||
| @@ -36,6 +36,7 @@ | |||
| 36 | #include <linux/parport.h> | 36 | #include <linux/parport.h> |
| 37 | #include <linux/input.h> | 37 | #include <linux/input.h> |
| 38 | #include <linux/mutex.h> | 38 | #include <linux/mutex.h> |
| 39 | #include <linux/slab.h> | ||
| 39 | 40 | ||
| 40 | MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); | 41 | MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); |
| 41 | MODULE_DESCRIPTION("Atari, Amstrad, Commodore, Amiga, Sega, etc. joystick driver"); | 42 | MODULE_DESCRIPTION("Atari, Amstrad, Commodore, Amiga, Sega, etc. joystick driver"); |
diff --git a/drivers/input/joystick/gamecon.c b/drivers/input/joystick/gamecon.c index ae998d99a5ae..fbd62abb66f9 100644 --- a/drivers/input/joystick/gamecon.c +++ b/drivers/input/joystick/gamecon.c | |||
| @@ -39,6 +39,7 @@ | |||
| 39 | #include <linux/parport.h> | 39 | #include <linux/parport.h> |
| 40 | #include <linux/input.h> | 40 | #include <linux/input.h> |
| 41 | #include <linux/mutex.h> | 41 | #include <linux/mutex.h> |
| 42 | #include <linux/slab.h> | ||
| 42 | 43 | ||
| 43 | MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); | 44 | MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); |
| 44 | MODULE_DESCRIPTION("NES, SNES, N64, MultiSystem, PSX gamepad driver"); | 45 | MODULE_DESCRIPTION("NES, SNES, N64, MultiSystem, PSX gamepad driver"); |
| @@ -819,7 +820,7 @@ static int __init gc_setup_pad(struct gc *gc, int idx, int pad_type) | |||
| 819 | int i; | 820 | int i; |
| 820 | int err; | 821 | int err; |
| 821 | 822 | ||
| 822 | if (pad_type < 1 || pad_type > GC_MAX) { | 823 | if (pad_type < 1 || pad_type >= GC_MAX) { |
| 823 | pr_err("Pad type %d unknown\n", pad_type); | 824 | pr_err("Pad type %d unknown\n", pad_type); |
| 824 | return -EINVAL; | 825 | return -EINVAL; |
| 825 | } | 826 | } |
diff --git a/drivers/input/joystick/turbografx.c b/drivers/input/joystick/turbografx.c index b6f859869540..d53b9e900234 100644 --- a/drivers/input/joystick/turbografx.c +++ b/drivers/input/joystick/turbografx.c | |||
| @@ -35,6 +35,7 @@ | |||
| 35 | #include <linux/module.h> | 35 | #include <linux/module.h> |
| 36 | #include <linux/init.h> | 36 | #include <linux/init.h> |
| 37 | #include <linux/mutex.h> | 37 | #include <linux/mutex.h> |
| 38 | #include <linux/slab.h> | ||
| 38 | 39 | ||
| 39 | MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); | 40 | MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); |
| 40 | MODULE_DESCRIPTION("TurboGraFX parallel port interface driver"); | 41 | MODULE_DESCRIPTION("TurboGraFX parallel port interface driver"); |
diff --git a/drivers/input/keyboard/adp5520-keys.c b/drivers/input/keyboard/adp5520-keys.c index a7ba27fb4109..3db8006dac3a 100644 --- a/drivers/input/keyboard/adp5520-keys.c +++ b/drivers/input/keyboard/adp5520-keys.c | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include <linux/platform_device.h> | 12 | #include <linux/platform_device.h> |
| 13 | #include <linux/input.h> | 13 | #include <linux/input.h> |
| 14 | #include <linux/mfd/adp5520.h> | 14 | #include <linux/mfd/adp5520.h> |
| 15 | #include <linux/slab.h> | ||
| 15 | 16 | ||
| 16 | struct adp5520_keys { | 17 | struct adp5520_keys { |
| 17 | struct input_dev *input; | 18 | struct input_dev *input; |
diff --git a/drivers/input/keyboard/adp5588-keys.c b/drivers/input/keyboard/adp5588-keys.c index b5142d2d5112..4771ab172b59 100644 --- a/drivers/input/keyboard/adp5588-keys.c +++ b/drivers/input/keyboard/adp5588-keys.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <linux/platform_device.h> | 19 | #include <linux/platform_device.h> |
| 20 | #include <linux/input.h> | 20 | #include <linux/input.h> |
| 21 | #include <linux/i2c.h> | 21 | #include <linux/i2c.h> |
| 22 | #include <linux/slab.h> | ||
| 22 | 23 | ||
| 23 | #include <linux/i2c/adp5588.h> | 24 | #include <linux/i2c/adp5588.h> |
| 24 | 25 | ||
diff --git a/drivers/input/keyboard/bf54x-keys.c b/drivers/input/keyboard/bf54x-keys.c index fe376a27fe57..7d989603f875 100644 --- a/drivers/input/keyboard/bf54x-keys.c +++ b/drivers/input/keyboard/bf54x-keys.c | |||
| @@ -34,6 +34,7 @@ | |||
| 34 | #include <linux/fs.h> | 34 | #include <linux/fs.h> |
| 35 | #include <linux/interrupt.h> | 35 | #include <linux/interrupt.h> |
| 36 | #include <linux/irq.h> | 36 | #include <linux/irq.h> |
| 37 | #include <linux/slab.h> | ||
| 37 | #include <linux/sched.h> | 38 | #include <linux/sched.h> |
| 38 | #include <linux/pm.h> | 39 | #include <linux/pm.h> |
| 39 | #include <linux/sysctl.h> | 40 | #include <linux/sysctl.h> |
| @@ -162,7 +163,7 @@ static irqreturn_t bfin_kpad_isr(int irq, void *dev_id) | |||
| 162 | input_sync(input); | 163 | input_sync(input); |
| 163 | 164 | ||
| 164 | if (bfin_kpad_get_keypressed(bf54x_kpad)) { | 165 | if (bfin_kpad_get_keypressed(bf54x_kpad)) { |
| 165 | disable_irq(bf54x_kpad->irq); | 166 | disable_irq_nosync(bf54x_kpad->irq); |
| 166 | bf54x_kpad->lastkey = key; | 167 | bf54x_kpad->lastkey = key; |
| 167 | mod_timer(&bf54x_kpad->timer, | 168 | mod_timer(&bf54x_kpad->timer, |
| 168 | jiffies + bf54x_kpad->keyup_test_jiffies); | 169 | jiffies + bf54x_kpad->keyup_test_jiffies); |
diff --git a/drivers/input/keyboard/davinci_keyscan.c b/drivers/input/keyboard/davinci_keyscan.c index d410d7a52f1d..a91ee941b5c1 100644 --- a/drivers/input/keyboard/davinci_keyscan.c +++ b/drivers/input/keyboard/davinci_keyscan.c | |||
| @@ -30,6 +30,7 @@ | |||
| 30 | #include <linux/delay.h> | 30 | #include <linux/delay.h> |
| 31 | #include <linux/platform_device.h> | 31 | #include <linux/platform_device.h> |
| 32 | #include <linux/errno.h> | 32 | #include <linux/errno.h> |
| 33 | #include <linux/slab.h> | ||
| 33 | 34 | ||
| 34 | #include <asm/irq.h> | 35 | #include <asm/irq.h> |
| 35 | 36 | ||
diff --git a/drivers/input/keyboard/ep93xx_keypad.c b/drivers/input/keyboard/ep93xx_keypad.c index bd25a3af1664..c8242dd190d0 100644 --- a/drivers/input/keyboard/ep93xx_keypad.c +++ b/drivers/input/keyboard/ep93xx_keypad.c | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #include <linux/clk.h> | 25 | #include <linux/clk.h> |
| 26 | #include <linux/io.h> | 26 | #include <linux/io.h> |
| 27 | #include <linux/input/matrix_keypad.h> | 27 | #include <linux/input/matrix_keypad.h> |
| 28 | #include <linux/slab.h> | ||
| 28 | 29 | ||
| 29 | #include <mach/hardware.h> | 30 | #include <mach/hardware.h> |
| 30 | #include <mach/ep93xx_keypad.h> | 31 | #include <mach/ep93xx_keypad.h> |
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index 2b708aa85553..b8213fd13c3f 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | #include <linux/irq.h> | 16 | #include <linux/irq.h> |
| 17 | #include <linux/sched.h> | 17 | #include <linux/sched.h> |
| 18 | #include <linux/pm.h> | 18 | #include <linux/pm.h> |
| 19 | #include <linux/slab.h> | ||
| 19 | #include <linux/sysctl.h> | 20 | #include <linux/sysctl.h> |
| 20 | #include <linux/proc_fs.h> | 21 | #include <linux/proc_fs.h> |
| 21 | #include <linux/delay.h> | 22 | #include <linux/delay.h> |
diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c index 2ee5b798024d..d92c15c39e68 100644 --- a/drivers/input/keyboard/imx_keypad.c +++ b/drivers/input/keyboard/imx_keypad.c | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
| 22 | #include <linux/module.h> | 22 | #include <linux/module.h> |
| 23 | #include <linux/platform_device.h> | 23 | #include <linux/platform_device.h> |
| 24 | #include <linux/slab.h> | ||
| 24 | #include <linux/timer.h> | 25 | #include <linux/timer.h> |
| 25 | 26 | ||
| 26 | /* | 27 | /* |
diff --git a/drivers/input/keyboard/jornada680_kbd.c b/drivers/input/keyboard/jornada680_kbd.c index 781fc6102860..5fc976dbce0b 100644 --- a/drivers/input/keyboard/jornada680_kbd.c +++ b/drivers/input/keyboard/jornada680_kbd.c | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #include <linux/kernel.h> | 24 | #include <linux/kernel.h> |
| 25 | #include <linux/module.h> | 25 | #include <linux/module.h> |
| 26 | #include <linux/platform_device.h> | 26 | #include <linux/platform_device.h> |
| 27 | #include <linux/slab.h> | ||
| 27 | 28 | ||
| 28 | #include <asm/delay.h> | 29 | #include <asm/delay.h> |
| 29 | #include <asm/io.h> | 30 | #include <asm/io.h> |
diff --git a/drivers/input/keyboard/jornada720_kbd.c b/drivers/input/keyboard/jornada720_kbd.c index 4e016d823069..2cd3e1d56ea4 100644 --- a/drivers/input/keyboard/jornada720_kbd.c +++ b/drivers/input/keyboard/jornada720_kbd.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | #include <linux/kernel.h> | 23 | #include <linux/kernel.h> |
| 24 | #include <linux/module.h> | 24 | #include <linux/module.h> |
| 25 | #include <linux/platform_device.h> | 25 | #include <linux/platform_device.h> |
| 26 | #include <linux/slab.h> | ||
| 26 | 27 | ||
| 27 | #include <mach/jornada720.h> | 28 | #include <mach/jornada720.h> |
| 28 | #include <mach/hardware.h> | 29 | #include <mach/hardware.h> |
diff --git a/drivers/input/keyboard/lm8323.c b/drivers/input/keyboard/lm8323.c index 574eda2a4957..60ac4684f875 100644 --- a/drivers/input/keyboard/lm8323.c +++ b/drivers/input/keyboard/lm8323.c | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | #include <linux/input.h> | 31 | #include <linux/input.h> |
| 32 | #include <linux/leds.h> | 32 | #include <linux/leds.h> |
| 33 | #include <linux/i2c/lm8323.h> | 33 | #include <linux/i2c/lm8323.h> |
| 34 | #include <linux/slab.h> | ||
| 34 | 35 | ||
| 35 | /* Commands to send to the chip. */ | 36 | /* Commands to send to the chip. */ |
| 36 | #define LM8323_CMD_READ_ID 0x80 /* Read chip ID. */ | 37 | #define LM8323_CMD_READ_ID 0x80 /* Read chip ID. */ |
diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c index d3c8b61a941d..b443e088fd3c 100644 --- a/drivers/input/keyboard/matrix_keypad.c +++ b/drivers/input/keyboard/matrix_keypad.c | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #include <linux/module.h> | 22 | #include <linux/module.h> |
| 23 | #include <linux/gpio.h> | 23 | #include <linux/gpio.h> |
| 24 | #include <linux/input/matrix_keypad.h> | 24 | #include <linux/input/matrix_keypad.h> |
| 25 | #include <linux/slab.h> | ||
| 25 | 26 | ||
| 26 | struct matrix_keypad { | 27 | struct matrix_keypad { |
| 27 | const struct matrix_keypad_platform_data *pdata; | 28 | const struct matrix_keypad_platform_data *pdata; |
| @@ -373,7 +374,9 @@ static int __devinit matrix_keypad_probe(struct platform_device *pdev) | |||
| 373 | input_dev->name = pdev->name; | 374 | input_dev->name = pdev->name; |
| 374 | input_dev->id.bustype = BUS_HOST; | 375 | input_dev->id.bustype = BUS_HOST; |
| 375 | input_dev->dev.parent = &pdev->dev; | 376 | input_dev->dev.parent = &pdev->dev; |
| 376 | input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP); | 377 | input_dev->evbit[0] = BIT_MASK(EV_KEY); |
| 378 | if (!pdata->no_autorepeat) | ||
| 379 | input_dev->evbit[0] |= BIT_MASK(EV_REP); | ||
| 377 | input_dev->open = matrix_keypad_start; | 380 | input_dev->open = matrix_keypad_start; |
| 378 | input_dev->close = matrix_keypad_stop; | 381 | input_dev->close = matrix_keypad_stop; |
| 379 | 382 | ||
diff --git a/drivers/input/keyboard/max7359_keypad.c b/drivers/input/keyboard/max7359_keypad.c index 3b5b948eba39..7fc8185e5c1b 100644 --- a/drivers/input/keyboard/max7359_keypad.c +++ b/drivers/input/keyboard/max7359_keypad.c | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | 15 | ||
| 16 | #include <linux/module.h> | 16 | #include <linux/module.h> |
| 17 | #include <linux/i2c.h> | 17 | #include <linux/i2c.h> |
| 18 | #include <linux/slab.h> | ||
| 18 | #include <linux/interrupt.h> | 19 | #include <linux/interrupt.h> |
| 19 | #include <linux/input.h> | 20 | #include <linux/input.h> |
| 20 | #include <linux/input/matrix_keypad.h> | 21 | #include <linux/input/matrix_keypad.h> |
diff --git a/drivers/input/keyboard/omap-keypad.c b/drivers/input/keyboard/omap-keypad.c index 1a494d505431..a72e61ddca91 100644 --- a/drivers/input/keyboard/omap-keypad.c +++ b/drivers/input/keyboard/omap-keypad.c | |||
| @@ -34,6 +34,7 @@ | |||
| 34 | #include <linux/platform_device.h> | 34 | #include <linux/platform_device.h> |
| 35 | #include <linux/mutex.h> | 35 | #include <linux/mutex.h> |
| 36 | #include <linux/errno.h> | 36 | #include <linux/errno.h> |
| 37 | #include <linux/slab.h> | ||
| 37 | #include <mach/gpio.h> | 38 | #include <mach/gpio.h> |
| 38 | #include <plat/keypad.h> | 39 | #include <plat/keypad.h> |
| 39 | #include <plat/menelaus.h> | 40 | #include <plat/menelaus.h> |
diff --git a/drivers/input/keyboard/opencores-kbd.c b/drivers/input/keyboard/opencores-kbd.c index 78cccddbf551..1f1a5563f60a 100644 --- a/drivers/input/keyboard/opencores-kbd.c +++ b/drivers/input/keyboard/opencores-kbd.c | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
| 15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
| 16 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
| 17 | #include <linux/slab.h> | ||
| 17 | 18 | ||
| 18 | struct opencores_kbd { | 19 | struct opencores_kbd { |
| 19 | struct input_dev *input; | 20 | struct input_dev *input; |
diff --git a/drivers/input/keyboard/pxa27x_keypad.c b/drivers/input/keyboard/pxa27x_keypad.c index 79cd3e9fdf2e..0e53b3bc39af 100644 --- a/drivers/input/keyboard/pxa27x_keypad.c +++ b/drivers/input/keyboard/pxa27x_keypad.c | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | #include <linux/clk.h> | 26 | #include <linux/clk.h> |
| 27 | #include <linux/err.h> | 27 | #include <linux/err.h> |
| 28 | #include <linux/input/matrix_keypad.h> | 28 | #include <linux/input/matrix_keypad.h> |
| 29 | #include <linux/slab.h> | ||
| 29 | 30 | ||
| 30 | #include <asm/mach/arch.h> | 31 | #include <asm/mach/arch.h> |
| 31 | #include <asm/mach/map.h> | 32 | #include <asm/mach/map.h> |
diff --git a/drivers/input/keyboard/pxa930_rotary.c b/drivers/input/keyboard/pxa930_rotary.c index 95fbba470e65..b7123a44b6ec 100644 --- a/drivers/input/keyboard/pxa930_rotary.c +++ b/drivers/input/keyboard/pxa930_rotary.c | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #include <linux/input.h> | 13 | #include <linux/input.h> |
| 14 | #include <linux/platform_device.h> | 14 | #include <linux/platform_device.h> |
| 15 | #include <linux/io.h> | 15 | #include <linux/io.h> |
| 16 | #include <linux/slab.h> | ||
| 16 | 17 | ||
| 17 | #include <mach/pxa930_rotary.h> | 18 | #include <mach/pxa930_rotary.h> |
| 18 | 19 | ||
diff --git a/drivers/input/keyboard/sh_keysc.c b/drivers/input/keyboard/sh_keysc.c index 854e2035cd6e..d7dafd9425b6 100644 --- a/drivers/input/keyboard/sh_keysc.c +++ b/drivers/input/keyboard/sh_keysc.c | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #include <linux/bitmap.h> | 22 | #include <linux/bitmap.h> |
| 23 | #include <linux/clk.h> | 23 | #include <linux/clk.h> |
| 24 | #include <linux/io.h> | 24 | #include <linux/io.h> |
| 25 | #include <linux/slab.h> | ||
| 25 | 26 | ||
| 26 | static const struct { | 27 | static const struct { |
| 27 | unsigned char kymd, keyout, keyin; | 28 | unsigned char kymd, keyout, keyin; |
diff --git a/drivers/input/keyboard/tosakbd.c b/drivers/input/keyboard/tosakbd.c index 42cb3faf7336..3910f269cfc8 100644 --- a/drivers/input/keyboard/tosakbd.c +++ b/drivers/input/keyboard/tosakbd.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <linux/input.h> | 18 | #include <linux/input.h> |
| 19 | #include <linux/delay.h> | 19 | #include <linux/delay.h> |
| 20 | #include <linux/interrupt.h> | 20 | #include <linux/interrupt.h> |
| 21 | #include <linux/slab.h> | ||
| 21 | 22 | ||
| 22 | #include <mach/gpio.h> | 23 | #include <mach/gpio.h> |
| 23 | #include <mach/tosa.h> | 24 | #include <mach/tosa.h> |
diff --git a/drivers/input/keyboard/twl4030_keypad.c b/drivers/input/keyboard/twl4030_keypad.c index 21d6184efa96..7aa59e07b689 100644 --- a/drivers/input/keyboard/twl4030_keypad.c +++ b/drivers/input/keyboard/twl4030_keypad.c | |||
| @@ -32,6 +32,7 @@ | |||
| 32 | #include <linux/input.h> | 32 | #include <linux/input.h> |
| 33 | #include <linux/platform_device.h> | 33 | #include <linux/platform_device.h> |
| 34 | #include <linux/i2c/twl.h> | 34 | #include <linux/i2c/twl.h> |
| 35 | #include <linux/slab.h> | ||
| 35 | 36 | ||
| 36 | 37 | ||
| 37 | /* | 38 | /* |
diff --git a/drivers/input/keyboard/w90p910_keypad.c b/drivers/input/keyboard/w90p910_keypad.c index 6032def03707..4ef764cc493c 100644 --- a/drivers/input/keyboard/w90p910_keypad.c +++ b/drivers/input/keyboard/w90p910_keypad.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <linux/clk.h> | 19 | #include <linux/clk.h> |
| 20 | #include <linux/err.h> | 20 | #include <linux/err.h> |
| 21 | #include <linux/io.h> | 21 | #include <linux/io.h> |
| 22 | #include <linux/slab.h> | ||
| 22 | 23 | ||
| 23 | #include <mach/w90p910_keypad.h> | 24 | #include <mach/w90p910_keypad.h> |
| 24 | 25 | ||
diff --git a/drivers/input/misc/88pm860x_onkey.c b/drivers/input/misc/88pm860x_onkey.c index 69a48e8701b9..40dabd8487b5 100644 --- a/drivers/input/misc/88pm860x_onkey.c +++ b/drivers/input/misc/88pm860x_onkey.c | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #include <linux/input.h> | 25 | #include <linux/input.h> |
| 26 | #include <linux/interrupt.h> | 26 | #include <linux/interrupt.h> |
| 27 | #include <linux/mfd/88pm860x.h> | 27 | #include <linux/mfd/88pm860x.h> |
| 28 | #include <linux/slab.h> | ||
| 28 | 29 | ||
| 29 | #define PM8607_WAKEUP 0x0b | 30 | #define PM8607_WAKEUP 0x0b |
| 30 | 31 | ||
diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig index 7097bfe581d7..23140a3bb8e0 100644 --- a/drivers/input/misc/Kconfig +++ b/drivers/input/misc/Kconfig | |||
| @@ -214,6 +214,17 @@ config INPUT_TWL4030_PWRBUTTON | |||
| 214 | To compile this driver as a module, choose M here. The module will | 214 | To compile this driver as a module, choose M here. The module will |
| 215 | be called twl4030_pwrbutton. | 215 | be called twl4030_pwrbutton. |
| 216 | 216 | ||
| 217 | config INPUT_TWL4030_VIBRA | ||
| 218 | tristate "Support for TWL4030 Vibrator" | ||
| 219 | depends on TWL4030_CORE | ||
| 220 | select TWL4030_CODEC | ||
| 221 | select INPUT_FF_MEMLESS | ||
| 222 | help | ||
| 223 | This option enables support for TWL4030 Vibrator Driver. | ||
| 224 | |||
| 225 | To compile this driver as a module, choose M here. The module will | ||
| 226 | be called twl4030_vibra. | ||
| 227 | |||
| 217 | config INPUT_UINPUT | 228 | config INPUT_UINPUT |
| 218 | tristate "User level driver support" | 229 | tristate "User level driver support" |
| 219 | help | 230 | help |
diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile index b611615e24ad..7e95a5d474dc 100644 --- a/drivers/input/misc/Makefile +++ b/drivers/input/misc/Makefile | |||
| @@ -26,6 +26,7 @@ obj-$(CONFIG_INPUT_GPIO_ROTARY_ENCODER) += rotary_encoder.o | |||
| 26 | obj-$(CONFIG_INPUT_SGI_BTNS) += sgi_btns.o | 26 | obj-$(CONFIG_INPUT_SGI_BTNS) += sgi_btns.o |
| 27 | obj-$(CONFIG_INPUT_SPARCSPKR) += sparcspkr.o | 27 | obj-$(CONFIG_INPUT_SPARCSPKR) += sparcspkr.o |
| 28 | obj-$(CONFIG_INPUT_TWL4030_PWRBUTTON) += twl4030-pwrbutton.o | 28 | obj-$(CONFIG_INPUT_TWL4030_PWRBUTTON) += twl4030-pwrbutton.o |
| 29 | obj-$(CONFIG_INPUT_TWL4030_VIBRA) += twl4030-vibra.o | ||
| 29 | obj-$(CONFIG_INPUT_UINPUT) += uinput.o | 30 | obj-$(CONFIG_INPUT_UINPUT) += uinput.o |
| 30 | obj-$(CONFIG_INPUT_WINBOND_CIR) += winbond-cir.o | 31 | obj-$(CONFIG_INPUT_WINBOND_CIR) += winbond-cir.o |
| 31 | obj-$(CONFIG_INPUT_WISTRON_BTNS) += wistron_btns.o | 32 | obj-$(CONFIG_INPUT_WISTRON_BTNS) += wistron_btns.o |
diff --git a/drivers/input/misc/ati_remote2.c b/drivers/input/misc/ati_remote2.c index 0501f0e65157..2124b99378bb 100644 --- a/drivers/input/misc/ati_remote2.c +++ b/drivers/input/misc/ati_remote2.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | */ | 10 | */ |
| 11 | 11 | ||
| 12 | #include <linux/usb/input.h> | 12 | #include <linux/usb/input.h> |
| 13 | #include <linux/slab.h> | ||
| 13 | 14 | ||
| 14 | #define DRIVER_DESC "ATI/Philips USB RF remote driver" | 15 | #define DRIVER_DESC "ATI/Philips USB RF remote driver" |
| 15 | #define DRIVER_VERSION "0.3" | 16 | #define DRIVER_VERSION "0.3" |
| @@ -474,10 +475,11 @@ static void ati_remote2_complete_key(struct urb *urb) | |||
| 474 | } | 475 | } |
| 475 | 476 | ||
| 476 | static int ati_remote2_getkeycode(struct input_dev *idev, | 477 | static int ati_remote2_getkeycode(struct input_dev *idev, |
| 477 | int scancode, int *keycode) | 478 | unsigned int scancode, unsigned int *keycode) |
| 478 | { | 479 | { |
| 479 | struct ati_remote2 *ar2 = input_get_drvdata(idev); | 480 | struct ati_remote2 *ar2 = input_get_drvdata(idev); |
| 480 | int index, mode; | 481 | unsigned int mode; |
| 482 | int index; | ||
| 481 | 483 | ||
| 482 | mode = scancode >> 8; | 484 | mode = scancode >> 8; |
| 483 | if (mode > ATI_REMOTE2_PC || !((1 << mode) & ar2->mode_mask)) | 485 | if (mode > ATI_REMOTE2_PC || !((1 << mode) & ar2->mode_mask)) |
| @@ -491,10 +493,12 @@ static int ati_remote2_getkeycode(struct input_dev *idev, | |||
| 491 | return 0; | 493 | return 0; |
| 492 | } | 494 | } |
| 493 | 495 | ||
| 494 | static int ati_remote2_setkeycode(struct input_dev *idev, int scancode, int keycode) | 496 | static int ati_remote2_setkeycode(struct input_dev *idev, |
| 497 | unsigned int scancode, unsigned int keycode) | ||
| 495 | { | 498 | { |
| 496 | struct ati_remote2 *ar2 = input_get_drvdata(idev); | 499 | struct ati_remote2 *ar2 = input_get_drvdata(idev); |
| 497 | int index, mode, old_keycode; | 500 | unsigned int mode, old_keycode; |
| 501 | int index; | ||
| 498 | 502 | ||
| 499 | mode = scancode >> 8; | 503 | mode = scancode >> 8; |
| 500 | if (mode > ATI_REMOTE2_PC || !((1 << mode) & ar2->mode_mask)) | 504 | if (mode > ATI_REMOTE2_PC || !((1 << mode) & ar2->mode_mask)) |
| @@ -504,9 +508,6 @@ static int ati_remote2_setkeycode(struct input_dev *idev, int scancode, int keyc | |||
| 504 | if (index < 0) | 508 | if (index < 0) |
| 505 | return -EINVAL; | 509 | return -EINVAL; |
| 506 | 510 | ||
| 507 | if (keycode < KEY_RESERVED || keycode > KEY_MAX) | ||
| 508 | return -EINVAL; | ||
| 509 | |||
| 510 | old_keycode = ar2->keycode[mode][index]; | 511 | old_keycode = ar2->keycode[mode][index]; |
| 511 | ar2->keycode[mode][index] = keycode; | 512 | ar2->keycode[mode][index] = keycode; |
| 512 | __set_bit(keycode, idev->keybit); | 513 | __set_bit(keycode, idev->keybit); |
diff --git a/drivers/input/misc/bfin_rotary.c b/drivers/input/misc/bfin_rotary.c index 61d10177fa83..4f72bdd69410 100644 --- a/drivers/input/misc/bfin_rotary.c +++ b/drivers/input/misc/bfin_rotary.c | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #include <linux/pm.h> | 13 | #include <linux/pm.h> |
| 14 | #include <linux/platform_device.h> | 14 | #include <linux/platform_device.h> |
| 15 | #include <linux/input.h> | 15 | #include <linux/input.h> |
| 16 | #include <linux/slab.h> | ||
| 16 | 17 | ||
| 17 | #include <asm/portmux.h> | 18 | #include <asm/portmux.h> |
| 18 | #include <asm/bfin_rotary.h> | 19 | #include <asm/bfin_rotary.h> |
diff --git a/drivers/input/misc/cobalt_btns.c b/drivers/input/misc/cobalt_btns.c index ee73d7219c92..fd8407a29631 100644 --- a/drivers/input/misc/cobalt_btns.c +++ b/drivers/input/misc/cobalt_btns.c | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #include <linux/ioport.h> | 22 | #include <linux/ioport.h> |
| 23 | #include <linux/module.h> | 23 | #include <linux/module.h> |
| 24 | #include <linux/platform_device.h> | 24 | #include <linux/platform_device.h> |
| 25 | #include <linux/slab.h> | ||
| 25 | 26 | ||
| 26 | #define BUTTONS_POLL_INTERVAL 30 /* msec */ | 27 | #define BUTTONS_POLL_INTERVAL 30 /* msec */ |
| 27 | #define BUTTONS_COUNT_THRESHOLD 3 | 28 | #define BUTTONS_COUNT_THRESHOLD 3 |
diff --git a/drivers/input/misc/dm355evm_keys.c b/drivers/input/misc/dm355evm_keys.c index 766c06911f41..19af682c24fb 100644 --- a/drivers/input/misc/dm355evm_keys.c +++ b/drivers/input/misc/dm355evm_keys.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | */ | 10 | */ |
| 11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
| 12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
| 13 | #include <linux/slab.h> | ||
| 13 | #include <linux/input.h> | 14 | #include <linux/input.h> |
| 14 | #include <linux/input/sparse-keymap.h> | 15 | #include <linux/input/sparse-keymap.h> |
| 15 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
diff --git a/drivers/input/misc/pcap_keys.c b/drivers/input/misc/pcap_keys.c index 7ea969347ca9..99335c286250 100644 --- a/drivers/input/misc/pcap_keys.c +++ b/drivers/input/misc/pcap_keys.c | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
| 18 | #include <linux/input.h> | 18 | #include <linux/input.h> |
| 19 | #include <linux/mfd/ezx-pcap.h> | 19 | #include <linux/mfd/ezx-pcap.h> |
| 20 | #include <linux/slab.h> | ||
| 20 | 21 | ||
| 21 | struct pcap_keys { | 22 | struct pcap_keys { |
| 22 | struct pcap_chip *pcap; | 23 | struct pcap_chip *pcap; |
diff --git a/drivers/input/misc/pcf50633-input.c b/drivers/input/misc/pcf50633-input.c index 008de0c5834b..95562735728d 100644 --- a/drivers/input/misc/pcf50633-input.c +++ b/drivers/input/misc/pcf50633-input.c | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #include <linux/device.h> | 20 | #include <linux/device.h> |
| 21 | #include <linux/platform_device.h> | 21 | #include <linux/platform_device.h> |
| 22 | #include <linux/input.h> | 22 | #include <linux/input.h> |
| 23 | #include <linux/slab.h> | ||
| 23 | 24 | ||
| 24 | #include <linux/mfd/pcf50633/core.h> | 25 | #include <linux/mfd/pcf50633/core.h> |
| 25 | 26 | ||
diff --git a/drivers/input/misc/rotary_encoder.c b/drivers/input/misc/rotary_encoder.c index 4ae07935985e..1f8e0108962e 100644 --- a/drivers/input/misc/rotary_encoder.c +++ b/drivers/input/misc/rotary_encoder.c | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #include <linux/platform_device.h> | 22 | #include <linux/platform_device.h> |
| 23 | #include <linux/gpio.h> | 23 | #include <linux/gpio.h> |
| 24 | #include <linux/rotary_encoder.h> | 24 | #include <linux/rotary_encoder.h> |
| 25 | #include <linux/slab.h> | ||
| 25 | 26 | ||
| 26 | #define DRV_NAME "rotary-encoder" | 27 | #define DRV_NAME "rotary-encoder" |
| 27 | 28 | ||
diff --git a/drivers/input/misc/sgi_btns.c b/drivers/input/misc/sgi_btns.c index be3a15f5b25d..1a80c0dab83b 100644 --- a/drivers/input/misc/sgi_btns.c +++ b/drivers/input/misc/sgi_btns.c | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #include <linux/ioport.h> | 22 | #include <linux/ioport.h> |
| 23 | #include <linux/module.h> | 23 | #include <linux/module.h> |
| 24 | #include <linux/platform_device.h> | 24 | #include <linux/platform_device.h> |
| 25 | #include <linux/slab.h> | ||
| 25 | 26 | ||
| 26 | #ifdef CONFIG_SGI_IP22 | 27 | #ifdef CONFIG_SGI_IP22 |
| 27 | #include <asm/sgi/ioc.h> | 28 | #include <asm/sgi/ioc.h> |
diff --git a/drivers/input/misc/sparcspkr.c b/drivers/input/misc/sparcspkr.c index b064419b90a2..0d45422f8095 100644 --- a/drivers/input/misc/sparcspkr.c +++ b/drivers/input/misc/sparcspkr.c | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | #include <linux/init.h> | 9 | #include <linux/init.h> |
| 10 | #include <linux/input.h> | 10 | #include <linux/input.h> |
| 11 | #include <linux/of_device.h> | 11 | #include <linux/of_device.h> |
| 12 | #include <linux/slab.h> | ||
| 12 | 13 | ||
| 13 | #include <asm/io.h> | 14 | #include <asm/io.h> |
| 14 | 15 | ||
diff --git a/drivers/input/misc/twl4030-vibra.c b/drivers/input/misc/twl4030-vibra.c new file mode 100644 index 000000000000..fee9eac8e04a --- /dev/null +++ b/drivers/input/misc/twl4030-vibra.c | |||
| @@ -0,0 +1,298 @@ | |||
| 1 | /* | ||
| 2 | * twl4030-vibra.c - TWL4030 Vibrator driver | ||
| 3 | * | ||
| 4 | * Copyright (C) 2008-2010 Nokia Corporation | ||
| 5 | * | ||
| 6 | * Written by Henrik Saari <henrik.saari@nokia.com> | ||
| 7 | * Updates by Felipe Balbi <felipe.balbi@nokia.com> | ||
| 8 | * Input by Jari Vanhala <ext-jari.vanhala@nokia.com> | ||
| 9 | * | ||
| 10 | * This program is free software; you can redistribute it and/or modify | ||
| 11 | * it under the terms of the GNU General Public License version 2 as | ||
| 12 | * published by the Free Software Foundation. | ||
| 13 | * | ||
| 14 | * This program is distributed in the hope that it will be useful, but | ||
| 15 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 17 | * General Public License for more details. | ||
| 18 | * | ||
| 19 | * You should have received a copy of the GNU General Public License | ||
| 20 | * along with this program; if not, write to the Free Software | ||
| 21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
| 22 | * 02110-1301 USA | ||
| 23 | * | ||
| 24 | */ | ||
| 25 | |||
| 26 | #include <linux/module.h> | ||
| 27 | #include <linux/jiffies.h> | ||
| 28 | #include <linux/platform_device.h> | ||
| 29 | #include <linux/workqueue.h> | ||
| 30 | #include <linux/i2c/twl.h> | ||
| 31 | #include <linux/mfd/twl4030-codec.h> | ||
| 32 | #include <linux/input.h> | ||
| 33 | #include <linux/slab.h> | ||
| 34 | |||
| 35 | /* MODULE ID2 */ | ||
| 36 | #define LEDEN 0x00 | ||
| 37 | |||
| 38 | /* ForceFeedback */ | ||
| 39 | #define EFFECT_DIR_180_DEG 0x8000 /* range is 0 - 0xFFFF */ | ||
| 40 | |||
| 41 | struct vibra_info { | ||
| 42 | struct device *dev; | ||
| 43 | struct input_dev *input_dev; | ||
| 44 | |||
| 45 | struct workqueue_struct *workqueue; | ||
| 46 | struct work_struct play_work; | ||
| 47 | |||
| 48 | bool enabled; | ||
| 49 | int speed; | ||
| 50 | int direction; | ||
| 51 | |||
| 52 | bool coexist; | ||
| 53 | }; | ||
| 54 | |||
| 55 | static void vibra_disable_leds(void) | ||
| 56 | { | ||
| 57 | u8 reg; | ||
| 58 | |||
| 59 | /* Disable LEDA & LEDB, cannot be used with vibra (PWM) */ | ||
| 60 | twl_i2c_read_u8(TWL4030_MODULE_LED, ®, LEDEN); | ||
| 61 | reg &= ~0x03; | ||
| 62 | twl_i2c_write_u8(TWL4030_MODULE_LED, LEDEN, reg); | ||
| 63 | } | ||
| 64 | |||
| 65 | /* Powers H-Bridge and enables audio clk */ | ||
| 66 | static void vibra_enable(struct vibra_info *info) | ||
| 67 | { | ||
| 68 | u8 reg; | ||
| 69 | |||
| 70 | twl4030_codec_enable_resource(TWL4030_CODEC_RES_POWER); | ||
| 71 | |||
| 72 | /* turn H-Bridge on */ | ||
| 73 | twl_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE, | ||
| 74 | ®, TWL4030_REG_VIBRA_CTL); | ||
| 75 | twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE, | ||
| 76 | (reg | TWL4030_VIBRA_EN), TWL4030_REG_VIBRA_CTL); | ||
| 77 | |||
| 78 | twl4030_codec_enable_resource(TWL4030_CODEC_RES_APLL); | ||
| 79 | |||
| 80 | info->enabled = true; | ||
| 81 | } | ||
| 82 | |||
| 83 | static void vibra_disable(struct vibra_info *info) | ||
| 84 | { | ||
| 85 | u8 reg; | ||
| 86 | |||
| 87 | /* Power down H-Bridge */ | ||
| 88 | twl_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE, | ||
| 89 | ®, TWL4030_REG_VIBRA_CTL); | ||
| 90 | twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE, | ||
| 91 | (reg & ~TWL4030_VIBRA_EN), TWL4030_REG_VIBRA_CTL); | ||
| 92 | |||
| 93 | twl4030_codec_disable_resource(TWL4030_CODEC_RES_POWER); | ||
| 94 | twl4030_codec_disable_resource(TWL4030_CODEC_RES_APLL); | ||
| 95 | |||
| 96 | info->enabled = false; | ||
| 97 | } | ||
| 98 | |||
| 99 | static void vibra_play_work(struct work_struct *work) | ||
| 100 | { | ||
| 101 | struct vibra_info *info = container_of(work, | ||
| 102 | struct vibra_info, play_work); | ||
| 103 | int dir; | ||
| 104 | int pwm; | ||
| 105 | u8 reg; | ||
| 106 | |||
| 107 | dir = info->direction; | ||
| 108 | pwm = info->speed; | ||
| 109 | |||
| 110 | twl_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE, | ||
| 111 | ®, TWL4030_REG_VIBRA_CTL); | ||
| 112 | if (pwm && (!info->coexist || !(reg & TWL4030_VIBRA_SEL))) { | ||
| 113 | |||
| 114 | if (!info->enabled) | ||
| 115 | vibra_enable(info); | ||
| 116 | |||
| 117 | /* set vibra rotation direction */ | ||
| 118 | twl_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE, | ||
| 119 | ®, TWL4030_REG_VIBRA_CTL); | ||
| 120 | reg = (dir) ? (reg | TWL4030_VIBRA_DIR) : | ||
| 121 | (reg & ~TWL4030_VIBRA_DIR); | ||
| 122 | twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE, | ||
| 123 | reg, TWL4030_REG_VIBRA_CTL); | ||
| 124 | |||
| 125 | /* set PWM, 1 = max, 255 = min */ | ||
| 126 | twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE, | ||
| 127 | 256 - pwm, TWL4030_REG_VIBRA_SET); | ||
| 128 | } else { | ||
| 129 | if (info->enabled) | ||
| 130 | vibra_disable(info); | ||
| 131 | } | ||
| 132 | } | ||
| 133 | |||
| 134 | /*** Input/ForceFeedback ***/ | ||
| 135 | |||
| 136 | static int vibra_play(struct input_dev *input, void *data, | ||
| 137 | struct ff_effect *effect) | ||
| 138 | { | ||
| 139 | struct vibra_info *info = input_get_drvdata(input); | ||
| 140 | |||
| 141 | info->speed = effect->u.rumble.strong_magnitude >> 8; | ||
| 142 | if (!info->speed) | ||
| 143 | info->speed = effect->u.rumble.weak_magnitude >> 9; | ||
| 144 | info->direction = effect->direction < EFFECT_DIR_180_DEG ? 0 : 1; | ||
| 145 | queue_work(info->workqueue, &info->play_work); | ||
| 146 | return 0; | ||
| 147 | } | ||
| 148 | |||
| 149 | static int twl4030_vibra_open(struct input_dev *input) | ||
| 150 | { | ||
| 151 | struct vibra_info *info = input_get_drvdata(input); | ||
| 152 | |||
| 153 | info->workqueue = create_singlethread_workqueue("vibra"); | ||
| 154 | if (info->workqueue == NULL) { | ||
| 155 | dev_err(&input->dev, "couldn't create workqueue\n"); | ||
| 156 | return -ENOMEM; | ||
| 157 | } | ||
| 158 | return 0; | ||
| 159 | } | ||
| 160 | |||
| 161 | static void twl4030_vibra_close(struct input_dev *input) | ||
| 162 | { | ||
| 163 | struct vibra_info *info = input_get_drvdata(input); | ||
| 164 | |||
| 165 | cancel_work_sync(&info->play_work); | ||
| 166 | INIT_WORK(&info->play_work, vibra_play_work); /* cleanup */ | ||
| 167 | destroy_workqueue(info->workqueue); | ||
| 168 | info->workqueue = NULL; | ||
| 169 | |||
| 170 | if (info->enabled) | ||
| 171 | vibra_disable(info); | ||
| 172 | } | ||
| 173 | |||
| 174 | /*** Module ***/ | ||
| 175 | #if CONFIG_PM | ||
| 176 | static int twl4030_vibra_suspend(struct device *dev) | ||
| 177 | { | ||
| 178 | struct platform_device *pdev = to_platform_device(dev); | ||
| 179 | struct vibra_info *info = platform_get_drvdata(pdev); | ||
| 180 | |||
| 181 | if (info->enabled) | ||
| 182 | vibra_disable(info); | ||
| 183 | |||
| 184 | return 0; | ||
| 185 | } | ||
| 186 | |||
| 187 | static int twl4030_vibra_resume(struct device *dev) | ||
| 188 | { | ||
| 189 | vibra_disable_leds(); | ||
| 190 | return 0; | ||
| 191 | } | ||
| 192 | |||
| 193 | static SIMPLE_DEV_PM_OPS(twl4030_vibra_pm_ops, | ||
| 194 | twl4030_vibra_suspend, twl4030_vibra_resume); | ||
| 195 | #endif | ||
| 196 | |||
| 197 | static int __devinit twl4030_vibra_probe(struct platform_device *pdev) | ||
| 198 | { | ||
| 199 | struct twl4030_codec_vibra_data *pdata = pdev->dev.platform_data; | ||
| 200 | struct vibra_info *info; | ||
| 201 | int ret; | ||
| 202 | |||
| 203 | if (!pdata) { | ||
| 204 | dev_dbg(&pdev->dev, "platform_data not available\n"); | ||
| 205 | return -EINVAL; | ||
| 206 | } | ||
| 207 | |||
| 208 | info = kzalloc(sizeof(*info), GFP_KERNEL); | ||
| 209 | if (!info) | ||
| 210 | return -ENOMEM; | ||
| 211 | |||
| 212 | info->dev = &pdev->dev; | ||
| 213 | info->coexist = pdata->coexist; | ||
| 214 | INIT_WORK(&info->play_work, vibra_play_work); | ||
| 215 | |||
| 216 | info->input_dev = input_allocate_device(); | ||
| 217 | if (info->input_dev == NULL) { | ||
| 218 | dev_err(&pdev->dev, "couldn't allocate input device\n"); | ||
| 219 | ret = -ENOMEM; | ||
| 220 | goto err_kzalloc; | ||
| 221 | } | ||
| 222 | |||
| 223 | input_set_drvdata(info->input_dev, info); | ||
| 224 | |||
| 225 | info->input_dev->name = "twl4030:vibrator"; | ||
| 226 | info->input_dev->id.version = 1; | ||
| 227 | info->input_dev->dev.parent = pdev->dev.parent; | ||
| 228 | info->input_dev->open = twl4030_vibra_open; | ||
| 229 | info->input_dev->close = twl4030_vibra_close; | ||
| 230 | __set_bit(FF_RUMBLE, info->input_dev->ffbit); | ||
| 231 | |||
| 232 | ret = input_ff_create_memless(info->input_dev, NULL, vibra_play); | ||
| 233 | if (ret < 0) { | ||
| 234 | dev_dbg(&pdev->dev, "couldn't register vibrator to FF\n"); | ||
| 235 | goto err_ialloc; | ||
| 236 | } | ||
| 237 | |||
| 238 | ret = input_register_device(info->input_dev); | ||
| 239 | if (ret < 0) { | ||
| 240 | dev_dbg(&pdev->dev, "couldn't register input device\n"); | ||
| 241 | goto err_iff; | ||
| 242 | } | ||
| 243 | |||
| 244 | vibra_disable_leds(); | ||
| 245 | |||
| 246 | platform_set_drvdata(pdev, info); | ||
| 247 | return 0; | ||
| 248 | |||
| 249 | err_iff: | ||
| 250 | input_ff_destroy(info->input_dev); | ||
| 251 | err_ialloc: | ||
| 252 | input_free_device(info->input_dev); | ||
| 253 | err_kzalloc: | ||
| 254 | kfree(info); | ||
| 255 | return ret; | ||
| 256 | } | ||
| 257 | |||
| 258 | static int __devexit twl4030_vibra_remove(struct platform_device *pdev) | ||
| 259 | { | ||
| 260 | struct vibra_info *info = platform_get_drvdata(pdev); | ||
| 261 | |||
| 262 | /* this also free ff-memless and calls close if needed */ | ||
| 263 | input_unregister_device(info->input_dev); | ||
| 264 | kfree(info); | ||
| 265 | platform_set_drvdata(pdev, NULL); | ||
| 266 | |||
| 267 | return 0; | ||
| 268 | } | ||
| 269 | |||
| 270 | static struct platform_driver twl4030_vibra_driver = { | ||
| 271 | .probe = twl4030_vibra_probe, | ||
| 272 | .remove = __devexit_p(twl4030_vibra_remove), | ||
| 273 | .driver = { | ||
| 274 | .name = "twl4030_codec_vibra", | ||
| 275 | .owner = THIS_MODULE, | ||
| 276 | #ifdef CONFIG_PM | ||
| 277 | .pm = &twl4030_vibra_pm_ops, | ||
| 278 | #endif | ||
| 279 | }, | ||
| 280 | }; | ||
| 281 | |||
| 282 | static int __init twl4030_vibra_init(void) | ||
| 283 | { | ||
| 284 | return platform_driver_register(&twl4030_vibra_driver); | ||
| 285 | } | ||
| 286 | module_init(twl4030_vibra_init); | ||
| 287 | |||
| 288 | static void __exit twl4030_vibra_exit(void) | ||
| 289 | { | ||
| 290 | platform_driver_unregister(&twl4030_vibra_driver); | ||
| 291 | } | ||
| 292 | module_exit(twl4030_vibra_exit); | ||
| 293 | |||
| 294 | MODULE_ALIAS("platform:twl4030_codec_vibra"); | ||
| 295 | |||
| 296 | MODULE_DESCRIPTION("TWL4030 Vibra driver"); | ||
| 297 | MODULE_LICENSE("GPL"); | ||
| 298 | MODULE_AUTHOR("Nokia Corporation"); | ||
diff --git a/drivers/input/misc/winbond-cir.c b/drivers/input/misc/winbond-cir.c index cbec3dfdd42b..64f1de7960c6 100644 --- a/drivers/input/misc/winbond-cir.c +++ b/drivers/input/misc/winbond-cir.c | |||
| @@ -56,6 +56,7 @@ | |||
| 56 | #include <linux/io.h> | 56 | #include <linux/io.h> |
| 57 | #include <linux/bitrev.h> | 57 | #include <linux/bitrev.h> |
| 58 | #include <linux/bitops.h> | 58 | #include <linux/bitops.h> |
| 59 | #include <linux/slab.h> | ||
| 59 | 60 | ||
| 60 | #define DRVNAME "winbond-cir" | 61 | #define DRVNAME "winbond-cir" |
| 61 | 62 | ||
| @@ -385,26 +386,24 @@ wbcir_do_getkeycode(struct wbcir_data *data, u32 scancode) | |||
| 385 | } | 386 | } |
| 386 | 387 | ||
| 387 | static int | 388 | static int |
| 388 | wbcir_getkeycode(struct input_dev *dev, int scancode, int *keycode) | 389 | wbcir_getkeycode(struct input_dev *dev, |
| 390 | unsigned int scancode, unsigned int *keycode) | ||
| 389 | { | 391 | { |
| 390 | struct wbcir_data *data = input_get_drvdata(dev); | 392 | struct wbcir_data *data = input_get_drvdata(dev); |
| 391 | 393 | ||
| 392 | *keycode = (int)wbcir_do_getkeycode(data, (u32)scancode); | 394 | *keycode = wbcir_do_getkeycode(data, scancode); |
| 393 | return 0; | 395 | return 0; |
| 394 | } | 396 | } |
| 395 | 397 | ||
| 396 | static int | 398 | static int |
| 397 | wbcir_setkeycode(struct input_dev *dev, int sscancode, int keycode) | 399 | wbcir_setkeycode(struct input_dev *dev, |
| 400 | unsigned int scancode, unsigned int keycode) | ||
| 398 | { | 401 | { |
| 399 | struct wbcir_data *data = input_get_drvdata(dev); | 402 | struct wbcir_data *data = input_get_drvdata(dev); |
| 400 | struct wbcir_keyentry *keyentry; | 403 | struct wbcir_keyentry *keyentry; |
| 401 | struct wbcir_keyentry *new_keyentry; | 404 | struct wbcir_keyentry *new_keyentry; |
| 402 | unsigned long flags; | 405 | unsigned long flags; |
| 403 | unsigned int old_keycode = KEY_RESERVED; | 406 | unsigned int old_keycode = KEY_RESERVED; |
| 404 | u32 scancode = (u32)sscancode; | ||
| 405 | |||
| 406 | if (keycode < 0 || keycode > KEY_MAX) | ||
| 407 | return -EINVAL; | ||
| 408 | 407 | ||
| 409 | new_keyentry = kmalloc(sizeof(*new_keyentry), GFP_KERNEL); | 408 | new_keyentry = kmalloc(sizeof(*new_keyentry), GFP_KERNEL); |
| 410 | if (!new_keyentry) | 409 | if (!new_keyentry) |
diff --git a/drivers/input/misc/wistron_btns.c b/drivers/input/misc/wistron_btns.c index c0afb71a3a6d..04d5a4a3181f 100644 --- a/drivers/input/misc/wistron_btns.c +++ b/drivers/input/misc/wistron_btns.c | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | #include <linux/module.h> | 29 | #include <linux/module.h> |
| 30 | #include <linux/preempt.h> | 30 | #include <linux/preempt.h> |
| 31 | #include <linux/string.h> | 31 | #include <linux/string.h> |
| 32 | #include <linux/slab.h> | ||
| 32 | #include <linux/types.h> | 33 | #include <linux/types.h> |
| 33 | #include <linux/platform_device.h> | 34 | #include <linux/platform_device.h> |
| 34 | #include <linux/leds.h> | 35 | #include <linux/leds.h> |
diff --git a/drivers/input/misc/wm831x-on.c b/drivers/input/misc/wm831x-on.c index ba4f5dd7c60e..c3d7ba5f5b47 100644 --- a/drivers/input/misc/wm831x-on.c +++ b/drivers/input/misc/wm831x-on.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | 19 | ||
| 20 | #include <linux/module.h> | 20 | #include <linux/module.h> |
| 21 | #include <linux/init.h> | 21 | #include <linux/init.h> |
| 22 | #include <linux/slab.h> | ||
| 22 | #include <linux/kernel.h> | 23 | #include <linux/kernel.h> |
| 23 | #include <linux/errno.h> | 24 | #include <linux/errno.h> |
| 24 | #include <linux/input.h> | 25 | #include <linux/input.h> |
| @@ -97,8 +98,9 @@ static int __devinit wm831x_on_probe(struct platform_device *pdev) | |||
| 97 | wm831x_on->dev->phys = "wm831x_on/input0"; | 98 | wm831x_on->dev->phys = "wm831x_on/input0"; |
| 98 | wm831x_on->dev->dev.parent = &pdev->dev; | 99 | wm831x_on->dev->dev.parent = &pdev->dev; |
| 99 | 100 | ||
| 100 | ret = wm831x_request_irq(wm831x, irq, wm831x_on_irq, | 101 | ret = request_threaded_irq(irq, NULL, wm831x_on_irq, |
| 101 | IRQF_TRIGGER_RISING, "wm831x_on", wm831x_on); | 102 | IRQF_TRIGGER_RISING, "wm831x_on", |
| 103 | wm831x_on); | ||
| 102 | if (ret < 0) { | 104 | if (ret < 0) { |
| 103 | dev_err(&pdev->dev, "Unable to request IRQ: %d\n", ret); | 105 | dev_err(&pdev->dev, "Unable to request IRQ: %d\n", ret); |
| 104 | goto err_input_dev; | 106 | goto err_input_dev; |
| @@ -114,7 +116,7 @@ static int __devinit wm831x_on_probe(struct platform_device *pdev) | |||
| 114 | return 0; | 116 | return 0; |
| 115 | 117 | ||
| 116 | err_irq: | 118 | err_irq: |
| 117 | wm831x_free_irq(wm831x, irq, NULL); | 119 | free_irq(irq, wm831x_on); |
| 118 | err_input_dev: | 120 | err_input_dev: |
| 119 | input_free_device(wm831x_on->dev); | 121 | input_free_device(wm831x_on->dev); |
| 120 | err: | 122 | err: |
| @@ -127,7 +129,7 @@ static int __devexit wm831x_on_remove(struct platform_device *pdev) | |||
| 127 | struct wm831x_on *wm831x_on = platform_get_drvdata(pdev); | 129 | struct wm831x_on *wm831x_on = platform_get_drvdata(pdev); |
| 128 | int irq = platform_get_irq(pdev, 0); | 130 | int irq = platform_get_irq(pdev, 0); |
| 129 | 131 | ||
| 130 | wm831x_free_irq(wm831x_on->wm831x, irq, wm831x_on); | 132 | free_irq(irq, wm831x_on); |
| 131 | cancel_delayed_work_sync(&wm831x_on->work); | 133 | cancel_delayed_work_sync(&wm831x_on->work); |
| 132 | input_unregister_device(wm831x_on->dev); | 134 | input_unregister_device(wm831x_on->dev); |
| 133 | kfree(wm831x_on); | 135 | kfree(wm831x_on); |
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index f93c2c0daf1f..0d22cb9ce42e 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | * the Free Software Foundation. | 15 | * the Free Software Foundation. |
| 16 | */ | 16 | */ |
| 17 | 17 | ||
| 18 | #include <linux/slab.h> | ||
| 18 | #include <linux/input.h> | 19 | #include <linux/input.h> |
| 19 | #include <linux/serio.h> | 20 | #include <linux/serio.h> |
| 20 | #include <linux/libps2.h> | 21 | #include <linux/libps2.h> |
| @@ -63,6 +64,9 @@ static const struct alps_model_info alps_model_data[] = { | |||
| 63 | { { 0x62, 0x02, 0x14 }, 0xcf, 0xcf, | 64 | { { 0x62, 0x02, 0x14 }, 0xcf, 0xcf, |
| 64 | ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED }, | 65 | ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED }, |
| 65 | { { 0x73, 0x02, 0x50 }, 0xcf, 0xcf, ALPS_FOUR_BUTTONS }, /* Dell Vostro 1400 */ | 66 | { { 0x73, 0x02, 0x50 }, 0xcf, 0xcf, ALPS_FOUR_BUTTONS }, /* Dell Vostro 1400 */ |
| 67 | { { 0x73, 0x02, 0x64 }, 0xf8, 0xf8, 0 }, /* HP Pavilion dm3 */ | ||
| 68 | { { 0x52, 0x01, 0x14 }, 0xff, 0xff, | ||
| 69 | ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED }, /* Toshiba Tecra A11-11L */ | ||
| 66 | }; | 70 | }; |
| 67 | 71 | ||
| 68 | /* | 72 | /* |
| @@ -118,40 +122,27 @@ static void alps_report_buttons(struct psmouse *psmouse, | |||
| 118 | struct input_dev *dev1, struct input_dev *dev2, | 122 | struct input_dev *dev1, struct input_dev *dev2, |
| 119 | int left, int right, int middle) | 123 | int left, int right, int middle) |
| 120 | { | 124 | { |
| 121 | struct alps_data *priv = psmouse->private; | 125 | struct input_dev *dev; |
| 122 | const struct alps_model_info *model = priv->i; | ||
| 123 | |||
| 124 | if (model->flags & ALPS_PS2_INTERLEAVED) { | ||
| 125 | struct input_dev *dev; | ||
| 126 | 126 | ||
| 127 | /* | 127 | /* |
| 128 | * If shared button has already been reported on the | 128 | * If shared button has already been reported on the |
| 129 | * other device (dev2) then this event should be also | 129 | * other device (dev2) then this event should be also |
| 130 | * sent through that device. | 130 | * sent through that device. |
| 131 | */ | 131 | */ |
| 132 | dev = test_bit(BTN_LEFT, dev2->key) ? dev2 : dev1; | 132 | dev = test_bit(BTN_LEFT, dev2->key) ? dev2 : dev1; |
| 133 | input_report_key(dev, BTN_LEFT, left); | 133 | input_report_key(dev, BTN_LEFT, left); |
| 134 | 134 | ||
| 135 | dev = test_bit(BTN_RIGHT, dev2->key) ? dev2 : dev1; | 135 | dev = test_bit(BTN_RIGHT, dev2->key) ? dev2 : dev1; |
| 136 | input_report_key(dev, BTN_RIGHT, right); | 136 | input_report_key(dev, BTN_RIGHT, right); |
| 137 | 137 | ||
| 138 | dev = test_bit(BTN_MIDDLE, dev2->key) ? dev2 : dev1; | 138 | dev = test_bit(BTN_MIDDLE, dev2->key) ? dev2 : dev1; |
| 139 | input_report_key(dev, BTN_MIDDLE, middle); | 139 | input_report_key(dev, BTN_MIDDLE, middle); |
| 140 | 140 | ||
| 141 | /* | 141 | /* |
| 142 | * Sync the _other_ device now, we'll do the first | 142 | * Sync the _other_ device now, we'll do the first |
| 143 | * device later once we report the rest of the events. | 143 | * device later once we report the rest of the events. |
| 144 | */ | 144 | */ |
| 145 | input_sync(dev2); | 145 | input_sync(dev2); |
| 146 | } else { | ||
| 147 | /* | ||
| 148 | * For devices with non-interleaved packets we know what | ||
| 149 | * device buttons belong to so we can simply report them. | ||
| 150 | */ | ||
| 151 | input_report_key(dev1, BTN_LEFT, left); | ||
| 152 | input_report_key(dev1, BTN_RIGHT, right); | ||
| 153 | input_report_key(dev1, BTN_MIDDLE, middle); | ||
| 154 | } | ||
| 155 | } | 146 | } |
| 156 | 147 | ||
| 157 | static void alps_process_packet(struct psmouse *psmouse) | 148 | static void alps_process_packet(struct psmouse *psmouse) |
diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c index 908b5b44052f..53ec7ddd1826 100644 --- a/drivers/input/mouse/appletouch.c +++ b/drivers/input/mouse/appletouch.c | |||
| @@ -205,8 +205,8 @@ struct atp { | |||
| 205 | bool overflow_warned; | 205 | bool overflow_warned; |
| 206 | int x_old; /* last reported x/y, */ | 206 | int x_old; /* last reported x/y, */ |
| 207 | int y_old; /* used for smoothing */ | 207 | int y_old; /* used for smoothing */ |
| 208 | signed char xy_cur[ATP_XSENSORS + ATP_YSENSORS]; | 208 | u8 xy_cur[ATP_XSENSORS + ATP_YSENSORS]; |
| 209 | signed char xy_old[ATP_XSENSORS + ATP_YSENSORS]; | 209 | u8 xy_old[ATP_XSENSORS + ATP_YSENSORS]; |
| 210 | int xy_acc[ATP_XSENSORS + ATP_YSENSORS]; | 210 | int xy_acc[ATP_XSENSORS + ATP_YSENSORS]; |
| 211 | int idlecount; /* number of empty packets */ | 211 | int idlecount; /* number of empty packets */ |
| 212 | struct work_struct work; | 212 | struct work_struct work; |
| @@ -531,7 +531,7 @@ static void atp_complete_geyser_1_2(struct urb *urb) | |||
| 531 | 531 | ||
| 532 | for (i = 0; i < ATP_XSENSORS + ATP_YSENSORS; i++) { | 532 | for (i = 0; i < ATP_XSENSORS + ATP_YSENSORS; i++) { |
| 533 | /* accumulate the change */ | 533 | /* accumulate the change */ |
| 534 | signed char change = dev->xy_old[i] - dev->xy_cur[i]; | 534 | int change = dev->xy_old[i] - dev->xy_cur[i]; |
| 535 | dev->xy_acc[i] -= change; | 535 | dev->xy_acc[i] -= change; |
| 536 | 536 | ||
| 537 | /* prevent down drifting */ | 537 | /* prevent down drifting */ |
diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c index 4f8fe0886b2a..b89879bd860f 100644 --- a/drivers/input/mouse/bcm5974.c +++ b/drivers/input/mouse/bcm5974.c | |||
| @@ -803,7 +803,6 @@ static struct usb_driver bcm5974_driver = { | |||
| 803 | .disconnect = bcm5974_disconnect, | 803 | .disconnect = bcm5974_disconnect, |
| 804 | .suspend = bcm5974_suspend, | 804 | .suspend = bcm5974_suspend, |
| 805 | .resume = bcm5974_resume, | 805 | .resume = bcm5974_resume, |
| 806 | .reset_resume = bcm5974_resume, | ||
| 807 | .id_table = bcm5974_table, | 806 | .id_table = bcm5974_table, |
| 808 | .supports_autosuspend = 1, | 807 | .supports_autosuspend = 1, |
| 809 | }; | 808 | }; |
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c index b27684f267bf..a138b5da79f9 100644 --- a/drivers/input/mouse/elantech.c +++ b/drivers/input/mouse/elantech.c | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | */ | 11 | */ |
| 12 | 12 | ||
| 13 | #include <linux/delay.h> | 13 | #include <linux/delay.h> |
| 14 | #include <linux/slab.h> | ||
| 14 | #include <linux/module.h> | 15 | #include <linux/module.h> |
| 15 | #include <linux/input.h> | 16 | #include <linux/input.h> |
| 16 | #include <linux/serio.h> | 17 | #include <linux/serio.h> |
diff --git a/drivers/input/mouse/hgpk.c b/drivers/input/mouse/hgpk.c index 9169d1591c1f..08d66d820d2b 100644 --- a/drivers/input/mouse/hgpk.c +++ b/drivers/input/mouse/hgpk.c | |||
| @@ -30,6 +30,7 @@ | |||
| 30 | */ | 30 | */ |
| 31 | 31 | ||
| 32 | #define DEBUG | 32 | #define DEBUG |
| 33 | #include <linux/slab.h> | ||
| 33 | #include <linux/input.h> | 34 | #include <linux/input.h> |
| 34 | #include <linux/serio.h> | 35 | #include <linux/serio.h> |
| 35 | #include <linux/libps2.h> | 36 | #include <linux/libps2.h> |
diff --git a/drivers/input/mouse/lifebook.c b/drivers/input/mouse/lifebook.c index 7c1d7d420ae3..c31ad11df6bb 100644 --- a/drivers/input/mouse/lifebook.c +++ b/drivers/input/mouse/lifebook.c | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | #include <linux/serio.h> | 16 | #include <linux/serio.h> |
| 17 | #include <linux/libps2.h> | 17 | #include <linux/libps2.h> |
| 18 | #include <linux/dmi.h> | 18 | #include <linux/dmi.h> |
| 19 | #include <linux/slab.h> | ||
| 19 | 20 | ||
| 20 | #include "psmouse.h" | 21 | #include "psmouse.h" |
| 21 | #include "lifebook.h" | 22 | #include "lifebook.h" |
diff --git a/drivers/input/mouse/pxa930_trkball.c b/drivers/input/mouse/pxa930_trkball.c index 1e827ad0afbe..943cfec15665 100644 --- a/drivers/input/mouse/pxa930_trkball.c +++ b/drivers/input/mouse/pxa930_trkball.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <linux/platform_device.h> | 18 | #include <linux/platform_device.h> |
| 19 | #include <linux/delay.h> | 19 | #include <linux/delay.h> |
| 20 | #include <linux/io.h> | 20 | #include <linux/io.h> |
| 21 | #include <linux/slab.h> | ||
| 21 | 22 | ||
| 22 | #include <mach/hardware.h> | 23 | #include <mach/hardware.h> |
| 23 | #include <mach/pxa930_trkball.h> | 24 | #include <mach/pxa930_trkball.h> |
diff --git a/drivers/input/mouse/sentelic.c b/drivers/input/mouse/sentelic.c index 81a6b81cb2fe..1242775fee19 100644 --- a/drivers/input/mouse/sentelic.c +++ b/drivers/input/mouse/sentelic.c | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | #include <linux/libps2.h> | 26 | #include <linux/libps2.h> |
| 27 | #include <linux/serio.h> | 27 | #include <linux/serio.h> |
| 28 | #include <linux/jiffies.h> | 28 | #include <linux/jiffies.h> |
| 29 | #include <linux/slab.h> | ||
| 29 | 30 | ||
| 30 | #include "psmouse.h" | 31 | #include "psmouse.h" |
| 31 | #include "sentelic.h" | 32 | #include "sentelic.h" |
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index d3f5243fa093..026df6010161 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | #include <linux/input.h> | 28 | #include <linux/input.h> |
| 29 | #include <linux/serio.h> | 29 | #include <linux/serio.h> |
| 30 | #include <linux/libps2.h> | 30 | #include <linux/libps2.h> |
| 31 | #include <linux/slab.h> | ||
| 31 | #include "psmouse.h" | 32 | #include "psmouse.h" |
| 32 | #include "synaptics.h" | 33 | #include "synaptics.h" |
| 33 | 34 | ||
diff --git a/drivers/input/mouse/synaptics_i2c.c b/drivers/input/mouse/synaptics_i2c.c index 9867dfe2a638..8291e7399ffa 100644 --- a/drivers/input/mouse/synaptics_i2c.c +++ b/drivers/input/mouse/synaptics_i2c.c | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | #include <linux/input.h> | 17 | #include <linux/input.h> |
| 18 | #include <linux/delay.h> | 18 | #include <linux/delay.h> |
| 19 | #include <linux/workqueue.h> | 19 | #include <linux/workqueue.h> |
| 20 | #include <linux/slab.h> | ||
| 20 | 21 | ||
| 21 | #define DRIVER_NAME "synaptics_i2c" | 22 | #define DRIVER_NAME "synaptics_i2c" |
| 22 | /* maximum product id is 15 characters */ | 23 | /* maximum product id is 15 characters */ |
diff --git a/drivers/input/mouse/touchkit_ps2.c b/drivers/input/mouse/touchkit_ps2.c index 909431c31ab4..88121c59c3cc 100644 --- a/drivers/input/mouse/touchkit_ps2.c +++ b/drivers/input/mouse/touchkit_ps2.c | |||
| @@ -26,7 +26,6 @@ | |||
| 26 | */ | 26 | */ |
| 27 | 27 | ||
| 28 | #include <linux/kernel.h> | 28 | #include <linux/kernel.h> |
| 29 | #include <linux/slab.h> | ||
| 30 | 29 | ||
| 31 | #include <linux/input.h> | 30 | #include <linux/input.h> |
| 32 | #include <linux/serio.h> | 31 | #include <linux/serio.h> |
diff --git a/drivers/input/mouse/trackpoint.c b/drivers/input/mouse/trackpoint.c index 63d4a67830f2..0643e49ca603 100644 --- a/drivers/input/mouse/trackpoint.c +++ b/drivers/input/mouse/trackpoint.c | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | * Trademarks are the property of their respective owners. | 8 | * Trademarks are the property of their respective owners. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | #include <linux/slab.h> | ||
| 11 | #include <linux/delay.h> | 12 | #include <linux/delay.h> |
| 12 | #include <linux/serio.h> | 13 | #include <linux/serio.h> |
| 13 | #include <linux/module.h> | 14 | #include <linux/module.h> |
diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c index a13d80f7da17..f34b22bce4ff 100644 --- a/drivers/input/mousedev.c +++ b/drivers/input/mousedev.c | |||
| @@ -15,7 +15,6 @@ | |||
| 15 | 15 | ||
| 16 | #include <linux/sched.h> | 16 | #include <linux/sched.h> |
| 17 | #include <linux/slab.h> | 17 | #include <linux/slab.h> |
| 18 | #include <linux/smp_lock.h> | ||
| 19 | #include <linux/poll.h> | 18 | #include <linux/poll.h> |
| 20 | #include <linux/module.h> | 19 | #include <linux/module.h> |
| 21 | #include <linux/init.h> | 20 | #include <linux/init.h> |
| @@ -542,10 +541,8 @@ static int mousedev_open(struct inode *inode, struct file *file) | |||
| 542 | if (i >= MOUSEDEV_MINORS) | 541 | if (i >= MOUSEDEV_MINORS) |
| 543 | return -ENODEV; | 542 | return -ENODEV; |
| 544 | 543 | ||
| 545 | lock_kernel(); | ||
| 546 | error = mutex_lock_interruptible(&mousedev_table_mutex); | 544 | error = mutex_lock_interruptible(&mousedev_table_mutex); |
| 547 | if (error) { | 545 | if (error) { |
| 548 | unlock_kernel(); | ||
| 549 | return error; | 546 | return error; |
| 550 | } | 547 | } |
| 551 | mousedev = mousedev_table[i]; | 548 | mousedev = mousedev_table[i]; |
| @@ -554,7 +551,6 @@ static int mousedev_open(struct inode *inode, struct file *file) | |||
| 554 | mutex_unlock(&mousedev_table_mutex); | 551 | mutex_unlock(&mousedev_table_mutex); |
| 555 | 552 | ||
| 556 | if (!mousedev) { | 553 | if (!mousedev) { |
| 557 | unlock_kernel(); | ||
| 558 | return -ENODEV; | 554 | return -ENODEV; |
| 559 | } | 555 | } |
| 560 | 556 | ||
| @@ -575,7 +571,6 @@ static int mousedev_open(struct inode *inode, struct file *file) | |||
| 575 | goto err_free_client; | 571 | goto err_free_client; |
| 576 | 572 | ||
| 577 | file->private_data = client; | 573 | file->private_data = client; |
| 578 | unlock_kernel(); | ||
| 579 | return 0; | 574 | return 0; |
| 580 | 575 | ||
| 581 | err_free_client: | 576 | err_free_client: |
| @@ -583,7 +578,6 @@ static int mousedev_open(struct inode *inode, struct file *file) | |||
| 583 | kfree(client); | 578 | kfree(client); |
| 584 | err_put_mousedev: | 579 | err_put_mousedev: |
| 585 | put_device(&mousedev->dev); | 580 | put_device(&mousedev->dev); |
| 586 | unlock_kernel(); | ||
| 587 | return error; | 581 | return error; |
| 588 | } | 582 | } |
| 589 | 583 | ||
diff --git a/drivers/input/serio/altera_ps2.c b/drivers/input/serio/altera_ps2.c index 320b7ca48bf8..7998560a1904 100644 --- a/drivers/input/serio/altera_ps2.c +++ b/drivers/input/serio/altera_ps2.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
| 19 | #include <linux/platform_device.h> | 19 | #include <linux/platform_device.h> |
| 20 | #include <linux/io.h> | 20 | #include <linux/io.h> |
| 21 | #include <linux/slab.h> | ||
| 21 | 22 | ||
| 22 | #define DRV_NAME "altera_ps2" | 23 | #define DRV_NAME "altera_ps2" |
| 23 | 24 | ||
diff --git a/drivers/input/serio/at32psif.c b/drivers/input/serio/at32psif.c index b54452a8c771..6ee8f0ddad51 100644 --- a/drivers/input/serio/at32psif.c +++ b/drivers/input/serio/at32psif.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <linux/io.h> | 18 | #include <linux/io.h> |
| 19 | #include <linux/clk.h> | 19 | #include <linux/clk.h> |
| 20 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
| 21 | #include <linux/slab.h> | ||
| 21 | 22 | ||
| 22 | /* PSIF register offsets */ | 23 | /* PSIF register offsets */ |
| 23 | #define PSIF_CR 0x00 | 24 | #define PSIF_CR 0x00 |
diff --git a/drivers/input/serio/ct82c710.c b/drivers/input/serio/ct82c710.c index d1380fc72cc6..4a3084695c00 100644 --- a/drivers/input/serio/ct82c710.c +++ b/drivers/input/serio/ct82c710.c | |||
| @@ -35,6 +35,7 @@ | |||
| 35 | #include <linux/errno.h> | 35 | #include <linux/errno.h> |
| 36 | #include <linux/err.h> | 36 | #include <linux/err.h> |
| 37 | #include <linux/platform_device.h> | 37 | #include <linux/platform_device.h> |
| 38 | #include <linux/slab.h> | ||
| 38 | 39 | ||
| 39 | #include <asm/io.h> | 40 | #include <asm/io.h> |
| 40 | 41 | ||
diff --git a/drivers/input/serio/gscps2.c b/drivers/input/serio/gscps2.c index 06addfa7cc47..3c287dd879d3 100644 --- a/drivers/input/serio/gscps2.c +++ b/drivers/input/serio/gscps2.c | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | 24 | ||
| 25 | #include <linux/init.h> | 25 | #include <linux/init.h> |
| 26 | #include <linux/module.h> | 26 | #include <linux/module.h> |
| 27 | #include <linux/slab.h> | ||
| 27 | #include <linux/serio.h> | 28 | #include <linux/serio.h> |
| 28 | #include <linux/input.h> | 29 | #include <linux/input.h> |
| 29 | #include <linux/interrupt.h> | 30 | #include <linux/interrupt.h> |
diff --git a/drivers/input/serio/hil_mlc.c b/drivers/input/serio/hil_mlc.c index 6cd03ebaf5fb..c92f4edfee7b 100644 --- a/drivers/input/serio/hil_mlc.c +++ b/drivers/input/serio/hil_mlc.c | |||
| @@ -58,6 +58,7 @@ | |||
| 58 | #include <linux/module.h> | 58 | #include <linux/module.h> |
| 59 | #include <linux/init.h> | 59 | #include <linux/init.h> |
| 60 | #include <linux/interrupt.h> | 60 | #include <linux/interrupt.h> |
| 61 | #include <linux/slab.h> | ||
| 61 | #include <linux/timer.h> | 62 | #include <linux/timer.h> |
| 62 | #include <linux/list.h> | 63 | #include <linux/list.h> |
| 63 | 64 | ||
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h index 2a5982e532f8..ead0494721d0 100644 --- a/drivers/input/serio/i8042-x86ia64io.h +++ b/drivers/input/serio/i8042-x86ia64io.h | |||
| @@ -442,6 +442,13 @@ static const struct dmi_system_id __initconst i8042_dmi_reset_table[] = { | |||
| 442 | }, | 442 | }, |
| 443 | }, | 443 | }, |
| 444 | { | 444 | { |
| 445 | /* Medion Akoya E1222 */ | ||
| 446 | .matches = { | ||
| 447 | DMI_MATCH(DMI_SYS_VENDOR, "MEDION"), | ||
| 448 | DMI_MATCH(DMI_PRODUCT_NAME, "E122X"), | ||
| 449 | }, | ||
| 450 | }, | ||
| 451 | { | ||
| 445 | /* Mivvy M310 */ | 452 | /* Mivvy M310 */ |
| 446 | .matches = { | 453 | .matches = { |
| 447 | DMI_MATCH(DMI_SYS_VENDOR, "VIOOO"), | 454 | DMI_MATCH(DMI_SYS_VENDOR, "VIOOO"), |
| @@ -624,6 +631,9 @@ static int i8042_pnp_kbd_probe(struct pnp_dev *dev, const struct pnp_device_id * | |||
| 624 | strlcat(i8042_pnp_kbd_name, pnp_dev_name(dev), sizeof(i8042_pnp_kbd_name)); | 631 | strlcat(i8042_pnp_kbd_name, pnp_dev_name(dev), sizeof(i8042_pnp_kbd_name)); |
| 625 | } | 632 | } |
| 626 | 633 | ||
| 634 | /* Keyboard ports are always supposed to be wakeup-enabled */ | ||
| 635 | device_set_wakeup_enable(&dev->dev, true); | ||
| 636 | |||
| 627 | i8042_pnp_kbd_devices++; | 637 | i8042_pnp_kbd_devices++; |
| 628 | return 0; | 638 | return 0; |
| 629 | } | 639 | } |
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c index ff4d77c4de11..6440a8f55686 100644 --- a/drivers/input/serio/i8042.c +++ b/drivers/input/serio/i8042.c | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | #include <linux/rcupdate.h> | 21 | #include <linux/rcupdate.h> |
| 22 | #include <linux/platform_device.h> | 22 | #include <linux/platform_device.h> |
| 23 | #include <linux/i8042.h> | 23 | #include <linux/i8042.h> |
| 24 | #include <linux/slab.h> | ||
| 24 | 25 | ||
| 25 | #include <asm/io.h> | 26 | #include <asm/io.h> |
| 26 | 27 | ||
| @@ -38,7 +39,7 @@ MODULE_PARM_DESC(noaux, "Do not probe or use AUX (mouse) port."); | |||
| 38 | 39 | ||
| 39 | static bool i8042_nomux; | 40 | static bool i8042_nomux; |
| 40 | module_param_named(nomux, i8042_nomux, bool, 0); | 41 | module_param_named(nomux, i8042_nomux, bool, 0); |
| 41 | MODULE_PARM_DESC(nomux, "Do not check whether an active multiplexing conrtoller is present."); | 42 | MODULE_PARM_DESC(nomux, "Do not check whether an active multiplexing controller is present."); |
| 42 | 43 | ||
| 43 | static bool i8042_unlock; | 44 | static bool i8042_unlock; |
| 44 | module_param_named(unlock, i8042_unlock, bool, 0); | 45 | module_param_named(unlock, i8042_unlock, bool, 0); |
| @@ -1386,6 +1387,8 @@ static int __init i8042_probe(struct platform_device *dev) | |||
| 1386 | { | 1387 | { |
| 1387 | int error; | 1388 | int error; |
| 1388 | 1389 | ||
| 1390 | i8042_platform_device = dev; | ||
| 1391 | |||
| 1389 | error = i8042_controller_selftest(); | 1392 | error = i8042_controller_selftest(); |
| 1390 | if (error) | 1393 | if (error) |
| 1391 | return error; | 1394 | return error; |
| @@ -1421,6 +1424,7 @@ static int __init i8042_probe(struct platform_device *dev) | |||
| 1421 | i8042_free_aux_ports(); /* in case KBD failed but AUX not */ | 1424 | i8042_free_aux_ports(); /* in case KBD failed but AUX not */ |
| 1422 | i8042_free_irqs(); | 1425 | i8042_free_irqs(); |
| 1423 | i8042_controller_reset(); | 1426 | i8042_controller_reset(); |
| 1427 | i8042_platform_device = NULL; | ||
| 1424 | 1428 | ||
| 1425 | return error; | 1429 | return error; |
| 1426 | } | 1430 | } |
| @@ -1430,6 +1434,7 @@ static int __devexit i8042_remove(struct platform_device *dev) | |||
| 1430 | i8042_unregister_ports(); | 1434 | i8042_unregister_ports(); |
| 1431 | i8042_free_irqs(); | 1435 | i8042_free_irqs(); |
| 1432 | i8042_controller_reset(); | 1436 | i8042_controller_reset(); |
| 1437 | i8042_platform_device = NULL; | ||
| 1433 | 1438 | ||
| 1434 | return 0; | 1439 | return 0; |
| 1435 | } | 1440 | } |
| @@ -1448,6 +1453,7 @@ static struct platform_driver i8042_driver = { | |||
| 1448 | 1453 | ||
| 1449 | static int __init i8042_init(void) | 1454 | static int __init i8042_init(void) |
| 1450 | { | 1455 | { |
| 1456 | struct platform_device *pdev; | ||
| 1451 | int err; | 1457 | int err; |
| 1452 | 1458 | ||
| 1453 | dbg_init(); | 1459 | dbg_init(); |
| @@ -1460,31 +1466,18 @@ static int __init i8042_init(void) | |||
| 1460 | if (err) | 1466 | if (err) |
| 1461 | goto err_platform_exit; | 1467 | goto err_platform_exit; |
| 1462 | 1468 | ||
| 1463 | i8042_platform_device = platform_device_alloc("i8042", -1); | 1469 | pdev = platform_create_bundle(&i8042_driver, i8042_probe, NULL, 0, NULL, 0); |
| 1464 | if (!i8042_platform_device) { | 1470 | if (IS_ERR(pdev)) { |
| 1465 | err = -ENOMEM; | 1471 | err = PTR_ERR(pdev); |
| 1466 | goto err_platform_exit; | 1472 | goto err_platform_exit; |
| 1467 | } | 1473 | } |
| 1468 | 1474 | ||
| 1469 | err = platform_device_add(i8042_platform_device); | ||
| 1470 | if (err) | ||
| 1471 | goto err_free_device; | ||
| 1472 | |||
| 1473 | err = platform_driver_probe(&i8042_driver, i8042_probe); | ||
| 1474 | if (err) | ||
| 1475 | goto err_del_device; | ||
| 1476 | |||
| 1477 | panic_blink = i8042_panic_blink; | 1475 | panic_blink = i8042_panic_blink; |
| 1478 | 1476 | ||
| 1479 | return 0; | 1477 | return 0; |
| 1480 | 1478 | ||
| 1481 | err_del_device: | ||
| 1482 | platform_device_del(i8042_platform_device); | ||
| 1483 | err_free_device: | ||
| 1484 | platform_device_put(i8042_platform_device); | ||
| 1485 | err_platform_exit: | 1479 | err_platform_exit: |
| 1486 | i8042_platform_exit(); | 1480 | i8042_platform_exit(); |
| 1487 | |||
| 1488 | return err; | 1481 | return err; |
| 1489 | } | 1482 | } |
| 1490 | 1483 | ||
diff --git a/drivers/input/serio/libps2.c b/drivers/input/serio/libps2.c index f3876acc3e83..980af94ba9c8 100644 --- a/drivers/input/serio/libps2.c +++ b/drivers/input/serio/libps2.c | |||
| @@ -14,7 +14,6 @@ | |||
| 14 | #include <linux/delay.h> | 14 | #include <linux/delay.h> |
| 15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
| 16 | #include <linux/sched.h> | 16 | #include <linux/sched.h> |
| 17 | #include <linux/slab.h> | ||
| 18 | #include <linux/interrupt.h> | 17 | #include <linux/interrupt.h> |
| 19 | #include <linux/input.h> | 18 | #include <linux/input.h> |
| 20 | #include <linux/serio.h> | 19 | #include <linux/serio.h> |
diff --git a/drivers/input/serio/parkbd.c b/drivers/input/serio/parkbd.c index b089977e0ef9..26b45936f9fd 100644 --- a/drivers/input/serio/parkbd.c +++ b/drivers/input/serio/parkbd.c | |||
| @@ -46,6 +46,7 @@ | |||
| 46 | 46 | ||
| 47 | #include <linux/module.h> | 47 | #include <linux/module.h> |
| 48 | #include <linux/parport.h> | 48 | #include <linux/parport.h> |
| 49 | #include <linux/slab.h> | ||
| 49 | #include <linux/init.h> | 50 | #include <linux/init.h> |
| 50 | #include <linux/serio.h> | 51 | #include <linux/serio.h> |
| 51 | 52 | ||
diff --git a/drivers/input/serio/pcips2.c b/drivers/input/serio/pcips2.c index 797314be7af2..43494742541c 100644 --- a/drivers/input/serio/pcips2.c +++ b/drivers/input/serio/pcips2.c | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #include <linux/ioport.h> | 15 | #include <linux/ioport.h> |
| 16 | #include <linux/input.h> | 16 | #include <linux/input.h> |
| 17 | #include <linux/pci.h> | 17 | #include <linux/pci.h> |
| 18 | #include <linux/slab.h> | ||
| 18 | #include <linux/init.h> | 19 | #include <linux/init.h> |
| 19 | #include <linux/serio.h> | 20 | #include <linux/serio.h> |
| 20 | #include <linux/delay.h> | 21 | #include <linux/delay.h> |
diff --git a/drivers/input/serio/q40kbd.c b/drivers/input/serio/q40kbd.c index e36a0901646c..5eb84b3b67fb 100644 --- a/drivers/input/serio/q40kbd.c +++ b/drivers/input/serio/q40kbd.c | |||
| @@ -36,6 +36,7 @@ | |||
| 36 | #include <linux/err.h> | 36 | #include <linux/err.h> |
| 37 | #include <linux/bitops.h> | 37 | #include <linux/bitops.h> |
| 38 | #include <linux/platform_device.h> | 38 | #include <linux/platform_device.h> |
| 39 | #include <linux/slab.h> | ||
| 39 | 40 | ||
| 40 | #include <asm/io.h> | 41 | #include <asm/io.h> |
| 41 | #include <asm/uaccess.h> | 42 | #include <asm/uaccess.h> |
diff --git a/drivers/input/serio/rpckbd.c b/drivers/input/serio/rpckbd.c index ed045c99f84b..9da6fbcaaa7e 100644 --- a/drivers/input/serio/rpckbd.c +++ b/drivers/input/serio/rpckbd.c | |||
| @@ -34,6 +34,7 @@ | |||
| 34 | #include <linux/err.h> | 34 | #include <linux/err.h> |
| 35 | #include <linux/platform_device.h> | 35 | #include <linux/platform_device.h> |
| 36 | #include <linux/io.h> | 36 | #include <linux/io.h> |
| 37 | #include <linux/slab.h> | ||
| 37 | 38 | ||
| 38 | #include <asm/irq.h> | 39 | #include <asm/irq.h> |
| 39 | #include <mach/hardware.h> | 40 | #include <mach/hardware.h> |
diff --git a/drivers/input/serio/serio_raw.c b/drivers/input/serio/serio_raw.c index 27fdaaffbb40..998664854440 100644 --- a/drivers/input/serio/serio_raw.c +++ b/drivers/input/serio/serio_raw.c | |||
| @@ -81,12 +81,12 @@ static int serio_raw_open(struct inode *inode, struct file *file) | |||
| 81 | struct serio_raw_list *list; | 81 | struct serio_raw_list *list; |
| 82 | int retval = 0; | 82 | int retval = 0; |
| 83 | 83 | ||
| 84 | lock_kernel(); | ||
| 85 | retval = mutex_lock_interruptible(&serio_raw_mutex); | 84 | retval = mutex_lock_interruptible(&serio_raw_mutex); |
| 86 | if (retval) | 85 | if (retval) |
| 87 | goto out_bkl; | 86 | return retval; |
| 88 | 87 | ||
| 89 | if (!(serio_raw = serio_raw_locate(iminor(inode)))) { | 88 | serio_raw = serio_raw_locate(iminor(inode)); |
| 89 | if (!serio_raw) { | ||
| 90 | retval = -ENODEV; | 90 | retval = -ENODEV; |
| 91 | goto out; | 91 | goto out; |
| 92 | } | 92 | } |
| @@ -96,7 +96,8 @@ static int serio_raw_open(struct inode *inode, struct file *file) | |||
| 96 | goto out; | 96 | goto out; |
| 97 | } | 97 | } |
| 98 | 98 | ||
| 99 | if (!(list = kzalloc(sizeof(struct serio_raw_list), GFP_KERNEL))) { | 99 | list = kzalloc(sizeof(struct serio_raw_list), GFP_KERNEL); |
| 100 | if (!list) { | ||
| 100 | retval = -ENOMEM; | 101 | retval = -ENOMEM; |
| 101 | goto out; | 102 | goto out; |
| 102 | } | 103 | } |
| @@ -109,8 +110,6 @@ static int serio_raw_open(struct inode *inode, struct file *file) | |||
| 109 | 110 | ||
| 110 | out: | 111 | out: |
| 111 | mutex_unlock(&serio_raw_mutex); | 112 | mutex_unlock(&serio_raw_mutex); |
| 112 | out_bkl: | ||
| 113 | unlock_kernel(); | ||
| 114 | return retval; | 113 | return retval; |
| 115 | } | 114 | } |
| 116 | 115 | ||
diff --git a/drivers/input/serio/xilinx_ps2.c b/drivers/input/serio/xilinx_ps2.c index 8298e1f68234..f84f8e32e3f1 100644 --- a/drivers/input/serio/xilinx_ps2.c +++ b/drivers/input/serio/xilinx_ps2.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <linux/serio.h> | 19 | #include <linux/serio.h> |
| 20 | #include <linux/interrupt.h> | 20 | #include <linux/interrupt.h> |
| 21 | #include <linux/errno.h> | 21 | #include <linux/errno.h> |
| 22 | #include <linux/slab.h> | ||
| 22 | #include <linux/init.h> | 23 | #include <linux/init.h> |
| 23 | #include <linux/list.h> | 24 | #include <linux/list.h> |
| 24 | #include <linux/io.h> | 25 | #include <linux/io.h> |
diff --git a/drivers/input/sparse-keymap.c b/drivers/input/sparse-keymap.c index fbd3987af57f..014248344763 100644 --- a/drivers/input/sparse-keymap.c +++ b/drivers/input/sparse-keymap.c | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | 15 | ||
| 16 | #include <linux/input.h> | 16 | #include <linux/input.h> |
| 17 | #include <linux/input/sparse-keymap.h> | 17 | #include <linux/input/sparse-keymap.h> |
| 18 | #include <linux/slab.h> | ||
| 18 | 19 | ||
| 19 | MODULE_AUTHOR("Dmitry Torokhov <dtor@mail.ru>"); | 20 | MODULE_AUTHOR("Dmitry Torokhov <dtor@mail.ru>"); |
| 20 | MODULE_DESCRIPTION("Generic support for sparse keymaps"); | 21 | MODULE_DESCRIPTION("Generic support for sparse keymaps"); |
| @@ -64,36 +65,39 @@ struct key_entry *sparse_keymap_entry_from_keycode(struct input_dev *dev, | |||
| 64 | EXPORT_SYMBOL(sparse_keymap_entry_from_keycode); | 65 | EXPORT_SYMBOL(sparse_keymap_entry_from_keycode); |
| 65 | 66 | ||
| 66 | static int sparse_keymap_getkeycode(struct input_dev *dev, | 67 | static int sparse_keymap_getkeycode(struct input_dev *dev, |
| 67 | int scancode, int *keycode) | 68 | unsigned int scancode, |
| 69 | unsigned int *keycode) | ||
| 68 | { | 70 | { |
| 69 | const struct key_entry *key = | 71 | const struct key_entry *key; |
| 70 | sparse_keymap_entry_from_scancode(dev, scancode); | ||
| 71 | 72 | ||
| 72 | if (key && key->type == KE_KEY) { | 73 | if (dev->keycode) { |
| 73 | *keycode = key->keycode; | 74 | key = sparse_keymap_entry_from_scancode(dev, scancode); |
| 74 | return 0; | 75 | if (key && key->type == KE_KEY) { |
| 76 | *keycode = key->keycode; | ||
| 77 | return 0; | ||
| 78 | } | ||
| 75 | } | 79 | } |
| 76 | 80 | ||
| 77 | return -EINVAL; | 81 | return -EINVAL; |
| 78 | } | 82 | } |
| 79 | 83 | ||
| 80 | static int sparse_keymap_setkeycode(struct input_dev *dev, | 84 | static int sparse_keymap_setkeycode(struct input_dev *dev, |
| 81 | int scancode, int keycode) | 85 | unsigned int scancode, |
| 86 | unsigned int keycode) | ||
| 82 | { | 87 | { |
| 83 | struct key_entry *key; | 88 | struct key_entry *key; |
| 84 | int old_keycode; | 89 | int old_keycode; |
| 85 | 90 | ||
| 86 | if (keycode < 0 || keycode > KEY_MAX) | 91 | if (dev->keycode) { |
| 87 | return -EINVAL; | 92 | key = sparse_keymap_entry_from_scancode(dev, scancode); |
| 88 | 93 | if (key && key->type == KE_KEY) { | |
| 89 | key = sparse_keymap_entry_from_scancode(dev, scancode); | 94 | old_keycode = key->keycode; |
| 90 | if (key && key->type == KE_KEY) { | 95 | key->keycode = keycode; |
| 91 | old_keycode = key->keycode; | 96 | set_bit(keycode, dev->keybit); |
| 92 | key->keycode = keycode; | 97 | if (!sparse_keymap_entry_from_keycode(dev, old_keycode)) |
| 93 | set_bit(keycode, dev->keybit); | 98 | clear_bit(old_keycode, dev->keybit); |
| 94 | if (!sparse_keymap_entry_from_keycode(dev, old_keycode)) | 99 | return 0; |
| 95 | clear_bit(old_keycode, dev->keybit); | 100 | } |
| 96 | return 0; | ||
| 97 | } | 101 | } |
| 98 | 102 | ||
| 99 | return -EINVAL; | 103 | return -EINVAL; |
| @@ -161,7 +165,7 @@ int sparse_keymap_setup(struct input_dev *dev, | |||
| 161 | return 0; | 165 | return 0; |
| 162 | 166 | ||
| 163 | err_out: | 167 | err_out: |
| 164 | kfree(keymap); | 168 | kfree(map); |
| 165 | return error; | 169 | return error; |
| 166 | 170 | ||
| 167 | } | 171 | } |
| @@ -173,14 +177,27 @@ EXPORT_SYMBOL(sparse_keymap_setup); | |||
| 173 | * | 177 | * |
| 174 | * This function is used to free memory allocated by sparse keymap | 178 | * This function is used to free memory allocated by sparse keymap |
| 175 | * in an input device that was set up by sparse_keymap_setup(). | 179 | * in an input device that was set up by sparse_keymap_setup(). |
| 180 | * NOTE: It is safe to cal this function while input device is | ||
| 181 | * still registered (however the drivers should care not to try to | ||
| 182 | * use freed keymap and thus have to shut off interrups/polling | ||
| 183 | * before freeing the keymap). | ||
| 176 | */ | 184 | */ |
| 177 | void sparse_keymap_free(struct input_dev *dev) | 185 | void sparse_keymap_free(struct input_dev *dev) |
| 178 | { | 186 | { |
| 187 | unsigned long flags; | ||
| 188 | |||
| 189 | /* | ||
| 190 | * Take event lock to prevent racing with input_get_keycode() | ||
| 191 | * and input_set_keycode() if we are called while input device | ||
| 192 | * is still registered. | ||
| 193 | */ | ||
| 194 | spin_lock_irqsave(&dev->event_lock, flags); | ||
| 195 | |||
| 179 | kfree(dev->keycode); | 196 | kfree(dev->keycode); |
| 180 | dev->keycode = NULL; | 197 | dev->keycode = NULL; |
| 181 | dev->keycodemax = 0; | 198 | dev->keycodemax = 0; |
| 182 | dev->getkeycode = NULL; | 199 | |
| 183 | dev->setkeycode = NULL; | 200 | spin_unlock_irqrestore(&dev->event_lock, flags); |
| 184 | } | 201 | } |
| 185 | EXPORT_SYMBOL(sparse_keymap_free); | 202 | EXPORT_SYMBOL(sparse_keymap_free); |
| 186 | 203 | ||
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c index a1770e6feeec..f46502589e4e 100644 --- a/drivers/input/tablet/wacom_sys.c +++ b/drivers/input/tablet/wacom_sys.c | |||
| @@ -371,7 +371,7 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi | |||
| 371 | } else if (pen) { | 371 | } else if (pen) { |
| 372 | /* penabled only accepts exact bytes of data */ | 372 | /* penabled only accepts exact bytes of data */ |
| 373 | if (features->type == TABLETPC2FG) | 373 | if (features->type == TABLETPC2FG) |
| 374 | features->pktlen = WACOM_PKGLEN_PENABLED; | 374 | features->pktlen = WACOM_PKGLEN_GRAPHIRE; |
| 375 | features->device_type = BTN_TOOL_PEN; | 375 | features->device_type = BTN_TOOL_PEN; |
| 376 | features->x_max = | 376 | features->x_max = |
| 377 | wacom_le16_to_cpu(&report[i + 3]); | 377 | wacom_le16_to_cpu(&report[i + 3]); |
| @@ -410,7 +410,7 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi | |||
| 410 | } else if (pen) { | 410 | } else if (pen) { |
| 411 | /* penabled only accepts exact bytes of data */ | 411 | /* penabled only accepts exact bytes of data */ |
| 412 | if (features->type == TABLETPC2FG) | 412 | if (features->type == TABLETPC2FG) |
| 413 | features->pktlen = WACOM_PKGLEN_PENABLED; | 413 | features->pktlen = WACOM_PKGLEN_GRAPHIRE; |
| 414 | features->device_type = BTN_TOOL_PEN; | 414 | features->device_type = BTN_TOOL_PEN; |
| 415 | features->y_max = | 415 | features->y_max = |
| 416 | wacom_le16_to_cpu(&report[i + 3]); | 416 | wacom_le16_to_cpu(&report[i + 3]); |
| @@ -673,13 +673,15 @@ static int wacom_resume(struct usb_interface *intf) | |||
| 673 | int rv; | 673 | int rv; |
| 674 | 674 | ||
| 675 | mutex_lock(&wacom->lock); | 675 | mutex_lock(&wacom->lock); |
| 676 | if (wacom->open) { | 676 | |
| 677 | /* switch to wacom mode first */ | ||
| 678 | wacom_query_tablet_data(intf, features); | ||
| 679 | |||
| 680 | if (wacom->open) | ||
| 677 | rv = usb_submit_urb(wacom->irq, GFP_NOIO); | 681 | rv = usb_submit_urb(wacom->irq, GFP_NOIO); |
| 678 | /* switch to wacom mode if needed */ | 682 | else |
| 679 | if (!wacom_retrieve_hid_descriptor(intf, features)) | ||
| 680 | wacom_query_tablet_data(intf, features); | ||
| 681 | } else | ||
| 682 | rv = 0; | 683 | rv = 0; |
| 684 | |||
| 683 | mutex_unlock(&wacom->lock); | 685 | mutex_unlock(&wacom->lock); |
| 684 | 686 | ||
| 685 | return rv; | 687 | return rv; |
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index 3d81443e683a..4a852d815c68 100644 --- a/drivers/input/tablet/wacom_wac.c +++ b/drivers/input/tablet/wacom_wac.c | |||
| @@ -1028,7 +1028,7 @@ static const struct wacom_features wacom_features_0x93 = | |||
| 1028 | static const struct wacom_features wacom_features_0x9A = | 1028 | static const struct wacom_features wacom_features_0x9A = |
| 1029 | { "Wacom ISDv4 9A", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255, 0, TABLETPC }; | 1029 | { "Wacom ISDv4 9A", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255, 0, TABLETPC }; |
| 1030 | static const struct wacom_features wacom_features_0x9F = | 1030 | static const struct wacom_features wacom_features_0x9F = |
| 1031 | { "Wacom ISDv4 9F", WACOM_PKGLEN_PENABLED, 26202, 16325, 255, 0, TABLETPC }; | 1031 | { "Wacom ISDv4 9F", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255, 0, TABLETPC }; |
| 1032 | static const struct wacom_features wacom_features_0xE2 = | 1032 | static const struct wacom_features wacom_features_0xE2 = |
| 1033 | { "Wacom ISDv4 E2", WACOM_PKGLEN_TPC2FG, 26202, 16325, 255, 0, TABLETPC2FG }; | 1033 | { "Wacom ISDv4 E2", WACOM_PKGLEN_TPC2FG, 26202, 16325, 255, 0, TABLETPC2FG }; |
| 1034 | static const struct wacom_features wacom_features_0xE3 = | 1034 | static const struct wacom_features wacom_features_0xE3 = |
diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h index 8590b1e8ec37..b50cf04e61a8 100644 --- a/drivers/input/tablet/wacom_wac.h +++ b/drivers/input/tablet/wacom_wac.h | |||
| @@ -17,7 +17,6 @@ | |||
| 17 | #define WACOM_PKGLEN_GRAPHIRE 8 | 17 | #define WACOM_PKGLEN_GRAPHIRE 8 |
| 18 | #define WACOM_PKGLEN_BBFUN 9 | 18 | #define WACOM_PKGLEN_BBFUN 9 |
| 19 | #define WACOM_PKGLEN_INTUOS 10 | 19 | #define WACOM_PKGLEN_INTUOS 10 |
| 20 | #define WACOM_PKGLEN_PENABLED 8 | ||
| 21 | #define WACOM_PKGLEN_TPC1FG 5 | 20 | #define WACOM_PKGLEN_TPC1FG 5 |
| 22 | #define WACOM_PKGLEN_TPC2FG 14 | 21 | #define WACOM_PKGLEN_TPC2FG 14 |
| 23 | 22 | ||
diff --git a/drivers/input/touchscreen/88pm860x-ts.c b/drivers/input/touchscreen/88pm860x-ts.c index 286bb490a9f2..b3aebc2166ba 100644 --- a/drivers/input/touchscreen/88pm860x-ts.c +++ b/drivers/input/touchscreen/88pm860x-ts.c | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include <linux/i2c.h> | 14 | #include <linux/i2c.h> |
| 15 | #include <linux/input.h> | 15 | #include <linux/input.h> |
| 16 | #include <linux/mfd/88pm860x.h> | 16 | #include <linux/mfd/88pm860x.h> |
| 17 | #include <linux/slab.h> | ||
| 17 | 18 | ||
| 18 | #define MEAS_LEN (8) | 19 | #define MEAS_LEN (8) |
| 19 | #define ACCURATE_BIT (12) | 20 | #define ACCURATE_BIT (12) |
diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig index 7208654a94ae..8a8fa4d2d6a8 100644 --- a/drivers/input/touchscreen/Kconfig +++ b/drivers/input/touchscreen/Kconfig | |||
| @@ -24,17 +24,18 @@ config TOUCHSCREEN_88PM860X | |||
| 24 | module will be called 88pm860x-ts. | 24 | module will be called 88pm860x-ts. |
| 25 | 25 | ||
| 26 | config TOUCHSCREEN_ADS7846 | 26 | config TOUCHSCREEN_ADS7846 |
| 27 | tristate "ADS7846/TSC2046 and ADS7843 based touchscreens" | 27 | tristate "ADS7846/TSC2046/AD7873 and AD(S)7843 based touchscreens" |
| 28 | depends on SPI_MASTER | 28 | depends on SPI_MASTER |
| 29 | depends on HWMON = n || HWMON | 29 | depends on HWMON = n || HWMON |
| 30 | help | 30 | help |
| 31 | Say Y here if you have a touchscreen interface using the | 31 | Say Y here if you have a touchscreen interface using the |
| 32 | ADS7846/TSC2046 or ADS7843 controller, and your board-specific | 32 | ADS7846/TSC2046/AD7873 or ADS7843/AD7843 controller, |
| 33 | setup code includes that in its table of SPI devices. | 33 | and your board-specific setup code includes that in its |
| 34 | table of SPI devices. | ||
| 34 | 35 | ||
| 35 | If HWMON is selected, and the driver is told the reference voltage | 36 | If HWMON is selected, and the driver is told the reference voltage |
| 36 | on your board, you will also get hwmon interfaces for the voltage | 37 | on your board, you will also get hwmon interfaces for the voltage |
| 37 | (and on ads7846/tsc2046, temperature) sensors of this chip. | 38 | (and on ads7846/tsc2046/ad7873, temperature) sensors of this chip. |
| 38 | 39 | ||
| 39 | If unsure, say N (but it's safe to say "Y"). | 40 | If unsure, say N (but it's safe to say "Y"). |
| 40 | 41 | ||
diff --git a/drivers/input/touchscreen/ad7877.c b/drivers/input/touchscreen/ad7877.c index eb83939c705e..e019d53d1ab4 100644 --- a/drivers/input/touchscreen/ad7877.c +++ b/drivers/input/touchscreen/ad7877.c | |||
| @@ -46,7 +46,7 @@ | |||
| 46 | #include <linux/spi/ad7877.h> | 46 | #include <linux/spi/ad7877.h> |
| 47 | #include <asm/irq.h> | 47 | #include <asm/irq.h> |
| 48 | 48 | ||
| 49 | #define TS_PEN_UP_TIMEOUT msecs_to_jiffies(50) | 49 | #define TS_PEN_UP_TIMEOUT msecs_to_jiffies(100) |
| 50 | 50 | ||
| 51 | #define MAX_SPI_FREQ_HZ 20000000 | 51 | #define MAX_SPI_FREQ_HZ 20000000 |
| 52 | #define MAX_12BIT ((1<<12)-1) | 52 | #define MAX_12BIT ((1<<12)-1) |
diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c index 8b05d8e97543..532279cda0e4 100644 --- a/drivers/input/touchscreen/ads7846.c +++ b/drivers/input/touchscreen/ads7846.c | |||
| @@ -36,6 +36,7 @@ | |||
| 36 | * TSC2046 is just newer ads7846 silicon. | 36 | * TSC2046 is just newer ads7846 silicon. |
| 37 | * Support for ads7843 tested on Atmel at91sam926x-EK. | 37 | * Support for ads7843 tested on Atmel at91sam926x-EK. |
| 38 | * Support for ads7845 has only been stubbed in. | 38 | * Support for ads7845 has only been stubbed in. |
| 39 | * Support for Analog Devices AD7873 and AD7843 tested. | ||
| 39 | * | 40 | * |
| 40 | * IRQ handling needs a workaround because of a shortcoming in handling | 41 | * IRQ handling needs a workaround because of a shortcoming in handling |
| 41 | * edge triggered IRQs on some platforms like the OMAP1/2. These | 42 | * edge triggered IRQs on some platforms like the OMAP1/2. These |
| @@ -821,6 +822,9 @@ static int ads7846_suspend(struct spi_device *spi, pm_message_t message) | |||
| 821 | 822 | ||
| 822 | spin_unlock_irq(&ts->lock); | 823 | spin_unlock_irq(&ts->lock); |
| 823 | 824 | ||
| 825 | if (device_may_wakeup(&ts->spi->dev)) | ||
| 826 | enable_irq_wake(ts->spi->irq); | ||
| 827 | |||
| 824 | return 0; | 828 | return 0; |
| 825 | 829 | ||
| 826 | } | 830 | } |
| @@ -829,6 +833,9 @@ static int ads7846_resume(struct spi_device *spi) | |||
| 829 | { | 833 | { |
| 830 | struct ads7846 *ts = dev_get_drvdata(&spi->dev); | 834 | struct ads7846 *ts = dev_get_drvdata(&spi->dev); |
| 831 | 835 | ||
| 836 | if (device_may_wakeup(&ts->spi->dev)) | ||
| 837 | disable_irq_wake(ts->spi->irq); | ||
| 838 | |||
| 832 | spin_lock_irq(&ts->lock); | 839 | spin_lock_irq(&ts->lock); |
| 833 | 840 | ||
| 834 | ts->is_suspended = 0; | 841 | ts->is_suspended = 0; |
| @@ -984,6 +991,15 @@ static int __devinit ads7846_probe(struct spi_device *spi) | |||
| 984 | 991 | ||
| 985 | vref = pdata->keep_vref_on; | 992 | vref = pdata->keep_vref_on; |
| 986 | 993 | ||
| 994 | if (ts->model == 7873) { | ||
| 995 | /* The AD7873 is almost identical to the ADS7846 | ||
| 996 | * keep VREF off during differential/ratiometric | ||
| 997 | * conversion modes | ||
| 998 | */ | ||
| 999 | ts->model = 7846; | ||
| 1000 | vref = 0; | ||
| 1001 | } | ||
| 1002 | |||
| 987 | /* set up the transfers to read touchscreen state; this assumes we | 1003 | /* set up the transfers to read touchscreen state; this assumes we |
| 988 | * use formula #2 for pressure, not #3. | 1004 | * use formula #2 for pressure, not #3. |
| 989 | */ | 1005 | */ |
| @@ -1191,6 +1207,8 @@ static int __devinit ads7846_probe(struct spi_device *spi) | |||
| 1191 | if (err) | 1207 | if (err) |
| 1192 | goto err_remove_attr_group; | 1208 | goto err_remove_attr_group; |
| 1193 | 1209 | ||
| 1210 | device_init_wakeup(&spi->dev, pdata->wakeup); | ||
| 1211 | |||
| 1194 | return 0; | 1212 | return 0; |
| 1195 | 1213 | ||
| 1196 | err_remove_attr_group: | 1214 | err_remove_attr_group: |
| @@ -1220,6 +1238,8 @@ static int __devexit ads7846_remove(struct spi_device *spi) | |||
| 1220 | { | 1238 | { |
| 1221 | struct ads7846 *ts = dev_get_drvdata(&spi->dev); | 1239 | struct ads7846 *ts = dev_get_drvdata(&spi->dev); |
| 1222 | 1240 | ||
| 1241 | device_init_wakeup(&spi->dev, false); | ||
| 1242 | |||
| 1223 | ads784x_hwmon_unregister(spi, ts); | 1243 | ads784x_hwmon_unregister(spi, ts); |
| 1224 | input_unregister_device(ts->input); | 1244 | input_unregister_device(ts->input); |
| 1225 | 1245 | ||
diff --git a/drivers/input/touchscreen/atmel-wm97xx.c b/drivers/input/touchscreen/atmel-wm97xx.c index a12242f77e23..fa8e56bd9094 100644 --- a/drivers/input/touchscreen/atmel-wm97xx.c +++ b/drivers/input/touchscreen/atmel-wm97xx.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <linux/timer.h> | 19 | #include <linux/timer.h> |
| 20 | #include <linux/gpio.h> | 20 | #include <linux/gpio.h> |
| 21 | #include <linux/io.h> | 21 | #include <linux/io.h> |
| 22 | #include <linux/slab.h> | ||
| 22 | 23 | ||
| 23 | #define AC97C_ICA 0x10 | 24 | #define AC97C_ICA 0x10 |
| 24 | #define AC97C_CBRHR 0x30 | 25 | #define AC97C_CBRHR 0x30 |
diff --git a/drivers/input/touchscreen/da9034-ts.c b/drivers/input/touchscreen/da9034-ts.c index 3ffd4c4b170c..2b72a5923c16 100644 --- a/drivers/input/touchscreen/da9034-ts.c +++ b/drivers/input/touchscreen/da9034-ts.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <linux/input.h> | 19 | #include <linux/input.h> |
| 20 | #include <linux/workqueue.h> | 20 | #include <linux/workqueue.h> |
| 21 | #include <linux/mfd/da903x.h> | 21 | #include <linux/mfd/da903x.h> |
| 22 | #include <linux/slab.h> | ||
| 22 | 23 | ||
| 23 | #define DA9034_MANUAL_CTRL 0x50 | 24 | #define DA9034_MANUAL_CTRL 0x50 |
| 24 | #define DA9034_LDO_ADC_EN (1 << 4) | 25 | #define DA9034_LDO_ADC_EN (1 << 4) |
diff --git a/drivers/input/touchscreen/eeti_ts.c b/drivers/input/touchscreen/eeti_ts.c index 9029bd3f34e5..204b8a1a601c 100644 --- a/drivers/input/touchscreen/eeti_ts.c +++ b/drivers/input/touchscreen/eeti_ts.c | |||
| @@ -33,6 +33,7 @@ | |||
| 33 | #include <linux/timer.h> | 33 | #include <linux/timer.h> |
| 34 | #include <linux/gpio.h> | 34 | #include <linux/gpio.h> |
| 35 | #include <linux/input/eeti_ts.h> | 35 | #include <linux/input/eeti_ts.h> |
| 36 | #include <linux/slab.h> | ||
| 36 | 37 | ||
| 37 | static int flip_x; | 38 | static int flip_x; |
| 38 | module_param(flip_x, bool, 0644); | 39 | module_param(flip_x, bool, 0644); |
diff --git a/drivers/input/touchscreen/jornada720_ts.c b/drivers/input/touchscreen/jornada720_ts.c index c8b7e8a45c4d..4b0a061811ff 100644 --- a/drivers/input/touchscreen/jornada720_ts.c +++ b/drivers/input/touchscreen/jornada720_ts.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <linux/input.h> | 18 | #include <linux/input.h> |
| 19 | #include <linux/interrupt.h> | 19 | #include <linux/interrupt.h> |
| 20 | #include <linux/module.h> | 20 | #include <linux/module.h> |
| 21 | #include <linux/slab.h> | ||
| 21 | 22 | ||
| 22 | #include <mach/hardware.h> | 23 | #include <mach/hardware.h> |
| 23 | #include <mach/jornada720.h> | 24 | #include <mach/jornada720.h> |
diff --git a/drivers/input/touchscreen/mc13783_ts.c b/drivers/input/touchscreen/mc13783_ts.c index be54fd639aca..c5bc62d85bb6 100644 --- a/drivers/input/touchscreen/mc13783_ts.c +++ b/drivers/input/touchscreen/mc13783_ts.c | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | #include <linux/module.h> | 17 | #include <linux/module.h> |
| 18 | #include <linux/input.h> | 18 | #include <linux/input.h> |
| 19 | #include <linux/sched.h> | 19 | #include <linux/sched.h> |
| 20 | #include <linux/slab.h> | ||
| 20 | #include <linux/init.h> | 21 | #include <linux/init.h> |
| 21 | 22 | ||
| 22 | #define MC13783_TS_NAME "mc13783-ts" | 23 | #define MC13783_TS_NAME "mc13783-ts" |
diff --git a/drivers/input/touchscreen/mcs5000_ts.c b/drivers/input/touchscreen/mcs5000_ts.c index 4c28b89757f9..ce8ab0269f6f 100644 --- a/drivers/input/touchscreen/mcs5000_ts.c +++ b/drivers/input/touchscreen/mcs5000_ts.c | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #include <linux/interrupt.h> | 20 | #include <linux/interrupt.h> |
| 21 | #include <linux/input.h> | 21 | #include <linux/input.h> |
| 22 | #include <linux/irq.h> | 22 | #include <linux/irq.h> |
| 23 | #include <linux/slab.h> | ||
| 23 | 24 | ||
| 24 | /* Registers */ | 25 | /* Registers */ |
| 25 | #define MCS5000_TS_STATUS 0x00 | 26 | #define MCS5000_TS_STATUS 0x00 |
diff --git a/drivers/input/touchscreen/migor_ts.c b/drivers/input/touchscreen/migor_ts.c index 141dd584330e..defe5dd3627c 100644 --- a/drivers/input/touchscreen/migor_ts.c +++ b/drivers/input/touchscreen/migor_ts.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | #include <linux/kernel.h> | 23 | #include <linux/kernel.h> |
| 24 | #include <linux/input.h> | 24 | #include <linux/input.h> |
| 25 | #include <linux/interrupt.h> | 25 | #include <linux/interrupt.h> |
| 26 | #include <linux/slab.h> | ||
| 26 | #include <asm/io.h> | 27 | #include <asm/io.h> |
| 27 | #include <linux/i2c.h> | 28 | #include <linux/i2c.h> |
| 28 | #include <linux/timer.h> | 29 | #include <linux/timer.h> |
diff --git a/drivers/input/touchscreen/pcap_ts.c b/drivers/input/touchscreen/pcap_ts.c index b79097e3028a..ea6ef16e59b4 100644 --- a/drivers/input/touchscreen/pcap_ts.c +++ b/drivers/input/touchscreen/pcap_ts.c | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
| 15 | #include <linux/fs.h> | 15 | #include <linux/fs.h> |
| 16 | #include <linux/string.h> | 16 | #include <linux/string.h> |
| 17 | #include <linux/slab.h> | ||
| 17 | #include <linux/pm.h> | 18 | #include <linux/pm.h> |
| 18 | #include <linux/timer.h> | 19 | #include <linux/timer.h> |
| 19 | #include <linux/interrupt.h> | 20 | #include <linux/interrupt.h> |
diff --git a/drivers/input/touchscreen/s3c2410_ts.c b/drivers/input/touchscreen/s3c2410_ts.c index 3755a47d053c..98a7d1279486 100644 --- a/drivers/input/touchscreen/s3c2410_ts.c +++ b/drivers/input/touchscreen/s3c2410_ts.c | |||
| @@ -26,7 +26,6 @@ | |||
| 26 | #include <linux/errno.h> | 26 | #include <linux/errno.h> |
| 27 | #include <linux/kernel.h> | 27 | #include <linux/kernel.h> |
| 28 | #include <linux/module.h> | 28 | #include <linux/module.h> |
| 29 | #include <linux/slab.h> | ||
| 30 | #include <linux/gpio.h> | 29 | #include <linux/gpio.h> |
| 31 | #include <linux/input.h> | 30 | #include <linux/input.h> |
| 32 | #include <linux/init.h> | 31 | #include <linux/init.h> |
diff --git a/drivers/input/touchscreen/ucb1400_ts.c b/drivers/input/touchscreen/ucb1400_ts.c index 89dcbe7b4b02..028a5363eea1 100644 --- a/drivers/input/touchscreen/ucb1400_ts.c +++ b/drivers/input/touchscreen/ucb1400_ts.c | |||
| @@ -26,7 +26,6 @@ | |||
| 26 | #include <linux/device.h> | 26 | #include <linux/device.h> |
| 27 | #include <linux/interrupt.h> | 27 | #include <linux/interrupt.h> |
| 28 | #include <linux/suspend.h> | 28 | #include <linux/suspend.h> |
| 29 | #include <linux/slab.h> | ||
| 30 | #include <linux/kthread.h> | 29 | #include <linux/kthread.h> |
| 31 | #include <linux/freezer.h> | 30 | #include <linux/freezer.h> |
| 32 | #include <linux/ucb1400.h> | 31 | #include <linux/ucb1400.h> |
diff --git a/drivers/input/touchscreen/w90p910_ts.c b/drivers/input/touchscreen/w90p910_ts.c index 6ccbdbbf33fe..cc18265be1a8 100644 --- a/drivers/input/touchscreen/w90p910_ts.c +++ b/drivers/input/touchscreen/w90p910_ts.c | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | #include <linux/clk.h> | 16 | #include <linux/clk.h> |
| 17 | #include <linux/input.h> | 17 | #include <linux/input.h> |
| 18 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
| 19 | #include <linux/slab.h> | ||
| 19 | 20 | ||
| 20 | /* ADC controller bit defines */ | 21 | /* ADC controller bit defines */ |
| 21 | #define ADC_DELAY 0xf00 | 22 | #define ADC_DELAY 0xf00 |
diff --git a/drivers/input/touchscreen/wm97xx-core.c b/drivers/input/touchscreen/wm97xx-core.c index f944918466e5..5109bf3dd858 100644 --- a/drivers/input/touchscreen/wm97xx-core.c +++ b/drivers/input/touchscreen/wm97xx-core.c | |||
| @@ -48,6 +48,7 @@ | |||
| 48 | #include <linux/wm97xx.h> | 48 | #include <linux/wm97xx.h> |
| 49 | #include <linux/uaccess.h> | 49 | #include <linux/uaccess.h> |
| 50 | #include <linux/io.h> | 50 | #include <linux/io.h> |
| 51 | #include <linux/slab.h> | ||
| 51 | 52 | ||
| 52 | #define TS_NAME "wm97xx" | 53 | #define TS_NAME "wm97xx" |
| 53 | #define WM_CORE_VERSION "1.00" | 54 | #define WM_CORE_VERSION "1.00" |
diff --git a/drivers/input/xen-kbdfront.c b/drivers/input/xen-kbdfront.c index d30436fee476..e14081675bb2 100644 --- a/drivers/input/xen-kbdfront.c +++ b/drivers/input/xen-kbdfront.c | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | #include <linux/errno.h> | 21 | #include <linux/errno.h> |
| 22 | #include <linux/module.h> | 22 | #include <linux/module.h> |
| 23 | #include <linux/input.h> | 23 | #include <linux/input.h> |
| 24 | #include <linux/slab.h> | ||
| 24 | 25 | ||
| 25 | #include <asm/xen/hypervisor.h> | 26 | #include <asm/xen/hypervisor.h> |
| 26 | 27 | ||
