Jiri Slaby | fea6f18 | 2008-06-26 22:25:33 +0200 | [diff] [blame^] | 1 | /* |
| 2 | * HID driver for some dell "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 |
| 10 | */ |
| 11 | |
| 12 | /* |
| 13 | * This program is free software; you can redistribute it and/or modify it |
| 14 | * under the terms of the GNU General Public License as published by the Free |
| 15 | * Software Foundation; either version 2 of the License, or (at your option) |
| 16 | * any later version. |
| 17 | */ |
| 18 | |
| 19 | #include <linux/device.h> |
| 20 | #include <linux/hid.h> |
| 21 | #include <linux/module.h> |
| 22 | |
| 23 | #include "hid-ids.h" |
| 24 | |
| 25 | static int dell_probe(struct hid_device *hdev, const struct hid_device_id *id) |
| 26 | { |
| 27 | int ret; |
| 28 | |
| 29 | hdev->quirks |= HID_QUIRK_RESET_LEDS; |
| 30 | |
| 31 | ret = hid_parse(hdev); |
| 32 | if (ret) { |
| 33 | dev_err(&hdev->dev, "parse failed\n"); |
| 34 | goto err_free; |
| 35 | } |
| 36 | |
| 37 | ret = hid_hw_start(hdev); |
| 38 | if (ret) { |
| 39 | dev_err(&hdev->dev, "hw start failed\n"); |
| 40 | goto err_free; |
| 41 | } |
| 42 | |
| 43 | return 0; |
| 44 | err_free: |
| 45 | return ret; |
| 46 | } |
| 47 | |
| 48 | static const struct hid_device_id dell_devices[] = { |
| 49 | { HID_USB_DEVICE(USB_VENDOR_ID_DELL, USB_DEVICE_ID_DELL_W7658) }, |
| 50 | { } |
| 51 | }; |
| 52 | MODULE_DEVICE_TABLE(hid, dell_devices); |
| 53 | |
| 54 | static struct hid_driver dell_driver = { |
| 55 | .name = "dell", |
| 56 | .id_table = dell_devices, |
| 57 | .probe = dell_probe, |
| 58 | }; |
| 59 | |
| 60 | static int dell_init(void) |
| 61 | { |
| 62 | return hid_register_driver(&dell_driver); |
| 63 | } |
| 64 | |
| 65 | static void dell_exit(void) |
| 66 | { |
| 67 | hid_unregister_driver(&dell_driver); |
| 68 | } |
| 69 | |
| 70 | module_init(dell_init); |
| 71 | module_exit(dell_exit); |
| 72 | MODULE_LICENSE("GPL"); |
| 73 | |
| 74 | HID_COMPAT_LOAD_DRIVER(dell); |