]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
HID: fixup quirk for NCR devices
authorJiri Kosina <jkosina@suse.cz>
Thu, 5 Nov 2009 13:08:03 +0000 (14:08 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 28 Jan 2010 23:01:20 +0000 (15:01 -0800)
commit 5b915d9e6dc3d22fedde91dfef1cb1a8fa9a1870 upstream.

NCR devices are terminally broken by design -- they claim themselves to contain
proper input applications in their HID report descriptor, but behave very badly
if treated in standard way.

According to NCR developers, the devices get confused when queried for reports
in a standard way, rendering them unusable.

NCR is shipping application called "RPSL" that can be used to drive these
devices through hiddev, under the assumption that in-kernel driver doesn't
perform initial report query.
If it does, neither in-kernel nor hiddev-based driver can operate with these
devices any more.

Introduce a quirk that skips the report query for all NCR devices. The previous
NOGET quirk was wrong and had been introduced because I misunderstood the nature
of brokenness of these devices.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/hid/usbhid/hid-core.c
drivers/hid/usbhid/hid-quirks.c
include/linux/hid.h

index 03bd703255a3d16311f8d6a50721c7c12ca4b4f0..5d901f698838a7f19bd4b829eda2e4d832fd6173 100644 (file)
@@ -998,7 +998,8 @@ static int usbhid_start(struct hid_device *hid)
        usbhid->urbctrl->transfer_dma = usbhid->ctrlbuf_dma;
        usbhid->urbctrl->transfer_flags |= (URB_NO_TRANSFER_DMA_MAP | URB_NO_SETUP_DMA_MAP);
 
-       usbhid_init_reports(hid);
+       if (!(hid->quirks & HID_QUIRK_NO_INIT_REPORTS))
+               usbhid_init_reports(hid);
 
        set_bit(HID_STARTED, &usbhid->iofl);
 
index 0d9045aa2c4bff7d8ca5a0ff342c716c2021ae02..5713b93e76cbdfdcdfce904b1dbe18763562f890 100644 (file)
@@ -280,7 +280,7 @@ u32 usbhid_lookup_quirk(const u16 idVendor, const u16 idProduct)
        if (idVendor == USB_VENDOR_ID_NCR &&
                        idProduct >= USB_DEVICE_ID_NCR_FIRST &&
                        idProduct <= USB_DEVICE_ID_NCR_LAST)
-                       return HID_QUIRK_NOGET;
+                       return HID_QUIRK_NO_INIT_REPORTS;
 
        down_read(&dquirks_rwsem);
        bl_entry = usbhid_exists_dquirk(idVendor, idProduct);
index 10f6284167400432a5bebebf2d28ea969e0d1840..87093652dda8d00ee341132f40eb17d5b46171be 100644 (file)
@@ -312,6 +312,7 @@ struct hid_item {
 #define HID_QUIRK_MULTI_INPUT                  0x00000040
 #define HID_QUIRK_SKIP_OUTPUT_REPORTS          0x00010000
 #define HID_QUIRK_FULLSPEED_INTERVAL           0x10000000
+#define HID_QUIRK_NO_INIT_REPORTS              0x20000000
 
 /*
  * This is the global environment of the parser. This information is