All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
To: Vladyslav Shtabovenko <dev@shtabovenko.df-kunde.de>
Cc: linux-input@vger.kernel.org, jikos@kernel.org
Subject: Re: [PATCH] HID: usbhid: quirk for MechanicalEagle Z-77 keyboard
Date: Tue, 13 Dec 2016 09:21:23 +0100	[thread overview]
Message-ID: <20161213082123.GD13907@mail.corp.redhat.com> (raw)
In-Reply-To: <3b47abb2-47cc-ed33-7c36-f79538182954@shtabovenko.df-kunde.de>

On Dec 08 2016 or thereabouts, Vladyslav Shtabovenko wrote:
> By the way, I also did some research on the internet and apparently
> many gaming/mechanical keyboards require similar quirks:
> 
> https://unix.stackexchange.com/questions/280564/usb-submit-urbctrl-failed-1-corsair-k65-rgb-keyboard/280574#280574
> 
> This one concerns the same chip as in my keyboard:
> 
> https://askubuntu.com/questions/811162/keyboard-not-working-after-waking-from-suspend-sleep/846019
> 
> With usbhid.quirks=0x04D9:0xA0CD:0x20000408 added to GRUB_CMDLINE_LINUX
> the keyboard works fine also on unpatched kernels.

Then can you just submit a patch which adds
"HID_QUIRK_NOGET | HID_QUIRK_ALWAYS_POLL | HID_QUIRK_NO_INIT_REPORTS" in
drivers/hid/usbhid/hid-quirks.c?

There should not be a need of patching hid-holtek.c

Cheers,
Benjamin

> 
> Cheers,
> Vladyslav
> 
> 
> 
> 
> Am 05.12.2016 um 22:56 schrieb Vladyslav Shtabovenko:
> >Hi,
> >
> >sorry for the late reply. I prefer to test things before submitting
> >them here and compiling the kernel takes more than one hour on
> >my machine...
> >
> >It sounds very weird, but if I remove the drivers/hid/hid-holtek-kbd.c
> >hunk and leave the other quirks, then the keyboard does not work at all:
> >It just does not recognized, so I cannot type anything. Does this make
> >any sense?
> >
> >Unless it is some sort of anomaly on Fedora's 4.8.10-100 kernel, it
> >seems that for some reason (that I don't understand) one has to declare
> >the keyboard in hid-holtek-kbd, although it is then controlled by usbhid.
> >
> >Cheers,
> >Vladyslav
> >
> >
> >
> >Am 01.12.2016 um 15:23 schrieb Benjamin Tissoires:
> >>On Nov 30 2016 or thereabouts, Vladyslav Shtabovenko wrote:
> >>>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.
> >>
> >>Hi,
> >>
> >>you probably also need to remove the drivers/hid/hid-holtek-kbd.c hunk
> >>if you prefer having hid-generic hanlding your keyboard.
> >>
> >>Cheers,
> >>Benjamin
> >>
> >>>
> >>>
> >>>Cheers,
> >>>Vladyslav
> >>>
> >>
> >>>From 29dec1f11e53eb87adedad7b2a7c7559ea290e46 Mon Sep 17 00:00:00 2001
> >>>From: Vladyslav Shtabovenko <dev@shtabovenko.df-kunde.de>
> >>>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 <dev@shtabovenko.df-kunde.de>
> >>>---
> >>> 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
> >>>
> >>>
> >>

      reply	other threads:[~2016-12-13  8:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-30  0:29 [PATCH] HID: usbhid: quirk for MechanicalEagle Z-77 keyboard Vladyslav Shtabovenko
2016-12-01 14:23 ` Benjamin Tissoires
2016-12-05 21:56   ` Vladyslav Shtabovenko
2016-12-08 19:39     ` Vladyslav Shtabovenko
2016-12-13  8:21       ` Benjamin Tissoires [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161213082123.GD13907@mail.corp.redhat.com \
    --to=benjamin.tissoires@redhat.com \
    --cc=dev@shtabovenko.df-kunde.de \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.