From patchwork Wed May 12 15:43:59 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Achatz X-Patchwork-Id: 99031 X-Patchwork-Delegate: jikos@jikos.cz Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4CFiF1h019372 for ; Wed, 12 May 2010 15:44:15 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756106Ab0ELPoE (ORCPT ); Wed, 12 May 2010 11:44:04 -0400 Received: from mail-in-05.arcor-online.net ([151.189.21.45]:60441 "EHLO mail-in-05.arcor-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756092Ab0ELPoC (ORCPT ); Wed, 12 May 2010 11:44:02 -0400 Received: from mail-in-12-z2.arcor-online.net (mail-in-12-z2.arcor-online.net [151.189.8.29]) by mx.arcor.de (Postfix) with ESMTP id 0F8A1E3E71; Wed, 12 May 2010 17:44:01 +0200 (CEST) Received: from mail-in-07.arcor-online.net (mail-in-07.arcor-online.net [151.189.21.47]) by mail-in-12-z2.arcor-online.net (Postfix) with ESMTP id D73332794C2; Wed, 12 May 2010 17:44:00 +0200 (CEST) Received: from [192.168.0.1] (dslb-088-065-138-186.pools.arcor-ip.net [88.65.138.186]) by mail-in-07.arcor-online.net (Postfix) with ESMTPS id 2FC5A107DFE; Wed, 12 May 2010 17:44:00 +0200 (CEST) X-DKIM: Sendmail DKIM Filter v2.8.2 mail-in-07.arcor-online.net 2FC5A107DFE Subject: [PATCH 2/5] HID: Added further information for Roccat Kone From: Stefan Achatz Reply-To: erazor_de@users.sourceforge.net To: Jiri Kosina , Stephane Chatty , Jussi Kivilinna , wylda@volny.cz, Stefan Achatz , Jerome Vidal , Tejun Heo , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 12 May 2010 17:43:59 +0200 Message-ID: <1273679039.2927.5.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 (2.28.3-1.fc12) 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.3 (demeter.kernel.org [140.211.167.41]); Wed, 12 May 2010 15:44:15 +0000 (UTC) diff --git a/drivers/hid/hid-roccat-kone.c b/drivers/hid/hid-roccat-kone.c index d23d309..9d68442 100644 --- a/drivers/hid/hid-roccat-kone.c +++ b/drivers/hid/hid-roccat-kone.c @@ -928,14 +928,15 @@ static int kone_raw_event(struct hid_device *hdev, struct hid_report *report, return 0; /* - * Firmware 1.38 introduced new behaviour for tilt buttons. - * Pressed tilt button is reported in each movement event. + * Firmware 1.38 introduced new behaviour for tilt and special buttons. + * Pressed button is reported in each movement event. * Workaround sends only one event per press. */ - if (kone->last_tilt_state == event->tilt) - event->tilt = 0; + if (memcmp(&kone->last_mouse_event.tilt, &event->tilt, 5)) + memcpy(&kone->last_mouse_event, event, + sizeof(struct kone_mouse_event)); else - kone->last_tilt_state = event->tilt; + memset(&event->tilt, 0, 5); /* * handle special events and keep actual profile and dpi values diff --git a/drivers/hid/hid-roccat-kone.h b/drivers/hid/hid-roccat-kone.h index 99290ad..b413b10 100644 --- a/drivers/hid/hid-roccat-kone.h +++ b/drivers/hid/hid-roccat-kone.h @@ -80,6 +80,17 @@ enum kone_button_info_types { kone_button_info_type_multimedia_volume_down = 0x27 }; +enum kone_button_info_numbers { + kone_button_top = 1, + kone_button_wheel_tilt_left = 2, + kone_button_wheel_tilt_right = 3, + kone_button_forward = 4, + kone_button_backward = 5, + kone_button_middle = 6, + kone_button_plus = 7, + kone_button_minus = 8, +}; + struct kone_light_info { uint8_t number; /* number of light 1-5 */ uint8_t mod; /* 1 = on, 2 = off */ @@ -117,6 +128,7 @@ struct kone_profile { uint8_t light_effect_speed; /* range 0-255 */ struct kone_light_info light_infos[5]; + /* offset is kone_button_info_numbers - 1 */ struct kone_button_info button_infos[8]; uint16_t checksum; /* \brief holds checksum of struct */ @@ -162,7 +174,7 @@ enum kone_mouse_events { /* TODO clarify meaning and occurence of kone_mouse_event_calibration */ kone_mouse_event_calibration = 0xc0, kone_mouse_event_call_overlong_macro = 0xe0, - /* switch events notify if user changed values wiht mousebutton click */ + /* switch events notify if user changed values with mousebutton click */