Skip to content

Commit

Permalink
HID: roccat: Kovaplus now reports external profile changes via roccat…
Browse files Browse the repository at this point in the history
… 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>
  • Loading branch information
Stefan Achatz authored and Jiri Kosina committed Sep 7, 2011
1 parent dc186b6 commit 6b9a57b
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions drivers/hid/hid-roccat-kovaplus.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ static ssize_t kovaplus_sysfs_set_actual_profile(struct device *dev,
struct usb_device *usb_dev;
unsigned long profile;
int retval;
struct kovaplus_roccat_report roccat_report;

dev = dev->parent->parent;
kovaplus = hid_get_drvdata(dev_get_drvdata(dev));
Expand All @@ -337,10 +338,22 @@ static ssize_t kovaplus_sysfs_set_actual_profile(struct device *dev,

mutex_lock(&kovaplus->kovaplus_lock);
retval = kovaplus_set_actual_profile(usb_dev, profile);
if (retval) {
mutex_unlock(&kovaplus->kovaplus_lock);
return retval;
}

kovaplus_profile_activated(kovaplus, profile);

roccat_report.type = KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_PROFILE_1;
roccat_report.profile = profile + 1;
roccat_report.button = 0;
roccat_report.data1 = profile + 1;
roccat_report.data2 = 0;
roccat_report_event(kovaplus->chrdev_minor,
(uint8_t const *)&roccat_report);

mutex_unlock(&kovaplus->kovaplus_lock);
if (retval)
return retval;

return size;
}
Expand Down

0 comments on commit 6b9a57b

Please sign in to comment.