aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2008-10-14 16:41:43 -0400
committerJiri Kosina <jkosina@suse.cz>2008-10-14 17:51:04 -0400
commita48c65b35a6f993aec13d18a37f6ea71fbcb0c06 (patch)
tree504d1e2e250f433e3cdaf9bd3d21853903b9def7
parentffcf70fb0693f1ab0133f973b5b9c552be766b16 (diff)
HID: add support for Bright ABNT2 brazilian device
This keyboard needs to reset the LEDS during probe. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r--drivers/hid/Kconfig7
-rw-r--r--drivers/hid/Makefile1
-rw-r--r--drivers/hid/hid-bright.c71
-rw-r--r--drivers/hid/hid-core.c1
-rw-r--r--drivers/hid/hid-dummy.c3
-rw-r--r--drivers/hid/hid-ids.h3
6 files changed, 86 insertions, 0 deletions
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
index fc4f80c4006c..6d7753be44fc 100644
--- a/drivers/hid/Kconfig
+++ b/drivers/hid/Kconfig
@@ -110,6 +110,13 @@ config HID_BELKIN
110 ---help--- 110 ---help---
111 Support for Belkin Flip KVM and Wireless keyboard. 111 Support for Belkin Flip KVM and Wireless keyboard.
112 112
113config HID_BRIGHT
114 tristate "Bright"
115 default m
116 depends on USB_HID
117 ---help---
118 Support for Bright ABNT-2 keyboard.
119
113config HID_CHERRY 120config HID_CHERRY
114 tristate "Cherry" 121 tristate "Cherry"
115 default m 122 default m
diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile
index 767f29500716..b09e43e7413e 100644
--- a/drivers/hid/Makefile
+++ b/drivers/hid/Makefile
@@ -23,6 +23,7 @@ endif
23obj-$(CONFIG_HID_A4TECH) += hid-a4tech.o 23obj-$(CONFIG_HID_A4TECH) += hid-a4tech.o
24obj-$(CONFIG_HID_APPLE) += hid-apple.o 24obj-$(CONFIG_HID_APPLE) += hid-apple.o
25obj-$(CONFIG_HID_BELKIN) += hid-belkin.o 25obj-$(CONFIG_HID_BELKIN) += hid-belkin.o
26obj-$(CONFIG_HID_BRIGHT) += hid-bright.o
26obj-$(CONFIG_HID_CHERRY) += hid-cherry.o 27obj-$(CONFIG_HID_CHERRY) += hid-cherry.o
27obj-$(CONFIG_HID_CHICONY) += hid-chicony.o 28obj-$(CONFIG_HID_CHICONY) += hid-chicony.o
28obj-$(CONFIG_HID_CYPRESS) += hid-cypress.o 29obj-$(CONFIG_HID_CYPRESS) += hid-cypress.o
diff --git a/drivers/hid/hid-bright.c b/drivers/hid/hid-bright.c
new file mode 100644
index 000000000000..38517a117dfd
--- /dev/null
+++ b/drivers/hid/hid-bright.c
@@ -0,0 +1,71 @@
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);
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 599846052fe3..2cba490fcd51 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1253,6 +1253,7 @@ static const struct hid_device_id hid_blacklist[] = {
1253 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) }, 1253 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) },
1254 { HID_USB_DEVICE(USB_VENDOR_ID_AVERMEDIA, USB_DEVICE_ID_AVER_FM_MR800) }, 1254 { HID_USB_DEVICE(USB_VENDOR_ID_AVERMEDIA, USB_DEVICE_ID_AVER_FM_MR800) },
1255 { HID_USB_DEVICE(USB_VENDOR_ID_BELKIN, USB_DEVICE_ID_FLIP_KVM) }, 1255 { HID_USB_DEVICE(USB_VENDOR_ID_BELKIN, USB_DEVICE_ID_FLIP_KVM) },
1256 { HID_USB_DEVICE(USB_VENDOR_ID_BRIGHT, USB_DEVICE_ID_BRIGHT_ABNT2) },
1256 { HID_USB_DEVICE(USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_CYMOTION) }, 1257 { HID_USB_DEVICE(USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_CYMOTION) },
1257 { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_TACTICAL_PAD) }, 1258 { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_TACTICAL_PAD) },
1258 { HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_1) }, 1259 { HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_1) },
diff --git a/drivers/hid/hid-dummy.c b/drivers/hid/hid-dummy.c
index 54d1fb6fd4d8..e148f86fb58e 100644
--- a/drivers/hid/hid-dummy.c
+++ b/drivers/hid/hid-dummy.c
@@ -13,6 +13,9 @@ static int __init hid_dummy_init(void)
13#ifdef CONFIG_HID_BELKIN_MODULE 13#ifdef CONFIG_HID_BELKIN_MODULE
14 HID_COMPAT_CALL_DRIVER(belkin); 14 HID_COMPAT_CALL_DRIVER(belkin);
15#endif 15#endif
16#ifdef CONFIG_HID_BRIGHT_MODULE
17 HID_COMPAT_CALL_DRIVER(bright);
18#endif
16#ifdef CONFIG_HID_CHERRY_MODULE 19#ifdef CONFIG_HID_CHERRY_MODULE
17 HID_COMPAT_CALL_DRIVER(cherry); 20 HID_COMPAT_CALL_DRIVER(cherry);
18#endif 21#endif
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 11afd33cbd6d..aad9ed1b406e 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -103,6 +103,9 @@
103#define USB_VENDOR_ID_BELKIN 0x050d 103#define USB_VENDOR_ID_BELKIN 0x050d
104#define USB_DEVICE_ID_FLIP_KVM 0x3201 104#define USB_DEVICE_ID_FLIP_KVM 0x3201
105 105
106#define USB_VENDOR_ID_BRIGHT 0x1241
107#define USB_DEVICE_ID_BRIGHT_ABNT2 0x1503
108
106#define USB_VENDOR_ID_BERKSHIRE 0x0c98 109#define USB_VENDOR_ID_BERKSHIRE 0x0c98
107#define USB_DEVICE_ID_BERKSHIRE_PCWD 0x1140 110#define USB_DEVICE_ID_BERKSHIRE_PCWD 0x1140
108 111