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: 84926 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp22574qgi; Tue, 29 Nov 2016 16:35:09 -0800 (PST) X-Received: by 10.84.208.227 with SMTP id c32mr67136462plj.144.1480466109292; Tue, 29 Nov 2016 16:35:09 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k21si61771129pgg.84.2016.11.29.16.35.09; Tue, 29 Nov 2016 16:35:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-input-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-input-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-input-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755191AbcK3AfI (ORCPT + 1 other); 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 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