Lines Matching +full:0 +full:- +full:1023

1 // SPDX-License-Identifier: GPL-2.0-or-later
6 * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz>
7 * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc
8 * Copyright (c) 2006-2007 Jiri Kosina
25 #include "hid-ids.h"
26 #include "hid-lg.h"
27 #include "hid-lg4ff.h"
29 #define LG_RDESC 0x001
30 #define LG_BAD_RELATIVE_KEYS 0x002
31 #define LG_DUPLICATE_USAGES 0x004
32 #define LG_EXPANDED_KEYMAP 0x010
33 #define LG_IGNORE_DOUBLED_WHEEL 0x020
34 #define LG_WIRELESS 0x040
35 #define LG_INVERT_HWHEEL 0x080
36 #define LG_NOGET 0x100
37 #define LG_FF 0x200
38 #define LG_FF2 0x400
39 #define LG_RDESC_REL_ABS 0x800
40 #define LG_FF3 0x1000
41 #define LG_FF4 0x2000
62 0x05, 0x01, /* Usage Page (Desktop), */
63 0x09, 0x04, /* Usage (Joystick), */
64 0xA1, 0x01, /* Collection (Application), */
65 0xA1, 0x02, /* Collection (Logical), */
66 0x95, 0x01, /* Report Count (1), */
67 0x75, 0x0A, /* Report Size (10), */
68 0x14, /* Logical Minimum (0), */
69 0x26, 0xFF, 0x03, /* Logical Maximum (1023), */
70 0x34, /* Physical Minimum (0), */
71 0x46, 0xFF, 0x03, /* Physical Maximum (1023), */
72 0x09, 0x30, /* Usage (X), */
73 0x81, 0x02, /* Input (Variable), */
74 0x95, 0x0C, /* Report Count (12), */
75 0x75, 0x01, /* Report Size (1), */
76 0x25, 0x01, /* Logical Maximum (1), */
77 0x45, 0x01, /* Physical Maximum (1), */
78 0x05, 0x09, /* Usage (Buttons), */
79 0x19, 0x01, /* Usage Minimum (1), */
80 0x29, 0x0c, /* Usage Maximum (12), */
81 0x81, 0x02, /* Input (Variable), */
82 0x95, 0x02, /* Report Count (2), */
83 0x06, 0x00, 0xFF, /* Usage Page (Vendor: 65280), */
84 0x09, 0x01, /* Usage (?: 1), */
85 0x81, 0x02, /* Input (Variable), */
86 0x05, 0x01, /* Usage Page (Desktop), */
87 0x26, 0xFF, 0x00, /* Logical Maximum (255), */
88 0x46, 0xFF, 0x00, /* Physical Maximum (255), */
89 0x95, 0x01, /* Report Count (1), */
90 0x75, 0x08, /* Report Size (8), */
91 0x81, 0x02, /* Input (Variable), */
92 0x25, 0x07, /* Logical Maximum (7), */
93 0x46, 0x3B, 0x01, /* Physical Maximum (315), */
94 0x75, 0x04, /* Report Size (4), */
95 0x65, 0x14, /* Unit (Degrees), */
96 0x09, 0x39, /* Usage (Hat Switch), */
97 0x81, 0x42, /* Input (Variable, Null State), */
98 0x75, 0x01, /* Report Size (1), */
99 0x95, 0x04, /* Report Count (4), */
100 0x65, 0x00, /* Unit (none), */
101 0x06, 0x00, 0xFF, /* Usage Page (Vendor: 65280), */
102 0x09, 0x01, /* Usage (?: 1), */
103 0x25, 0x01, /* Logical Maximum (1), */
104 0x45, 0x01, /* Physical Maximum (1), */
105 0x81, 0x02, /* Input (Variable), */
106 0x05, 0x01, /* Usage Page (Desktop), */
107 0x95, 0x01, /* Report Count (1), */
108 0x75, 0x08, /* Report Size (8), */
109 0x26, 0xFF, 0x00, /* Logical Maximum (255), */
110 0x46, 0xFF, 0x00, /* Physical Maximum (255), */
111 0x09, 0x31, /* Usage (Y), */
112 0x81, 0x02, /* Input (Variable), */
113 0x09, 0x35, /* Usage (Rz), */
114 0x81, 0x02, /* Input (Variable), */
115 0xC0, /* End Collection, */
116 0xA1, 0x02, /* Collection (Logical), */
117 0x26, 0xFF, 0x00, /* Logical Maximum (255), */
118 0x46, 0xFF, 0x00, /* Physical Maximum (255), */
119 0x95, 0x07, /* Report Count (7), */
120 0x75, 0x08, /* Report Size (8), */
121 0x09, 0x03, /* Usage (?: 3), */
122 0x91, 0x02, /* Output (Variable), */
123 0xC0, /* End Collection, */
124 0xC0 /* End Collection */
128 0x05, 0x01, /* Usage Page (Desktop), */
129 0x09, 0x04, /* Usage (Joystick), */
130 0xA1, 0x01, /* Collection (Application), */
131 0xA1, 0x02, /* Collection (Logical), */
132 0x95, 0x01, /* Report Count (1), */
133 0x75, 0x0E, /* Report Size (14), */
134 0x14, /* Logical Minimum (0), */
135 0x26, 0xFF, 0x3F, /* Logical Maximum (16383), */
136 0x34, /* Physical Minimum (0), */
137 0x46, 0xFF, 0x3F, /* Physical Maximum (16383), */
138 0x09, 0x30, /* Usage (X), */
139 0x81, 0x02, /* Input (Variable), */
140 0x95, 0x0E, /* Report Count (14), */
141 0x75, 0x01, /* Report Size (1), */
142 0x25, 0x01, /* Logical Maximum (1), */
143 0x45, 0x01, /* Physical Maximum (1), */
144 0x05, 0x09, /* Usage Page (Button), */
145 0x19, 0x01, /* Usage Minimum (01h), */
146 0x29, 0x0E, /* Usage Maximum (0Eh), */
147 0x81, 0x02, /* Input (Variable), */
148 0x05, 0x01, /* Usage Page (Desktop), */
149 0x95, 0x01, /* Report Count (1), */
150 0x75, 0x04, /* Report Size (4), */
151 0x25, 0x07, /* Logical Maximum (7), */
152 0x46, 0x3B, 0x01, /* Physical Maximum (315), */
153 0x65, 0x14, /* Unit (Degrees), */
154 0x09, 0x39, /* Usage (Hat Switch), */
155 0x81, 0x42, /* Input (Variable, Nullstate), */
156 0x65, 0x00, /* Unit, */
157 0x26, 0xFF, 0x00, /* Logical Maximum (255), */
158 0x46, 0xFF, 0x00, /* Physical Maximum (255), */
159 0x75, 0x08, /* Report Size (8), */
160 0x81, 0x01, /* Input (Constant), */
161 0x09, 0x31, /* Usage (Y), */
162 0x81, 0x02, /* Input (Variable), */
163 0x09, 0x35, /* Usage (Rz), */
164 0x81, 0x02, /* Input (Variable), */
165 0x81, 0x01, /* Input (Constant), */
166 0xC0, /* End Collection, */
167 0xA1, 0x02, /* Collection (Logical), */
168 0x09, 0x02, /* Usage (02h), */
169 0x95, 0x07, /* Report Count (7), */
170 0x91, 0x02, /* Output (Variable), */
171 0xC0, /* End Collection, */
172 0xC0 /* End Collection */
176 0x05, 0x01, /* Usage Page (Desktop), */
177 0x09, 0x04, /* Usage (Joystick), */
178 0xA1, 0x01, /* Collection (Application), */
179 0xA1, 0x02, /* Collection (Logical), */
180 0x95, 0x01, /* Report Count (1), */
181 0x75, 0x0A, /* Report Size (10), */
182 0x15, 0x00, /* Logical Minimum (0), */
183 0x26, 0xFF, 0x03, /* Logical Maximum (1023), */
184 0x35, 0x00, /* Physical Minimum (0), */
185 0x46, 0xFF, 0x03, /* Physical Maximum (1023), */
186 0x09, 0x30, /* Usage (X), */
187 0x81, 0x02, /* Input (Variable), */
188 0x95, 0x0C, /* Report Count (12), */
189 0x75, 0x01, /* Report Size (1), */
190 0x25, 0x01, /* Logical Maximum (1), */
191 0x45, 0x01, /* Physical Maximum (1), */
192 0x05, 0x09, /* Usage Page (Button), */
193 0x19, 0x01, /* Usage Minimum (01h), */
194 0x29, 0x0C, /* Usage Maximum (0Ch), */
195 0x81, 0x02, /* Input (Variable), */
196 0x95, 0x02, /* Report Count (2), */
197 0x06, 0x00, 0xFF, /* Usage Page (FF00h), */
198 0x09, 0x01, /* Usage (01h), */
199 0x81, 0x02, /* Input (Variable), */
200 0x09, 0x02, /* Usage (02h), */
201 0x26, 0xFF, 0x00, /* Logical Maximum (255), */
202 0x46, 0xFF, 0x00, /* Physical Maximum (255), */
203 0x95, 0x01, /* Report Count (1), */
204 0x75, 0x08, /* Report Size (8), */
205 0x81, 0x02, /* Input (Variable), */
206 0x05, 0x01, /* Usage Page (Desktop), */
207 0x25, 0x07, /* Logical Maximum (7), */
208 0x46, 0x3B, 0x01, /* Physical Maximum (315), */
209 0x75, 0x04, /* Report Size (4), */
210 0x65, 0x14, /* Unit (Degrees), */
211 0x09, 0x39, /* Usage (Hat Switch), */
212 0x81, 0x42, /* Input (Variable, Null State), */
213 0x75, 0x01, /* Report Size (1), */
214 0x95, 0x04, /* Report Count (4), */
215 0x65, 0x00, /* Unit, */
216 0x06, 0x00, 0xFF, /* Usage Page (FF00h), */
217 0x09, 0x01, /* Usage (01h), */
218 0x25, 0x01, /* Logical Maximum (1), */
219 0x45, 0x01, /* Physical Maximum (1), */
220 0x81, 0x02, /* Input (Variable), */
221 0x05, 0x01, /* Usage Page (Desktop), */
222 0x95, 0x01, /* Report Count (1), */
223 0x75, 0x08, /* Report Size (8), */
224 0x26, 0xFF, 0x00, /* Logical Maximum (255), */
225 0x46, 0xFF, 0x00, /* Physical Maximum (255), */
226 0x09, 0x31, /* Usage (Y), */
227 0x81, 0x02, /* Input (Variable), */
228 0x09, 0x32, /* Usage (Z), */
229 0x81, 0x02, /* Input (Variable), */
230 0xC0, /* End Collection, */
231 0xA1, 0x02, /* Collection (Logical), */
232 0x26, 0xFF, 0x00, /* Logical Maximum (255), */
233 0x46, 0xFF, 0x00, /* Physical Maximum (255), */
234 0x95, 0x07, /* Report Count (7), */
235 0x75, 0x08, /* Report Size (8), */
236 0x09, 0x03, /* Usage (03h), */
237 0x91, 0x02, /* Output (Variable), */
238 0xC0, /* End Collection, */
239 0xC0 /* End Collection */
243 0x05, 0x01, /* Usage Page (Desktop), */
244 0x09, 0x04, /* Usage (Joystick), */
245 0xA1, 0x01, /* Collection (Application), */
246 0xA1, 0x02, /* Collection (Logical), */
247 0x95, 0x01, /* Report Count (1), */
248 0x75, 0x0A, /* Report Size (10), */
249 0x15, 0x00, /* Logical Minimum (0), */
250 0x26, 0xFF, 0x03, /* Logical Maximum (1023), */
251 0x35, 0x00, /* Physical Minimum (0), */
252 0x46, 0xFF, 0x03, /* Physical Maximum (1023), */
253 0x09, 0x30, /* Usage (X), */
254 0x81, 0x02, /* Input (Variable), */
255 0x95, 0x08, /* Report Count (8), */
256 0x75, 0x01, /* Report Size (1), */
257 0x25, 0x01, /* Logical Maximum (1), */
258 0x45, 0x01, /* Physical Maximum (1), */
259 0x05, 0x09, /* Usage Page (Button), */
260 0x19, 0x01, /* Usage Minimum (01h), */
261 0x29, 0x08, /* Usage Maximum (08h), */
262 0x81, 0x02, /* Input (Variable), */
263 0x06, 0x00, 0xFF, /* Usage Page (FF00h), */
264 0x75, 0x0E, /* Report Size (14), */
265 0x95, 0x01, /* Report Count (1), */
266 0x26, 0xFF, 0x00, /* Logical Maximum (255), */
267 0x46, 0xFF, 0x00, /* Physical Maximum (255), */
268 0x09, 0x00, /* Usage (00h), */
269 0x81, 0x02, /* Input (Variable), */
270 0x05, 0x01, /* Usage Page (Desktop), */
271 0x75, 0x08, /* Report Size (8), */
272 0x09, 0x31, /* Usage (Y), */
273 0x81, 0x02, /* Input (Variable), */
274 0x09, 0x32, /* Usage (Z), */
275 0x81, 0x02, /* Input (Variable), */
276 0x06, 0x00, 0xFF, /* Usage Page (FF00h), */
277 0x09, 0x01, /* Usage (01h), */
278 0x81, 0x02, /* Input (Variable), */
279 0xC0, /* End Collection, */
280 0xA1, 0x02, /* Collection (Logical), */
281 0x09, 0x02, /* Usage (02h), */
282 0x95, 0x07, /* Report Count (7), */
283 0x91, 0x02, /* Output (Variable), */
284 0xC0, /* End Collection, */
285 0xC0 /* End Collection */
289 0x05, 0x01, /* Usage Page (Desktop), */
290 0x09, 0x04, /* Usage (Joystick), */
291 0xA1, 0x01, /* Collection (Application), */
292 0xA1, 0x02, /* Collection (Logical), */
293 0x95, 0x01, /* Report Count (1), */
294 0x75, 0x0A, /* Report Size (10), */
295 0x15, 0x00, /* Logical Minimum (0), */
296 0x26, 0xFF, 0x03, /* Logical Maximum (1023), */
297 0x35, 0x00, /* Physical Minimum (0), */
298 0x46, 0xFF, 0x03, /* Physical Maximum (1023), */
299 0x09, 0x30, /* Usage (X), */
300 0x81, 0x02, /* Input (Variable), */
301 0x95, 0x0A, /* Report Count (10), */
302 0x75, 0x01, /* Report Size (1), */
303 0x25, 0x01, /* Logical Maximum (1), */
304 0x45, 0x01, /* Physical Maximum (1), */
305 0x05, 0x09, /* Usage Page (Button), */
306 0x19, 0x01, /* Usage Minimum (01h), */
307 0x29, 0x0A, /* Usage Maximum (0Ah), */
308 0x81, 0x02, /* Input (Variable), */
309 0x06, 0x00, 0xFF, /* Usage Page (FF00h), */
310 0x09, 0x00, /* Usage (00h), */
311 0x95, 0x04, /* Report Count (4), */
312 0x81, 0x02, /* Input (Variable), */
313 0x95, 0x01, /* Report Count (1), */
314 0x75, 0x08, /* Report Size (8), */
315 0x26, 0xFF, 0x00, /* Logical Maximum (255), */
316 0x46, 0xFF, 0x00, /* Physical Maximum (255), */
317 0x09, 0x01, /* Usage (01h), */
318 0x81, 0x02, /* Input (Variable), */
319 0x05, 0x01, /* Usage Page (Desktop), */
320 0x09, 0x31, /* Usage (Y), */
321 0x81, 0x02, /* Input (Variable), */
322 0x09, 0x32, /* Usage (Z), */
323 0x81, 0x02, /* Input (Variable), */
324 0x06, 0x00, 0xFF, /* Usage Page (FF00h), */
325 0x09, 0x00, /* Usage (00h), */
326 0x81, 0x02, /* Input (Variable), */
327 0xC0, /* End Collection, */
328 0xA1, 0x02, /* Collection (Logical), */
329 0x09, 0x02, /* Usage (02h), */
330 0x95, 0x07, /* Report Count (7), */
331 0x91, 0x02, /* Output (Variable), */
332 0xC0, /* End Collection, */
333 0xC0 /* End Collection */
337 0x05, 0x01, /* Usage Page (Desktop), */
338 0x09, 0x04, /* Usage (Joystik), */
339 0xA1, 0x01, /* Collection (Application), */
340 0xA1, 0x02, /* Collection (Logical), */
341 0x95, 0x01, /* Report Count (1), */
342 0x75, 0x0A, /* Report Size (10), */
343 0x15, 0x00, /* Logical Minimum (0), */
344 0x26, 0xFF, 0x03, /* Logical Maximum (1023), */
345 0x35, 0x00, /* Physical Minimum (0), */
346 0x46, 0xFF, 0x03, /* Physical Maximum (1023), */
347 0x09, 0x30, /* Usage (X), */
348 0x81, 0x02, /* Input (Variable), */
349 0x95, 0x06, /* Report Count (6), */
350 0x75, 0x01, /* Report Size (1), */
351 0x25, 0x01, /* Logical Maximum (1), */
352 0x45, 0x01, /* Physical Maximum (1), */
353 0x05, 0x09, /* Usage Page (Button), */
354 0x19, 0x01, /* Usage Minimum (01h), */
355 0x29, 0x06, /* Usage Maximum (06h), */
356 0x81, 0x02, /* Input (Variable), */
357 0x95, 0x01, /* Report Count (1), */
358 0x75, 0x08, /* Report Size (8), */
359 0x26, 0xFF, 0x00, /* Logical Maximum (255), */
360 0x46, 0xFF, 0x00, /* Physical Maximum (255), */
361 0x06, 0x00, 0xFF, /* Usage Page (FF00h), */
362 0x09, 0x01, /* Usage (01h), */
363 0x81, 0x02, /* Input (Variable), */
364 0x05, 0x01, /* Usage Page (Desktop), */
365 0x81, 0x01, /* Input (Constant), */
366 0x09, 0x31, /* Usage (Y), */
367 0x81, 0x02, /* Input (Variable), */
368 0x09, 0x32, /* Usage (Z), */
369 0x81, 0x02, /* Input (Variable), */
370 0x06, 0x00, 0xFF, /* Usage Page (FF00h), */
371 0x09, 0x01, /* Usage (01h), */
372 0x81, 0x02, /* Input (Variable), */
373 0xC0, /* End Collection, */
374 0xA1, 0x02, /* Collection (Logical), */
375 0x09, 0x02, /* Usage (02h), */
376 0x95, 0x07, /* Report Count (7), */
377 0x91, 0x02, /* Output (Variable), */
378 0xC0, /* End Collection, */
379 0xC0 /* End Collection */
383 0x05, 0x01, /* Usage Page (Desktop), */
384 0x09, 0x04, /* Usage (Joystik), */
385 0xA1, 0x01, /* Collection (Application), */
386 0xA1, 0x02, /* Collection (Logical), */
387 0x15, 0x00, /* Logical Minimum (0), */
388 0x26, 0xFF, 0x00, /* Logical Maximum (255), */
389 0x35, 0x00, /* Physical Minimum (0), */
390 0x46, 0xFF, 0x00, /* Physical Maximum (255), */
391 0x75, 0x08, /* Report Size (8), */
392 0x95, 0x01, /* Report Count (1), */
393 0x09, 0x30, /* Usage (X), */
394 0x81, 0x02, /* Input (Variable), */
395 0xA4, /* Push, */
396 0x25, 0x01, /* Logical Maximum (1), */
397 0x45, 0x01, /* Physical Maximum (1), */
398 0x75, 0x01, /* Report Size (1), */
399 0x95, 0x02, /* Report Count (2), */
400 0x81, 0x01, /* Input (Constant), */
401 0x95, 0x06, /* Report Count (6), */
402 0x05, 0x09, /* Usage Page (Button), */
403 0x19, 0x01, /* Usage Minimum (01h), */
404 0x29, 0x06, /* Usage Maximum (06h), */
405 0x81, 0x02, /* Input (Variable), */
406 0x05, 0x01, /* Usage Page (Desktop), */
407 0xB4, /* Pop, */
408 0x81, 0x02, /* Input (Constant), */
409 0x09, 0x31, /* Usage (Y), */
410 0x81, 0x02, /* Input (Variable), */
411 0x09, 0x32, /* Usage (Z), */
412 0x81, 0x02, /* Input (Variable), */
413 0xC0, /* End Collection, */
414 0xA1, 0x02, /* Collection (Logical), */
415 0x26, 0xFF, 0x00, /* Logical Maximum (255), */
416 0x46, 0xFF, 0x00, /* Physical Maximum (255), */
417 0x75, 0x08, /* Report Size (8), */
418 0x95, 0x04, /* Report Count (4), */
419 0x09, 0x02, /* Usage (02h), */
420 0xB1, 0x02, /* Feature (Variable), */
421 0xC0, /* End Collection, */
422 0xC0 /* End Collection, */
428 * the original value of 0x28c of logical maximum to 0x104d
435 if ((drv_data->quirks & LG_RDESC) && *rsize >= 91 && rdesc[83] == 0x26 && in lg_report_fixup()
436 rdesc[84] == 0x8c && rdesc[85] == 0x02) { in lg_report_fixup()
439 rdesc[84] = rdesc[89] = 0x4d; in lg_report_fixup()
440 rdesc[85] = rdesc[90] = 0x10; in lg_report_fixup()
442 if ((drv_data->quirks & LG_RDESC_REL_ABS) && *rsize >= 51 && in lg_report_fixup()
443 rdesc[32] == 0x81 && rdesc[33] == 0x06 && in lg_report_fixup()
444 rdesc[49] == 0x81 && rdesc[50] == 0x06) { in lg_report_fixup()
447 rdesc[33] = rdesc[50] = 0x02; in lg_report_fixup()
450 switch (hdev->product) { in lg_report_fixup()
521 if (*rsize >= 101 && rdesc[41] == 0x95 && rdesc[42] == 0x0B && in lg_report_fixup()
522 rdesc[47] == 0x05 && rdesc[48] == 0x09) { in lg_report_fixup()
524 rdesc[41] = 0x05; in lg_report_fixup()
525 rdesc[42] = 0x09; in lg_report_fixup()
526 rdesc[47] = 0x95; in lg_report_fixup()
527 rdesc[48] = 0x0B; in lg_report_fixup()
541 if ((usage->hid & HID_USAGE_PAGE) != HID_UP_LOGIVENDOR) in lg_ultrax_remote_mapping()
542 return 0; in lg_ultrax_remote_mapping()
544 set_bit(EV_REP, hi->input->evbit); in lg_ultrax_remote_mapping()
545 switch (usage->hid & HID_USAGE) { in lg_ultrax_remote_mapping()
547 case 0x004: lg_map_key_clear(KEY_AGAIN); break; in lg_ultrax_remote_mapping()
548 case 0x00d: lg_map_key_clear(KEY_HOME); break; in lg_ultrax_remote_mapping()
549 case 0x024: lg_map_key_clear(KEY_SHUFFLE); break; in lg_ultrax_remote_mapping()
550 case 0x025: lg_map_key_clear(KEY_TV); break; in lg_ultrax_remote_mapping()
551 case 0x026: lg_map_key_clear(KEY_MENU); break; in lg_ultrax_remote_mapping()
552 case 0x031: lg_map_key_clear(KEY_AUDIO); break; in lg_ultrax_remote_mapping()
553 case 0x032: lg_map_key_clear(KEY_TEXT); break; in lg_ultrax_remote_mapping()
554 case 0x033: lg_map_key_clear(KEY_LAST); break; in lg_ultrax_remote_mapping()
555 case 0x047: lg_map_key_clear(KEY_MP3); break; in lg_ultrax_remote_mapping()
556 case 0x048: lg_map_key_clear(KEY_DVD); break; in lg_ultrax_remote_mapping()
557 case 0x049: lg_map_key_clear(KEY_MEDIA); break; in lg_ultrax_remote_mapping()
558 case 0x04a: lg_map_key_clear(KEY_VIDEO); break; in lg_ultrax_remote_mapping()
559 case 0x04b: lg_map_key_clear(KEY_ANGLE); break; in lg_ultrax_remote_mapping()
560 case 0x04c: lg_map_key_clear(KEY_LANGUAGE); break; in lg_ultrax_remote_mapping()
561 case 0x04d: lg_map_key_clear(KEY_SUBTITLE); break; in lg_ultrax_remote_mapping()
562 case 0x051: lg_map_key_clear(KEY_RED); break; in lg_ultrax_remote_mapping()
563 case 0x052: lg_map_key_clear(KEY_CLOSE); break; in lg_ultrax_remote_mapping()
566 return 0; in lg_ultrax_remote_mapping()
574 if ((usage->hid & HID_USAGE_PAGE) != HID_UP_LOGIVENDOR) in lg_dinovo_mapping()
575 return 0; in lg_dinovo_mapping()
577 switch (usage->hid & HID_USAGE) { in lg_dinovo_mapping()
579 case 0x00d: lg_map_key_clear(KEY_MEDIA); break; in lg_dinovo_mapping()
581 return 0; in lg_dinovo_mapping()
590 if ((usage->hid & HID_USAGE_PAGE) != HID_UP_CONSUMER) in lg_wireless_mapping()
591 return 0; in lg_wireless_mapping()
593 switch (usage->hid & HID_USAGE) { in lg_wireless_mapping()
594 case 0x1001: lg_map_key_clear(KEY_MESSENGER); break; in lg_wireless_mapping()
595 case 0x1003: lg_map_key_clear(KEY_SOUND); break; in lg_wireless_mapping()
596 case 0x1004: lg_map_key_clear(KEY_VIDEO); break; in lg_wireless_mapping()
597 case 0x1005: lg_map_key_clear(KEY_AUDIO); break; in lg_wireless_mapping()
598 case 0x100a: lg_map_key_clear(KEY_DOCUMENTS); break; in lg_wireless_mapping()
600 case 0x100f: lg_map_key_clear(KEY_FN_1); break; in lg_wireless_mapping()
601 case 0x1010: lg_map_key_clear(KEY_FN_2); break; in lg_wireless_mapping()
602 case 0x1011: lg_map_key_clear(KEY_PREVIOUSSONG); break; in lg_wireless_mapping()
603 case 0x1012: lg_map_key_clear(KEY_NEXTSONG); break; in lg_wireless_mapping()
604 case 0x1013: lg_map_key_clear(KEY_CAMERA); break; in lg_wireless_mapping()
605 case 0x1014: lg_map_key_clear(KEY_MESSENGER); break; in lg_wireless_mapping()
606 case 0x1015: lg_map_key_clear(KEY_RECORD); break; in lg_wireless_mapping()
607 case 0x1016: lg_map_key_clear(KEY_PLAYER); break; in lg_wireless_mapping()
608 case 0x1017: lg_map_key_clear(KEY_EJECTCD); break; in lg_wireless_mapping()
609 case 0x1018: lg_map_key_clear(KEY_MEDIA); break; in lg_wireless_mapping()
610 case 0x1019: lg_map_key_clear(KEY_PROG1); break; in lg_wireless_mapping()
611 case 0x101a: lg_map_key_clear(KEY_PROG2); break; in lg_wireless_mapping()
612 case 0x101b: lg_map_key_clear(KEY_PROG3); break; in lg_wireless_mapping()
613 case 0x101c: lg_map_key_clear(KEY_CYCLEWINDOWS); break; in lg_wireless_mapping()
614 case 0x101f: lg_map_key_clear(KEY_ZOOMIN); break; in lg_wireless_mapping()
615 case 0x1020: lg_map_key_clear(KEY_ZOOMOUT); break; in lg_wireless_mapping()
616 case 0x1021: lg_map_key_clear(KEY_ZOOMRESET); break; in lg_wireless_mapping()
617 case 0x1023: lg_map_key_clear(KEY_CLOSE); break; in lg_wireless_mapping()
618 case 0x1027: lg_map_key_clear(KEY_MENU); break; in lg_wireless_mapping()
620 case 0x1028: lg_map_key_clear(KEY_ANGLE); break; in lg_wireless_mapping()
621 case 0x1029: lg_map_key_clear(KEY_SHUFFLE); break; in lg_wireless_mapping()
622 case 0x102a: lg_map_key_clear(KEY_BACK); break; in lg_wireless_mapping()
623 case 0x102b: lg_map_key_clear(KEY_CYCLEWINDOWS); break; in lg_wireless_mapping()
624 case 0x102d: lg_map_key_clear(KEY_WWW); break; in lg_wireless_mapping()
627 case 0x1031: lg_map_key_clear(KEY_OK); break; in lg_wireless_mapping()
628 case 0x1032: lg_map_key_clear(KEY_CANCEL); break; in lg_wireless_mapping()
629 case 0x1041: lg_map_key_clear(KEY_BATTERY); break; in lg_wireless_mapping()
630 case 0x1042: lg_map_key_clear(KEY_WORDPROCESSOR); break; in lg_wireless_mapping()
631 case 0x1043: lg_map_key_clear(KEY_SPREADSHEET); break; in lg_wireless_mapping()
632 case 0x1044: lg_map_key_clear(KEY_PRESENTATION); break; in lg_wireless_mapping()
633 case 0x1045: lg_map_key_clear(KEY_UNDO); break; in lg_wireless_mapping()
634 case 0x1046: lg_map_key_clear(KEY_REDO); break; in lg_wireless_mapping()
635 case 0x1047: lg_map_key_clear(KEY_PRINT); break; in lg_wireless_mapping()
636 case 0x1048: lg_map_key_clear(KEY_SAVE); break; in lg_wireless_mapping()
637 case 0x1049: lg_map_key_clear(KEY_PROG1); break; in lg_wireless_mapping()
638 case 0x104a: lg_map_key_clear(KEY_PROG2); break; in lg_wireless_mapping()
639 case 0x104b: lg_map_key_clear(KEY_PROG3); break; in lg_wireless_mapping()
640 case 0x104c: lg_map_key_clear(KEY_PROG4); break; in lg_wireless_mapping()
643 return 0; in lg_wireless_mapping()
655 0,216, 0,213,175,156, 0, 0, 0, 0, in lg_input_mapping()
656 144, 0, 0, 0, 0, 0, 0, 0, 0,212, in lg_input_mapping()
657 174,167,152,161,112, 0, 0, 0,154, 0, in lg_input_mapping()
658 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, in lg_input_mapping()
659 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, in lg_input_mapping()
660 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, in lg_input_mapping()
661 0, 0, 0, 0, 0,183,184,185,186,187, in lg_input_mapping()
662 188,189,190,191,192,193,194, 0, 0, 0 in lg_input_mapping()
665 unsigned int hid = usage->hid; in lg_input_mapping()
667 if (hdev->product == USB_DEVICE_ID_LOGITECH_RECEIVER && in lg_input_mapping()
671 if (hdev->product == USB_DEVICE_ID_DINOVO_MINI && in lg_input_mapping()
675 if ((drv_data->quirks & LG_WIRELESS) && lg_wireless_mapping(hi, usage, bit, max)) in lg_input_mapping()
679 return 0; in lg_input_mapping()
684 if (field->application == HID_GD_MOUSE) { in lg_input_mapping()
685 if ((drv_data->quirks & LG_IGNORE_DOUBLED_WHEEL) && in lg_input_mapping()
687 return -1; in lg_input_mapping()
689 if ((drv_data->quirks & LG_EXPANDED_KEYMAP) && in lg_input_mapping()
691 e_keymap[hid] != 0) { in lg_input_mapping()
698 return 0; in lg_input_mapping()
707 if ((drv_data->quirks & LG_BAD_RELATIVE_KEYS) && usage->type == EV_KEY && in lg_input_mapped()
708 (field->flags & HID_MAIN_ITEM_RELATIVE)) in lg_input_mapped()
709 field->flags &= ~HID_MAIN_ITEM_RELATIVE; in lg_input_mapped()
711 if ((drv_data->quirks & LG_DUPLICATE_USAGES) && (usage->type == EV_KEY || in lg_input_mapped()
712 usage->type == EV_REL || usage->type == EV_ABS)) in lg_input_mapped()
713 clear_bit(usage->code, *bit); in lg_input_mapped()
716 if (usage->type == EV_ABS && (usage->code == ABS_X || in lg_input_mapped()
717 usage->code == ABS_Y || usage->code == ABS_Z || in lg_input_mapped()
718 usage->code == ABS_RZ)) { in lg_input_mapped()
719 switch (hdev->product) { in lg_input_mapped()
732 field->application = HID_GD_MULTIAXIS; in lg_input_mapped()
739 return 0; in lg_input_mapped()
747 if ((drv_data->quirks & LG_INVERT_HWHEEL) && usage->code == REL_HWHEEL) { in lg_event()
748 input_event(field->hidinput->input, usage->type, usage->code, in lg_event()
749 -value); in lg_event()
752 if (drv_data->quirks & LG_FF4) { in lg_event()
756 return 0; in lg_event()
764 if (drv_data->quirks & LG_FF4) in lg_raw_event()
767 return 0; in lg_raw_event()
772 struct usb_interface *iface = to_usb_interface(hdev->dev.parent); in lg_probe()
773 __u8 iface_num = iface->cur_altsetting->desc.bInterfaceNumber; in lg_probe()
779 if ((hdev->product == USB_DEVICE_ID_LOGITECH_G29_WHEEL) && in lg_probe()
780 (iface_num != 0)) { in lg_probe()
782 return -ENODEV; in lg_probe()
788 return -ENOMEM; in lg_probe()
790 drv_data->quirks = id->driver_data; in lg_probe()
794 if (drv_data->quirks & LG_NOGET) in lg_probe()
795 hdev->quirks |= HID_QUIRK_NOGET; in lg_probe()
803 if (drv_data->quirks & (LG_FF | LG_FF2 | LG_FF3 | LG_FF4)) in lg_probe()
813 if (hdev->product == USB_DEVICE_ID_LOGITECH_WII_WHEEL) { in lg_probe()
815 0x00, 0xAF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 in lg_probe()
820 ret = -ENOMEM; in lg_probe()
824 ret = hid_hw_raw_request(hdev, buf[0], buf, sizeof(cbuf), in lg_probe()
826 if (ret >= 0) { in lg_probe()
830 wait_event_interruptible_timeout(wait, 0, in lg_probe()
834 buf[1] = 0xB2; in lg_probe()
837 ret = hid_hw_raw_request(hdev, buf[0], buf, sizeof(cbuf), in lg_probe()
843 if (drv_data->quirks & LG_FF) in lg_probe()
845 else if (drv_data->quirks & LG_FF2) in lg_probe()
847 else if (drv_data->quirks & LG_FF3) in lg_probe()
849 else if (drv_data->quirks & LG_FF4) in lg_probe()
855 return 0; in lg_probe()
867 if (drv_data->quirks & LG_FF4) in lg_remove()
958 int lg4ff_no_autoswitch = 0;