From 35068976916fdef82d6e69ef1f8c9a1c47732759 Mon Sep 17 00:00:00 2001 From: Adrian Drzewiecki Date: Sat, 6 Jan 2007 12:37:26 +0100 Subject: HID: fix mappings for DiNovo Edge Keyboard - Logitech USB BT receiver This patch fixes mappings for the Logitech USB BT receiver that ships along with Logitech's DiNovo Edge keyboard. Without these changes, the "touchwheel" does not work as intended (a mouse) Signed-off-by: Adrian Drzewiecki Acked-by: Vojtech Pavlik Signed-off-by: Jiri Kosina --- drivers/hid/hid-input.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 998638020ea..28689e3eb55 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -68,6 +68,7 @@ static const struct { #define map_led(c) do { usage->code = c; usage->type = EV_LED; bit = input->ledbit; max = LED_MAX; } while (0) #define map_abs_clear(c) do { map_abs(c); clear_bit(c, bit); } while (0) +#define map_rel_clear(c) do { map_rel(c); clear_bit(c, bit); } while (0) #define map_key_clear(c) do { map_key(c); clear_bit(c, bit); } while (0) #ifdef CONFIG_USB_HIDINPUT_POWERBOOK @@ -292,7 +293,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel } } - map_key(code); + map_key_clear(code); break; @@ -343,9 +344,9 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel case HID_GD_RX: case HID_GD_RY: case HID_GD_RZ: case HID_GD_SLIDER: case HID_GD_DIAL: case HID_GD_WHEEL: if (field->flags & HID_MAIN_ITEM_RELATIVE) - map_rel(usage->hid & 0xf); + map_rel_clear(usage->hid & 0xf); else - map_abs(usage->hid & 0xf); + map_abs_clear(usage->hid & 0xf); break; case HID_GD_HATSWITCH: @@ -500,7 +501,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel case 0x22f: map_key_clear(KEY_ZOOMRESET); break; case 0x233: map_key_clear(KEY_SCROLLUP); break; case 0x234: map_key_clear(KEY_SCROLLDOWN); break; - case 0x238: map_rel(REL_HWHEEL); break; + case 0x238: map_rel_clear(REL_HWHEEL); break; case 0x25f: map_key_clear(KEY_CANCEL); break; case 0x279: map_key_clear(KEY_REDO); break; -- cgit v1.2.3-70-g09d2 From d6509c36ba333282362e5f9769869f8a8d790aaf Mon Sep 17 00:00:00 2001 From: "Ahmed S. Darwish" Date: Sat, 6 Jan 2007 15:18:52 +0200 Subject: HID: tiny patch to remove a kmalloc cast Remove unnecessary cast. Signed-off-by: Ahmed Darwish Signed-off-by: Jiri Kosina --- drivers/hid/hid-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 18c2b3cf6bc..2fcfdbb43cd 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -656,7 +656,7 @@ struct hid_device *hid_parse_report(__u8 *start, unsigned size) for (i = 0; i < HID_REPORT_TYPES; i++) INIT_LIST_HEAD(&device->report_enum[i].report_list); - if (!(device->rdesc = (__u8 *)kmalloc(size, GFP_KERNEL))) { + if (!(device->rdesc = kmalloc(size, GFP_KERNEL))) { kfree(device->collection); kfree(device); return NULL; -- cgit v1.2.3-70-g09d2 From 4d503ecc86a14b86ab7bcdfa8b755994143eba19 Mon Sep 17 00:00:00 2001 From: Jiri Kosina Date: Mon, 8 Jan 2007 13:42:43 +0100 Subject: HID: mousepoll parameter makes no sense for generic HID mousepoll parameter makes no sense for generic HID code. It belongs to (and is implemented by) usbhid. This is also where all users are expecting it. Signed-off-by: Jiri Kosina --- drivers/hid/hid-core.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 2fcfdbb43cd..f143c35227f 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -43,14 +43,6 @@ #define DRIVER_DESC "USB HID core driver" #define DRIVER_LICENSE "GPL" -/* - * Module parameters. - */ - -static unsigned int hid_mousepoll_interval; -module_param_named(mousepoll, hid_mousepoll_interval, uint, 0644); -MODULE_PARM_DESC(mousepoll, "Polling interval of mice"); - /* * Register a new report for a device. */ -- cgit v1.2.3-70-g09d2 From 531498013163c72cee8540e98e12c0c430c7fe87 Mon Sep 17 00:00:00 2001 From: Jiri Kosina Date: Tue, 9 Jan 2007 13:24:25 +0100 Subject: HID: Fix DRIVER_DESC macro DRIVER_DESC macro is wrong in drivers/hid/hid-core.c. Its value is legacy from original usb+hid code and clashes with current usbhid implementation. Fix it. Signed-off-by: Jiri Kosina --- drivers/hid/hid-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index f143c35227f..1e1a7770a6b 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -40,7 +40,7 @@ #define DRIVER_VERSION "v2.6" #define DRIVER_AUTHOR "Andreas Gal, Vojtech Pavlik" -#define DRIVER_DESC "USB HID core driver" +#define DRIVER_DESC "HID core driver" #define DRIVER_LICENSE "GPL" /* -- cgit v1.2.3-70-g09d2