Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at v2.6.28-rc2 71 lines 1.5 kB view raw
1/* 2 * HID driver for some bright "special" devices 3 * 4 * Copyright (c) 2008 Mauro Carvalho Chehab <mchehab@redhat.com> 5 * 6 * Based on hid-dell driver 7 */ 8 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. 14 */ 15 16#include <linux/device.h> 17#include <linux/hid.h> 18#include <linux/module.h> 19 20#include "hid-ids.h" 21 22static int bright_probe(struct hid_device *hdev, const struct hid_device_id *id) 23{ 24 int ret; 25 26 ret = hid_parse(hdev); 27 if (ret) { 28 dev_err(&hdev->dev, "parse failed\n"); 29 goto err_free; 30 } 31 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; 36 } 37 38 usbhid_set_leds(hdev); 39 40 return 0; 41err_free: 42 return ret; 43} 44 45static const struct hid_device_id bright_devices[] = { 46 { HID_USB_DEVICE(USB_VENDOR_ID_BRIGHT, USB_DEVICE_ID_BRIGHT_ABNT2) }, 47 { } 48}; 49MODULE_DEVICE_TABLE(hid, bright_devices); 50 51static struct hid_driver bright_driver = { 52 .name = "bright", 53 .id_table = bright_devices, 54 .probe = bright_probe, 55}; 56 57static int bright_init(void) 58{ 59 return hid_register_driver(&bright_driver); 60} 61 62static void bright_exit(void) 63{ 64 hid_unregister_driver(&bright_driver); 65} 66 67module_init(bright_init); 68module_exit(bright_exit); 69MODULE_LICENSE("GPL"); 70 71HID_COMPAT_LOAD_DRIVER(bright);