Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/dtor/input

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: i8042 - add ALDI/MEDION netbook E1222 to qurik reset table
  Input: ALPS - fix stuck buttons on some touchpads
  Input: wm831x-on - convert to use genirq
  Input: ads7846 - add wakeup support
  Input: appletouch - fix integer overflow issue
  Input: ad7877 - increase pen up imeout
  Input: ads7846 - add support for AD7843 parts
  Input: bf54x-keys - fix system hang when pressing a key
  Input: alps - add support for the touchpad on Toshiba Tecra A11-11L
  Input: remove BKL, fix input_open_file() locking
  Input: serio_raw - remove BKL
  Input: mousedev - remove BKL
  Input: add driver for TWL4030 vibrator device
  Input: enable remote wakeup for PNP i8042 keyboard ports
  Input: scancode in get/set_keycodes should be unsigned
  Input: i8042 - use platfrom_create_bundle() helper
  Input: wacom - merge out and in prox events
  Input: gamecon - fix off by one range check
  Input: wacom - replace WACOM_PKGLEN_PENABLED
  • Loading branch information
Linus Torvalds committed Mar 14, 2010
2 parents f901e75 + 31968ec commit a818d8e
Show file tree
Hide file tree
Showing 33 changed files with 549 additions and 283 deletions.
24 changes: 12 additions & 12 deletions drivers/hid/hid-input.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,22 +68,25 @@ static const struct {
#define map_key_clear(c) hid_map_usage_clear(hidinput, usage, &bit, \
&max, EV_KEY, (c))

static inline int match_scancode(int code, int scancode)
static inline int match_scancode(unsigned int code, unsigned int scancode)
{
if (scancode == 0)
return 1;
return ((code & (HID_USAGE_PAGE | HID_USAGE)) == scancode);

return (code & (HID_USAGE_PAGE | HID_USAGE)) == scancode;
}

static inline int match_keycode(int code, int keycode)
static inline int match_keycode(unsigned int code, unsigned int keycode)
{
if (keycode == 0)
return 1;
return (code == keycode);

return code == keycode;
}

static struct hid_usage *hidinput_find_key(struct hid_device *hid,
int scancode, int keycode)
unsigned int scancode,
unsigned int keycode)
{
int i, j, k;
struct hid_report *report;
Expand All @@ -105,8 +108,8 @@ static struct hid_usage *hidinput_find_key(struct hid_device *hid,
return NULL;
}

static int hidinput_getkeycode(struct input_dev *dev, int scancode,
int *keycode)
static int hidinput_getkeycode(struct input_dev *dev,
unsigned int scancode, unsigned int *keycode)
{
struct hid_device *hid = input_get_drvdata(dev);
struct hid_usage *usage;
Expand All @@ -119,16 +122,13 @@ static int hidinput_getkeycode(struct input_dev *dev, int scancode,
return -EINVAL;
}

static int hidinput_setkeycode(struct input_dev *dev, int scancode,
int keycode)
static int hidinput_setkeycode(struct input_dev *dev,
unsigned int scancode, unsigned int keycode)
{
struct hid_device *hid = input_get_drvdata(dev);
struct hid_usage *usage;
int old_keycode;

if (keycode < 0 || keycode > KEY_MAX)
return -EINVAL;

usage = hidinput_find_key(hid, scancode, 0);
if (usage) {
old_keycode = usage->code;
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/evdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ static long evdev_do_ioctl(struct file *file, unsigned int cmd,
struct input_absinfo abs;
struct ff_effect effect;
int __user *ip = (int __user *)p;
int i, t, u, v;
unsigned int i, t, u, v;
int error;

switch (cmd) {
Expand Down
38 changes: 19 additions & 19 deletions drivers/input/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,8 @@ static int input_fetch_keycode(struct input_dev *dev, int scancode)
}

static int input_default_getkeycode(struct input_dev *dev,
int scancode, int *keycode)
unsigned int scancode,
unsigned int *keycode)
{
if (!dev->keycodesize)
return -EINVAL;
Expand All @@ -596,7 +597,8 @@ static int input_default_getkeycode(struct input_dev *dev,
}

static int input_default_setkeycode(struct input_dev *dev,
int scancode, int keycode)
unsigned int scancode,
unsigned int keycode)
{
int old_keycode;
int i;
Expand Down Expand Up @@ -654,11 +656,9 @@ static int input_default_setkeycode(struct input_dev *dev,
* This function should be called by anyone interested in retrieving current
* keymap. Presently keyboard and evdev handlers use it.
*/
int input_get_keycode(struct input_dev *dev, int scancode, int *keycode)
int input_get_keycode(struct input_dev *dev,
unsigned int scancode, unsigned int *keycode)
{
if (scancode < 0)
return -EINVAL;

return dev->getkeycode(dev, scancode, keycode);
}
EXPORT_SYMBOL(input_get_keycode);
Expand All @@ -672,16 +672,14 @@ EXPORT_SYMBOL(input_get_keycode);
* This function should be called by anyone needing to update current
* keymap. Presently keyboard and evdev handlers use it.
*/
int input_set_keycode(struct input_dev *dev, int scancode, int keycode)
int input_set_keycode(struct input_dev *dev,
unsigned int scancode, unsigned int keycode)
{
unsigned long flags;
int old_keycode;
int retval;

if (scancode < 0)
return -EINVAL;

if (keycode < 0 || keycode > KEY_MAX)
if (keycode > KEY_MAX)
return -EINVAL;

spin_lock_irqsave(&dev->event_lock, flags);
Expand Down Expand Up @@ -1881,35 +1879,37 @@ static int input_open_file(struct inode *inode, struct file *file)
const struct file_operations *old_fops, *new_fops = NULL;
int err;

lock_kernel();
err = mutex_lock_interruptible(&input_mutex);
if (err)
return err;

/* No load-on-demand here? */
handler = input_table[iminor(inode) >> 5];
if (!handler || !(new_fops = fops_get(handler->fops))) {
err = -ENODEV;
goto out;
}
if (handler)
new_fops = fops_get(handler->fops);

mutex_unlock(&input_mutex);

/*
* That's _really_ odd. Usually NULL ->open means "nothing special",
* not "no device". Oh, well...
*/
if (!new_fops->open) {
if (!new_fops || !new_fops->open) {
fops_put(new_fops);
err = -ENODEV;
goto out;
}

old_fops = file->f_op;
file->f_op = new_fops;

err = new_fops->open(inode, file);

if (err) {
fops_put(file->f_op);
file->f_op = fops_get(old_fops);
}
fops_put(old_fops);
out:
unlock_kernel();
return err;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/input/joystick/gamecon.c
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ static int __init gc_setup_pad(struct gc *gc, int idx, int pad_type)
int i;
int err;

if (pad_type < 1 || pad_type > GC_MAX) {
if (pad_type < 1 || pad_type >= GC_MAX) {
pr_err("Pad type %d unknown\n", pad_type);
return -EINVAL;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/keyboard/bf54x-keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ static irqreturn_t bfin_kpad_isr(int irq, void *dev_id)
input_sync(input);

if (bfin_kpad_get_keypressed(bf54x_kpad)) {
disable_irq(bf54x_kpad->irq);
disable_irq_nosync(bf54x_kpad->irq);
bf54x_kpad->lastkey = key;
mod_timer(&bf54x_kpad->timer,
jiffies + bf54x_kpad->keyup_test_jiffies);
Expand Down
11 changes: 11 additions & 0 deletions drivers/input/misc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,17 @@ config INPUT_TWL4030_PWRBUTTON
To compile this driver as a module, choose M here. The module will
be called twl4030_pwrbutton.

config INPUT_TWL4030_VIBRA
tristate "Support for TWL4030 Vibrator"
depends on TWL4030_CORE
select TWL4030_CODEC
select INPUT_FF_MEMLESS
help
This option enables support for TWL4030 Vibrator Driver.

To compile this driver as a module, choose M here. The module will
be called twl4030_vibra.

config INPUT_UINPUT
tristate "User level driver support"
help
Expand Down
1 change: 1 addition & 0 deletions drivers/input/misc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ obj-$(CONFIG_INPUT_GPIO_ROTARY_ENCODER) += rotary_encoder.o
obj-$(CONFIG_INPUT_SGI_BTNS) += sgi_btns.o
obj-$(CONFIG_INPUT_SPARCSPKR) += sparcspkr.o
obj-$(CONFIG_INPUT_TWL4030_PWRBUTTON) += twl4030-pwrbutton.o
obj-$(CONFIG_INPUT_TWL4030_VIBRA) += twl4030-vibra.o
obj-$(CONFIG_INPUT_UINPUT) += uinput.o
obj-$(CONFIG_INPUT_WINBOND_CIR) += winbond-cir.o
obj-$(CONFIG_INPUT_WISTRON_BTNS) += wistron_btns.o
Expand Down
14 changes: 7 additions & 7 deletions drivers/input/misc/ati_remote2.c
Original file line number Diff line number Diff line change
Expand Up @@ -474,10 +474,11 @@ static void ati_remote2_complete_key(struct urb *urb)
}

static int ati_remote2_getkeycode(struct input_dev *idev,
int scancode, int *keycode)
unsigned int scancode, unsigned int *keycode)
{
struct ati_remote2 *ar2 = input_get_drvdata(idev);
int index, mode;
unsigned int mode;
int index;

mode = scancode >> 8;
if (mode > ATI_REMOTE2_PC || !((1 << mode) & ar2->mode_mask))
Expand All @@ -491,10 +492,12 @@ static int ati_remote2_getkeycode(struct input_dev *idev,
return 0;
}

static int ati_remote2_setkeycode(struct input_dev *idev, int scancode, int keycode)
static int ati_remote2_setkeycode(struct input_dev *idev,
unsigned int scancode, unsigned int keycode)
{
struct ati_remote2 *ar2 = input_get_drvdata(idev);
int index, mode, old_keycode;
unsigned int mode, old_keycode;
int index;

mode = scancode >> 8;
if (mode > ATI_REMOTE2_PC || !((1 << mode) & ar2->mode_mask))
Expand All @@ -504,9 +507,6 @@ static int ati_remote2_setkeycode(struct input_dev *idev, int scancode, int keyc
if (index < 0)
return -EINVAL;

if (keycode < KEY_RESERVED || keycode > KEY_MAX)
return -EINVAL;

old_keycode = ar2->keycode[mode][index];
ar2->keycode[mode][index] = keycode;
__set_bit(keycode, idev->keybit);
Expand Down
Loading

0 comments on commit a818d8e

Please sign in to comment.