aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorJarod Wilson <jarod@redhat.com>2011-10-14 16:57:42 -0400
committerJiri Kosina <jkosina@suse.cz>2012-02-06 11:35:03 -0500
commit44ea35c138d400b3aeeb2a5317edd4634e6823e3 (patch)
tree03c70a79051a85f195728e8e3989ea5d316c38c2 /drivers/hid
parent6c30d5a53229aad22bb675e0bd6eb518ecaa4316 (diff)
HID: add support for tivo slide remote
This patch finishes off adding full support for the TiVo Slide remote, which is a mostly pure HID device from the perspective of the kernel. There are a few mappings that use a vendor-specific usage page, and a few keys in the consumer usage page that I think make sense to remap slightly, to better fit their key labels' intended use. Doing this in a stand-alone hid-tivo.c makes the modifications only matter for this specific device. What's actually connected to the computer is a Broadcom-made usb dongle, which has an embedded hub, bluetooth adapter, mouse and keyboard devices. You pair with the dongle, then the remote sends data that its converted into HID on the keyboard interface (the mouse interface doesn't do anything interesting, so far as I can tell). lsusb for this device: Bus 004 Device 005: ID 0a5c:2190 Broadcom Corp. Bus 004 Device 004: ID 0a5c:4503 Broadcom Corp. Bus 004 Device 003: ID 150a:1201 Bus 004 Device 002: ID 0a5c:4500 Broadcom Corp. BCM2046B1 USB 2.0 Hub (part of BCM2046 Bluetooth) Speaking of the keyboard interface, the remote actually does contain a keyboard as well. The top slides away, revealing a reasonably functional qwerty keyboard (not unlike many slide cell phones), thus the product name. CC: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/Kconfig6
-rw-r--r--drivers/hid/Makefile1
-rw-r--r--drivers/hid/hid-core.c1
-rw-r--r--drivers/hid/hid-ids.h3
-rw-r--r--drivers/hid/hid-tivo.c89
5 files changed, 100 insertions, 0 deletions
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
index a421abdd1ab7..1f0b229f7dfc 100644
--- a/drivers/hid/Kconfig
+++ b/drivers/hid/Kconfig
@@ -594,6 +594,12 @@ config SMARTJOYPLUS_FF
594 Say Y here if you have a SmartJoy PLUS PS2/USB adapter and want to 594 Say Y here if you have a SmartJoy PLUS PS2/USB adapter and want to
595 enable force feedback support for it. 595 enable force feedback support for it.
596 596
597config HID_TIVO_SLIDE
598 tristate "TiVo Slide Bluetooth remote control support"
599 depends on USB_HID
600 ---help---
601 Say Y if you have a TiVo Slide Bluetooth remote control.
602
597config HID_TOPSEED 603config HID_TOPSEED
598 tristate "TopSeed Cyberlink, BTC Emprex, Conceptronic remote control support" 604 tristate "TopSeed Cyberlink, BTC Emprex, Conceptronic remote control support"
599 depends on USB_HID 605 depends on USB_HID
diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile
index 8aefdc963cce..c05f448f34a0 100644
--- a/drivers/hid/Makefile
+++ b/drivers/hid/Makefile
@@ -79,6 +79,7 @@ obj-$(CONFIG_HID_SPEEDLINK) += hid-speedlink.o
79obj-$(CONFIG_HID_SUNPLUS) += hid-sunplus.o 79obj-$(CONFIG_HID_SUNPLUS) += hid-sunplus.o
80obj-$(CONFIG_HID_GREENASIA) += hid-gaff.o 80obj-$(CONFIG_HID_GREENASIA) += hid-gaff.o
81obj-$(CONFIG_HID_THRUSTMASTER) += hid-tmff.o 81obj-$(CONFIG_HID_THRUSTMASTER) += hid-tmff.o
82obj-$(CONFIG_HID_TIVO) += hid-tivo.o
82obj-$(CONFIG_HID_TOPSEED) += hid-topseed.o 83obj-$(CONFIG_HID_TOPSEED) += hid-topseed.o
83obj-$(CONFIG_HID_TWINHAN) += hid-twinhan.o 84obj-$(CONFIG_HID_TWINHAN) += hid-twinhan.o
84obj-$(CONFIG_HID_UCLOGIC) += hid-uclogic.o 85obj-$(CONFIG_HID_UCLOGIC) += hid-uclogic.o
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 75dbe344cabe..23fa03176ace 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1536,6 +1536,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
1536 { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb653) }, 1536 { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb653) },
1537 { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb654) }, 1537 { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb654) },
1538 { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb65a) }, 1538 { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb65a) },
1539 { HID_USB_DEVICE(USB_VENDOR_ID_TIVO, USB_DEVICE_ID_TIVO_SLIDE) },
1539 { HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED, USB_DEVICE_ID_TOPSEED_CYBERLINK) }, 1540 { HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED, USB_DEVICE_ID_TOPSEED_CYBERLINK) },
1540 { HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED2, USB_DEVICE_ID_TOPSEED2_RF_COMBO) }, 1541 { HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED2, USB_DEVICE_ID_TOPSEED2_RF_COMBO) },
1541 { HID_USB_DEVICE(USB_VENDOR_ID_TOUCH_INTL, USB_DEVICE_ID_TOUCH_INTL_MULTI_TOUCH) }, 1542 { HID_USB_DEVICE(USB_VENDOR_ID_TOUCH_INTL, USB_DEVICE_ID_TOUCH_INTL_MULTI_TOUCH) },
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index fb9e61f85666..5f63e361be13 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -655,6 +655,9 @@
655 655
656#define USB_VENDOR_ID_THRUSTMASTER 0x044f 656#define USB_VENDOR_ID_THRUSTMASTER 0x044f
657 657
658#define USB_VENDOR_ID_TIVO 0x150a
659#define USB_DEVICE_ID_TIVO_SLIDE 0x1201
660
658#define USB_VENDOR_ID_TOPSEED 0x0766 661#define USB_VENDOR_ID_TOPSEED 0x0766
659#define USB_DEVICE_ID_TOPSEED_CYBERLINK 0x0204 662#define USB_DEVICE_ID_TOPSEED_CYBERLINK 0x0204
660 663
diff --git a/drivers/hid/hid-tivo.c b/drivers/hid/hid-tivo.c
new file mode 100644
index 000000000000..3d43c06dfffa
--- /dev/null
+++ b/drivers/hid/hid-tivo.c
@@ -0,0 +1,89 @@
1/*
2 * HID driver for TiVo Slide Bluetooth remote
3 *
4 * Copyright (c) 2011 Jarod Wilson <jarod@redhat.com>
5 * based on the hid-topseed driver, which is in turn, based on hid-cherry...
6 */
7
8/*
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the Free
11 * Software Foundation; either version 2 of the License, or (at your option)
12 * any later version.
13 */
14
15#include <linux/device.h>
16#include <linux/hid.h>
17#include <linux/module.h>
18
19#include "hid-ids.h"
20
21#define HID_UP_TIVOVENDOR 0xffff0000
22#define tivo_map_key_clear(c) hid_map_usage_clear(hi, usage, bit, max, \
23 EV_KEY, (c))
24
25static int tivo_input_mapping(struct hid_device *hdev, struct hid_input *hi,
26 struct hid_field *field, struct hid_usage *usage,
27 unsigned long **bit, int *max)
28{
29 switch (usage->hid & HID_USAGE_PAGE) {
30 case HID_UP_TIVOVENDOR:
31 switch (usage->hid & HID_USAGE) {
32 /* TiVo button */
33 case 0x3d: tivo_map_key_clear(KEY_MEDIA); break;
34 /* Live TV */
35 case 0x3e: tivo_map_key_clear(KEY_TV); break;
36 /* Red thumbs down */
37 case 0x41: tivo_map_key_clear(KEY_KPMINUS); break;
38 /* Green thumbs up */
39 case 0x42: tivo_map_key_clear(KEY_KPPLUS); break;
40 default:
41 return 0;
42 }
43 break;
44 case HID_UP_CONSUMER:
45 switch (usage->hid & HID_USAGE) {
46 /* Enter/Last (default mapping: KEY_LAST) */
47 case 0x083: tivo_map_key_clear(KEY_ENTER); break;
48 /* Info (default mapping: KEY_PROPS) */
49 case 0x209: tivo_map_key_clear(KEY_INFO); break;
50 default:
51 return 0;
52 }
53 break;
54 default:
55 return 0;
56 }
57
58 /* This means we found a matching mapping here, else, look in the
59 * standard hid mappings in hid-input.c */
60 return 1;
61}
62
63static const struct hid_device_id tivo_devices[] = {
64 /* TiVo Slide Bluetooth remote, pairs with a Broadcom dongle */
65 { HID_USB_DEVICE(USB_VENDOR_ID_TIVO, USB_DEVICE_ID_TIVO_SLIDE) },
66 { }
67};
68MODULE_DEVICE_TABLE(hid, tivo_devices);
69
70static struct hid_driver tivo_driver = {
71 .name = "tivo_slide",
72 .id_table = tivo_devices,
73 .input_mapping = tivo_input_mapping,
74};
75
76static int __init tivo_init(void)
77{
78 return hid_register_driver(&tivo_driver);
79}
80
81static void __exit tivo_exit(void)
82{
83 hid_unregister_driver(&tivo_driver);
84}
85
86module_init(tivo_init);
87module_exit(tivo_exit);
88MODULE_LICENSE("GPL");
89MODULE_AUTHOR("Jarod Wilson <jarod@redhat.com>");