From patchwork Tue Jun 7 10:39:31 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Ospite X-Patchwork-Id: 855712 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.3) with ESMTP id p57AeHSR013095 for ; Tue, 7 Jun 2011 10:40:17 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752180Ab1FGKjx (ORCPT ); Tue, 7 Jun 2011 06:39:53 -0400 Received: from smtp204.alice.it ([82.57.200.100]:59053 "EHLO smtp204.alice.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751201Ab1FGKjr (ORCPT ); Tue, 7 Jun 2011 06:39:47 -0400 Received: from jcn (87.3.146.22) by smtp204.alice.it (8.5.124.08) (authenticated as fospite@alice.it) id 4DE62ADD00814428; Tue, 7 Jun 2011 12:39:38 +0200 Date: Tue, 7 Jun 2011 12:39:31 +0200 From: Antonio Ospite To: simon@mungewell.org Cc: linux-input@vger.kernel.org Subject: Re: HID joystick - Axis 11 non operational. Message-Id: <20110607123931.2267a703.ospite@studenti.unina.it> In-Reply-To: <20110604224546.7ebb8939.ospite@studenti.unina.it> References: <9c3f08ce41f278fc835bf09e489eef0f.squirrel@host171.canaca.com> <20110603161511.af4dd9e0.ospite@studenti.unina.it> <20110604224546.7ebb8939.ospite@studenti.unina.it> X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.4; x86_64-pc-linux-gnu) X-Face: z*RaLf`X<@C75u6Ig9}{oW$H; 1_\2t5)({*|jhM/Vb; ]yA5\I~93>J<_`<4)A{':UrE Mime-Version: 1.0 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]); Tue, 07 Jun 2011 10:40:18 +0000 (UTC) On Sat, 4 Jun 2011 22:45:46 +0200 Antonio Ospite wrote: > On Fri, 3 Jun 2011 16:15:11 +0200 > Antonio Ospite wrote: > > > I confirm that the axis for Dpad-left (usage->code == 0x2f IINM) of the > > Sixaxis looks like it is not working. I too can see the data on hidraw > > device but not on the joystick or even the event device, so it may be > > below the joystick layer. > > > > OK found something: 0x2f is ABS_MT_SLOT, > http://lxr.linux.no/linux+*/include/linux/input.h#L773 > > And in input.c::input_handle_abs_event() this case is handled in a > special way: > http://lxr.linux.no/#linux+v2.6.39/drivers/input/input.c#L172 > > This little change improves things a little bit, but the pressure event is > now reported twice, once with the actual value and once with 0, you can test > with: > > $ evtest /dev/input/eventX | \ > egrep -v 'code (0|1|2|5|48|49|50|51|52|53|54|55|56|57|58|58|59)|Report Sync' > The second ABS_MT_SLOT event is fired up here: http://lxr.linux.no/#linux+v2.6.39/drivers/input/input.c#L210 when I get code == 0x30 (ABS_MT_TOUCH_MAJOR, I am still not sure where from), with the following hack I can make axis 11 work again but I have no idea if I am broking MultiTouch devices, anyone? Simon, if that works for you too, I can send an RFC patch out, but how should we motivate it? The Sixaxis is sending out MT events even if it is not a MT device... Regards, Antonio Index: linux-2.6/drivers/input/input.c =================================================================== --- linux-2.6.orig/drivers/input/input.c +++ linux-2.6/drivers/input/input.c @@ -169,7 +169,7 @@ bool is_mt_event; int *pold; - if (code == ABS_MT_SLOT) { + if (code == ABS_MT_SLOT && dev->mtsize > 0) { /* * "Stage" the event; we'll flush it later, when we * get actual touch data. @@ -205,7 +205,8 @@ } /* Flush pending "slot" event */ - if (is_mt_event && dev->slot != input_abs_get_val(dev, ABS_MT_SLOT)) { + if (is_mt_event && dev->slot != input_abs_get_val(dev, ABS_MT_SLOT) && + dev->mtsize > 0 ) { input_abs_set_val(dev, ABS_MT_SLOT, dev->slot); input_pass_event(dev, EV_ABS, ABS_MT_SLOT, dev->slot); }