From patchwork Fri Dec 18 15:10:21 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Kosina X-Patchwork-Id: 68704 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.2) with ESMTP id nBIFAglN014783 for ; Fri, 18 Dec 2009 15:10:43 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754476AbZLRPKa (ORCPT ); Fri, 18 Dec 2009 10:10:30 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754468AbZLRPK2 (ORCPT ); Fri, 18 Dec 2009 10:10:28 -0500 Received: from cantor.suse.de ([195.135.220.2]:59183 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754462AbZLRPKX (ORCPT ); Fri, 18 Dec 2009 10:10:23 -0500 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 9742F94109; Fri, 18 Dec 2009 16:10:22 +0100 (CET) Date: Fri, 18 Dec 2009 16:10:21 +0100 (CET) From: Jiri Kosina To: Dmitry Torokhov Cc: Stefan Bader , Anssi Hannula , Tim Cole , Sergey Kolesnikov , linux-input@vger.kernel.org Subject: Re: linux kernel HID problem with Saitek X52 Pro Flight System In-Reply-To: <20091217013831.GF6800@core.coreip.homeip.net> Message-ID: References: <1260541128.3656.6.camel@bede> <4B225601.3080002@canonical.com> <1260572529.3656.12.camel@bede> <4B22F952.6070001@iki.fi> <20091212044425.GA2956@core.coreip.homeip.net> <4B261412.6090409@canonical.com> <20091214173631.GC2373@core.coreip.homeip.net> <4B278C67.5050505@canonical.com> <20091217013831.GF6800@core.coreip.homeip.net> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 5862b0f..dad7aae 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -198,7 +198,12 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel switch (field->application) { case HID_GD_MOUSE: case HID_GD_POINTER: code += 0x110; break; - case HID_GD_JOYSTICK: code += 0x120; break; + case HID_GD_JOYSTICK: + if (code <= 0xf) + code += BTN_JOYSTICK; + else + code += BTN_TRIGGER_HAPPY; + break; case HID_GD_GAMEPAD: code += 0x130; break; default: switch (field->physical) { diff --git a/include/linux/input.h b/include/linux/input.h index 7be8a65..7c54287 100644 --- a/include/linux/input.h +++ b/include/linux/input.h @@ -597,6 +597,48 @@ struct input_absinfo { #define KEY_CAMERA_FOCUS 0x210 +#define BTN_TRIGGER_HAPPY 0x220 +#define BTN_TRIGGER_HAPPY1 0x220 +#define BTN_TRIGGER_HAPPY2 0x221 +#define BTN_TRIGGER_HAPPY3 0x222 +#define BTN_TRIGGER_HAPPY4 0x223 +#define BTN_TRIGGER_HAPPY5 0x224 +#define BTN_TRIGGER_HAPPY6 0x225 +#define BTN_TRIGGER_HAPPY7 0x226 +#define BTN_TRIGGER_HAPPY8 0x227 +#define BTN_TRIGGER_HAPPY9 0x228 +#define BTN_TRIGGER_HAPPY10 0x229 +#define BTN_TRIGGER_HAPPY11 0x22a +#define BTN_TRIGGER_HAPPY12 0x22b +#define BTN_TRIGGER_HAPPY13 0x22c +#define BTN_TRIGGER_HAPPY14 0x22d +#define BTN_TRIGGER_HAPPY15 0x22e +#define BTN_TRIGGER_HAPPY16 0x22f +#define BTN_TRIGGER_HAPPY17 0x230 +#define BTN_TRIGGER_HAPPY18 0x231 +#define BTN_TRIGGER_HAPPY19 0x232 +#define BTN_TRIGGER_HAPPY20 0x233 +#define BTN_TRIGGER_HAPPY21 0x234 +#define BTN_TRIGGER_HAPPY22 0x235 +#define BTN_TRIGGER_HAPPY23 0x236 +#define BTN_TRIGGER_HAPPY24 0x237 +#define BTN_TRIGGER_HAPPY25 0x238 +#define BTN_TRIGGER_HAPPY26 0x239 +#define BTN_TRIGGER_HAPPY27 0x23a +#define BTN_TRIGGER_HAPPY28 0x23b +#define BTN_TRIGGER_HAPPY29 0x23c +#define BTN_TRIGGER_HAPPY30 0x23d +#define BTN_TRIGGER_HAPPY31 0x23e +#define BTN_TRIGGER_HAPPY32 0x23f +#define BTN_TRIGGER_HAPPY33 0x240 +#define BTN_TRIGGER_HAPPY34 0x241 +#define BTN_TRIGGER_HAPPY35 0x242 +#define BTN_TRIGGER_HAPPY36 0x243 +#define BTN_TRIGGER_HAPPY37 0x244 +#define BTN_TRIGGER_HAPPY38 0x245 +#define BTN_TRIGGER_HAPPY39 0x246 +#define BTN_TRIGGER_HAPPY40 0x247 + /* We avoid low common keys in module aliases so they don't get huge. */ #define KEY_MIN_INTERESTING KEY_MUTE #define KEY_MAX 0x2ff