blob: 1a0d0dfc62fc354135e089bb5ace455595d2e451 [file] [log] [blame]
Jiri Slabyfea6f182008-06-26 22:25:33 +02001/*
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
25static int dell_probe(struct hid_device *hdev, const struct hid_device_id *id)
26{
27 int ret;
28
Jiri Slabyfea6f182008-06-26 22:25:33 +020029 ret = hid_parse(hdev);
30 if (ret) {
31 dev_err(&hdev->dev, "parse failed\n");
32 goto err_free;
33 }
34
Jiri Slaby93c10132008-06-27 00:04:24 +020035 ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
Jiri Slabyfea6f182008-06-26 22:25:33 +020036 if (ret) {
37 dev_err(&hdev->dev, "hw start failed\n");
38 goto err_free;
39 }
40
Jiri Slaby6edfa8d2008-06-27 20:41:02 +020041 usbhid_set_leds(hdev);
42
Jiri Slabyfea6f182008-06-26 22:25:33 +020043 return 0;
44err_free:
45 return ret;
46}
47
48static const struct hid_device_id dell_devices[] = {
49 { HID_USB_DEVICE(USB_VENDOR_ID_DELL, USB_DEVICE_ID_DELL_W7658) },
Mauro Carvalho Chehab0dc49162008-10-14 11:08:47 -020050 { HID_USB_DEVICE(USB_VENDOR_ID_DELL, USB_DEVICE_ID_DELL_SK8115) },
Jiri Slabyfea6f182008-06-26 22:25:33 +020051 { }
52};
53MODULE_DEVICE_TABLE(hid, dell_devices);
54
55static struct hid_driver dell_driver = {
56 .name = "dell",
57 .id_table = dell_devices,
58 .probe = dell_probe,
59};
60
61static int dell_init(void)
62{
63 return hid_register_driver(&dell_driver);
64}
65
66static void dell_exit(void)
67{
68 hid_unregister_driver(&dell_driver);
69}
70
71module_init(dell_init);
72module_exit(dell_exit);
73MODULE_LICENSE("GPL");
74
75HID_COMPAT_LOAD_DRIVER(dell);