From bd393dbd33aeae0bb239f3c69938d37cc55193ca Mon Sep 17 00:00:00 2001 From: Stefan Achatz Date: Thu, 29 Dec 2011 17:20:14 +0100 Subject: HID: roccat: Only one Kconfig entry for all roccat drivers To cleanup Kconfig space and ease selection for users there is now a single entry that selects all roccat related drivers at once. Signed-off-by: Stefan Achatz Signed-off-by: Jiri Kosina --- drivers/hid/Makefile | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'drivers/hid/Makefile') diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile index 8aefdc963cce..7d926719e21b 100644 --- a/drivers/hid/Makefile +++ b/drivers/hid/Makefile @@ -64,14 +64,9 @@ obj-$(CONFIG_HID_PANTHERLORD) += hid-pl.o obj-$(CONFIG_HID_PETALYNX) += hid-petalynx.o obj-$(CONFIG_HID_PICOLCD) += hid-picolcd.o obj-$(CONFIG_HID_PRIMAX) += hid-primax.o -obj-$(CONFIG_HID_ROCCAT) += hid-roccat.o -obj-$(CONFIG_HID_ROCCAT_COMMON) += hid-roccat-common.o -obj-$(CONFIG_HID_ROCCAT_ARVO) += hid-roccat-arvo.o -obj-$(CONFIG_HID_ROCCAT_ISKU) += hid-roccat-isku.o -obj-$(CONFIG_HID_ROCCAT_KONE) += hid-roccat-kone.o -obj-$(CONFIG_HID_ROCCAT_KONEPLUS) += hid-roccat-koneplus.o -obj-$(CONFIG_HID_ROCCAT_KOVAPLUS) += hid-roccat-kovaplus.o -obj-$(CONFIG_HID_ROCCAT_PYRA) += hid-roccat-pyra.o +obj-$(CONFIG_HID_ROCCAT) += hid-roccat.o hid-roccat-common.o \ + hid-roccat-arvo.o hid-roccat-isku.o hid-roccat-kone.o \ + hid-roccat-koneplus.o hid-roccat-kovaplus.o hid-roccat-pyra.o obj-$(CONFIG_HID_SAMSUNG) += hid-samsung.o obj-$(CONFIG_HID_SMARTJOYPLUS) += hid-sjoy.o obj-$(CONFIG_HID_SONY) += hid-sony.o -- cgit v1.2.3 From 44ea35c138d400b3aeeb2a5317edd4634e6823e3 Mon Sep 17 00:00:00 2001 From: Jarod Wilson Date: Fri, 14 Oct 2011 16:57:42 -0400 Subject: 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 Signed-off-by: Jarod Wilson Signed-off-by: Jiri Kosina --- drivers/hid/Kconfig | 6 ++++ drivers/hid/Makefile | 1 + drivers/hid/hid-core.c | 1 + drivers/hid/hid-ids.h | 3 ++ drivers/hid/hid-tivo.c | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 100 insertions(+) create mode 100644 drivers/hid/hid-tivo.c (limited to 'drivers/hid/Makefile') 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 Say Y here if you have a SmartJoy PLUS PS2/USB adapter and want to enable force feedback support for it. +config HID_TIVO_SLIDE + tristate "TiVo Slide Bluetooth remote control support" + depends on USB_HID + ---help--- + Say Y if you have a TiVo Slide Bluetooth remote control. + config HID_TOPSEED tristate "TopSeed Cyberlink, BTC Emprex, Conceptronic remote control support" 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 obj-$(CONFIG_HID_SUNPLUS) += hid-sunplus.o obj-$(CONFIG_HID_GREENASIA) += hid-gaff.o obj-$(CONFIG_HID_THRUSTMASTER) += hid-tmff.o +obj-$(CONFIG_HID_TIVO) += hid-tivo.o obj-$(CONFIG_HID_TOPSEED) += hid-topseed.o obj-$(CONFIG_HID_TWINHAN) += hid-twinhan.o obj-$(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[] = { { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb653) }, { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb654) }, { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb65a) }, + { HID_USB_DEVICE(USB_VENDOR_ID_TIVO, USB_DEVICE_ID_TIVO_SLIDE) }, { HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED, USB_DEVICE_ID_TOPSEED_CYBERLINK) }, { HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED2, USB_DEVICE_ID_TOPSEED2_RF_COMBO) }, { 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 @@ #define USB_VENDOR_ID_THRUSTMASTER 0x044f +#define USB_VENDOR_ID_TIVO 0x150a +#define USB_DEVICE_ID_TIVO_SLIDE 0x1201 + #define USB_VENDOR_ID_TOPSEED 0x0766 #define USB_DEVICE_ID_TOPSEED_CYBERLINK 0x0204 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 @@ +/* + * HID driver for TiVo Slide Bluetooth remote + * + * Copyright (c) 2011 Jarod Wilson + * based on the hid-topseed driver, which is in turn, based on hid-cherry... + */ + +/* + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + */ + +#include +#include +#include + +#include "hid-ids.h" + +#define HID_UP_TIVOVENDOR 0xffff0000 +#define tivo_map_key_clear(c) hid_map_usage_clear(hi, usage, bit, max, \ + EV_KEY, (c)) + +static int tivo_input_mapping(struct hid_device *hdev, struct hid_input *hi, + struct hid_field *field, struct hid_usage *usage, + unsigned long **bit, int *max) +{ + switch (usage->hid & HID_USAGE_PAGE) { + case HID_UP_TIVOVENDOR: + switch (usage->hid & HID_USAGE) { + /* TiVo button */ + case 0x3d: tivo_map_key_clear(KEY_MEDIA); break; + /* Live TV */ + case 0x3e: tivo_map_key_clear(KEY_TV); break; + /* Red thumbs down */ + case 0x41: tivo_map_key_clear(KEY_KPMINUS); break; + /* Green thumbs up */ + case 0x42: tivo_map_key_clear(KEY_KPPLUS); break; + default: + return 0; + } + break; + case HID_UP_CONSUMER: + switch (usage->hid & HID_USAGE) { + /* Enter/Last (default mapping: KEY_LAST) */ + case 0x083: tivo_map_key_clear(KEY_ENTER); break; + /* Info (default mapping: KEY_PROPS) */ + case 0x209: tivo_map_key_clear(KEY_INFO); break; + default: + return 0; + } + break; + default: + return 0; + } + + /* This means we found a matching mapping here, else, look in the + * standard hid mappings in hid-input.c */ + return 1; +} + +static const struct hid_device_id tivo_devices[] = { + /* TiVo Slide Bluetooth remote, pairs with a Broadcom dongle */ + { HID_USB_DEVICE(USB_VENDOR_ID_TIVO, USB_DEVICE_ID_TIVO_SLIDE) }, + { } +}; +MODULE_DEVICE_TABLE(hid, tivo_devices); + +static struct hid_driver tivo_driver = { + .name = "tivo_slide", + .id_table = tivo_devices, + .input_mapping = tivo_input_mapping, +}; + +static int __init tivo_init(void) +{ + return hid_register_driver(&tivo_driver); +} + +static void __exit tivo_exit(void) +{ + hid_unregister_driver(&tivo_driver); +} + +module_init(tivo_init); +module_exit(tivo_exit); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Jarod Wilson "); -- cgit v1.2.3 From 1e93674a8ea169320950c5e6d1fa29a20b534e60 Mon Sep 17 00:00:00 2001 From: Andreas Hübner Date: Wed, 22 Feb 2012 02:10:06 +0100 Subject: HID: add new driver for non-compliant Saitek devices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The driver currently only supports the PS1000 controller. It fixes the report descriptor by removing a non-existing axis and clearing the constant bit on the d-pad and button input reports. Signed-off-by: Andreas Hübner Signed-off-by: Jiri Kosina --- drivers/hid/Kconfig | 9 +++++++ drivers/hid/Makefile | 1 + drivers/hid/hid-core.c | 1 + drivers/hid/hid-ids.h | 1 + drivers/hid/hid-saitek.c | 70 ++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 82 insertions(+) create mode 100644 drivers/hid/hid-saitek.c (limited to 'drivers/hid/Makefile') diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index 1e6b78ed5ac9..9398cfce80b6 100644 --- a/drivers/hid/Kconfig +++ b/drivers/hid/Kconfig @@ -532,6 +532,15 @@ config HID_ROCCAT_PYRA ---help--- Support for Roccat Pyra mouse. +config HID_SAITEK + tristate "Saitek non-fully HID-compliant devices" + depends on USB_HID + ---help--- + Support for Saitek devices that are not fully compliant with the + HID standard. + + Currently only supports the PS1000 controller. + config HID_SAMSUNG tristate "Samsung InfraRed remote control or keyboards" depends on USB_HID diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile index c05f448f34a0..524532b49eaa 100644 --- a/drivers/hid/Makefile +++ b/drivers/hid/Makefile @@ -72,6 +72,7 @@ obj-$(CONFIG_HID_ROCCAT_KONE) += hid-roccat-kone.o obj-$(CONFIG_HID_ROCCAT_KONEPLUS) += hid-roccat-koneplus.o obj-$(CONFIG_HID_ROCCAT_KOVAPLUS) += hid-roccat-kovaplus.o obj-$(CONFIG_HID_ROCCAT_PYRA) += hid-roccat-pyra.o +obj-$(CONFIG_HID_SAITEK) += hid-saitek.o obj-$(CONFIG_HID_SAMSUNG) += hid-samsung.o obj-$(CONFIG_HID_SMARTJOYPLUS) += hid-sjoy.o obj-$(CONFIG_HID_SONY) += hid-sony.o diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 549c7538e57f..58d8f50649eb 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -1519,6 +1519,7 @@ static const struct hid_device_id hid_have_special_driver[] = { { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KOVAPLUS) }, { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_PYRA_WIRED) }, { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_PYRA_WIRELESS) }, + { HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_PS1000) }, { HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_IR_REMOTE) }, { HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE) }, { HID_USB_DEVICE(USB_VENDOR_ID_SKYCABLE, USB_DEVICE_ID_SKYCABLE_WIRELESS_PRESENTER) }, diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 6de95422586a..bc6e2b5862aa 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h @@ -615,6 +615,7 @@ #define USB_VENDOR_ID_SAITEK 0x06a3 #define USB_DEVICE_ID_SAITEK_RUMBLEPAD 0xff17 +#define USB_DEVICE_ID_SAITEK_PS1000 0xff17 #define USB_VENDOR_ID_SAMSUNG 0x0419 #define USB_DEVICE_ID_SAMSUNG_IR_REMOTE 0x0001 diff --git a/drivers/hid/hid-saitek.c b/drivers/hid/hid-saitek.c new file mode 100644 index 000000000000..45aea77bb611 --- /dev/null +++ b/drivers/hid/hid-saitek.c @@ -0,0 +1,70 @@ +/* + * HID driver for Saitek devices, currently only the PS1000 (USB gamepad). + * Fixes the HID report descriptor by removing a non-existent axis and + * clearing the constant bit on the input reports for buttons and d-pad. + * (This module is based on "hid-ortek".) + * + * Copyright (c) 2012 Andreas Hübner + */ + +/* + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + */ + +#include +#include +#include +#include + +#include "hid-ids.h" + +static __u8 *saitek_report_fixup(struct hid_device *hdev, __u8 *rdesc, + unsigned int *rsize) +{ + if (*rsize == 137 && rdesc[20] == 0x09 && rdesc[21] == 0x33 + && rdesc[94] == 0x81 && rdesc[95] == 0x03 + && rdesc[110] == 0x81 && rdesc[111] == 0x03) { + + hid_info(hdev, "Fixing up Saitek PS1000 report descriptor\n"); + + /* convert spurious axis to a "noop" Logical Minimum (0) */ + rdesc[20] = 0x15; + rdesc[21] = 0x00; + + /* clear constant bit on buttons and d-pad */ + rdesc[95] = 0x02; + rdesc[111] = 0x02; + + } + return rdesc; +} + +static const struct hid_device_id saitek_devices[] = { + { HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_PS1000)}, + { } +}; + +MODULE_DEVICE_TABLE(hid, saitek_devices); + +static struct hid_driver saitek_driver = { + .name = "saitek", + .id_table = saitek_devices, + .report_fixup = saitek_report_fixup +}; + +static int __init saitek_init(void) +{ + return hid_register_driver(&saitek_driver); +} + +static void __exit saitek_exit(void) +{ + hid_unregister_driver(&saitek_driver); +} + +module_init(saitek_init); +module_exit(saitek_exit); +MODULE_LICENSE("GPL"); -- cgit v1.2.3