Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 256810
b: refs/heads/master
c: 23c10be
h: refs/heads/master
v: v3
  • Loading branch information
Ari Savolainen authored and Jiri Kosina committed Jul 12, 2011
1 parent 208c3bd commit a75dbad
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6be914f11db8e88d11b08d6c496624dbbd642d80
refs/heads/master: 23c10becdbc712de3fb35d0c7ec105a81d21f4c7
1 change: 1 addition & 0 deletions trunk/drivers/hid/hid-ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@
#define USB_DEVICE_ID_MS_PRESENTER_8K_BT 0x0701
#define USB_DEVICE_ID_MS_PRESENTER_8K_USB 0x0713
#define USB_DEVICE_ID_MS_DIGITAL_MEDIA_3K 0x0730
#define USB_DEVICE_ID_MS_COMFORT_MOUSE_4500 0x076c

#define USB_VENDOR_ID_MOJO 0x8282
#define USB_DEVICE_ID_RETRO_ADAPTER 0x3201
Expand Down
26 changes: 21 additions & 5 deletions trunk/drivers/hid/hid-microsoft.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@

#include "hid-ids.h"

#define MS_HIDINPUT 0x01
#define MS_ERGONOMY 0x02
#define MS_PRESENTER 0x04
#define MS_RDESC 0x08
#define MS_NOGET 0x10
#define MS_HIDINPUT 0x01
#define MS_ERGONOMY 0x02
#define MS_PRESENTER 0x04
#define MS_RDESC 0x08
#define MS_NOGET 0x10
#define MS_DUPLICATE_USAGES 0x20

/*
* Microsoft Wireless Desktop Receiver (Model 1028) has
Expand Down Expand Up @@ -109,6 +110,18 @@ static int ms_input_mapping(struct hid_device *hdev, struct hid_input *hi,
return 0;
}

static int ms_input_mapped(struct hid_device *hdev, struct hid_input *hi,
struct hid_field *field, struct hid_usage *usage,
unsigned long **bit, int *max)
{
unsigned long quirks = (unsigned long)hid_get_drvdata(hdev);

if (quirks & MS_DUPLICATE_USAGES)
clear_bit(usage->code, *bit);

return 0;
}

static int ms_event(struct hid_device *hdev, struct hid_field *field,
struct hid_usage *usage, __s32 value)
{
Expand Down Expand Up @@ -183,6 +196,8 @@ static const struct hid_device_id ms_devices[] = {
.driver_data = MS_ERGONOMY },
{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_WIRELESS_OPTICAL_DESKTOP_3_0),
.driver_data = MS_NOGET },
{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_COMFORT_MOUSE_4500),
.driver_data = MS_DUPLICATE_USAGES },

{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_PRESENTER_8K_BT),
.driver_data = MS_PRESENTER },
Expand All @@ -195,6 +210,7 @@ static struct hid_driver ms_driver = {
.id_table = ms_devices,
.report_fixup = ms_report_fixup,
.input_mapping = ms_input_mapping,
.input_mapped = ms_input_mapped,
.event = ms_event,
.probe = ms_probe,
};
Expand Down

0 comments on commit a75dbad

Please sign in to comment.