diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-25 12:03:13 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-25 12:03:13 +0200 |
commit | 31dced41c6822ce751c033a53502ea4d8d399422 (patch) | |
tree | 53f6abc56c517a6dcb790bf9b3a71ac42694233a /drivers/hid/hid-roccat-pyra.c | |
parent | 7c1953ddb609f1c161bf4a11a5e4e4577e82e557 (diff) | |
parent | b3aec7b686329e6bb65aa08c7f9458f7fd512f06 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (61 commits)
HID: hid-magicmouse: Magic Trackpad has 1 button, not 2
HID: Add device IDs for more SJOY adapters
HID: primax: remove spurious dependency
HID: support primax keyboards violating USB HID spec
HID: usbhid: cancel timer for retry synchronously
HID: wacom: Set input bits before registration
HID: consolidate MacbookAir 4,1 mappings
HID: MacbookAir4,1 and MacbookAir4,2 need entry in hid_mouse_ignore_list[]
HID: Add support MacbookAir 4,1 keyboard
HID: hidraw: open count should not increase if error
HID: hiddev: potential info leak in hiddev_ioctl()
HID: multitouch: decide if hid-multitouch needs to handle mt devices
HID: add autodetection of multitouch devices
HID: "hid-logitech" driver with Logitech Driving Force GT
HID: hid-logitech-dj: fix off by one
HID: hidraw: protect hidraw_disconnect() better
HID: hid-multitouch: add support for the IDEACOM 6650 chip
HID: Add full support for Logitech Unifying receivers
HID: hidraw: free list for all error in hidraw_open
HID: roccat: Kone now reports external profile changes via roccat device
...
Diffstat (limited to 'drivers/hid/hid-roccat-pyra.c')
-rw-r--r-- | drivers/hid/hid-roccat-pyra.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/drivers/hid/hid-roccat-pyra.c b/drivers/hid/hid-roccat-pyra.c index 8140776bd8c..df05c1b1064 100644 --- a/drivers/hid/hid-roccat-pyra.c +++ b/drivers/hid/hid-roccat-pyra.c @@ -298,6 +298,7 @@ static ssize_t pyra_sysfs_write_settings(struct file *fp, struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev)); int retval = 0; int difference; + struct pyra_roccat_report roccat_report; if (off != 0 || count != sizeof(struct pyra_settings)) return -EINVAL; @@ -307,17 +308,23 @@ static ssize_t pyra_sysfs_write_settings(struct file *fp, if (difference) { retval = pyra_set_settings(usb_dev, (struct pyra_settings const *)buf); - if (!retval) - memcpy(&pyra->settings, buf, - sizeof(struct pyra_settings)); - } - mutex_unlock(&pyra->pyra_lock); + if (retval) { + mutex_unlock(&pyra->pyra_lock); + return retval; + } - if (retval) - return retval; + memcpy(&pyra->settings, buf, + sizeof(struct pyra_settings)); - profile_activated(pyra, pyra->settings.startup_profile); + profile_activated(pyra, pyra->settings.startup_profile); + roccat_report.type = PYRA_MOUSE_EVENT_BUTTON_TYPE_PROFILE_2; + roccat_report.value = pyra->settings.startup_profile + 1; + roccat_report.key = 0; + roccat_report_event(pyra->chrdev_minor, + (uint8_t const *)&roccat_report); + } + mutex_unlock(&pyra->pyra_lock); return sizeof(struct pyra_settings); } |