From patchwork Mon Dec 23 16:17:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Ospite X-Patchwork-Id: 3397031 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A10219F169 for ; Mon, 23 Dec 2013 16:18:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 591E32058E for ; Mon, 23 Dec 2013 16:18:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 79C242058C for ; Mon, 23 Dec 2013 16:18:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757333Ab3LWQSV (ORCPT ); Mon, 23 Dec 2013 11:18:21 -0500 Received: from smtp206.alice.it ([82.57.200.102]:22437 "EHLO smtp206.alice.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752505Ab3LWQSU (ORCPT ); Mon, 23 Dec 2013 11:18:20 -0500 Received: from jcn (82.59.93.217) by smtp206.alice.it (8.6.060.28) id 529A678F05200115; Mon, 23 Dec 2013 17:18:19 +0100 Received: from ao2 by jcn with local (Exim 4.82) (envelope-from ) id 1Vv8Ct-0007du-Gs; Mon, 23 Dec 2013 17:18:15 +0100 From: Antonio Ospite To: linux-input@vger.kernel.org Cc: Antonio Ospite , David Herrmann , Dmitry Torokhov , Jiri Kosina Subject: [PATCH] Input: gamepad - use independent axes for analog D-Pad buttons Date: Mon, 23 Dec 2013 17:17:43 +0100 Message-Id: <1387815463-29345-1-git-send-email-ospite@studenti.unina.it> X-Mailer: git-send-email 1.8.5.2 X-Face: z*RaLf`X<@C75u6Ig9}{oW$H; 1_\2t5)({*|jhM/Vb; ]yA5\I~93>J<_`<4)A{':UrE Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Model this part of the API after the Sony PlayStation 3 Controller which exposes independent analog values for each one of the D-Pad buttons. The PS3 programming API psl1ght also maps the analog D-Pad buttons individually. Cc: David Herrmann Signed-off-by: Antonio Ospite Reviewed-by: David Herrmann --- Hi, as David mentioned no gamepad defines analog D-Pad buttons as mentioned in the gamepad API, so the API change should be OK. And is it OK too to fill the holes in the ABS space or should I just use higher codes? Thanks, Antonio Documentation/input/gamepad.txt | 4 ++-- drivers/staging/et131x/Module.symvers | 0 include/uapi/linux/input.h | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) delete mode 100644 drivers/staging/et131x/Module.symvers diff --git a/Documentation/input/gamepad.txt b/Documentation/input/gamepad.txt index ed13782..aab000d 100644 --- a/Documentation/input/gamepad.txt +++ b/Documentation/input/gamepad.txt @@ -124,8 +124,8 @@ D-Pad: Digital buttons are reported as: BTN_DPAD_* Analog buttons are reported as: - ABS_HAT0X and ABS_HAT0Y - (for ABS values negative is left/up, positive is right/down) + ABS_DPAD_* + (ABS values start at 0, pressure is reported as positive values) Analog-Sticks: The left analog-stick is reported as ABS_X, ABS_Y. The right analog stick is diff --git a/drivers/staging/et131x/Module.symvers b/drivers/staging/et131x/Module.symvers deleted file mode 100644 index e69de29..0000000 diff --git a/include/uapi/linux/input.h b/include/uapi/linux/input.h index d3fcbff..dcc73c0 100644 --- a/include/uapi/linux/input.h +++ b/include/uapi/linux/input.h @@ -842,6 +842,11 @@ struct input_keymap_entry { #define ABS_VOLUME 0x20 +#define ABS_DPAD_UP 0x21 /* Analog D-Pad Up for gamepads */ +#define ABS_DPAD_DOWN 0x22 /* Analog D-Pad Down for gamepads */ +#define ABS_DPAD_LEFT 0x23 /* Analog D-Pad Left for gamepads */ +#define ABS_DPAD_RIGHT 0x24 /* Analog D-Pad Right for gamepads */ + #define ABS_MISC 0x28 #define ABS_MT_SLOT 0x2f /* MT slot being modified */