From patchwork Sat Jun 4 20:45:46 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Ospite X-Patchwork-Id: 849392 X-Patchwork-Delegate: jikos@jikos.cz Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p54Kk01K011108 for ; Sat, 4 Jun 2011 20:46:00 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752824Ab1FDUpz (ORCPT ); Sat, 4 Jun 2011 16:45:55 -0400 Received: from smtp205.alice.it ([82.57.200.101]:41263 "EHLO smtp205.alice.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752314Ab1FDUpy (ORCPT ); Sat, 4 Jun 2011 16:45:54 -0400 Received: from jcn (82.60.124.218) by smtp205.alice.it (8.5.124.08) (authenticated as fospite@alice.it) id 4DE634750042F9D3; Sat, 4 Jun 2011 22:45:48 +0200 Date: Sat, 4 Jun 2011 22:45:46 +0200 From: Antonio Ospite To: simon@mungewell.org Cc: linux-input@vger.kernel.org Subject: Re: HID joystick - Axis 11 non operational. Message-Id: <20110604224546.7ebb8939.ospite@studenti.unina.it> In-Reply-To: <20110603161511.af4dd9e0.ospite@studenti.unina.it> References: <9c3f08ce41f278fc835bf09e489eef0f.squirrel@host171.canaca.com> <20110603161511.af4dd9e0.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 (demeter1.kernel.org [140.211.167.41]); Sat, 04 Jun 2011 20:46:00 +0000 (UTC) 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 thins 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' Otherwise we would need to remap the axis code to something more meaningful by patching the HID descriptor, can this be done? 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. @@ -210,6 +210,9 @@ input_pass_event(dev, EV_ABS, ABS_MT_SLOT, dev->slot); } + if (code == 0x2f) + printk(KERN_DEBUG "%s: code: %08x handled value: %d\n", __func__, code, *pval); + return INPUT_PASS_TO_HANDLERS; }