linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: gamepad - use independent axes for analog D-Pad buttons
@ 2013-12-23 16:17 Antonio Ospite
  2013-12-25 17:40 ` David Herrmann
  2013-12-30  0:52 ` Dmitry Torokhov
  0 siblings, 2 replies; 8+ messages in thread
From: Antonio Ospite @ 2013-12-23 16:17 UTC (permalink / raw)
  To: linux-input; +Cc: Antonio Ospite, David Herrmann, Dmitry Torokhov, Jiri Kosina

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 <dh.herrmann@gmail.com>
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
---

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 */
-- 
1.8.5.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-01-09 14:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-23 16:17 [PATCH] Input: gamepad - use independent axes for analog D-Pad buttons Antonio Ospite
2013-12-25 17:40 ` David Herrmann
2013-12-30  0:52 ` Dmitry Torokhov
2013-12-30 11:20   ` Antonio Ospite
2013-12-30 11:44     ` David Herrmann
2013-12-30 18:50       ` Dmitry Torokhov
2014-01-09 14:33         ` David Herrmann
2013-12-30 18:51     ` Dmitry Torokhov

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).