All of lore.kernel.org
 help / color / mirror / Atom feed
* [Patch] aureal remote quirk to fix an bogus HID report descriptor
@ 2011-01-13 18:58 Stephan Raue
  2011-01-18 13:19 ` Jiri Kosina
  0 siblings, 1 reply; 2+ messages in thread
From: Stephan Raue @ 2011-01-13 18:58 UTC (permalink / raw)
  To: linux-input; +Cc: stephan

[-- Attachment #1: Type: text/plain, Size: 688 bytes --]

Remote Controls shipped with some new Jetway ION system has two event 
interfaces : Keyboard and Mouse. Mouse buttons work but keyboard buttons 
doesn't.

The remote identifies itself as :

Vendor:Device 0x0755:0x2626
Cy se W-01RN USB_V3.1

the Remote Control has a bogus HID Report Descriptor. According to that 
report descriptor, the maximum logical value for key events is 1 and not 
101 (101 keys).

This quirk fixes this wrong Report Descriptor and is basically the same 
found in hid-elecom.c.

This patch is originally from 
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/607062 with changes 
to not oops on linux-2.6.37.


Signed-off-by: Stephan Raue <stephan@openelec.tv>

[-- Attachment #2: linux-2.6.37-052-aureal_remote_quirk-0.1.patch --]
[-- Type: text/x-patch, Size: 3932 bytes --]

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 <vojtech@suse.cz>
+ *  Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc
+ *  Copyright (c) 2006-2007 Jiri Kosina
+ *  Copyright (c) 2007 Paul Walmsley
+ *  Copyright (c) 2008 Jiri Slaby
+ *  Copyright (c) 2010 Franco Catrin <fcatrin@gmail.com>
+ */
+
+/*
+ * 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 <linux/device.h>
+#include <linux/hid.h>
+#include <linux/module.h>
+
+#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 <mike-@cinci.rr.com> for Concept2, Inc
  *  Copyright (c) 2006-2007 Jiri Kosina
  *  Copyright (c) 2007 Paul Walmsley
+ *  Copyright (c) 2010 Franco Catrin <fcatrin@gmail.com>
  */
 
 /*
@@ -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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Patch] aureal remote quirk to fix an bogus HID report descriptor
  2011-01-13 18:58 [Patch] aureal remote quirk to fix an bogus HID report descriptor Stephan Raue
@ 2011-01-18 13:19 ` Jiri Kosina
  0 siblings, 0 replies; 2+ messages in thread
From: Jiri Kosina @ 2011-01-18 13:19 UTC (permalink / raw)
  To: Stephan Raue; +Cc: linux-input

On Thu, 13 Jan 2011, Stephan Raue wrote:

> Remote Controls shipped with some new Jetway ION system has two event
> interfaces : Keyboard and Mouse. Mouse buttons work but keyboard buttons
> doesn't.
> 
> The remote identifies itself as :
> 
> Vendor:Device 0x0755:0x2626
> Cy se W-01RN USB_V3.1
> 
> the Remote Control has a bogus HID Report Descriptor. According to that report
> descriptor, the maximum logical value for key events is 1 and not 101 (101
> keys).
> 
> This quirk fixes this wrong Report Descriptor and is basically the same found
> in hid-elecom.c.
> 
> This patch is originally from
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/607062 with changes to
> not oops on linux-2.6.37.
> 
> 
> Signed-off-by: Stephan Raue <stephan@openelec.tv>

Hi Stepahn,

thanks for the driver! 

A few comments though, before I can apply the driver

- please always CC me on patches against drivers/hid/
- you are adding driver with Copyright of Franco Catrin 
  <fcatrin@gmail.com>, but you are providing your own Signed-off-by only. 
  What is the origin of the code, please?
- additions to hid-ids.h don't really qualify for copyright
- please don't add any new HID drivers with the 'EMBEDDED' stuff in 
  Kconfig. You can read some explanation in the changelog text of commit 
  73d5e8f77e88a4d3a154dfdbb4ed2cf461b7bf21 ("HID: fix up 'EMBEDDED' mess 
  in Kconfig").
- please send the patch inline in the message text, not attached

Thanks,

-- 
Jiri Kosina
SUSE Labs, Novell Inc.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-01-18 13:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-13 18:58 [Patch] aureal remote quirk to fix an bogus HID report descriptor Stephan Raue
2011-01-18 13:19 ` Jiri Kosina

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.