aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/usbhid/hid-core.c
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2007-06-18 07:30:11 -0400
committerJiri Kosina <jkosina@suse.cz>2007-07-09 08:13:33 -0400
commit92d9e6e607eb7f8f1d2a43935f45cf300cf6fdf8 (patch)
tree52a583569ad4262ea354941e604f464770ee7756 /drivers/hid/usbhid/hid-core.c
parent5fce620c0c7caa9e8d9588e8dcc66c52c456851a (diff)
HID: support for Petalynx Maxter remote control
Petalynx Maxter remote control [1] 0x18b1/0x0037 emits 0xfa and 0xfc from consumer page (reserved in HUT 1.12) for back and more keys. It also emits a few usages from LOGIVENDOR page, which need adding. Also, this device has broken report descriptor - the reported maximum is too low - it doesn't contain the range for 'back' and 'more' keys, so we need to bump it up before the report descriptor is being parsed. Besides all this, it also requires NOGET quirk. This patch does so. [1] http://www.elmak.pl/index.php?option=com_phpshop&page=shop.browse&category_id=14&ext=opis&lang=en Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/usbhid/hid-core.c')
-rw-r--r--drivers/hid/usbhid/hid-core.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index 093abb5c9879..ef7b881aab3a 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -688,6 +688,21 @@ static void hid_fixup_logitech_descriptor(unsigned char *rdesc, int rsize)
688 } 688 }
689} 689}
690 690
691/* Petalynx Maxter Remote has maximum for consumer page set too low */
692static void hid_fixup_petalynx_descriptor(unsigned char *rdesc, int rsize)
693{
694 if (rsize >= 60 && rdesc[39] == 0x2a
695 && rdesc[40] == 0xf5
696 && rdesc[41] == 0x00
697 && rdesc[59] == 0x26
698 && rdesc[60] == 0xf9
699 && rdesc[61] == 0x00) {
700 info("Fixing up Petalynx Maxter Remote report descriptor");
701 rdesc[60] = 0xfa;
702 rdesc[40] = 0xfa;
703 }
704}
705
691/* 706/*
692 * Some USB barcode readers from cypress have usage min and usage max in 707 * Some USB barcode readers from cypress have usage min and usage max in
693 * the wrong order 708 * the wrong order
@@ -781,6 +796,9 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf)
781 if (quirks & HID_QUIRK_SWAPPED_MIN_MAX) 796 if (quirks & HID_QUIRK_SWAPPED_MIN_MAX)
782 hid_fixup_cypress_descriptor(rdesc, rsize); 797 hid_fixup_cypress_descriptor(rdesc, rsize);
783 798
799 if (quirks & HID_QUIRK_PETALYNX_DESCRIPTOR)
800 hid_fixup_petalynx_descriptor(rdesc, rsize);
801
784#ifdef CONFIG_HID_DEBUG 802#ifdef CONFIG_HID_DEBUG
785 printk(KERN_DEBUG __FILE__ ": report descriptor (size %u, read %d) = ", rsize, n); 803 printk(KERN_DEBUG __FILE__ ": report descriptor (size %u, read %d) = ", rsize, n);
786 for (n = 0; n < rsize; n++) 804 for (n = 0; n < rsize; n++)