Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: wacom - fix runtime PM related deadlock
  Input: joydev - fix JSIOCSAXMAP ioctl
  Input: uinput - setup MT usage during device creation
This commit is contained in:
Linus Torvalds 2010-10-07 13:46:33 -07:00
commit afe147466c
3 changed files with 22 additions and 11 deletions

View File

@ -483,6 +483,9 @@ static int joydev_handle_JSIOCSAXMAP(struct joydev *joydev,
memcpy(joydev->abspam, abspam, len); memcpy(joydev->abspam, abspam, len);
for (i = 0; i < joydev->nabs; i++)
joydev->absmap[joydev->abspam[i]] = i;
out: out:
kfree(abspam); kfree(abspam);
return retval; return retval;

View File

@ -404,6 +404,13 @@ static int uinput_setup_device(struct uinput_device *udev, const char __user *bu
retval = uinput_validate_absbits(dev); retval = uinput_validate_absbits(dev);
if (retval < 0) if (retval < 0)
goto exit; goto exit;
if (test_bit(ABS_MT_SLOT, dev->absbit)) {
int nslot = input_abs_get_max(dev, ABS_MT_SLOT) + 1;
input_mt_create_slots(dev, nslot);
input_set_events_per_packet(dev, 6 * nslot);
} else if (test_bit(ABS_MT_POSITION_X, dev->absbit)) {
input_set_events_per_packet(dev, 60);
}
} }
udev->state = UIST_SETUP_COMPLETE; udev->state = UIST_SETUP_COMPLETE;

View File

@ -103,27 +103,26 @@ static void wacom_sys_irq(struct urb *urb)
static int wacom_open(struct input_dev *dev) static int wacom_open(struct input_dev *dev)
{ {
struct wacom *wacom = input_get_drvdata(dev); struct wacom *wacom = input_get_drvdata(dev);
int retval = 0;
if (usb_autopm_get_interface(wacom->intf) < 0)
return -EIO;
mutex_lock(&wacom->lock); mutex_lock(&wacom->lock);
wacom->irq->dev = wacom->usbdev;
if (usb_autopm_get_interface(wacom->intf) < 0) {
mutex_unlock(&wacom->lock);
return -EIO;
}
if (usb_submit_urb(wacom->irq, GFP_KERNEL)) { if (usb_submit_urb(wacom->irq, GFP_KERNEL)) {
usb_autopm_put_interface(wacom->intf); retval = -EIO;
mutex_unlock(&wacom->lock); goto out;
return -EIO;
} }
wacom->open = true; wacom->open = true;
wacom->intf->needs_remote_wakeup = 1; wacom->intf->needs_remote_wakeup = 1;
out:
mutex_unlock(&wacom->lock); mutex_unlock(&wacom->lock);
return 0; if (retval)
usb_autopm_put_interface(wacom->intf);
return retval;
} }
static void wacom_close(struct input_dev *dev) static void wacom_close(struct input_dev *dev)
@ -135,6 +134,8 @@ static void wacom_close(struct input_dev *dev)
wacom->open = false; wacom->open = false;
wacom->intf->needs_remote_wakeup = 0; wacom->intf->needs_remote_wakeup = 0;
mutex_unlock(&wacom->lock); mutex_unlock(&wacom->lock);
usb_autopm_put_interface(wacom->intf);
} }
static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hid_desc, static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hid_desc,