From patchwork Thu Jan 13 18:58:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Raue X-Patchwork-Id: 476601 X-Patchwork-Delegate: jikos@jikos.cz Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p0DJ6Ia5006381 for ; Thu, 13 Jan 2011 19:06:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933144Ab1AMTGR (ORCPT ); Thu, 13 Jan 2011 14:06:17 -0500 Received: from mail04.solnet.ch ([212.101.4.138]:59387 "EHLO mail04.solnet.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933142Ab1AMTGQ (ORCPT ); Thu, 13 Jan 2011 14:06:16 -0500 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 13 Jan 2011 19:06:19 +0000 (UTC) X-Greylist: delayed 446 seconds by postgrey-1.27 at vger.kernel.org; Thu, 13 Jan 2011 14:06:16 EST X-Virus-Scanned: by SolNet-Check at mail04.solnet.ch Received: from mail04.solnet.ch ([127.0.0.1]) by localhost (mail04.solnet.ch [127.0.0.1]) (SolNet-Check, port 10024) with LMTP id uwiYrgIc-imz; Thu, 13 Jan 2011 18:58:46 +0000 (UTC) Message-ID: <4D2F4B65.1020807@openelec.tv> Date: Thu, 13 Jan 2011 19:58:45 +0100 From: Stephan Raue User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: linux-input@vger.kernel.org CC: stephan@openelec.tv Subject: [Patch] aureal remote quirk to fix an bogus HID report descriptor Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org diff -Naur linux-2.6.37/drivers/hid/hid-aureal.c linux-2.6.37.patch/drivers/hid/hid-aureal.c --- linux-2.6.37/drivers/hid/hid-aureal.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.37.patch/drivers/hid/hid-aureal.c 2011-01-07 22:35:31.413389936 +0100 @@ -0,0 +1,60 @@ +/* + * HID driver for some sunplus "special" devices + * + * Copyright (c) 1999 Andreas Gal + * Copyright (c) 2000-2005 Vojtech Pavlik + * Copyright (c) 2005 Michael Haboustak for Concept2, Inc + * Copyright (c) 2006-2007 Jiri Kosina + * Copyright (c) 2007 Paul Walmsley + * Copyright (c) 2008 Jiri Slaby + * Copyright (c) 2010 Franco Catrin + */ + +/* + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + */ + +#include +#include +#include + +#include "hid-ids.h" + +static __u8 *aureal_report_fixup(struct hid_device *hdev, __u8 *rdesc, + unsigned int *rsize) +{ + if (*rsize >= 54 && rdesc[52] == 0x25 && rdesc[53] == 0x01) { + dev_info(&hdev->dev, "fixing Aureal Cy se W-01RN USB_V3.1 " + "report descriptor. Keyboard Logical Maximum = 101\n"); + rdesc[53] = 0x65; + } return rdesc; +} + +static const struct hid_device_id aureal_devices[] = { + { HID_USB_DEVICE(USB_VENDOR_ID_AUREAL, USB_DEVICE_ID_AUREAL_W01RN) }, + { } +}; +MODULE_DEVICE_TABLE(hid, aureal_devices); + +static struct hid_driver aureal_driver = { + .name = "aureal", + .id_table = aureal_devices, + .report_fixup = aureal_report_fixup, +}; + +static int __init aureal_init(void) +{ + return hid_register_driver(&aureal_driver); +} + +static void __exit aureal_exit(void) +{ + hid_unregister_driver(&aureal_driver); +} + +module_init(aureal_init); +module_exit(aureal_exit); +MODULE_LICENSE("GPL"); diff -Naur linux-2.6.37/drivers/hid/hid-ids.h linux-2.6.37.patch/drivers/hid/hid-ids.h --- linux-2.6.37/drivers/hid/hid-ids.h 2011-01-05 01:50:19.000000000 +0100 +++ linux-2.6.37.patch/drivers/hid/hid-ids.h 2011-01-07 22:35:31.414389949 +0100 @@ -6,6 +6,7 @@ * Copyright (c) 2005 Michael Haboustak for Concept2, Inc * Copyright (c) 2006-2007 Jiri Kosina * Copyright (c) 2007 Paul Walmsley + * Copyright (c) 2010 Franco Catrin */ /* @@ -327,6 +328,9 @@ #define USB_DEVICE_ID_KYE_ERGO_525V 0x0087 #define USB_DEVICE_ID_KYE_GPEN_560 0x5003 +#define USB_VENDOR_ID_AUREAL 0x0755 +#define USB_DEVICE_ID_AUREAL_W01RN 0x2626 + #define USB_VENDOR_ID_LABTEC 0x1020 #define USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD 0x0006 diff -Naur linux-2.6.37/drivers/hid/Kconfig linux-2.6.37.patch/drivers/hid/Kconfig --- linux-2.6.37/drivers/hid/Kconfig 2011-01-05 01:50:19.000000000 +0100 +++ linux-2.6.37.patch/drivers/hid/Kconfig 2011-01-07 22:35:31.467390603 +0100 @@ -87,6 +87,13 @@ Say Y here if you want support for keyboards of Apple iBooks, PowerBooks, MacBooks, MacBook Pros and Apple Aluminum. +config HID_AUREAL + tristate "Aureal" if EMBEDDED + depends on USB_HID + default !EMBEDDED + ---help--- + Support for Aureal Cy se W-01RN Remote Controller + config HID_BELKIN tristate "Belkin Flip KVM and Wireless keyboard" if EMBEDDED depends on USB_HID diff -Naur linux-2.6.37/drivers/hid/Makefile linux-2.6.37.patch/drivers/hid/Makefile --- linux-2.6.37/drivers/hid/Makefile 2011-01-05 01:50:19.000000000 +0100 +++ linux-2.6.37.patch/drivers/hid/Makefile 2011-01-07 22:35:31.547391590 +0100 @@ -29,6 +29,7 @@ obj-$(CONFIG_HID_A4TECH) += hid-a4tech.o obj-$(CONFIG_HID_ACRUX_FF) += hid-axff.o obj-$(CONFIG_HID_APPLE) += hid-apple.o +obj-$(CONFIG_HID_AUREAL) += hid-aureal.o obj-$(CONFIG_HID_BELKIN) += hid-belkin.o obj-$(CONFIG_HID_CANDO) += hid-cando.o obj-$(CONFIG_HID_CHERRY) += hid-cherry.o