]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/suse-2.6.27.39/patches.fixes/usb-hid-ncr-no-init-reports.patch
Fix oinkmaster patch.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.fixes / usb-hid-ncr-no-init-reports.patch
1 From 5b915d9e6dc3d22fedde91dfef1cb1a8fa9a1870 Mon Sep 17 00:00:00 2001
2 From: Jiri Kosina <jkosina@suse.cz>
3 Date: Thu, 5 Nov 2009 14:08:03 +0100
4 Subject: [PATCH] HID: fixup quirk for NCR devices
5 Reference: bnc#548807
6
7 NCR devices are terminally broken by design -- they claim themselves to contain
8 proper input applications in their HID report descriptor, but behave very badly
9 if treated in standard way.
10
11 According to NCR developers, the devices get confused when queried for reports
12 in a standard way, rendering them unusable.
13
14 NCR is shipping application called "RPSL" that can be used to drive these
15 devices through hiddev, under the assumption that in-kernel driver doesn't
16 perform initial report query.
17 If it does, neither in-kernel nor hiddev-based driver can operate with these
18 devices any more.
19
20 Introduce a quirk that skips the report query for all NCR devices. The previous
21 NOGET quirk was wrong and had been introduced because I misunderstood the nature
22 of brokenness of these devices.
23
24 Signed-off-by: Jiri Kosina <jkosina@suse.cz>
25
26 Index: linux-2.6.27/include/linux/hid.h
27 ===================================================================
28 --- linux-2.6.27.orig/include/linux/hid.h
29 +++ linux-2.6.27/include/linux/hid.h
30 @@ -284,6 +284,7 @@ struct hid_item {
31 #define HID_QUIRK_MICROSOFT_KEYS 0x08000000
32 #define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000
33 #define HID_QUIRK_APPLE_NUMLOCK_EMULATION 0x20000000
34 +#define HID_QUIRK_NO_INIT_REPORTS 0x40000000
35
36 /*
37 * Separate quirks for runtime report descriptor fixup
38 Index: linux-2.6.27/drivers/hid/usbhid/hid-quirks.c
39 ===================================================================
40 --- linux-2.6.27.orig/drivers/hid/usbhid/hid-quirks.c
41 +++ linux-2.6.27/drivers/hid/usbhid/hid-quirks.c
42 @@ -993,7 +993,7 @@ u32 usbhid_lookup_quirk(const u16 idVend
43 if (idVendor == USB_VENDOR_ID_NCR &&
44 idProduct >= USB_DEVICE_ID_NCR_FIRST &&
45 idProduct <= USB_DEVICE_ID_NCR_LAST)
46 - return HID_QUIRK_NOGET;
47 + return HID_QUIRK_NO_INIT_REPORTS;
48
49 down_read(&dquirks_rwsem);
50 bl_entry = usbhid_exists_dquirk(idVendor, idProduct);
51 Index: linux-2.6.27/drivers/hid/usbhid/hid-core.c
52 ===================================================================
53 --- linux-2.6.27.orig/drivers/hid/usbhid/hid-core.c
54 +++ linux-2.6.27/drivers/hid/usbhid/hid-core.c
55 @@ -980,7 +980,9 @@ static int hid_probe(struct usb_interfac
56 if (!(hid = usb_hid_configure(intf)))
57 return -ENODEV;
58
59 - usbhid_init_reports(hid);
60 + if (!(hid->quirks & HID_QUIRK_NO_INIT_REPORTS))
61 + usbhid_init_reports(hid);
62 +
63 hid_dump_device(hid);
64 if (hid->quirks & HID_QUIRK_RESET_LEDS)
65 usbhid_set_leds(hid);