30 #include <linux/device.h>
32 #include <linux/hid.h>
33 #include <linux/module.h>
56 static inline void samsung_irda_dev_trace(
struct hid_device *hdev,
59 hid_info(hdev,
"fixing up Samsung IrDA %d byte report descriptor\n",
66 if (*rsize == 184 && rdesc[175] == 0x25 && rdesc[176] == 0x40 &&
67 rdesc[177] == 0x75 && rdesc[178] == 0x30 &&
68 rdesc[179] == 0x95 && rdesc[180] == 0x01 &&
70 samsung_irda_dev_trace(hdev, 184);
76 if (*rsize == 203 && rdesc[192] == 0x15 && rdesc[193] == 0x0 &&
77 rdesc[194] == 0x25 && rdesc[195] == 0x12) {
78 samsung_irda_dev_trace(hdev, 203);
82 if (*rsize == 135 && rdesc[124] == 0x15 && rdesc[125] == 0x0 &&
83 rdesc[126] == 0x25 && rdesc[127] == 0x11) {
84 samsung_irda_dev_trace(hdev, 135);
88 if (*rsize == 171 && rdesc[160] == 0x15 && rdesc[161] == 0x0 &&
89 rdesc[162] == 0x25 && rdesc[163] == 0x01) {
90 samsung_irda_dev_trace(hdev, 171);
97 #define samsung_kbd_mouse_map_key_clear(c) \
98 hid_map_usage_clear(hi, usage, bit, max, EV_KEY, (c))
100 static int samsung_kbd_mouse_input_mapping(
struct hid_device *hdev,
102 unsigned long **
bit,
int *
max)
105 unsigned short ifnum = intf->cur_altsetting->desc.bInterfaceNumber;
110 dbg_hid(
"samsung wireless keyboard/mouse input mapping event [0x%x]\n",
137 rdesc = samsung_irda_report_fixup(hdev, rdesc, rsize);
143 unsigned long **
bit,
int *
max)
148 ret = samsung_kbd_mouse_input_mapping(hdev,
149 hi, field, usage, bit, max);
154 static int samsung_probe(
struct hid_device *hdev,
160 ret = hid_parse(hdev);
162 hid_err(hdev,
"parse failed\n");
167 if (hdev->
rsize == 184) {
174 ret = hid_hw_start(hdev, cmask);
176 hid_err(hdev,
"hw start failed\n");
194 .id_table = samsung_devices,
195 .report_fixup = samsung_report_fixup,
196 .input_mapping = samsung_input_mapping,
197 .probe = samsung_probe,
200 static int __init samsung_init(
void)
205 static void __exit samsung_exit(
void)