linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
To: "Clément VUCHENER" <clement.vuchener@gmail.com>
Cc: Jiri Kosina <jikos@kernel.org>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	linux-kernel@vger.kernel.org,
	linux-input <linux-input@vger.kernel.org>
Subject: Re: [PATCH v2 0/3] new driver for Valve Steam Controller
Date: Wed, 21 Feb 2018 11:57:35 +0100	[thread overview]
Message-ID: <20180221105735.GA15792@casa> (raw)
In-Reply-To: <CAM4jgCqPwHiqi9ecehE6wXi1fevSbqUSB3ABVNHXD1NCstGVZw@mail.gmail.com>

On Wed, Feb 21, 2018 at 11:39:49AM +0100, Clément VUCHENER wrote:
> Hi Rodrigo,

Hello, Clément!

> I have written a kernel driver [1], some time ago. I did not submit it
> for merging in the main-line because I thought that would mess with
> user-space drivers. If your driver create an input device, a
> user-space driver will have to disable it before creating its own. I
> guess libusb based drivers will detach the kernel driver and will be
> fine. But it is not as simple if you use hidraw. And there may be some
> state problem as Pierre-Loup already said.


I not think that is a real problem. You can run this driver and a
user-space driver and the Steam Client all at the same time. You will
have several input devices that represet the same physical device. But
as long as the user client (game) uses only one of them, all will be
fine. That is, as long as the different drivers do not send any stateful
commands, of course.

> A few more tips about your discussion with Pierre-Loup (sorry I am not
> replying to the answers directly, it's hard to insert myself in this
> long discussion):
> 
> Beside Ynsta's driver, you may have a look at my own user-space driver
> [2] or Dennis Hamester's library scraw [3].
> 
> You can enable and disable the accel and gyro when the separate input
> device is opened or closed to save battery. My kernel driver does it,
> IIRC I have taken the idea from the wiimote driver.

Yeah, my future accel/gyro patch does exactly that. I copied the wii
too.

Also, my intention is to add a module variable so that the separate
input device is disabled by default and Steam Client will work properly.

> Note that there is
> an issue with joydev using the accel/gyro input device. hid-sony
> solved it by adding an exception in joydev driver (joydev_blacklist in
> drivers/input/joydev.c).

I don't know about that, I will look into it, thanks.

> In my driver, I split the left pad and left stick events by looking at
> the left pad touch bit. It works well as long as they are not used at
> the same time. When they both being used the data alternate between
> left pad and left stick data, the touch bit is set accordingly so axis
> data is easy to use, but it looks like the left touch pad is being
> tapped very fast.

Actually, there is a proper way to do that, that involves using the
lpad_touch and the lpand_and_joy bits at the same time. I think that I
will split the joystick and left-pad axes definitely. Few problems that
way. Maybe I'll map the left-pad to ABS_HAT1{X,Y}, that will play nicely
with the dpad being ABS_HAT0{X,Y].

Regards.
Rodrigo

> [1]: https://github.com/cvuchener/steamcontroller-linux-kernel
> [2]: https://github.com/cvuchener/input-scripts/tree/master/src/daemon/steamcontroller
> [3]: https://gitlab.com/dennis-hamester/scraw)

      reply	other threads:[~2018-02-21 10:57 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-20 19:33 [PATCH v2 0/3] new driver for Valve Steam Controller Rodrigo Rivas Costa
2018-02-20 19:33 ` [PATCH v2 1/3] HID: add " Rodrigo Rivas Costa
2018-02-21  5:32   ` Cameron Gutman
2018-02-22 22:54     ` Rodrigo Rivas Costa
2018-02-21 14:13   ` Benjamin Tissoires
2018-02-20 19:33 ` [PATCH v2 2/3] HID: steam: add serial number information Rodrigo Rivas Costa
2018-02-20 19:33 ` [PATCH v2 3/3] HID: steam: add battery device Rodrigo Rivas Costa
2018-02-20 22:29 ` [PATCH v2 0/3] new driver for Valve Steam Controller Pierre-Loup A. Griffais
2018-02-20 23:20   ` Rodrigo Rivas Costa
2018-02-21  0:09     ` Pierre-Loup A. Griffais
2018-02-21 20:21       ` Rodrigo Rivas Costa
2018-02-22  0:13         ` Pierre-Loup A. Griffais
2018-02-22  9:05           ` Clément VUCHENER
2018-02-22  9:10           ` Benjamin Tissoires
2018-02-22 16:31             ` Rodrigo Rivas Costa
2018-02-22 17:06               ` Benjamin Tissoires
2018-02-22 17:48                 ` Rodrigo Rivas Costa
2018-02-23  8:20                   ` Benjamin Tissoires
2018-02-21 10:39 ` Clément VUCHENER
2018-02-21 10:57   ` Rodrigo Rivas Costa [this message]

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=20180221105735.GA15792@casa \
    --to=rodrigorivascosta@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 \
    /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).