diff options
author | Stefan Achatz <erazor_de@users.sourceforge.net> | 2011-08-27 09:24:41 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2011-09-07 07:38:27 -0400 |
commit | dc186b661cbb30ef593131a43d0d7ce721def512 (patch) | |
tree | 6488f9b98da4a05612f4bc6b91a773be274c8d19 /drivers/hid | |
parent | 1c5784da12e34e98eb0a1b8f4323419dd84ea0b0 (diff) |
HID: roccat: Pyra now reports external profile changes via roccat device
Profile changes were only reported when issued mouse internal. Now all
changes are reported.
Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-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 8140776bd8c5..df05c1b1064f 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, | |||
298 | struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev)); | 298 | struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev)); |
299 | int retval = 0; | 299 | int retval = 0; |
300 | int difference; | 300 | int difference; |
301 | struct pyra_roccat_report roccat_report; | ||
301 | 302 | ||
302 | if (off != 0 || count != sizeof(struct pyra_settings)) | 303 | if (off != 0 || count != sizeof(struct pyra_settings)) |
303 | return -EINVAL; | 304 | return -EINVAL; |
@@ -307,17 +308,23 @@ static ssize_t pyra_sysfs_write_settings(struct file *fp, | |||
307 | if (difference) { | 308 | if (difference) { |
308 | retval = pyra_set_settings(usb_dev, | 309 | retval = pyra_set_settings(usb_dev, |
309 | (struct pyra_settings const *)buf); | 310 | (struct pyra_settings const *)buf); |
310 | if (!retval) | 311 | if (retval) { |
311 | memcpy(&pyra->settings, buf, | 312 | mutex_unlock(&pyra->pyra_lock); |
312 | sizeof(struct pyra_settings)); | 313 | return retval; |
313 | } | 314 | } |
314 | mutex_unlock(&pyra->pyra_lock); | ||
315 | 315 | ||
316 | if (retval) | 316 | memcpy(&pyra->settings, buf, |
317 | return retval; | 317 | sizeof(struct pyra_settings)); |
318 | 318 | ||
319 | profile_activated(pyra, pyra->settings.startup_profile); | 319 | profile_activated(pyra, pyra->settings.startup_profile); |
320 | 320 | ||
321 | roccat_report.type = PYRA_MOUSE_EVENT_BUTTON_TYPE_PROFILE_2; | ||
322 | roccat_report.value = pyra->settings.startup_profile + 1; | ||
323 | roccat_report.key = 0; | ||
324 | roccat_report_event(pyra->chrdev_minor, | ||
325 | (uint8_t const *)&roccat_report); | ||
326 | } | ||
327 | mutex_unlock(&pyra->pyra_lock); | ||
321 | return sizeof(struct pyra_settings); | 328 | return sizeof(struct pyra_settings); |
322 | } | 329 | } |
323 | 330 | ||