From patchwork Sat Aug 27 13:24:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Achatz X-Patchwork-Id: 1103742 X-Patchwork-Delegate: jikos@jikos.cz Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7RDPg8Z029459 for ; Sat, 27 Aug 2011 13:25:42 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751254Ab1H0NYu (ORCPT ); Sat, 27 Aug 2011 09:24:50 -0400 Received: from mail-in-18.arcor-online.net ([151.189.21.58]:38488 "EHLO mail-in-18.arcor-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752180Ab1H0NYs (ORCPT ); Sat, 27 Aug 2011 09:24:48 -0400 Received: from mail-in-11-z2.arcor-online.net (mail-in-11-z2.arcor-online.net [151.189.8.28]) by mx.arcor.de (Postfix) with ESMTP id 0FE323DC51B; Sat, 27 Aug 2011 15:24:47 +0200 (CEST) Received: from mail-in-10.arcor-online.net (mail-in-10.arcor-online.net [151.189.21.50]) by mail-in-11-z2.arcor-online.net (Postfix) with ESMTP id 027011CB842; Sat, 27 Aug 2011 15:24:47 +0200 (CEST) Received: from [192.168.0.7] (dslb-188-105-218-067.pools.arcor-ip.net [188.105.218.67]) (Authenticated sender: screamingfist@arcor.de) by mail-in-10.arcor-online.net (Postfix) with ESMTPSA id 8BBCB2D6724; Sat, 27 Aug 2011 15:24:46 +0200 (CEST) X-DKIM: Sendmail DKIM Filter v2.8.2 mail-in-10.arcor-online.net 8BBCB2D6724 Subject: [PATCH 3/5] HID: roccat: Kovaplus now reports external profile changes via roccat device From: Stefan Achatz Reply-To: erazor_de@users.sourceforge.net To: Jiri Kosina , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Date: Sat, 27 Aug 2011 15:24:45 +0200 Message-ID: <1314451485.24216.74.camel@neuromancer.tessier-ashpool> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 (2.30.3-1.fc13) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Sat, 27 Aug 2011 13:25:42 +0000 (UTC) Profile changes were only reported when issued mouse internal. Now all changes are reported. Signed-off-by: Stefan Achatz --- drivers/hid/hid-roccat-kovaplus.c | 17 +++++++++++++++-- 1 files changed, 15 insertions(+), 2 deletions(-) diff --git a/drivers/hid/hid-roccat-kovaplus.c b/drivers/hid/hid-roccat-kovaplus.c index 1f8336e..112d934 100644 --- a/drivers/hid/hid-roccat-kovaplus.c +++ b/drivers/hid/hid-roccat-kovaplus.c @@ -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)); @@ -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; }