From patchwork Thu Dec 6 16:59:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Nic_Soud=C3=A9e?= X-Patchwork-Id: 10716423 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5236F13BF for ; Thu, 6 Dec 2018 16:59:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 400822F141 for ; Thu, 6 Dec 2018 16:59:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3412F2F14E; Thu, 6 Dec 2018 16:59:33 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UPPERCASE_50_75 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 272AB2F141 for ; Thu, 6 Dec 2018 16:59:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725916AbeLFQ72 (ORCPT ); Thu, 6 Dec 2018 11:59:28 -0500 Received: from mail-qt1-f195.google.com ([209.85.160.195]:33146 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725948AbeLFQ72 (ORCPT ); Thu, 6 Dec 2018 11:59:28 -0500 Received: by mail-qt1-f195.google.com with SMTP id l11so1323250qtp.0 for ; Thu, 06 Dec 2018 08:59:27 -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:mime-version:content-disposition :content-transfer-encoding:user-agent; bh=e2D9452X5wA2K2ebTq7YQyxxgHWthAHhHqSrFhHts4k=; b=HONrL4HbAlJ6Zr/0Mo7kWdfkMzPqigkw06fCG5HjloeImHCYmpzbZ/eeCD6CNJDSku Vt7KjnJ4rke1hjoimda9bb8ujZyCRANTLGMH+j5nIP8W3RC4pPEonyvmGqj12CH2o7O5 bWXcDOabGgJ6kGQQzqXkAiVaU/Ftedv/UzUKbJLvw6O0vXvdDEejN+Kxl/4l4p6EKxg/ w0Tcqhybgge9+MN6rzeVstax6cV4au3+GnwukUwj87cKpF2KSdEs+rbyel57OAZY66RV 4Q1WLUyJRbnP0/Xjnr8hIyMjR8C333L2SWP+ktU+tg0cooPjAYO7w2dI4MEZ9Ca5hvha 8oww== 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:mime-version :content-disposition:content-transfer-encoding:user-agent; bh=e2D9452X5wA2K2ebTq7YQyxxgHWthAHhHqSrFhHts4k=; b=lcNoUnJMWQd9mJ2nJMW1jxwf+iPXgelc5TQmDFfDlon4TNk/kAuwm6x+Q3rYBqbVkY hNTrA5R0tHSPnf45lUIeJYabKntOOdfpQf/ogN0/0FF96iYZyNDN9x5+0KGOrbf1h8yA kI9ZtrnDEWr/4JtBs3c0190LGoAbJukqIH/8PFLp9O5SWaIjOIqUV51EdhvcosKPJ9nf Bh6BMkdJzB/FuS9DzmvyJMjJhiPxE8/yqAG5E2wkXxcJrL68GaJY6VdloL4yjDpevNZe /xPtpAZjnjG0xPvX1zK7ELRioQUezO1JGrv1OV99hSgBR1fsVfEBOa9AtxE7e4mRimzQ 0kpw== X-Gm-Message-State: AA+aEWb1uKl4lg2hqyelSHrfQguq9qxhiVXy5CQTZBhvHMNDS6PSs9b0 bIyUyKcxL8ONYXFNnOi/4ltk7axQ2N8= X-Google-Smtp-Source: AFSGD/WYTCzB0D8BKH1JojWEj92Tkx94zYlwF9rMvx2KqgALnJVYNFm85SiUUw6H7ht1qIHvi1WSzw== X-Received: by 2002:aed:22ba:: with SMTP id p55mr27557431qtc.137.1544115567067; Thu, 06 Dec 2018 08:59:27 -0800 (PST) Received: from jasnah (pool-100-15-173-95.washdc.fios.verizon.net. [100.15.173.95]) by smtp.gmail.com with ESMTPSA id j95sm499577qtb.74.2018.12.06.08.59.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Dec 2018 08:59:26 -0800 (PST) Date: Thu, 6 Dec 2018 11:59:25 -0500 From: Nic =?iso-8859-1?q?Soud=E9e?= To: Jiri Kosina Cc: Benjamin Tissoires , linux-input@vger.kernel.org, Nic =?iso-8859-1?q?Soud=E9e?= Subject: [PATCH] HID: quirks: fix RetroUSB.com devices Message-ID: <20181206165925.GA12842@jasnah> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-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 SNES RetroPort and RetroPad register only 4 gamepad buttons when they should register all 8 buttons. This is described here: https://ask.fedoraproject.org/en/question/128102 This is happening because of: Commit 190d7f02ce8e ("HID: input: do not increment usages when duplicate is found") Here, I add the quirk HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE (created for backward compatibility with the change in 190d7f02ce8e) for the two products. Tested with both RetroPort and RetroPad. Signed-off-by: Nic Soudée --- drivers/hid/hid-ids.h | 4 ++++ drivers/hid/hid-quirks.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index f63489c882bb..ba2f97fd54e5 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h @@ -933,6 +933,10 @@ #define USB_VENDOR_ID_REALTEK 0x0bda #define USB_DEVICE_ID_REALTEK_READER 0x0152 +#define USB_VENDOR_ID_RETROUSB 0xf000 +#define USB_DEVICE_ID_RETROUSB_SNES_RETROPAD 0x0003 +#define USB_DEVICE_ID_RETROUSB_SNES_RETROPORT 0x00f1 + #define USB_VENDOR_ID_ROCCAT 0x1e7d #define USB_DEVICE_ID_ROCCAT_ARVO 0x30d4 #define USB_DEVICE_ID_ROCCAT_ISKU 0x319c diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c index 52c3b01917e7..a38f3e08efed 100644 --- a/drivers/hid/hid-quirks.c +++ b/drivers/hid/hid-quirks.c @@ -135,6 +135,8 @@ static const struct hid_device_id hid_quirks[] = { { HID_USB_DEVICE(USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3003), HID_QUIRK_NOGET }, { HID_USB_DEVICE(USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3008), HID_QUIRK_NOGET }, { HID_USB_DEVICE(USB_VENDOR_ID_REALTEK, USB_DEVICE_ID_REALTEK_READER), HID_QUIRK_NO_INIT_REPORTS }, + { HID_USB_DEVICE(USB_VENDOR_ID_RETROUSB, USB_DEVICE_ID_RETROUSB_SNES_RETROPAD), HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE }, + { HID_USB_DEVICE(USB_VENDOR_ID_RETROUSB, USB_DEVICE_ID_RETROUSB_SNES_RETROPORT), HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE }, { HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_RUMBLEPAD), HID_QUIRK_BADPAD }, { HID_USB_DEVICE(USB_VENDOR_ID_SEMICO, USB_DEVICE_ID_SEMICO_USB_KEYKOARD2), HID_QUIRK_NO_INIT_REPORTS }, { HID_USB_DEVICE(USB_VENDOR_ID_SEMICO, USB_DEVICE_ID_SEMICO_USB_KEYKOARD), HID_QUIRK_NO_INIT_REPORTS },