blob: b629fba5a05757c5743fc9cfa06d69280b3173ef [file] [log] [blame]
Jiri Slaby5f22a792008-05-16 11:49:19 +02001/*
2 * HID driver for some logitech "special" devices
3 *
4 * Copyright (c) 1999 Andreas Gal
5 * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz>
6 * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc
7 * Copyright (c) 2006-2007 Jiri Kosina
8 * Copyright (c) 2007 Paul Walmsley
9 * Copyright (c) 2008 Jiri Slaby
Hendrik Iben2c6118e2010-10-04 15:39:49 +020010 * Copyright (c) 2010 Hendrik Iben
Jiri Slaby5f22a792008-05-16 11:49:19 +020011 */
12
13/*
14 * This program is free software; you can redistribute it and/or modify it
15 * under the terms of the GNU General Public License as published by the Free
16 * Software Foundation; either version 2 of the License, or (at your option)
17 * any later version.
18 */
19
20#include <linux/device.h>
21#include <linux/hid.h>
22#include <linux/module.h>
Simon Wood32c88cb2010-09-22 13:19:42 +020023#include <linux/random.h>
24#include <linux/sched.h>
25#include <linux/wait.h>
Jiri Slaby5f22a792008-05-16 11:49:19 +020026
27#include "hid-ids.h"
Jiri Slaby606bd0a2008-07-04 23:06:45 +020028#include "hid-lg.h"
Jiri Slaby5f22a792008-05-16 11:49:19 +020029
30#define LG_RDESC 0x001
31#define LG_BAD_RELATIVE_KEYS 0x002
32#define LG_DUPLICATE_USAGES 0x004
Jiri Slaby5f22a792008-05-16 11:49:19 +020033#define LG_EXPANDED_KEYMAP 0x010
34#define LG_IGNORE_DOUBLED_WHEEL 0x020
35#define LG_WIRELESS 0x040
36#define LG_INVERT_HWHEEL 0x080
37#define LG_NOGET 0x100
Jiri Slaby606bd0a2008-07-04 23:06:45 +020038#define LG_FF 0x200
39#define LG_FF2 0x400
Jiri Kosina24985cf2009-11-13 10:45:53 +010040#define LG_RDESC_REL_ABS 0x800
Gary Stein74f292c2010-01-13 00:25:58 +010041#define LG_FF3 0x1000
Simon Wood32c88cb2010-09-22 13:19:42 +020042#define LG_FF4 0x2000
Jiri Slaby5f22a792008-05-16 11:49:19 +020043
44/*
45 * Certain Logitech keyboards send in report #3 keys which are far
46 * above the logical maximum described in descriptor. This extends
47 * the original value of 0x28c of logical maximum to 0x104d
48 */
Nikolai Kondrashov73e40082010-08-06 23:03:06 +040049static __u8 *lg_report_fixup(struct hid_device *hdev, __u8 *rdesc,
50 unsigned int *rsize)
Jiri Slaby5f22a792008-05-16 11:49:19 +020051{
52 unsigned long quirks = (unsigned long)hid_get_drvdata(hdev);
53
Nikolai Kondrashov73e40082010-08-06 23:03:06 +040054 if ((quirks & LG_RDESC) && *rsize >= 90 && rdesc[83] == 0x26 &&
Jiri Slaby5f22a792008-05-16 11:49:19 +020055 rdesc[84] == 0x8c && rdesc[85] == 0x02) {
56 dev_info(&hdev->dev, "fixing up Logitech keyboard report "
57 "descriptor\n");
58 rdesc[84] = rdesc[89] = 0x4d;
59 rdesc[85] = rdesc[90] = 0x10;
60 }
Nikolai Kondrashov73e40082010-08-06 23:03:06 +040061 if ((quirks & LG_RDESC_REL_ABS) && *rsize >= 50 &&
Jiri Kosina24985cf2009-11-13 10:45:53 +010062 rdesc[32] == 0x81 && rdesc[33] == 0x06 &&
63 rdesc[49] == 0x81 && rdesc[50] == 0x06) {
64 dev_info(&hdev->dev, "fixing up rel/abs in Logitech "
65 "report descriptor\n");
66 rdesc[33] = rdesc[50] = 0x02;
67 }
Jiri Kosinad8692ac2010-10-23 22:59:33 +020068 if ((quirks & LG_FF4) && *rsize >= 101 &&
Simon Wood32c88cb2010-09-22 13:19:42 +020069 rdesc[41] == 0x95 && rdesc[42] == 0x0B &&
70 rdesc[47] == 0x05 && rdesc[48] == 0x09) {
71 dev_info(&hdev->dev, "fixing up Logitech Speed Force Wireless "
72 "button descriptor\n");
73 rdesc[41] = 0x05;
74 rdesc[42] = 0x09;
75 rdesc[47] = 0x95;
76 rdesc[48] = 0x0B;
77 }
Nikolai Kondrashov73e40082010-08-06 23:03:06 +040078 return rdesc;
Jiri Slaby5f22a792008-05-16 11:49:19 +020079}
80
81#define lg_map_key_clear(c) hid_map_usage_clear(hi, usage, bit, max, \
82 EV_KEY, (c))
83
84static int lg_ultrax_remote_mapping(struct hid_input *hi,
85 struct hid_usage *usage, unsigned long **bit, int *max)
86{
87 if ((usage->hid & HID_USAGE_PAGE) != HID_UP_LOGIVENDOR)
88 return 0;
89
90 set_bit(EV_REP, hi->input->evbit);
91 switch (usage->hid & HID_USAGE) {
92 /* Reported on Logitech Ultra X Media Remote */
93 case 0x004: lg_map_key_clear(KEY_AGAIN); break;
94 case 0x00d: lg_map_key_clear(KEY_HOME); break;
95 case 0x024: lg_map_key_clear(KEY_SHUFFLE); break;
96 case 0x025: lg_map_key_clear(KEY_TV); break;
97 case 0x026: lg_map_key_clear(KEY_MENU); break;
98 case 0x031: lg_map_key_clear(KEY_AUDIO); break;
99 case 0x032: lg_map_key_clear(KEY_TEXT); break;
100 case 0x033: lg_map_key_clear(KEY_LAST); break;
101 case 0x047: lg_map_key_clear(KEY_MP3); break;
102 case 0x048: lg_map_key_clear(KEY_DVD); break;
103 case 0x049: lg_map_key_clear(KEY_MEDIA); break;
104 case 0x04a: lg_map_key_clear(KEY_VIDEO); break;
105 case 0x04b: lg_map_key_clear(KEY_ANGLE); break;
106 case 0x04c: lg_map_key_clear(KEY_LANGUAGE); break;
107 case 0x04d: lg_map_key_clear(KEY_SUBTITLE); break;
108 case 0x051: lg_map_key_clear(KEY_RED); break;
109 case 0x052: lg_map_key_clear(KEY_CLOSE); break;
110
111 default:
112 return 0;
113 }
114 return 1;
115}
116
Jiri Kosina66d61be2009-11-24 18:22:20 +0100117static int lg_dinovo_mapping(struct hid_input *hi, struct hid_usage *usage,
118 unsigned long **bit, int *max)
119{
120 if ((usage->hid & HID_USAGE_PAGE) != HID_UP_LOGIVENDOR)
121 return 0;
122
123 switch (usage->hid & HID_USAGE) {
124
125 case 0x00d: lg_map_key_clear(KEY_MEDIA); break;
126 default:
127 return 0;
128
129 }
130 return 1;
131}
132
Jiri Slaby5f22a792008-05-16 11:49:19 +0200133static int lg_wireless_mapping(struct hid_input *hi, struct hid_usage *usage,
134 unsigned long **bit, int *max)
135{
136 if ((usage->hid & HID_USAGE_PAGE) != HID_UP_CONSUMER)
137 return 0;
138
139 switch (usage->hid & HID_USAGE) {
140 case 0x1001: lg_map_key_clear(KEY_MESSENGER); break;
141 case 0x1003: lg_map_key_clear(KEY_SOUND); break;
142 case 0x1004: lg_map_key_clear(KEY_VIDEO); break;
143 case 0x1005: lg_map_key_clear(KEY_AUDIO); break;
144 case 0x100a: lg_map_key_clear(KEY_DOCUMENTS); break;
Lorenzo Castelli183922122010-04-16 19:00:31 +0200145 /* The following two entries are Playlist 1 and 2 on the MX3200 */
146 case 0x100f: lg_map_key_clear(KEY_FN_1); break;
147 case 0x1010: lg_map_key_clear(KEY_FN_2); break;
Jiri Slaby5f22a792008-05-16 11:49:19 +0200148 case 0x1011: lg_map_key_clear(KEY_PREVIOUSSONG); break;
149 case 0x1012: lg_map_key_clear(KEY_NEXTSONG); break;
150 case 0x1013: lg_map_key_clear(KEY_CAMERA); break;
151 case 0x1014: lg_map_key_clear(KEY_MESSENGER); break;
152 case 0x1015: lg_map_key_clear(KEY_RECORD); break;
153 case 0x1016: lg_map_key_clear(KEY_PLAYER); break;
154 case 0x1017: lg_map_key_clear(KEY_EJECTCD); break;
155 case 0x1018: lg_map_key_clear(KEY_MEDIA); break;
156 case 0x1019: lg_map_key_clear(KEY_PROG1); break;
157 case 0x101a: lg_map_key_clear(KEY_PROG2); break;
158 case 0x101b: lg_map_key_clear(KEY_PROG3); break;
Lorenzo Castelli183922122010-04-16 19:00:31 +0200159 case 0x101c: lg_map_key_clear(KEY_CYCLEWINDOWS); break;
Jiri Slaby5f22a792008-05-16 11:49:19 +0200160 case 0x101f: lg_map_key_clear(KEY_ZOOMIN); break;
161 case 0x1020: lg_map_key_clear(KEY_ZOOMOUT); break;
162 case 0x1021: lg_map_key_clear(KEY_ZOOMRESET); break;
163 case 0x1023: lg_map_key_clear(KEY_CLOSE); break;
164 case 0x1027: lg_map_key_clear(KEY_MENU); break;
165 /* this one is marked as 'Rotate' */
166 case 0x1028: lg_map_key_clear(KEY_ANGLE); break;
167 case 0x1029: lg_map_key_clear(KEY_SHUFFLE); break;
168 case 0x102a: lg_map_key_clear(KEY_BACK); break;
169 case 0x102b: lg_map_key_clear(KEY_CYCLEWINDOWS); break;
Lorenzo Castelli183922122010-04-16 19:00:31 +0200170 case 0x102d: lg_map_key_clear(KEY_WWW); break;
171 /* The following two are 'Start/answer call' and 'End/reject call'
172 on the MX3200 */
173 case 0x1031: lg_map_key_clear(KEY_OK); break;
174 case 0x1032: lg_map_key_clear(KEY_CANCEL); break;
Jiri Slaby5f22a792008-05-16 11:49:19 +0200175 case 0x1041: lg_map_key_clear(KEY_BATTERY); break;
176 case 0x1042: lg_map_key_clear(KEY_WORDPROCESSOR); break;
177 case 0x1043: lg_map_key_clear(KEY_SPREADSHEET); break;
178 case 0x1044: lg_map_key_clear(KEY_PRESENTATION); break;
179 case 0x1045: lg_map_key_clear(KEY_UNDO); break;
180 case 0x1046: lg_map_key_clear(KEY_REDO); break;
181 case 0x1047: lg_map_key_clear(KEY_PRINT); break;
182 case 0x1048: lg_map_key_clear(KEY_SAVE); break;
183 case 0x1049: lg_map_key_clear(KEY_PROG1); break;
184 case 0x104a: lg_map_key_clear(KEY_PROG2); break;
185 case 0x104b: lg_map_key_clear(KEY_PROG3); break;
186 case 0x104c: lg_map_key_clear(KEY_PROG4); break;
187
188 default:
189 return 0;
190 }
191 return 1;
192}
193
194static int lg_input_mapping(struct hid_device *hdev, struct hid_input *hi,
195 struct hid_field *field, struct hid_usage *usage,
196 unsigned long **bit, int *max)
197{
198 /* extended mapping for certain Logitech hardware (Logitech cordless
199 desktop LX500) */
200 static const u8 e_keymap[] = {
201 0,216, 0,213,175,156, 0, 0, 0, 0,
202 144, 0, 0, 0, 0, 0, 0, 0, 0,212,
203 174,167,152,161,112, 0, 0, 0,154, 0,
204 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
205 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
206 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
207 0, 0, 0, 0, 0,183,184,185,186,187,
208 188,189,190,191,192,193,194, 0, 0, 0
209 };
210 unsigned long quirks = (unsigned long)hid_get_drvdata(hdev);
211 unsigned int hid = usage->hid;
212
213 if (hdev->product == USB_DEVICE_ID_LOGITECH_RECEIVER &&
214 lg_ultrax_remote_mapping(hi, usage, bit, max))
215 return 1;
216
Jiri Kosina66d61be2009-11-24 18:22:20 +0100217 if (hdev->product == USB_DEVICE_ID_DINOVO_MINI &&
218 lg_dinovo_mapping(hi, usage, bit, max))
219 return 1;
220
Jiri Slaby5f22a792008-05-16 11:49:19 +0200221 if ((quirks & LG_WIRELESS) && lg_wireless_mapping(hi, usage, bit, max))
222 return 1;
223
224 if ((hid & HID_USAGE_PAGE) != HID_UP_BUTTON)
225 return 0;
226
227 hid &= HID_USAGE;
228
229 /* Special handling for Logitech Cordless Desktop */
230 if (field->application == HID_GD_MOUSE) {
231 if ((quirks & LG_IGNORE_DOUBLED_WHEEL) &&
232 (hid == 7 || hid == 8))
233 return -1;
234 } else {
235 if ((quirks & LG_EXPANDED_KEYMAP) &&
236 hid < ARRAY_SIZE(e_keymap) &&
237 e_keymap[hid] != 0) {
238 hid_map_usage(hi, usage, bit, max, EV_KEY,
239 e_keymap[hid]);
240 return 1;
241 }
242 }
243
244 return 0;
245}
246
247static int lg_input_mapped(struct hid_device *hdev, struct hid_input *hi,
248 struct hid_field *field, struct hid_usage *usage,
249 unsigned long **bit, int *max)
250{
251 unsigned long quirks = (unsigned long)hid_get_drvdata(hdev);
252
253 if ((quirks & LG_BAD_RELATIVE_KEYS) && usage->type == EV_KEY &&
254 (field->flags & HID_MAIN_ITEM_RELATIVE))
255 field->flags &= ~HID_MAIN_ITEM_RELATIVE;
256
257 if ((quirks & LG_DUPLICATE_USAGES) && (usage->type == EV_KEY ||
258 usage->type == EV_REL || usage->type == EV_ABS))
259 clear_bit(usage->code, *bit);
260
261 return 0;
262}
263
264static int lg_event(struct hid_device *hdev, struct hid_field *field,
265 struct hid_usage *usage, __s32 value)
266{
267 unsigned long quirks = (unsigned long)hid_get_drvdata(hdev);
268
269 if ((quirks & LG_INVERT_HWHEEL) && usage->code == REL_HWHEEL) {
270 input_event(field->hidinput->input, usage->type, usage->code,
271 -value);
272 return 1;
273 }
274
275 return 0;
276}
277
278static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id)
279{
280 unsigned long quirks = id->driver_data;
Jiri Slaby606bd0a2008-07-04 23:06:45 +0200281 unsigned int connect_mask = HID_CONNECT_DEFAULT;
Jiri Slaby5f22a792008-05-16 11:49:19 +0200282 int ret;
283
284 hid_set_drvdata(hdev, (void *)quirks);
285
Jiri Slaby5f22a792008-05-16 11:49:19 +0200286 if (quirks & LG_NOGET)
287 hdev->quirks |= HID_QUIRK_NOGET;
288
289 ret = hid_parse(hdev);
290 if (ret) {
291 dev_err(&hdev->dev, "parse failed\n");
292 goto err_free;
293 }
294
Gary Stein74f292c2010-01-13 00:25:58 +0100295 if (quirks & (LG_FF | LG_FF2 | LG_FF3))
Jiri Slaby606bd0a2008-07-04 23:06:45 +0200296 connect_mask &= ~HID_CONNECT_FF;
297
298 ret = hid_hw_start(hdev, connect_mask);
Jiri Slaby5f22a792008-05-16 11:49:19 +0200299 if (ret) {
300 dev_err(&hdev->dev, "hw start failed\n");
301 goto err_free;
302 }
303
Simon Wood32c88cb2010-09-22 13:19:42 +0200304 if (quirks & LG_FF4) {
305 unsigned char buf[] = { 0x00, 0xAF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
306
307 ret = hdev->hid_output_raw_report(hdev, buf, sizeof(buf), HID_FEATURE_REPORT);
308
309 if (ret >= 0) {
310 /* insert a little delay of 10 jiffies ~ 40ms */
311 wait_queue_head_t wait;
312 init_waitqueue_head (&wait);
313 wait_event_interruptible_timeout(wait, 0, 10);
314
315 /* Select random Address */
316 buf[1] = 0xB2;
317 get_random_bytes(&buf[2], 2);
318
319 ret = hdev->hid_output_raw_report(hdev, buf, sizeof(buf), HID_FEATURE_REPORT);
320 }
321 }
322
Jiri Slaby606bd0a2008-07-04 23:06:45 +0200323 if (quirks & LG_FF)
324 lgff_init(hdev);
325 if (quirks & LG_FF2)
326 lg2ff_init(hdev);
Gary Stein74f292c2010-01-13 00:25:58 +0100327 if (quirks & LG_FF3)
328 lg3ff_init(hdev);
Simon Wood32c88cb2010-09-22 13:19:42 +0200329 if (quirks & LG_FF4)
330 lg4ff_init(hdev);
Jiri Slaby606bd0a2008-07-04 23:06:45 +0200331
Jiri Slaby5f22a792008-05-16 11:49:19 +0200332 return 0;
333err_free:
334 return ret;
335}
336
337static const struct hid_device_id lg_devices[] = {
338 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_MX3000_RECEIVER),
339 .driver_data = LG_RDESC | LG_WIRELESS },
340 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_S510_RECEIVER),
341 .driver_data = LG_RDESC | LG_WIRELESS },
342 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_S510_RECEIVER_2),
343 .driver_data = LG_RDESC | LG_WIRELESS },
344
345 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RECEIVER),
346 .driver_data = LG_BAD_RELATIVE_KEYS },
347
348 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_DINOVO_DESKTOP),
349 .driver_data = LG_DUPLICATE_USAGES },
350 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_DINOVO_EDGE),
351 .driver_data = LG_DUPLICATE_USAGES },
352 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_DINOVO_MINI),
353 .driver_data = LG_DUPLICATE_USAGES },
354
Jiri Slaby5f22a792008-05-16 11:49:19 +0200355 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_ELITE_KBD),
356 .driver_data = LG_IGNORE_DOUBLED_WHEEL | LG_EXPANDED_KEYMAP },
357 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_CORDLESS_DESKTOP_LX500),
358 .driver_data = LG_IGNORE_DOUBLED_WHEEL | LG_EXPANDED_KEYMAP },
359
Jiri Slaby5f22a792008-05-16 11:49:19 +0200360 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_EXTREME_3D),
361 .driver_data = LG_NOGET },
362 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_WHEEL),
Jiri Slaby606bd0a2008-07-04 23:06:45 +0200363 .driver_data = LG_NOGET | LG_FF },
364
Hendrik Iben2c6118e2010-10-04 15:39:49 +0200365 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD_CORD),
366 .driver_data = LG_FF2 },
Jiri Slaby606bd0a2008-07-04 23:06:45 +0200367 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD),
368 .driver_data = LG_FF },
369 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD2_2),
370 .driver_data = LG_FF },
371 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_WINGMAN_F3D),
372 .driver_data = LG_FF },
373 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_FORCE3D_PRO),
374 .driver_data = LG_FF },
375 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_MOMO_WHEEL),
376 .driver_data = LG_FF },
377 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_MOMO_WHEEL2),
378 .driver_data = LG_FF },
Christophe Borivant243b7062009-04-17 11:39:39 +0200379 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_G25_WHEEL),
380 .driver_data = LG_FF },
Simon Wood32c88cb2010-09-22 13:19:42 +0200381 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_WII_WHEEL),
382 .driver_data = LG_FF4 },
Jiri Kosinafd30ea82009-06-23 12:11:31 +0200383 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_WINGMAN_FFG ),
384 .driver_data = LG_FF },
Jiri Slaby606bd0a2008-07-04 23:06:45 +0200385 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD2),
386 .driver_data = LG_FF2 },
Gary Stein74f292c2010-01-13 00:25:58 +0100387 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_FLIGHT_SYSTEM_G940),
388 .driver_data = LG_FF3 },
Jiri Kosina24985cf2009-11-13 10:45:53 +0100389 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_SPACENAVIGATOR),
390 .driver_data = LG_RDESC_REL_ABS },
391 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_SPACETRAVELLER),
392 .driver_data = LG_RDESC_REL_ABS },
Jiri Slaby5f22a792008-05-16 11:49:19 +0200393 { }
394};
Jiri Kosina24985cf2009-11-13 10:45:53 +0100395
Jiri Slaby5f22a792008-05-16 11:49:19 +0200396MODULE_DEVICE_TABLE(hid, lg_devices);
397
398static struct hid_driver lg_driver = {
399 .name = "logitech",
400 .id_table = lg_devices,
401 .report_fixup = lg_report_fixup,
402 .input_mapping = lg_input_mapping,
403 .input_mapped = lg_input_mapped,
404 .event = lg_event,
405 .probe = lg_probe,
406};
407
Peter Huewea24f4232009-07-02 19:08:38 +0200408static int __init lg_init(void)
Jiri Slaby5f22a792008-05-16 11:49:19 +0200409{
410 return hid_register_driver(&lg_driver);
411}
412
Peter Huewea24f4232009-07-02 19:08:38 +0200413static void __exit lg_exit(void)
Jiri Slaby5f22a792008-05-16 11:49:19 +0200414{
415 hid_unregister_driver(&lg_driver);
416}
417
418module_init(lg_init);
419module_exit(lg_exit);
420MODULE_LICENSE("GPL");