From patchwork Mon Sep 15 03:13:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Wright X-Patchwork-Id: 4902591 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E2E09BEEA5 for ; Mon, 15 Sep 2014 03:13:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E2D21201C0 for ; Mon, 15 Sep 2014 03:13:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 075F7201BB for ; Mon, 15 Sep 2014 03:13:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752848AbaIODNk (ORCPT ); Sun, 14 Sep 2014 23:13:40 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:40718 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751700AbaIODNj (ORCPT ); Sun, 14 Sep 2014 23:13:39 -0400 Received: by mail-pa0-f51.google.com with SMTP id kx10so5395782pab.24 for ; Sun, 14 Sep 2014 20:13:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=android.com; s=20120917; h=from:to:cc:subject:date:message-id; bh=8PWipFKUf91zakAaHOiCcvn0VkfaGythHAvCIfxVoCQ=; b=d25u9XU64F5dTDo4oUpuyInLTltOWhWnwSoDzLW6VRrR2o/DeF/XmLgj94jkX+4BxS 7FwMXp+jzQ6RtvXZrmL8iwVzA1xogC2HsfuX0pn/R9//uLTc2PfEI9uweSNz42We4XMA ikWFLb8TUuCYDLVQDxMzinkFy6lfVip61s1h7X1qJIuwT+SsBIshg8haidjcKleOBtjt zB5wmQceukur1S1QCXWMrxkTU2G8rJuIbuA/KINN58e5c6eZ/pJ5JHgXmxpmAr/Zdf5i yDO1kjVMv1dzZa98TaKc8AHgMYhT2zbaV/ty7JO3FTMdjDukHvx710Qi2xfmSQSW2lF5 36rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=8PWipFKUf91zakAaHOiCcvn0VkfaGythHAvCIfxVoCQ=; b=Q/9Jb8wSBxMAR2Wt3vg7BDXU8f/fzlxIU0X5QVGhOLxFhC8QkRV9tjNmbpRT0/ig3+ 3VqTjqOpwW3v4q222pGXUkoZ8QUAtkU0sHxfShV3+/LVY+uN6ENGF/V5+U1Xl6Lo2jlt gZijwRte11gvcgxeWcTaeLMSla25bksK1MOcN3BD8dTBNyJ0gYgjbFniZiWTiE0cJi9p XtWeu1TYDO4pk6ynhaP8SKKzONH7ylCYTTJhSc0r/8Rpr1RxZxiSAkmBsviczQP3nMc5 taTerNZQLXIzOdI9FW9AY0Bx8v8jbLVK+iOBa7RXh9GzYJAETsv2BsU6nLxMcCQr7epj E5eQ== X-Gm-Message-State: ALoCoQmYJo4YQSLh6BT7r8/9oXw8mfLs4yxMYXKDT1m//2rI4i4sk7tT9OBYvZYJ2nOwY4wtZ4fm X-Received: by 10.70.10.100 with SMTP id h4mr42480pdb.162.1410750819418; Sun, 14 Sep 2014 20:13:39 -0700 (PDT) Received: from vintas.mtv.corp.google.com (vintas.mtv.corp.google.com [172.22.122.49]) by mx.google.com with ESMTPSA id gz1sm555943pbb.8.2014.09.14.20.13.37 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 14 Sep 2014 20:13:38 -0700 (PDT) From: Michael Wright X-Google-Original-From: Michael Wright To: linux-input@vger.kernel.org Cc: Michael Wright Subject: [PATCH] HID: add new gamepad LED constants Date: Sun, 14 Sep 2014 20:13:31 -0700 Message-Id: <1410750811-11156-1-git-send-email-michaelwr@google.com> X-Mailer: git-send-email 2.1.0.rc2.206.gedb03e5 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,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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 Improve gamepad support by introducing new LED constants for player LEDs and the mappings from their corresponding HID usages introduced in HUTTR47: http://www.usb.org/developers/hidpage/HUTRR47.pdf Change-Id: If25d8a8e2570dfab3a35f9be5b1d03ab662f6b1c Signed-off-by: Michael Wright --- drivers/hid/hid-input.c | 4 ++++ include/uapi/linux/input.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 2619f7f..a1cb3bf 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -633,6 +633,10 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel case 0x4b: map_led (LED_MISC); break; /* "Generic Indicator" */ case 0x19: map_led (LED_MAIL); break; /* "Message Waiting" */ case 0x4d: map_led (LED_CHARGING); break; /* "External Power Connected" */ + case 0x4f: map_led (LED_PLAYER_1); break; /* "Player 1" */ + case 0x50: map_led (LED_PLAYER_2); break; /* "Player 2" */ + case 0x51: map_led (LED_PLAYER_3); break; /* "Player 3" */ + case 0x52: map_led (LED_PLAYER_4); break; /* "Player 4" */ default: goto ignore; } diff --git a/include/uapi/linux/input.h b/include/uapi/linux/input.h index 1874ebe..bb43f20 100644 --- a/include/uapi/linux/input.h +++ b/include/uapi/linux/input.h @@ -908,6 +908,10 @@ struct input_keymap_entry { #define LED_MISC 0x08 #define LED_MAIL 0x09 #define LED_CHARGING 0x0a +#define LED_PLAYER_1 0x0b +#define LED_PLAYER_2 0x0c +#define LED_PLAYER_3 0x0d +#define LED_PLAYER_4 0x0e #define LED_MAX 0x0f #define LED_CNT (LED_MAX+1)