Received: by 10.223.185.116 with SMTP id b49csp909087wrg; Wed, 21 Feb 2018 08:52:41 -0800 (PST) X-Google-Smtp-Source: AH8x225fWaG3FAmmJWokgRqgHUH6uM2vMIIQdy4xblO71Ab/SyycR4Xtna7epN7Bw6wAxiaDoXFJ X-Received: by 2002:a17:902:63:: with SMTP id 90-v6mr3650713pla.125.1519231961755; Wed, 21 Feb 2018 08:52:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519231961; cv=none; d=google.com; s=arc-20160816; b=MGEuFC+k4A4XNaUcpC9IClssKiXmWMeJMFRck/NrD+veIbwpp7hGycFXFSeH8QigzK TNV1MpmqhhuZVTh52l8T4YkARA7Pqy7Qs4s8lxM/HFyepCZfbA/oDwWCTE4YFZQLk8Ig zRsQXQxQwXyZwAn1WzlS1njVzlcmEE+WWpp2Q3LM1JSEJQqp28+aCHwNPlQhbfBh8LQs 3nH8JrcANWPaqWepTzaMblyis3PhH/U6P4L3sRhK4b00PWTlh/EH7ab0wnxp6NhzEtg4 NbYXYENXmFRY0Kgqvv2ZZdvc1ogmHWBLV+mzvMs7LCc4JNp96nIM+e4QKyuvkBHPv87s KkpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=hj6CRn0UQlz1LiMRYtsxWpAH/72+G5hYAT/Fj/bb8hk=; b=gmBGcMl0O/Cgbu23GHa08Iarj6RMhnblPI7fBYE8Md254EpUaF/2x34tlRBWxOiI32 rmS4pvVnIef/Cp7kEX7qEermCUFL8LlhFHrnW7rGpEKQUiIo1ftsy5Vnwgf1HEBjbnyQ RlgaQDXxiNF4242mozcii7FQCRT8Al58R2gJBXMtGqEbuRTnHDMCITUaZMOxCa1SFXc2 VkjkvZ7wWgFGhA6A5Ti3ruzDRFucMYEUB3ie9yMsB4pQs0JX2OBelgTVNPc52+mrGo1T iQEEeYzsviY/QhzaCk49FXMpau10nqEhEzKMyI8Gb0kQuQMO78jnuiwyCr3ZB8qcS6xH yggQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hYuB+xxB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d10si1290098pgu.401.2018.02.21.08.52.27; Wed, 21 Feb 2018 08:52:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hYuB+xxB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753751AbeBUK5m (ORCPT + 99 others); Wed, 21 Feb 2018 05:57:42 -0500 Received: from mail-wr0-f179.google.com ([209.85.128.179]:35785 "EHLO mail-wr0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752185AbeBUK5k (ORCPT ); Wed, 21 Feb 2018 05:57:40 -0500 Received: by mail-wr0-f179.google.com with SMTP id l43so3218772wrc.2; Wed, 21 Feb 2018 02:57:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=hj6CRn0UQlz1LiMRYtsxWpAH/72+G5hYAT/Fj/bb8hk=; b=hYuB+xxBSd7ZB2Iy8UPVSSFVCkxSu5I0kCFOiAcl65WZQ/1jjT/txdqdBOCScDBzTQ pObkdbInIvxeh2Q/uoXJfE+ofUfqfni2VcxTU5UMfbEe6lkp8jzjAHEmq36nfrwaIq/D BSNiWDDUSPShHg1vvwwtgDunofOmTNmCUMKyehweqINP6E1oEGvKwXga6dgs2HMjXM8y W+jPYzrFwcN0QaLb0qmhkFCC24RxaAwR6Jc2ThsYKk4DfkoPrZ6VDg0RcKGvJqc7B+Mc cS8kn4ql+/7k5ZG0j7r8UwoLeFiOVldHRRs6Ng9aA2kMjUuzgwpnFQgMa5bD7FwsCmWt KO6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=hj6CRn0UQlz1LiMRYtsxWpAH/72+G5hYAT/Fj/bb8hk=; b=IAwZCkIcE4bEMHXV3UTszjqPfNGgRv2pXM/nGdC9zv+x6aqMiKUkptwx+rGzHWhrU7 eSIm2zl8eMKaLeiLIyx8XKBCZsKWf1EpHmRiKKQCksMsBZkKg+2NBd2sTYHu0sx6V3pR 87Vi0KGG14OcgjWP+q2eTX3gbF66oY9SpOyWyLpmKxk4Zw4msQUV9HKTux8jzcYk8WWa Fs6vPme+tMdlonCXX0/GHfgdc4v2XM2TONqDB3eEdTK80RadyGWJ8n/qaaDtrqELHdh7 jdzv7iCdomu/YGGMxgG/G66LG/tXcmgHYKMuLXV3YnG/B716jqOl0txfEBFTQyOCQX+A IGXg== X-Gm-Message-State: APf1xPCp20Nfo7xxOMQemzGvwW9qDTMWABViRhTnLePwdAV+SzK/Zvfa MF6REhOkCs0nTLgp1/6Hhvxw4h0Auts= X-Received: by 10.223.129.76 with SMTP id 70mr2630174wrm.255.1519210658746; Wed, 21 Feb 2018 02:57:38 -0800 (PST) Received: from casa ([2a01:c50e:5126:7a00:3036:bcff:fec8:b31f]) by smtp.gmail.com with ESMTPSA id 67sm28578746wmg.13.2018.02.21.02.57.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2018 02:57:38 -0800 (PST) Date: Wed, 21 Feb 2018 11:57:35 +0100 From: Rodrigo Rivas Costa To: =?iso-8859-1?Q?Cl=E9ment?= VUCHENER Cc: Jiri Kosina , Benjamin Tissoires , linux-kernel@vger.kernel.org, linux-input Subject: Re: [PATCH v2 0/3] new driver for Valve Steam Controller Message-ID: <20180221105735.GA15792@casa> References: <20180220193306.28748-1-rodrigorivascosta@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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)