From: Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
To: "Benjamin Tissoires" <benjamin.tissoires@redhat.com>,
"Pierre-Loup A. Griffais" <pgriffais@valvesoftware.com>,
"Clément VUCHENER" <clement.vuchener@gmail.com>,
"Jiri Kosina" <jikos@kernel.org>,
"Cameron Gutman" <aicommander@gmail.com>,
lkml <linux-kernel@vger.kernel.org>,
linux-input <linux-input@vger.kernel.org>
Cc: Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
Subject: [RFC PATCH v6 0/1] hid-steam driver with user mode client dection
Date: Wed, 21 Mar 2018 21:49:31 +0100 [thread overview]
Message-ID: <20180321204932.12687-1-rodrigorivascosta@gmail.com> (raw)
This is a RFC for the problem of how to work with the Steam Controller from
a kernel driver without disturbing the user mode drivers.
The main user mode driver is the Steam Controller itself. From now on I will
call any user mode driver a "hidraw client" because that is the mode most of
them use.
Steam Client is able to use a raw libusb user mode driver, but it
looks like it does so only if hidraw is not available, so I'm not currently
concerned with those.
This driver, as is, does the following:
1. It keeps the mouse/keyboard emulation (lizard mode) working while the
hid-steam input device is not in use.
2. When the hid-steam input device is opened, lizard mode is disabled, but
ONLY IF there are no hidraw clients. This is necessary because with the
lizard mode on, a gesture in the gamepad can make several unrelated input
events and games go crazy.
3. When the hid-steam input device is closed, lizard mode is re-enabled, but
ONLY IF there are no hidraw clients.
4. If while the hid-steam input device is opened, a hidraw client starts,
then the input events are disabled for this driver, in order to avoid
double inputs in games that read all available game controllers.
4. If a hid-steam input device and a hidraw client are running, and then the
hidraw client finishes, then lizard mode is disabled, just like in 2.
Other than what to do exactly, IMO, there are three tricky parts that deserve
the RFC:
1. Is the procedure avobe the right way to do it?
2. How to detect whether a hidraw client is in use. Currently I'm looking at
hid_device::ll_open_count and compare with the number of times I called
hid_hw_open() - hid_hw_close(). I'm exploring using a custom hid_ll_driver
instead...
3. How to disable the lizard mode. Currently I'm sending a few feature
reports that prevent the hardware from sending keyboard/mouse events. But
maybe they can be disabled at hid level, so we can avoid messing with the
hardware configuration, and the possible incompatibilities and races that
arise.
PS. I've collapsed the patch-set into a single bigger commit, because my
original split makes sense no longer. Sorry for the inconvenience.
Thank you in advance for any comment.
Rodrigo Rivas Costa (1):
HID: add driver for Valve Steam Controller
drivers/hid/Kconfig | 8 +
drivers/hid/Makefile | 1 +
drivers/hid/hid-ids.h | 4 +
drivers/hid/hid-steam.c | 874 ++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 887 insertions(+)
create mode 100644 drivers/hid/hid-steam.c
--
2.16.2
next reply other threads:[~2018-03-21 20:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-21 20:49 Rodrigo Rivas Costa [this message]
2018-03-21 20:49 ` [RFC PATCH v6 1/1] HID: add driver for Valve Steam Controller Rodrigo Rivas Costa
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=20180321204932.12687-1-rodrigorivascosta@gmail.com \
--to=rodrigorivascosta@gmail.com \
--cc=aicommander@gmail.com \
--cc=benjamin.tissoires@redhat.com \
--cc=clement.vuchener@gmail.com \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pgriffais@valvesoftware.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