linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Wright <michaelwr@android.com>
To: linux-input@vger.kernel.org
Cc: Michael Wright <michaelwr@google.com>
Subject: [PATCH] HID: add new gamepad LED constants
Date: Sun, 14 Sep 2014 20:13:31 -0700	[thread overview]
Message-ID: <1410750811-11156-1-git-send-email-michaelwr@google.com> (raw)

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 <michaelwr@google.com>
---
 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)
 
-- 
2.1.0.rc2.206.gedb03e5


             reply	other threads:[~2014-09-15  3:13 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-15  3:13 Michael Wright [this message]
2014-09-15  5:07 ` [PATCH] HID: add new gamepad LED constants David Herrmann
2014-09-15 18:03   ` Michael Wright
2014-09-15 21:57     ` Dmitry Torokhov
2014-09-15 22:15       ` David Herrmann
2014-09-15 22:58         ` Dmitry Torokhov
2014-09-15 23:41           ` Michael Wright
2014-09-16  0:54             ` Dmitry Torokhov
2014-09-16  1:02               ` Michael Wright
2014-09-16  2:00             ` simon
2014-09-16  4:06               ` Michael Wright
2014-09-17  1:44                 ` Pierre-Loup A. Griffais
2014-09-17  1:56                   ` Michael Wright
2014-09-22 21:36                     ` Michael Wright
2014-09-23 16:40                       ` Dmitry Torokhov
2014-09-16 10:00           ` David Herrmann
2014-09-23 16:37             ` Dmitry Torokhov
2014-09-25 10:26               ` David Herrmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1410750811-11156-1-git-send-email-michaelwr@google.com \
    --to=michaelwr@android.com \
    --cc=linux-input@vger.kernel.org \
    --cc=michaelwr@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).