From patchwork Thu Dec 17 23:18:58 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Ebke X-Patchwork-Id: 68558 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 nBI4ixwk005715 for ; Fri, 18 Dec 2009 04:48:04 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751477AbZLQXth (ORCPT ); Thu, 17 Dec 2009 18:49:37 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751478AbZLQXth (ORCPT ); Thu, 17 Dec 2009 18:49:37 -0500 Received: from mail.physik.uni-muenchen.de ([192.54.42.129]:57020 "EHLO mail.physik.uni-muenchen.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751477AbZLQXtg (ORCPT ); Thu, 17 Dec 2009 18:49:36 -0500 X-Greylist: delayed 1834 seconds by postgrey-1.27 at vger.kernel.org; Thu, 17 Dec 2009 18:49:36 EST Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.physik.uni-muenchen.de (Postfix) with ESMTP id A697527E41; Fri, 18 Dec 2009 00:18:59 +0100 (CET) X-Virus-Scanned: amavisd-new at physik.uni-muenchen.de Received: from mail.physik.uni-muenchen.de ([127.0.0.1]) by localhost (mail.physik.uni-muenchen.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id S-jl30MTSgId; Fri, 18 Dec 2009 00:18:59 +0100 (CET) Received: from [192.168.1.66] (ppp-88-217-0-134.dynamic.mnet-online.de [88.217.0.134]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.physik.uni-muenchen.de (Postfix) with ESMTP id 3CEEC27D8A; Fri, 18 Dec 2009 00:18:59 +0100 (CET) Message-ID: <4B2ABC62.2030600@physik.uni-muenchen.de> Date: Fri, 18 Dec 2009 00:18:58 +0100 From: Johannes Ebke User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090707) MIME-Version: 1.0 To: Jiri Kosina CC: Dmitry Torokhov , linux-input@vger.kernel.org Subject: Re: Linux Force Feedback for Saitek Cyborg Evo Force References: <4B26B824.8010403@physik.uni-muenchen.de> In-Reply-To: X-Enigmail-Version: 0.95.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org diff -ru iforce_orig/iforce-main.c iforce/iforce-main.c --- iforce_orig/iforce-main.c 2009-12-03 04:51:21.000000000 +0100 +++ iforce/iforce-main.c 2009-12-17 23:55:10.000000000 +0100 @@ -35,6 +35,10 @@ { BTN_TRIGGER, BTN_TOP, BTN_THUMB, BTN_TOP2, BTN_BASE, BTN_BASE2, BTN_BASE3, BTN_BASE4, BTN_BASE5, BTN_A, BTN_B, BTN_C, -1 }; +static signed short btn_saitek_cyborg[] = +{ BTN_TRIGGER, BTN_THUMB, BTN_TOP, BTN_TOP2, BTN_BASE, + BTN_BASE2, BTN_BASE3, BTN_BASE4, BTN_BASE5, BTN_A, BTN_B, BTN_C, -1 }; + static signed short btn_avb_pegasus[] = { BTN_TRIGGER, BTN_TOP, BTN_THUMB, BTN_TOP2, BTN_BASE, BTN_BASE2, BTN_BASE3, BTN_BASE4, -1 }; @@ -54,6 +58,9 @@ static signed short abs_joystick[] = { ABS_X, ABS_Y, ABS_THROTTLE, ABS_HAT0X, ABS_HAT0Y, -1 }; +static signed short abs_saitek_cyborg[] = +{ ABS_X, ABS_Y, ABS_THROTTLE, ABS_RUDDER, ABS_HAT0X, ABS_HAT0Y, -1 }; + static signed short abs_avb_pegasus[] = { ABS_X, ABS_Y, ABS_THROTTLE, ABS_RUDDER, ABS_HAT0X, ABS_HAT0Y, ABS_HAT1X, ABS_HAT1Y, -1 }; @@ -79,6 +86,7 @@ { 0x06f8, 0x0004, "Guillemot Force Feedback Racing Wheel", btn_wheel, abs_wheel, ff_iforce }, //? { 0x06f8, 0x0004, "Gullemot Jet Leader 3D", btn_joystick, abs_joystick, ff_iforce }, //? { 0x06d6, 0x29bc, "Trust Force Feedback Race Master", btn_wheel, abs_wheel, ff_iforce }, + { 0x06a3, 0xffb5, "Saitek Cyborg Evo Force", btn_saitek_cyborg, abs_saitek_cyborg, ff_iforce }, //? { 0x0000, 0x0000, "Unknown I-Force Device [%04x:%04x]", btn_joystick, abs_joystick, ff_iforce } }; diff -ru iforce_orig/iforce-packets.c iforce/iforce-packets.c --- iforce_orig/iforce-packets.c 2009-12-03 04:51:21.000000000 +0100 +++ iforce/iforce-packets.c 2009-12-18 00:10:08.000000000 +0100 @@ -182,16 +182,24 @@ case 0x01: /* joystick position data */ case 0x03: /* wheel position data */ - if (HI(cmd) == 1) { - input_report_abs(dev, ABS_X, (__s16) (((__s16)data[1] << 8) | data[0])); - input_report_abs(dev, ABS_Y, (__s16) (((__s16)data[3] << 8) | data[2])); - input_report_abs(dev, ABS_THROTTLE, 255 - data[4]); - if (LO(cmd) >= 8 && test_bit(ABS_RUDDER ,dev->absbit)) - input_report_abs(dev, ABS_RUDDER, (__s8)data[7]); - } else { + case 0x06: /* saitek position data */ + if (HI(cmd) == 3) { input_report_abs(dev, ABS_WHEEL, (__s16) (((__s16)data[1] << 8) | data[0])); input_report_abs(dev, ABS_GAS, 255 - data[2]); input_report_abs(dev, ABS_BRAKE, 255 - data[3]); + } else { + input_report_abs(dev, ABS_X, (__s16) (((__s16)data[1] << 8) | data[0])); + input_report_abs(dev, ABS_Y, (__s16) (((__s16)data[3] << 8) | data[2])); + if (HI(cmd) == 6) { + input_report_abs(dev, ABS_THROTTLE, data[4]); + if (LO(cmd) >= 8 && test_bit(ABS_RUDDER ,dev->absbit)) + input_report_abs(dev, ABS_RUDDER, data[7]); + } else { + input_report_abs(dev, ABS_THROTTLE, 255 - data[4]); + if (LO(cmd) >= 8 && test_bit(ABS_RUDDER ,dev->absbit)) + input_report_abs(dev, ABS_RUDDER, (__s8)data[7]); + } + } input_report_abs(dev, ABS_HAT0X, iforce_hat_to_axis[data[6] >> 4].x); diff -ru iforce_orig/iforce-usb.c iforce/iforce-usb.c --- iforce_orig/iforce-usb.c 2009-12-03 04:51:21.000000000 +0100 +++ iforce/iforce-usb.c 2009-12-15 22:46:11.000000000 +0100 @@ -227,6 +227,7 @@ { USB_DEVICE(0x06f8, 0x0001) }, /* Guillemot Race Leader Force Feedback */ { USB_DEVICE(0x06f8, 0x0004) }, /* Guillemot Force Feedback Racing Wheel */ { USB_DEVICE(0x06f8, 0xa302) }, /* Guillemot Jet Leader 3D */ + { USB_DEVICE(0x06a3, 0xffb5) }, /* Saitek Cyborg Evo Force */ { } /* Terminating entry */ };