From patchwork Wed Nov 30 00:29:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladyslav Shtabovenko X-Patchwork-Id: 9453311 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 1DDCE6071E for ; Wed, 30 Nov 2016 00:35:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 103F12846E for ; Wed, 30 Nov 2016 00:35:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 04ABA28646; Wed, 30 Nov 2016 00:35:10 +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=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_TVD_MIME_EPI 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 E32BE2846E for ; Wed, 30 Nov 2016 00:35:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755191AbcK3AfI (ORCPT ); Tue, 29 Nov 2016 19:35:08 -0500 Received: from smtprelay03.ispgateway.de ([80.67.31.41]:51227 "EHLO smtprelay03.ispgateway.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755146AbcK3AfH (ORCPT ); Tue, 29 Nov 2016 19:35:07 -0500 X-Greylist: delayed 325 seconds by postgrey-1.27 at vger.kernel.org; Tue, 29 Nov 2016 19:35:06 EST Received: from [109.125.114.54] (helo=elektron.lan) by smtprelay03.ispgateway.de with esmtpsa (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.84) (envelope-from ) id 1cBsmI-0004Ov-3O; Wed, 30 Nov 2016 01:29:38 +0100 From: Vladyslav Shtabovenko Subject: [PATCH] HID: usbhid: quirk for MechanicalEagle Z-77 keyboard Cc: jikos@kernel.org, benjamin.tissoires@redhat.com To: linux-input@vger.kernel.org Message-ID: <823ed7c4-cb1c-a042-4309-4064b9bbfc78@shtabovenko.df-kunde.de> Date: Wed, 30 Nov 2016 01:29:37 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 X-Df-Sender: ZGV2QHNodGFib3ZlbmtvLmRmLWt1bmRlLmRl 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 Hi, my MechanicalEagle Z-77 keyboard that identifies itself as Bus 003 Device 005: ID 04d9:a0cd Holtek Semiconductor, Inc. has troubles getting recognized after standby. My machine is a Thinkpad X230 in an Ultrabase docking station and everytime the laptop wakes up from standby, the keyboard is not working and I have to reconnect it several times until I can type again. The problem is identical to the one described here: http://lkml.iu.edu/hypermail/linux/kernel/1407.1/04532.html I used the same solution as the author, i.e. added quirks for the specific ID of the keyboard and the issues went away. Tested this for more than three weeks with no problems or side effects whatsoever. Initially I sent the patch directly to Benjamin Tissoires and Jiri Kosina. Benjamin asked me to add the keyboard to hid_have_special_driver in hid-core.c, to ensure that it is handled by hid-holtek instead of hid-generic. However, after doing so, it turned out that with hid-holtek I obtain the same buggy behavior as before. The only difference was that the keyboard was sometimes recognized and sometimes not, so it was a bit like Russian roulette. I also noticed that the "original" Holtek-patch by Wangzhao Cai did not contain this addition to hid_have_special_driver. For me, hid-generic + quirks from the attached patch actually work better with my Holtek-based keyboard than hid-holtek with the same quirks. Please find my patch attached. This is the one without the addition to hid_have_special_driver, i.e. it fixes the problem with the keyboard being unrecognized after standby in 100% of cases. Cheers, Vladyslav From 29dec1f11e53eb87adedad7b2a7c7559ea290e46 Mon Sep 17 00:00:00 2001 From: Vladyslav Shtabovenko Date: Sat, 26 Nov 2016 17:01:38 +0100 Subject: [PATCH] HID: usbhid: quirk for MechanicalEagle Z-77 keyboard Hello, my MechanicalEagle Z-77 keyboard that identifies itself as Bus 003 Device 005: ID 04d9:a0cd Holtek Semiconductor, Inc. has troubles getting recognized after standby. My machine is a Thinkpad X230 in an Ultrabase docking station and everytime the laptop wakes up from standby, the keyboard is not working and I have to reconnect it several times until I can type again. The problem is identical to the one described here: http://lkml.iu.edu/hypermail/linux/kernel/1407.1/04532.html I used the same solution as the author, i.e. added quirks for the specific ID of the keyboard and the issues went away. Tested this for more than three weeks with no problems or side effects whatsoever. Please find my patch attached. Cheers, Vladyslav Signed-off-by: Vladyslav Shtabovenko --- drivers/hid/hid-holtek-kbd.c | 4 +++- drivers/hid/hid-ids.h | 1 + drivers/hid/usbhid/hid-quirks.c | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/hid/hid-holtek-kbd.c b/drivers/hid/hid-holtek-kbd.c index 6e1a4a4..6b8593b 100644 --- a/drivers/hid/hid-holtek-kbd.c +++ b/drivers/hid/hid-holtek-kbd.c @@ -156,7 +156,9 @@ static int holtek_kbd_probe(struct hid_device *hdev, static const struct hid_device_id holtek_kbd_devices[] = { { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, - USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD) }, + USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD), + HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, + USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD_A0CD) }, { } }; MODULE_DEVICE_TABLE(hid, holtek_kbd_devices); diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 575aa65..898e4fe 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h @@ -527,6 +527,7 @@ #define USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A081 0xa081 #define USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A0C2 0xa0c2 #define USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD_A096 0xa096 +#define USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD_A0CD 0xa0cd #define USB_VENDOR_ID_IMATION 0x0718 #define USB_DEVICE_ID_DISC_STAKKA 0xd000 diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c index e6cfd32..0632939 100644 --- a/drivers/hid/usbhid/hid-quirks.c +++ b/drivers/hid/usbhid/hid-quirks.c @@ -159,6 +159,8 @@ static const struct hid_blacklist { { USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_SYNAPTICS_QUAD_HD, HID_QUIRK_NO_INIT_REPORTS }, { USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_SYNAPTICS_TP_V103, HID_QUIRK_NO_INIT_REPORTS }, { USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD_A096, HID_QUIRK_NO_INIT_INPUT_REPORTS }, + { USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD_A0CD, +HID_QUIRK_NO_INIT_INPUT_REPORTS }, { USB_VENDOR_ID_MULTIPLE_1781, USB_DEVICE_ID_RAPHNET_4NES4SNES_OLD, HID_QUIRK_MULTI_INPUT }, { USB_VENDOR_ID_DRACAL_RAPHNET, USB_DEVICE_ID_RAPHNET_2NES2SNES, HID_QUIRK_MULTI_INPUT }, { USB_VENDOR_ID_DRACAL_RAPHNET, USB_DEVICE_ID_RAPHNET_4NES4SNES, HID_QUIRK_MULTI_INPUT }, -- 2.5.5