Input: xpad - x360w: report dpad as buttons and axes
authorPavel Rojtberg <rojtberg@gmail.com>
Sat, 10 Oct 2015 16:33:52 +0000 (09:33 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 1 Dec 2018 08:48:00 +0000 (09:48 +0100)
commit8d20f7d97a0881fc919578f97ce2b4f65abbe94e
tree7399a470f91e22fe7b2f577552ed1b2a0aba44dc
parent9a249a885bb8b8b7c0902a744210645ddc91c4f3
Input: xpad - x360w: report dpad as buttons and axes

[ Upstream commit 5ee8bda943de20017636845a5c8d7069a4a283b8 ]

as discussed here[0], x360w is the only pad that maps dpad_to_button.
This is bad for downstream developers as they have to differ between
x360 and x360w which is not intuitive.

This patch implements the suggested solution of exposing the dpad both
as axes and as buttons. This retains backward compatibility with software
already dealing with the difference while makes new software work as
expected across x360/ x360w pads.

[0] http://www.spinics.net/lists/linux-input/msg34421.html

Signed-off-by: Pavel Rojtberg <rojtberg@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/input/joystick/xpad.c