USB: whiteheat: fix potential null-deref at probe
[firefly-linux-kernel-4.4.55.git] / drivers / hid / hid-roccat-pyra.c
1 /*
2  * Roccat Pyra driver for Linux
3  *
4  * Copyright (c) 2010 Stefan Achatz <erazor_de@users.sourceforge.net>
5  */
6
7 /*
8  * This program is free software; you can redistribute it and/or modify it
9  * under the terms of the GNU General Public License as published by the Free
10  * Software Foundation; either version 2 of the License, or (at your option)
11  * any later version.
12  */
13
14 /*
15  * Roccat Pyra is a mobile gamer mouse which comes in wired and wireless
16  * variant. Wireless variant is not tested.
17  * Userland tools can be found at http://sourceforge.net/projects/roccat
18  */
19
20 #include <linux/device.h>
21 #include <linux/input.h>
22 #include <linux/hid.h>
23 #include <linux/module.h>
24 #include <linux/slab.h>
25 #include <linux/hid-roccat.h>
26 #include "hid-ids.h"
27 #include "hid-roccat-common.h"
28 #include "hid-roccat-pyra.h"
29
30 static uint profile_numbers[5] = {0, 1, 2, 3, 4};
31
32 /* pyra_class is used for creating sysfs attributes via roccat char device */
33 static struct class *pyra_class;
34
35 static void profile_activated(struct pyra_device *pyra,
36                 unsigned int new_profile)
37 {
38         if (new_profile >= ARRAY_SIZE(pyra->profile_settings))
39                 return;
40         pyra->actual_profile = new_profile;
41         pyra->actual_cpi = pyra->profile_settings[pyra->actual_profile].y_cpi;
42 }
43
44 static int pyra_send_control(struct usb_device *usb_dev, int value,
45                 enum pyra_control_requests request)
46 {
47         struct roccat_common2_control control;
48
49         if ((request == PYRA_CONTROL_REQUEST_PROFILE_SETTINGS ||
50                         request == PYRA_CONTROL_REQUEST_PROFILE_BUTTONS) &&
51                         (value < 0 || value > 4))
52                 return -EINVAL;
53
54         control.command = ROCCAT_COMMON_COMMAND_CONTROL;
55         control.value = value;
56         control.request = request;
57
58         return roccat_common2_send(usb_dev, ROCCAT_COMMON_COMMAND_CONTROL,
59                         &control, sizeof(struct roccat_common2_control));
60 }
61
62 static int pyra_get_profile_settings(struct usb_device *usb_dev,
63                 struct pyra_profile_settings *buf, int number)
64 {
65         int retval;
66         retval = pyra_send_control(usb_dev, number,
67                         PYRA_CONTROL_REQUEST_PROFILE_SETTINGS);
68         if (retval)
69                 return retval;
70         return roccat_common2_receive(usb_dev, PYRA_COMMAND_PROFILE_SETTINGS,
71                         buf, PYRA_SIZE_PROFILE_SETTINGS);
72 }
73
74 static int pyra_get_settings(struct usb_device *usb_dev,
75                 struct pyra_settings *buf)
76 {
77         return roccat_common2_receive(usb_dev, PYRA_COMMAND_SETTINGS,
78                         buf, PYRA_SIZE_SETTINGS);
79 }
80
81 static int pyra_set_settings(struct usb_device *usb_dev,
82                 struct pyra_settings const *settings)
83 {
84         return roccat_common2_send_with_status(usb_dev,
85                         PYRA_COMMAND_SETTINGS, settings,
86                         PYRA_SIZE_SETTINGS);
87 }
88
89 static ssize_t pyra_sysfs_read(struct file *fp, struct kobject *kobj,
90                 char *buf, loff_t off, size_t count,
91                 size_t real_size, uint command)
92 {
93         struct device *dev =
94                         container_of(kobj, struct device, kobj)->parent->parent;
95         struct pyra_device *pyra = hid_get_drvdata(dev_get_drvdata(dev));
96         struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
97         int retval;
98
99         if (off >= real_size)
100                 return 0;
101
102         if (off != 0 || count != real_size)
103                 return -EINVAL;
104
105         mutex_lock(&pyra->pyra_lock);
106         retval = roccat_common2_receive(usb_dev, command, buf, real_size);
107         mutex_unlock(&pyra->pyra_lock);
108
109         if (retval)
110                 return retval;
111
112         return real_size;
113 }
114
115 static ssize_t pyra_sysfs_write(struct file *fp, struct kobject *kobj,
116                 void const *buf, loff_t off, size_t count,
117                 size_t real_size, uint command)
118 {
119         struct device *dev =
120                         container_of(kobj, struct device, kobj)->parent->parent;
121         struct pyra_device *pyra = hid_get_drvdata(dev_get_drvdata(dev));
122         struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
123         int retval;
124
125         if (off != 0 || count != real_size)
126                 return -EINVAL;
127
128         mutex_lock(&pyra->pyra_lock);
129         retval = roccat_common2_send_with_status(usb_dev, command, (void *)buf, real_size);
130         mutex_unlock(&pyra->pyra_lock);
131
132         if (retval)
133                 return retval;
134
135         return real_size;
136 }
137
138 #define PYRA_SYSFS_W(thingy, THINGY) \
139 static ssize_t pyra_sysfs_write_ ## thingy(struct file *fp, \
140                 struct kobject *kobj, struct bin_attribute *attr, char *buf, \
141                 loff_t off, size_t count) \
142 { \
143         return pyra_sysfs_write(fp, kobj, buf, off, count, \
144                         PYRA_SIZE_ ## THINGY, PYRA_COMMAND_ ## THINGY); \
145 }
146
147 #define PYRA_SYSFS_R(thingy, THINGY) \
148 static ssize_t pyra_sysfs_read_ ## thingy(struct file *fp, \
149                 struct kobject *kobj, struct bin_attribute *attr, char *buf, \
150                 loff_t off, size_t count) \
151 { \
152         return pyra_sysfs_read(fp, kobj, buf, off, count, \
153                         PYRA_SIZE_ ## THINGY, PYRA_COMMAND_ ## THINGY); \
154 }
155
156 #define PYRA_SYSFS_RW(thingy, THINGY) \
157 PYRA_SYSFS_W(thingy, THINGY) \
158 PYRA_SYSFS_R(thingy, THINGY)
159
160 #define PYRA_BIN_ATTRIBUTE_RW(thingy, THINGY) \
161 { \
162         .attr = { .name = #thingy, .mode = 0660 }, \
163         .size = PYRA_SIZE_ ## THINGY, \
164         .read = pyra_sysfs_read_ ## thingy, \
165         .write = pyra_sysfs_write_ ## thingy \
166 }
167
168 #define PYRA_BIN_ATTRIBUTE_R(thingy, THINGY) \
169 { \
170         .attr = { .name = #thingy, .mode = 0440 }, \
171         .size = PYRA_SIZE_ ## THINGY, \
172         .read = pyra_sysfs_read_ ## thingy, \
173 }
174
175 #define PYRA_BIN_ATTRIBUTE_W(thingy, THINGY) \
176 { \
177         .attr = { .name = #thingy, .mode = 0220 }, \
178         .size = PYRA_SIZE_ ## THINGY, \
179         .write = pyra_sysfs_write_ ## thingy \
180 }
181
182 PYRA_SYSFS_W(control, CONTROL)
183 PYRA_SYSFS_RW(info, INFO)
184 PYRA_SYSFS_RW(profile_settings, PROFILE_SETTINGS)
185 PYRA_SYSFS_RW(profile_buttons, PROFILE_BUTTONS)
186 PYRA_SYSFS_R(settings, SETTINGS)
187
188 static ssize_t pyra_sysfs_read_profilex_settings(struct file *fp,
189                 struct kobject *kobj, struct bin_attribute *attr, char *buf,
190                 loff_t off, size_t count)
191 {
192         struct device *dev =
193                         container_of(kobj, struct device, kobj)->parent->parent;
194         struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
195         ssize_t retval;
196
197         retval = pyra_send_control(usb_dev, *(uint *)(attr->private),
198                         PYRA_CONTROL_REQUEST_PROFILE_SETTINGS);
199         if (retval)
200                 return retval;
201
202         return pyra_sysfs_read(fp, kobj, buf, off, count,
203                         PYRA_SIZE_PROFILE_SETTINGS,
204                         PYRA_COMMAND_PROFILE_SETTINGS);
205 }
206
207 static ssize_t pyra_sysfs_read_profilex_buttons(struct file *fp,
208                 struct kobject *kobj, struct bin_attribute *attr, char *buf,
209                 loff_t off, size_t count)
210 {
211         struct device *dev =
212                         container_of(kobj, struct device, kobj)->parent->parent;
213         struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
214         ssize_t retval;
215
216         retval = pyra_send_control(usb_dev, *(uint *)(attr->private),
217                         PYRA_CONTROL_REQUEST_PROFILE_BUTTONS);
218         if (retval)
219                 return retval;
220
221         return pyra_sysfs_read(fp, kobj, buf, off, count,
222                         PYRA_SIZE_PROFILE_BUTTONS,
223                         PYRA_COMMAND_PROFILE_BUTTONS);
224 }
225
226 static ssize_t pyra_sysfs_write_settings(struct file *fp,
227                 struct kobject *kobj, struct bin_attribute *attr, char *buf,
228                 loff_t off, size_t count)
229 {
230         struct device *dev =
231                         container_of(kobj, struct device, kobj)->parent->parent;
232         struct pyra_device *pyra = hid_get_drvdata(dev_get_drvdata(dev));
233         struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
234         int retval = 0;
235         struct pyra_roccat_report roccat_report;
236         struct pyra_settings const *settings;
237
238         if (off != 0 || count != PYRA_SIZE_SETTINGS)
239                 return -EINVAL;
240
241         settings = (struct pyra_settings const *)buf;
242         if (settings->startup_profile >= ARRAY_SIZE(pyra->profile_settings))
243                 return -EINVAL;
244
245         mutex_lock(&pyra->pyra_lock);
246
247         retval = pyra_set_settings(usb_dev, settings);
248         if (retval) {
249                 mutex_unlock(&pyra->pyra_lock);
250                 return retval;
251         }
252
253         profile_activated(pyra, settings->startup_profile);
254
255         roccat_report.type = PYRA_MOUSE_EVENT_BUTTON_TYPE_PROFILE_2;
256         roccat_report.value = settings->startup_profile + 1;
257         roccat_report.key = 0;
258         roccat_report_event(pyra->chrdev_minor,
259                         (uint8_t const *)&roccat_report);
260
261         mutex_unlock(&pyra->pyra_lock);
262         return PYRA_SIZE_SETTINGS;
263 }
264
265
266 static ssize_t pyra_sysfs_show_actual_cpi(struct device *dev,
267                 struct device_attribute *attr, char *buf)
268 {
269         struct pyra_device *pyra =
270                         hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
271         return snprintf(buf, PAGE_SIZE, "%d\n", pyra->actual_cpi);
272 }
273
274 static ssize_t pyra_sysfs_show_actual_profile(struct device *dev,
275                 struct device_attribute *attr, char *buf)
276 {
277         struct pyra_device *pyra =
278                         hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
279         struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
280         struct pyra_settings settings;
281
282         mutex_lock(&pyra->pyra_lock);
283         roccat_common2_receive(usb_dev, PYRA_COMMAND_SETTINGS,
284                         &settings, PYRA_SIZE_SETTINGS);
285         mutex_unlock(&pyra->pyra_lock);
286
287         return snprintf(buf, PAGE_SIZE, "%d\n", settings.startup_profile);
288 }
289
290 static ssize_t pyra_sysfs_show_firmware_version(struct device *dev,
291                 struct device_attribute *attr, char *buf)
292 {
293         struct pyra_device *pyra;
294         struct usb_device *usb_dev;
295         struct pyra_info info;
296
297         dev = dev->parent->parent;
298         pyra = hid_get_drvdata(dev_get_drvdata(dev));
299         usb_dev = interface_to_usbdev(to_usb_interface(dev));
300
301         mutex_lock(&pyra->pyra_lock);
302         roccat_common2_receive(usb_dev, PYRA_COMMAND_INFO,
303                         &info, PYRA_SIZE_INFO);
304         mutex_unlock(&pyra->pyra_lock);
305
306         return snprintf(buf, PAGE_SIZE, "%d\n", info.firmware_version);
307 }
308
309 static struct device_attribute pyra_attributes[] = {
310         __ATTR(actual_cpi, 0440, pyra_sysfs_show_actual_cpi, NULL),
311         __ATTR(actual_profile, 0440, pyra_sysfs_show_actual_profile, NULL),
312         __ATTR(firmware_version, 0440,
313                         pyra_sysfs_show_firmware_version, NULL),
314         __ATTR(startup_profile, 0440,
315                         pyra_sysfs_show_actual_profile, NULL),
316         __ATTR_NULL
317 };
318
319 static struct bin_attribute pyra_bin_attributes[] = {
320         PYRA_BIN_ATTRIBUTE_W(control, CONTROL),
321         PYRA_BIN_ATTRIBUTE_RW(info, INFO),
322         PYRA_BIN_ATTRIBUTE_RW(profile_settings, PROFILE_SETTINGS),
323         PYRA_BIN_ATTRIBUTE_RW(profile_buttons, PROFILE_BUTTONS),
324         PYRA_BIN_ATTRIBUTE_RW(settings, SETTINGS),
325         {
326                 .attr = { .name = "profile1_settings", .mode = 0440 },
327                 .size = PYRA_SIZE_PROFILE_SETTINGS,
328                 .read = pyra_sysfs_read_profilex_settings,
329                 .private = &profile_numbers[0]
330         },
331         {
332                 .attr = { .name = "profile2_settings", .mode = 0440 },
333                 .size = PYRA_SIZE_PROFILE_SETTINGS,
334                 .read = pyra_sysfs_read_profilex_settings,
335                 .private = &profile_numbers[1]
336         },
337         {
338                 .attr = { .name = "profile3_settings", .mode = 0440 },
339                 .size = PYRA_SIZE_PROFILE_SETTINGS,
340                 .read = pyra_sysfs_read_profilex_settings,
341                 .private = &profile_numbers[2]
342         },
343         {
344                 .attr = { .name = "profile4_settings", .mode = 0440 },
345                 .size = PYRA_SIZE_PROFILE_SETTINGS,
346                 .read = pyra_sysfs_read_profilex_settings,
347                 .private = &profile_numbers[3]
348         },
349         {
350                 .attr = { .name = "profile5_settings", .mode = 0440 },
351                 .size = PYRA_SIZE_PROFILE_SETTINGS,
352                 .read = pyra_sysfs_read_profilex_settings,
353                 .private = &profile_numbers[4]
354         },
355         {
356                 .attr = { .name = "profile1_buttons", .mode = 0440 },
357                 .size = PYRA_SIZE_PROFILE_BUTTONS,
358                 .read = pyra_sysfs_read_profilex_buttons,
359                 .private = &profile_numbers[0]
360         },
361         {
362                 .attr = { .name = "profile2_buttons", .mode = 0440 },
363                 .size = PYRA_SIZE_PROFILE_BUTTONS,
364                 .read = pyra_sysfs_read_profilex_buttons,
365                 .private = &profile_numbers[1]
366         },
367         {
368                 .attr = { .name = "profile3_buttons", .mode = 0440 },
369                 .size = PYRA_SIZE_PROFILE_BUTTONS,
370                 .read = pyra_sysfs_read_profilex_buttons,
371                 .private = &profile_numbers[2]
372         },
373         {
374                 .attr = { .name = "profile4_buttons", .mode = 0440 },
375                 .size = PYRA_SIZE_PROFILE_BUTTONS,
376                 .read = pyra_sysfs_read_profilex_buttons,
377                 .private = &profile_numbers[3]
378         },
379         {
380                 .attr = { .name = "profile5_buttons", .mode = 0440 },
381                 .size = PYRA_SIZE_PROFILE_BUTTONS,
382                 .read = pyra_sysfs_read_profilex_buttons,
383                 .private = &profile_numbers[4]
384         },
385         __ATTR_NULL
386 };
387
388 static int pyra_init_pyra_device_struct(struct usb_device *usb_dev,
389                 struct pyra_device *pyra)
390 {
391         struct pyra_settings settings;
392         int retval, i;
393
394         mutex_init(&pyra->pyra_lock);
395
396         retval = pyra_get_settings(usb_dev, &settings);
397         if (retval)
398                 return retval;
399
400         for (i = 0; i < 5; ++i) {
401                 retval = pyra_get_profile_settings(usb_dev,
402                                 &pyra->profile_settings[i], i);
403                 if (retval)
404                         return retval;
405         }
406
407         profile_activated(pyra, settings.startup_profile);
408
409         return 0;
410 }
411
412 static int pyra_init_specials(struct hid_device *hdev)
413 {
414         struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
415         struct usb_device *usb_dev = interface_to_usbdev(intf);
416         struct pyra_device *pyra;
417         int retval;
418
419         if (intf->cur_altsetting->desc.bInterfaceProtocol
420                         == USB_INTERFACE_PROTOCOL_MOUSE) {
421
422                 pyra = kzalloc(sizeof(*pyra), GFP_KERNEL);
423                 if (!pyra) {
424                         hid_err(hdev, "can't alloc device descriptor\n");
425                         return -ENOMEM;
426                 }
427                 hid_set_drvdata(hdev, pyra);
428
429                 retval = pyra_init_pyra_device_struct(usb_dev, pyra);
430                 if (retval) {
431                         hid_err(hdev, "couldn't init struct pyra_device\n");
432                         goto exit_free;
433                 }
434
435                 retval = roccat_connect(pyra_class, hdev,
436                                 sizeof(struct pyra_roccat_report));
437                 if (retval < 0) {
438                         hid_err(hdev, "couldn't init char dev\n");
439                 } else {
440                         pyra->chrdev_minor = retval;
441                         pyra->roccat_claimed = 1;
442                 }
443         } else {
444                 hid_set_drvdata(hdev, NULL);
445         }
446
447         return 0;
448 exit_free:
449         kfree(pyra);
450         return retval;
451 }
452
453 static void pyra_remove_specials(struct hid_device *hdev)
454 {
455         struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
456         struct pyra_device *pyra;
457
458         if (intf->cur_altsetting->desc.bInterfaceProtocol
459                         == USB_INTERFACE_PROTOCOL_MOUSE) {
460                 pyra = hid_get_drvdata(hdev);
461                 if (pyra->roccat_claimed)
462                         roccat_disconnect(pyra->chrdev_minor);
463                 kfree(hid_get_drvdata(hdev));
464         }
465 }
466
467 static int pyra_probe(struct hid_device *hdev, const struct hid_device_id *id)
468 {
469         int retval;
470
471         retval = hid_parse(hdev);
472         if (retval) {
473                 hid_err(hdev, "parse failed\n");
474                 goto exit;
475         }
476
477         retval = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
478         if (retval) {
479                 hid_err(hdev, "hw start failed\n");
480                 goto exit;
481         }
482
483         retval = pyra_init_specials(hdev);
484         if (retval) {
485                 hid_err(hdev, "couldn't install mouse\n");
486                 goto exit_stop;
487         }
488         return 0;
489
490 exit_stop:
491         hid_hw_stop(hdev);
492 exit:
493         return retval;
494 }
495
496 static void pyra_remove(struct hid_device *hdev)
497 {
498         pyra_remove_specials(hdev);
499         hid_hw_stop(hdev);
500 }
501
502 static void pyra_keep_values_up_to_date(struct pyra_device *pyra,
503                 u8 const *data)
504 {
505         struct pyra_mouse_event_button const *button_event;
506
507         switch (data[0]) {
508         case PYRA_MOUSE_REPORT_NUMBER_BUTTON:
509                 button_event = (struct pyra_mouse_event_button const *)data;
510                 switch (button_event->type) {
511                 case PYRA_MOUSE_EVENT_BUTTON_TYPE_PROFILE_2:
512                         profile_activated(pyra, button_event->data1 - 1);
513                         break;
514                 case PYRA_MOUSE_EVENT_BUTTON_TYPE_CPI:
515                         pyra->actual_cpi = button_event->data1;
516                         break;
517                 }
518                 break;
519         }
520 }
521
522 static void pyra_report_to_chrdev(struct pyra_device const *pyra,
523                 u8 const *data)
524 {
525         struct pyra_roccat_report roccat_report;
526         struct pyra_mouse_event_button const *button_event;
527
528         if (data[0] != PYRA_MOUSE_REPORT_NUMBER_BUTTON)
529                 return;
530
531         button_event = (struct pyra_mouse_event_button const *)data;
532
533         switch (button_event->type) {
534         case PYRA_MOUSE_EVENT_BUTTON_TYPE_PROFILE_2:
535         case PYRA_MOUSE_EVENT_BUTTON_TYPE_CPI:
536                 roccat_report.type = button_event->type;
537                 roccat_report.value = button_event->data1;
538                 roccat_report.key = 0;
539                 roccat_report_event(pyra->chrdev_minor,
540                                 (uint8_t const *)&roccat_report);
541                 break;
542         case PYRA_MOUSE_EVENT_BUTTON_TYPE_MACRO:
543         case PYRA_MOUSE_EVENT_BUTTON_TYPE_SHORTCUT:
544         case PYRA_MOUSE_EVENT_BUTTON_TYPE_QUICKLAUNCH:
545                 if (button_event->data2 == PYRA_MOUSE_EVENT_BUTTON_PRESS) {
546                         roccat_report.type = button_event->type;
547                         roccat_report.key = button_event->data1;
548                         /*
549                          * pyra reports profile numbers with range 1-5.
550                          * Keeping this behaviour.
551                          */
552                         roccat_report.value = pyra->actual_profile + 1;
553                         roccat_report_event(pyra->chrdev_minor,
554                                         (uint8_t const *)&roccat_report);
555                 }
556                 break;
557         }
558 }
559
560 static int pyra_raw_event(struct hid_device *hdev, struct hid_report *report,
561                 u8 *data, int size)
562 {
563         struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
564         struct pyra_device *pyra = hid_get_drvdata(hdev);
565
566         if (intf->cur_altsetting->desc.bInterfaceProtocol
567                         != USB_INTERFACE_PROTOCOL_MOUSE)
568                 return 0;
569
570         if (pyra == NULL)
571                 return 0;
572
573         pyra_keep_values_up_to_date(pyra, data);
574
575         if (pyra->roccat_claimed)
576                 pyra_report_to_chrdev(pyra, data);
577
578         return 0;
579 }
580
581 static const struct hid_device_id pyra_devices[] = {
582         { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT,
583                         USB_DEVICE_ID_ROCCAT_PYRA_WIRED) },
584         { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT,
585                         USB_DEVICE_ID_ROCCAT_PYRA_WIRELESS) },
586         { }
587 };
588
589 MODULE_DEVICE_TABLE(hid, pyra_devices);
590
591 static struct hid_driver pyra_driver = {
592                 .name = "pyra",
593                 .id_table = pyra_devices,
594                 .probe = pyra_probe,
595                 .remove = pyra_remove,
596                 .raw_event = pyra_raw_event
597 };
598
599 static int __init pyra_init(void)
600 {
601         int retval;
602
603         /* class name has to be same as driver name */
604         pyra_class = class_create(THIS_MODULE, "pyra");
605         if (IS_ERR(pyra_class))
606                 return PTR_ERR(pyra_class);
607         pyra_class->dev_attrs = pyra_attributes;
608         pyra_class->dev_bin_attrs = pyra_bin_attributes;
609
610         retval = hid_register_driver(&pyra_driver);
611         if (retval)
612                 class_destroy(pyra_class);
613         return retval;
614 }
615
616 static void __exit pyra_exit(void)
617 {
618         hid_unregister_driver(&pyra_driver);
619         class_destroy(pyra_class);
620 }
621
622 module_init(pyra_init);
623 module_exit(pyra_exit);
624
625 MODULE_AUTHOR("Stefan Achatz");
626 MODULE_DESCRIPTION("USB Roccat Pyra driver");
627 MODULE_LICENSE("GPL v2");