From patchwork Fri May 4 10:16:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Rodrigo Rivas Costa X-Patchwork-Id: 10380305 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 01F85603B4 for ; Fri, 4 May 2018 10:16:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB0D929331 for ; Fri, 4 May 2018 10:16:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CE1FF29341; Fri, 4 May 2018 10:16:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 59B5D29331 for ; Fri, 4 May 2018 10:16:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751059AbeEDKQh (ORCPT ); Fri, 4 May 2018 06:16:37 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:52037 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750733AbeEDKQg (ORCPT ); Fri, 4 May 2018 06:16:36 -0400 Received: by mail-wm0-f54.google.com with SMTP id j4so3226291wme.1; Fri, 04 May 2018 03:16:35 -0700 (PDT) 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=5vWQR3FJKIM/7x4yNfMy1UZKT4wWZmlB/s5NcbZS1hk=; b=JHgOhgKoW+K9G4MYYVLeyzFcV33NwBG55ltujcjMk8Na20tMd1E4CzhypCZog+Oj9s d9GCrXGPI7L06cDyCEEYArAEM605DFJikpD1TiHY4NeGUBDWbw5juh3MyQ1bdOLjIXRE fm4ARg5CLOdc4G0GLNrLTirGjp3W/5Qzq1mcX0g2y8ioVBrjudY2OcFH5ZbhYmlcVFWh e9J/HphxhkFWF5GEVOpx3KBQIJd7ptSOg1f/sfLwCfbrTHQIGDJdIUexll/ffdLtCqn+ uVJSN7apjijCkRD4hb9jqTwQA0OXRNLp6IHFjet0lEJEUIezi72rIm+kgIYZN6Y8Tpql WsYg== 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=5vWQR3FJKIM/7x4yNfMy1UZKT4wWZmlB/s5NcbZS1hk=; b=U98LCcpv3Al3yFV8bxS8F7EIIp9Vko99KjBuO4byjvnAtE+LCid7NZsj6f5WacF0q6 bC1U+K/b3FYPAgCB3AWsXpu8dj1sfMCQ+TR2xXBOVGAh87KeHWm4ywvH/eA3p9vuTuBg iPWosMmwaGrGf6Veo0q2ezEJgQHB1HYCs9XAKOegqIClvfPcDDISt1U8KJkyGMJT4g+z Wx5cdOEqml/J6BTlDfjwX6SQFUgx5ICpJ5a94vsOpMHmR/tQSnKAWJgDQlpHZW3CCE8D BP4sJqoCbCHPyOPXlMcdmPkHeHzlDwRxlY1YZy35J23jRMumJgjGVBnWUkhxBqotcy9G quSA== X-Gm-Message-State: ALQs6tAtsnNJtNSMxT7mIJ1/mtW7a20zThq147Y1QRuZzU/BptF6bHbN aHLgLuXoMCnFIkqsPO23qrE= X-Google-Smtp-Source: AB8JxZqeO+s0MeDzZhfJN7FgtVyCT6X3OIHsD+IUxGkuKGfE0L0oMbVD2mKfoUE2AR8XukXqG8fWKg== X-Received: by 10.28.99.85 with SMTP id x82mr13087809wmb.14.1525428994554; Fri, 04 May 2018 03:16:34 -0700 (PDT) Received: from casa ([2a01:c50e:5126:7a00:2df9:4400:2598:7c5b]) by smtp.gmail.com with ESMTPSA id u36-v6sm25033619wrf.87.2018.05.04.03.16.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 May 2018 03:16:33 -0700 (PDT) Date: Fri, 4 May 2018 12:16:31 +0200 From: Rodrigo Rivas Costa To: Jiri Kosina Cc: Benjamin Tissoires , "Pierre-Loup A. Griffais" , =?iso-8859-1?Q?Cl=E9ment?= VUCHENER , Cameron Gutman , lkml , linux-input Subject: Re: [PATCH v9 0/2] hid-steam driver with user mode client dection Message-ID: <20180504101631.GA7496@casa> References: <20180416122703.22306-1-rodrigorivascosta@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, May 04, 2018 at 10:12:51AM +0200, Jiri Kosina wrote: > On Mon, 16 Apr 2018, Rodrigo Rivas Costa wrote: > > > Hello! This is reroll v9 of the Steam Controller driver. > > > > @Pierre-Loup, @Clément, could you please check if this driver is acceptable by > > Valve? I think this could be the one ;-). > > > > I've rolled back the synthetic LPAD diagonals. It happens that the actual > > coordinates of the pads are rotated about 15 degrees to the center, but the > > marks in the pad are aligned to 0/90 degrees. That, and my poor's man > > trigonometry, makes clicking the diagonals quite unreliable. > > Sorry for the noise, but now I think that we are better limiting ourselves to > > the events emitted by the hardware, as is. > > > > Other than that, I've doing some torture testing, with and without the Steam > > Client running. I've changed: > > 1. The way EPIPE is handled when sending a report: I've noticed that Steam > > Client retries up to 50 times, with little or no delay between them, so I do > > the same. > > 2. I've added a fallback in case this driver is unable to get the serial number > > of the controller. Failures on any other report can be ignored safely. But > > failing to get the serial number was preventing the creating of the hidraw > > node (wired controller only), and that could prevent Steam Client from > > working. > > 3. I've received a mail from Valve with a bunch of constants for the > > protocol. Most are related to the setting of new mappings (that we do not > > need) and a few of the rest are deprecated. Anyway, I've renamed the > > constants STEAM_CMD_* to align them with the official names, and added a > > few more that were unknown to me, just for future reference. Still, commands > > used for enabling/disabling lizard mode are the same. > > If noone has any objections (last chance to raise them), I'll be queuing > this for 4.18. That would be great, thanks! Now that my distro upgraded to 4.16, without the hid-quirks array, I've been testing it a bit more. It works great, but I've noticed that I've missed a couple of lines when creating the client hdev. It doesn't seem to cause any harm, and anyway 'type' and 'country' are currently both 0 in my controller; only 'version' is visibly different but who uses that? Anyway, this would be the change, I don't know if it is worth a whole reroll... Best regards, --- Rodrigo Rivas Costa > > Thanks, > > -- > Jiri Kosina > SUSE Labs > -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/hid/hid-steam.c b/drivers/hid/hid-steam.c index af7ebb618867..cb86cc834201 100644 --- a/drivers/hid/hid-steam.c +++ b/drivers/hid/hid-steam.c @@ -651,6 +651,9 @@ static struct hid_device *steam_create_client_hid(struct hid_device *hdev) client_hdev->bus = hdev->bus; client_hdev->vendor = hdev->vendor; client_hdev->product = hdev->product; + client_hdev->version = hdev->version; + client_hdev->type = hdev->type; + client_hdev->country = hdev->country; strlcpy(client_hdev->name, hdev->name, sizeof(client_hdev->name)); strlcpy(client_hdev->phys, hdev->phys,