Comment 11 for bug 1771431

Revision history for this message
TJ (tj) wrote :

The kernel has a module for this, "hid-primax", which re-orders the received HID reports to make them compliant.

$ modinfo hid-primax
filename: /lib/modules/4.15.0-34-lowlatency/kernel/drivers/hid/hid-primax.ko
license: GPL
author: Terry Lambert <email address hidden>
srcversion: 9AF9EA4DBFB1326426467BB
alias: hid:b0003g*v00000461p00004E05
depends: hid
retpoline: Y
intree: Y
name: hid_primax
vermagic: 4.15.0-34-lowlatency SMP preempt mod_unload
signat: PKCS#7
signer:
sig_key:
sig_hashalgo: md4

$ git show f6a04605f3038

commit f6a04605f303852963f3f357d19b967aa83c172f
Author: Terry Lambert <email address hidden>
Date: Fri Oct 14 17:18:54 2011 -0700

    HID: support primax keyboards violating USB HID spec

    Primax keyboards with the issue this driver addresses report modifier
    keys as in band key events instead of as out of band modifier bits,
    resulting in the modifier keys generating key up events immediately
    before the keys they are intended to modify. This driver rewrites
    the raw report data from such keyboards into USB HID 1.11 compliant
    report data. It only matches the USB vendor and product IDs for the
    keyboard it has been tested on. Since there are several keyboards,
    notably a number of laptops and folding USB keyboards known to have
    similar unresolved problem reports, the list is expected to grow.

    Signed-off-by: Terry Lambert <email address hidden>
    Signed-off-by: Jiri Kosina <email address hidden>

$ git describe --contains f6a04605f3038
v3.2-rc1~187^2^2~2

Currently the driver only supports the device ID 0461:4e05 and will need the IDs of other devices adding in order to work with them.

# extract from drivers/hid/hid-primax.c

static const struct hid_device_id px_devices[] = {
    { HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_KEYBOARD) },
    { }
};

$ grep PRIMAX drivers/hid/hid-ids.h
#define USB_VENDOR_ID_PRIMAX 0x0461
#define USB_DEVICE_ID_PRIMAX_MOUSE_4D22 0x4d22
#define USB_DEVICE_ID_PRIMAX_KEYBOARD 0x4e05
#define USB_DEVICE_ID_PRIMAX_REZEL 0x4e72

Collecting additional IDs and adding them would be the best action to take.