libata: mask off DET when restoring SControl for detach
[linux-2.6/mini2440.git] / drivers / hid / hid-bright.c
blob38517a117dfd2b06cccec696094223ed5e7cfe36
1 /*
2 * HID driver for some bright "special" devices
4 * Copyright (c) 2008 Mauro Carvalho Chehab <mchehab@redhat.com>
6 * Based on hid-dell driver
7 */
9 /*
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the Free
12 * Software Foundation; either version 2 of the License, or (at your option)
13 * any later version.
16 #include <linux/device.h>
17 #include <linux/hid.h>
18 #include <linux/module.h>
20 #include "hid-ids.h"
22 static int bright_probe(struct hid_device *hdev, const struct hid_device_id *id)
24 int ret;
26 ret = hid_parse(hdev);
27 if (ret) {
28 dev_err(&hdev->dev, "parse failed\n");
29 goto err_free;
32 ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
33 if (ret) {
34 dev_err(&hdev->dev, "hw start failed\n");
35 goto err_free;
38 usbhid_set_leds(hdev);
40 return 0;
41 err_free:
42 return ret;
45 static const struct hid_device_id bright_devices[] = {
46 { HID_USB_DEVICE(USB_VENDOR_ID_BRIGHT, USB_DEVICE_ID_BRIGHT_ABNT2) },
47 { }
49 MODULE_DEVICE_TABLE(hid, bright_devices);
51 static struct hid_driver bright_driver = {
52 .name = "bright",
53 .id_table = bright_devices,
54 .probe = bright_probe,
57 static int bright_init(void)
59 return hid_register_driver(&bright_driver);
62 static void bright_exit(void)
64 hid_unregister_driver(&bright_driver);
67 module_init(bright_init);
68 module_exit(bright_exit);
69 MODULE_LICENSE("GPL");
71 HID_COMPAT_LOAD_DRIVER(bright);