aboutsummaryrefslogtreecommitdiff
path: root/drivers/hid/hid-core.c
AgeCommit message (Collapse)Author
2013-05-06HID: debug: fix RCU preemption issueJiri Kosina
Commit 2353f2bea ("HID: protect hid_debug_list") introduced mutex locking around debug_list access to prevent SMP races when debugfs nodes are being operated upon by multiple userspace processess. mutex is not a proper synchronization primitive though, as the hid-debug callbacks are being called from atomic contexts. We also have to be careful about disabling IRQs when taking the lock to prevent deadlock against IRQ handlers. Benjamin reports this has also been reported in RH bugzilla as bug #958935. =============================== [ INFO: suspicious RCU usage. ] 3.9.0+ #94 Not tainted ------------------------------- include/linux/rcupdate.h:476 Illegal context switch in RCU read-side critical section! other info that might help us debug this: rcu_scheduler_active = 1, debug_locks = 0 4 locks held by Xorg/5502: #0: (&evdev->mutex){+.+...}, at: [<ffffffff81512c3d>] evdev_write+0x6d/0x160 #1: (&(&dev->event_lock)->rlock#2){-.-...}, at: [<ffffffff8150dd9b>] input_inject_event+0x5b/0x230 #2: (rcu_read_lock){.+.+..}, at: [<ffffffff8150dd82>] input_inject_event+0x42/0x230 #3: (&(&usbhid->lock)->rlock){-.....}, at: [<ffffffff81565289>] usb_hidinput_input_event+0x89/0x120 stack backtrace: CPU: 0 PID: 5502 Comm: Xorg Not tainted 3.9.0+ #94 Hardware name: Dell Inc. OptiPlex 390/0M5DCD, BIOS A09 07/24/2012 0000000000000001 ffff8800689c7c38 ffffffff816f249f ffff8800689c7c68 ffffffff810acb1d 0000000000000000 ffffffff81a03ac7 000000000000019d 0000000000000000 ffff8800689c7c90 ffffffff8107cda7 0000000000000000 Call Trace: [<ffffffff816f249f>] dump_stack+0x19/0x1b [<ffffffff810acb1d>] lockdep_rcu_suspicious+0xfd/0x130 [<ffffffff8107cda7>] __might_sleep+0xc7/0x230 [<ffffffff816f7770>] mutex_lock_nested+0x40/0x3a0 [<ffffffff81312ac4>] ? vsnprintf+0x354/0x640 [<ffffffff81553cc4>] hid_debug_event+0x34/0x100 [<ffffffff81554197>] hid_dump_input+0x67/0xa0 [<ffffffff81556430>] hid_set_field+0x50/0x120 [<ffffffff8156529a>] usb_hidinput_input_event+0x9a/0x120 [<ffffffff8150d89e>] input_handle_event+0x8e/0x530 [<ffffffff8150df10>] input_inject_event+0x1d0/0x230 [<ffffffff8150dd82>] ? input_inject_event+0x42/0x230 [<ffffffff81512cae>] evdev_write+0xde/0x160 [<ffffffff81185038>] vfs_write+0xc8/0x1f0 [<ffffffff81185535>] SyS_write+0x55/0xa0 [<ffffffff81704482>] system_call_fastpath+0x16/0x1b BUG: sleeping function called from invalid context at kernel/mutex.c:413 in_atomic(): 1, irqs_disabled(): 1, pid: 5502, name: Xorg INFO: lockdep is turned off. irq event stamp: 1098574 hardirqs last enabled at (1098573): [<ffffffff816fb53f>] _raw_spin_unlock_irqrestore+0x3f/0x70 hardirqs last disabled at (1098574): [<ffffffff816faaf5>] _raw_spin_lock_irqsave+0x25/0xa0 softirqs last enabled at (1098306): [<ffffffff8104971f>] __do_softirq+0x18f/0x3c0 softirqs last disabled at (1097867): [<ffffffff81049ad5>] irq_exit+0xa5/0xb0 CPU: 0 PID: 5502 Comm: Xorg Not tainted 3.9.0+ #94 Hardware name: Dell Inc. OptiPlex 390/0M5DCD, BIOS A09 07/24/2012 ffffffff81a03ac7 ffff8800689c7c68 ffffffff816f249f ffff8800689c7c90 ffffffff8107ce60 0000000000000000 ffff8800689c7fd8 ffff88006a62c800 ffff8800689c7d10 ffffffff816f7770 ffff8800689c7d00 ffffffff81312ac4 Call Trace: [<ffffffff816f249f>] dump_stack+0x19/0x1b [<ffffffff8107ce60>] __might_sleep+0x180/0x230 [<ffffffff816f7770>] mutex_lock_nested+0x40/0x3a0 [<ffffffff81312ac4>] ? vsnprintf+0x354/0x640 [<ffffffff81553cc4>] hid_debug_event+0x34/0x100 [<ffffffff81554197>] hid_dump_input+0x67/0xa0 [<ffffffff81556430>] hid_set_field+0x50/0x120 [<ffffffff8156529a>] usb_hidinput_input_event+0x9a/0x120 [<ffffffff8150d89e>] input_handle_event+0x8e/0x530 [<ffffffff8150df10>] input_inject_event+0x1d0/0x230 [<ffffffff8150dd82>] ? input_inject_event+0x42/0x230 [<ffffffff81512cae>] evdev_write+0xde/0x160 [<ffffffff81185038>] vfs_write+0xc8/0x1f0 [<ffffffff81185535>] SyS_write+0x55/0xa0 [<ffffffff81704482>] system_call_fastpath+0x16/0x1b Reported-by: majianpeng <majianpeng@gmail.com> Reported-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-05-01HID: reintroduce fix-up for certain Sony RF receiversFernando Luis Vázquez Cao
It looks like the manual merge 0d69a3c731e120b05b7da9fb976830475a3fbc01 ("Merge branches 'for-3.9/sony' and 'for-3.9/steelseries' into for-linus") accidentally removed Sony RF receiver with USB product id 0x0374 from the "have special driver" list, effectively nullifying a464918419f94a0043d2f549d6defb4c3f69f68a ("HID: add support for Sony RF receiver with USB product id 0x0374"). Add the device back to the list. Cc: stable@vger.kernel.org Signed-off-by: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-04-30Merge branches 'for-3.10/wiimote' and 'for-3.9/upstream-fixes' into for-linusJiri Kosina
2013-04-30Merge branches 'for-3.10/multitouch', 'for-3.10/roccat' and ↵Jiri Kosina
'for-3.10/upstream' into for-linus Conflicts: drivers/hid/Kconfig
2013-04-30Merge branches 'for-3.10/appleir', 'for-3.10/hid-debug', ↵Jiri Kosina
'for-3.10/hid-driver-transport-cleanups', 'for-3.10/i2c-hid' and 'for-3.10/logitech' into for-linus
2013-04-30HID: protect hid_debug_listJiri Kosina
Accesses to hid_device->hid_debug_list are not serialized properly, which could result in SMP concurrency issues when HID debugfs events are accessesed by multiple userspace processess. Serialize all the list operations by a mutex. Spotted by Al Viro. Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-04-30HID: debug: break out hid_dump_report() into hid-debugBenjamin Tissoires
No semantic changes, but hid_dump_report should be in hid-debug.c, not in hid-core.c Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-04-29HID: Add PID for Japanese version of NE4K keyboardAdam Jiang
This patche adds PID of Japanese Natual Ergonomic Keyboard 4000. HID NE4K driver depends on this PID for determining its quirks. F14-F18 keys would not work without the patch. Signed-off-by: Adam Jiang <jiang.adam@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-04-18HID: appleir: add support for Apple ir devicesBenjamin Tissoires
This driver was originally written by James McKenzie, updated by Greg Kroah-Hartman, further updated by Bastien Nocera, with suspend support added. I ported it to the HID subsystem, in order to simplify it a litle and allow lirc to use it through hiddev. More recent versions of the IR receiver are also supported through a patch by Alex Karpenko. The patch also adds support for the 2nd and 5th generation of the controller, and the menu key on newer brushed metal remotes. Tested-by: Fabien André <fabien.andre@gmail.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-04-04HID: wiimote: add 2nd generation Wii Remote IDsDavid Herrmann
This adds the 2nd generation Wii Remote IDs. They have a different Bluetooth chipset (CSR instead of Broadcom) and are more restrictive in what they accept as input. Hence, you need up-to-date BlueZ and Bluetooth HIDP modules to use these devices. Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-03-29HID: fix Masterkit MA901 hid quirksAlexey Klimov
This patch reverts commit 0322bd3980 ("usb hid quirks for Masterkit MA901 usb radio") and adds checks in hid_ignore() for Masterkit MA901 usb radio device. This usb radio device shares USB ID with many Atmel V-USB (and probably other) devices so patch sorts things out by checking name, vendor, product of hid device. Signed-off-by: Alexey Klimov <klimov.linux@gmail.com> Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-03-14HID: roccat: add support for Roccat Kone Pure gaming mouseStefan Achatz
Userland-tools can already be found at http://sourceforge.net/projects/roccat Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-03-09HID: Merge branch 'master' into for-3.10/hid-driver-transport-cleanupsJiri Kosina
Sync with Linus' tree. This is necessary to resolve build conflict caused by dcd9006b1b053c7b ("HID: logitech-dj: do not directly call hid_output_raw_report() during probe") which issues direct call to usbhid_submit_report(), but that is gone in this branch and hid_hw_request() has to be used instead. Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-03-01HID: Separate struct hid_device's driver_lock into two locks.Andrew de los Reyes
This patch separates struct hid_device's driver_lock into two. The goal is to allow hid device drivers to receive input during their probe() or remove() function calls. This is necessary because some drivers need to communicate with the device to determine parameters needed during probe (e.g., size of a multi-touch surface), and if possible, may perfer to communicate with a device on host-initiated disconnect (e.g., to put it into a low-power state). Historically, three functions used driver_lock: - hid_device_probe: blocks to acquire lock - hid_device_remove: blocks to acquire lock - hid_input_report: if locked returns -EBUSY, else acquires lock This patch adds another lock (driver_input_lock) which is used to block input from occurring. The lock behavior is now: - hid_device_probe: blocks to acq. driver_lock, then driver_input_lock - hid_device_remove: blocks to acq. driver_lock, then driver_input_lock - hid_input_report: if driver_input_lock locked returns -EBUSY, else acquires driver_input_lock This patch also adds two helper functions to be called during probe() or remove(): hid_device_io_start() and hid_device_io_stop(). These functions lock and unlock, respectively, driver_input_lock; they also make a note of whether they did so that hid-core knows if a driver has changed the lock state. This patch results in no behavior change for existing devices and drivers. However, during a probe() or remove() function call in a driver, that driver may now selectively call hid_device_io_start() to let input events come through, then optionally call hid_device_io_stop() to stop them. Signed-off-by: Andrew de los Reyes <adlr@chromium.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-02-25HID: make sensor autodetection independent of underlying busMika Westerberg
Instead of limiting HID sensors to USB and I2C busses we can just make everything that has usage page of HID_UP_SENSOR to be included in HID_GROUP_SENSOR_HUB group. This allows the sensor-hub to work over bluetooth (and other transports) as well. Reported-by: Alexander Holler <holler@ahsoftware.de> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-By: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-02-24Merge branch 'v4l_for_linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media updates from Mauro Carvalho Chehab: - Some cleanups at V4L2 documentation - new drivers: ts2020 frontend, ov9650 sensor, s5c73m3 sensor, sh-mobile veu mem2mem driver, radio-ma901, davinci_vpfe staging driver - Lots of missing MAINTAINERS entries added - several em28xx driver improvements, including its conversion to videobuf2 - several fixups on drivers to make them to better comply with the API - DVB core: add support for DVBv5 stats, allowing the implementation of statistics for new standards like ISDB - mb86a20s: add statistics to the driver - lots of new board additions, cleanups, and driver improvements. * 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (596 commits) [media] media: Add 0x3009 USB PID to ttusb2 driver (fixed diff) [media] rtl28xxu: Add USB IDs for Compro VideoMate U620F [media] em28xx: add usb id for terratec h5 rev. 3 [media] media: rc: gpio-ir-recv: add support for device tree parsing [media] mceusb: move check earlier to make smatch happy [media] radio-si470x doc: add info about v4l2-ctl and sox+alsa [media] staging: media: Remove unnecessary OOM messages [media] sh_vou: Use vou_dev instead of vou_file wherever possible [media] sh_vou: Use video_drvdata() [media] drivers/media/platform/soc_camera/pxa_camera.c: use devm_ functions [media] mt9t112: mt9t111 format set up differs from mt9t112 [media] sh-mobile-ceu-camera: fix SHARPNESS control default Revert "[media] fc0011: Return early, if the frequency is already tuned" [media] cx18/ivtv: fix regression: remove __init from a non-init function [media] em28xx: fix analog streaming with USB bulk transfers [media] stv0900: remove unnecessary null pointer check [media] fc0011: Return early, if the frequency is already tuned [media] fc0011: Add some sanity checks and cleanups [media] fc0011: Fix xin value clamping Revert "[media] [PATH,1/2] mxl5007 move reset to attach" ...
2013-02-21Merge branches 'for-3.9/sony' and 'for-3.9/steelseries' into for-linusJiri Kosina
Conflicts: drivers/hid/hid-core.c
2013-02-21Merge branches 'for-3.9/logitech', 'for-3.9/multitouch', 'for-3.9/ntrig', ↵Jiri Kosina
'for-3.9/thingm' and 'for-3.9/upstream' into for-linus
2013-02-19HID: add ThingM blink(1) USB RGB LED supportVivien Didelot
The ThingM blink(1) is an open source hardware USB RGB LED. It contains an internal EEPROM, allowing to configure up to 12 light patterns. A light pattern is a RGB color plus a fade time. This driver registers a LED class instance with additional sysfs attributes to support basic functions such as setting RGB colors, fade and playing. Other functions are still accessible through the hidraw interface. At this time, the only documentation for the device is the firmware source code from ThingM, plus a few schematics. They are available at: https://github.com/todbot/blink1 This patch is version 3. It updates the name of the source file, the driver and the led sysfs entry, according to comments from Jiri Kosina and Simon Wood. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-02-18HID: blacklist Velleman data acquisition boardsIan Abbott
These are simple data acquistion boards, not HID devices and are handled by the vmk80xx comedi driver. At least one of them (10cf:5500) misidentifies itself as a HID in its USB interface descriptor. Ignore all these devices. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-02-18HID: extend autodetect to handle I2C sensors as wellMika Westerberg
Since the advent of HID over I2C protocol, it is possible to have sensor hubs behind I2C bus as well. We can autodetect this in a same way than USB sensor hubs. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-02-05HID: core: add "report" hook, called once the report has been parsedBenjamin Tissoires
This callback is called when the parsing of the report has been done by hid-core (so after the calls to .event). The hid drivers can now have access to the whole report by relying on the values stored in the different fields. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-01-31USB: HID: SRW-S1 Gaming Wheel DriverSimon Wood
Add support the SRW-S1 by patching HID descriptor to read axis as Generic Desktop X, Y and Z (rather than Usage page being 'Simulation'). Signed-off-by: Simon Wood <simon@mungewell.org> Tested-by: John Murphy <rosegardener@freeode.co.uk> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-01-17HID: Support Jess/Saitek Color Rumble PadMichael Karcher
Add support for another gamepad to the hid-pl driver. The "color rumble pad P580" marketed using the "Saitek" brand in Germany, and using a USB Vendor ID attributed to "Jess" seems to be electronically identical to the 4-field variant of the "Green Asia" gamepad. The pad has been tested to support rumble strengths up to 255, not just 127. Signed-off-by: Michael Karcher <kernel@mkarcher.dialup.fu-berlin.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-01-15HID: add support for Sony RF receiver with USB product id 0x0374Fernando Luis Vázquez Cao
Some Vaio desktop computers, among them the VGC-LN51JGB multimedia PC, have a RF receiver, multi-interface USB device 054c:0374, that is used to connect a wireless keyboard and a wireless mouse. The keyboard works flawlessly, but the mouse (VGP-WMS3 in my case) does not seem to be generating any pointer events. The problem is that the mouse pointer is wrongly declared as a constant non-data variable in the report descriptor (see lsusb and usbhid-dump output below), with the consequence that it is ignored by the HID code. Add this device to the have-special-driver list and fix up the report descriptor in the Sony-specific driver which happens to already have a fixup for a similar firmware bug. # lsusb -vd 054C:0374 Bus 003 Device 002: ID 054c:0374 Sony Corp. Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 8 idVendor 0x054c Sony Corp. idProduct 0x0374 iSerial 0 [...] Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 3 Human Interface Device bInterfaceSubClass 1 Boot Interface Subclass bInterfaceProtocol 2 Mouse iInterface 2 RF Receiver [...] Report Descriptor: (length is 100) [...] Item(Global): Usage Page, data= [ 0x01 ] 1 Generic Desktop Controls Item(Local ): Usage, data= [ 0x30 ] 48 Direction-X Item(Local ): Usage, data= [ 0x31 ] 49 Direction-Y Item(Global): Report Count, data= [ 0x02 ] 2 Item(Global): Report Size, data= [ 0x08 ] 8 Item(Global): Logical Minimum, data= [ 0x81 ] 129 Item(Global): Logical Maximum, data= [ 0x7f ] 127 Item(Main ): Input, data= [ 0x07 ] 7 Constant Variable Relative No_Wrap Linear Preferred_State No_Null_Position Non_Volatile Bitfield # usbhid-dump 003:002:001:DESCRIPTOR 1357910009.758544 05 01 09 02 A1 01 05 01 09 02 A1 02 85 01 09 01 A1 00 05 09 19 01 29 05 95 05 75 01 15 00 25 01 81 02 75 03 95 01 81 01 05 01 09 30 09 31 95 02 75 08 15 81 25 7F 81 07 A1 02 85 01 09 38 35 00 45 00 15 81 25 7F 95 01 75 08 81 06 C0 A1 02 85 01 05 0C 15 81 25 7F 95 01 75 08 0A 38 02 81 06 C0 C0 C0 C0 Cc: linux-input@vger.kernel.org Cc: linux-usb@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-12-28[hid] usb hid quirks for Masterkit MA901 usb radioAlexey Klimov
Don't let Masterkit MA901 USB radio be handled by usb hid drivers. This device will be handled by radio-ma901.c driver. Signed-off-by: Alexey Klimov <klimov.linux@gmail.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-12-12Merge branches 'for-3.7/upstream-fixes', 'for-3.8/hidraw', ↵Jiri Kosina
'for-3.8/i2c-hid', 'for-3.8/multitouch', 'for-3.8/roccat', 'for-3.8/sensors' and 'for-3.8/upstream' into for-linus Conflicts: drivers/hid/hid-core.c
2012-12-12Revert "HID: sensors: add to special driver list"Alexander Holler
Those IDs aren't necessary anymore. This reverts commit c8147d9ea19bfe7d8e569351bc7239e118dd6997. Signed-off-by: Alexander Holler <holler@ahsoftware.de> Acked-by: "Pandruvada, Srinivas" <srinivas.pandruvada@intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-12-12HID: sensors: autodetect USB HID sensor hubsAlexander Holler
It should not be necessary to add IDs for HID sensor hubs to lists in hid-core.c and hid-sensor-hub.c. So instead of a whitelist, autodetect such USB HID sensor hubs, based on a collection of type physical inside a useage page of type sensor. If some sensor hubs stil must be usable as raw devices, a blacklist might be created. Signed-off-by: Alexander Holler <holler@ahsoftware.de> Acked-by: "Pandruvada, Srinivas" <srinivas.pandruvada@intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-12-07HID: hidp: fallback to input session properly if hid is blacklistedLamarque V. Souza
This patch against kernel 3.7.0-rc8 fixes a kernel oops when turning on the bluetooth mouse with id 0458:0058 [1]. The mouse in question supports both input and hid sessions, however it is blacklisted in drivers/hid/hid-core.c so the input session is one that should be used. Long ago (around kernel 3.0.0) some changes in the bluetooth subsystem made the kernel do not fallback to input session when hid session is not supported or blacklisted. This patch restore that behaviour by making the kernel try the input session if hid_add_device returns ENODEV. The patch exports hid_ignore() from hid-core.c so that it can be used in the bluetooth subsystem. [1] https://bugzilla.kernel.org/show_bug.cgi?id=39882 Signed-off-by: Lamarque V. Souza <lamarque@gmail.com> Acked-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-12-02HID: Add Apple wireless keyboard 2011 ANSI to special driver listBen Hutchings
Commit 0a97e1e9f9a6 ('HID: apple: Add Apple wireless keyboard 2011 ANSI PID') did not update the special driver list in hid-core.c, so hid-generic may still bind to this device. Reported-by: Ari Pollak <ari@scvngr.com> References: http://bugs.debian.org/694546 Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Cc: <stable@vger.kernel.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-11-15HID: add usage_index in struct hid_usage.Benjamin Tissoires
Currently, there is no way to know the index of the current field in the .input_mapping and .event callbacks when this field is inside an array of HID fields. This patch adds this index to the struct hid_usage so that this information is available to input_mapping and event callbacks. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Acked-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-11-15HID: fix unit exponent parsingBenjamin Tissoires
HID spec details special values for the HID field unit exponent. Basically, the range [0x8..0xf] correspond to [-8..-1], so this is a standard two's complement on a half-byte. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Acked-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-11-07HID: Ignore D-WAV/eGalax devices handled by usbtouchscreenForest Bond
Previously, both usbhid and usbtouchscreen would bind to D-WAV devices with class HID and protocol None, so they would be claimed by whichever driver was loaded first. Some of these devices do in fact work with usbhid, but not all of them do. OTOH they all work with usbtouchscreen as of commit 037a833ed05a86d01ea27a2c32043b86c549be1b ("Input: usbtouchscreen - initialize eGalax devices"). So we ignore them in usbhid to prevent getting in the way of usbtouchscreen and claiming an interface that we may not be able to do anything useful with. Signed-off-by: Forest Bond <forest.bond@rapidrollout.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-10-31HID: Add driver for ION iCadeBastien Nocera
Add a driver for the ION iCade mini arcade cabinet [1]. The device generates a key press and release for each joystick movement or button press or release. For example, moving the stick to the left will generate the "A" key being pressed and then released. A list of all the combinations is available in the iCade developer guide [2]. This driver hides all this and makes the device work as a generic joystick. [1]: http://www.ionaudio.com/products/details/icade [2]: http://www.ionaudio.com/downloads/iCade_Dev_Resource_v1.3.pdf Signed-off-by: Bastien Nocera <hadess@hadess.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-10-31HID: Add support for the MacBook Pro 10,2 keyboard / touchpadDirk Hohndel
This enables the existing drivers for keyboard and touchpad with the new USB IDs found on the MBP 13" Reasonable Resolution (also known as the Retina Display). Added entries to both keyboard and mouse ignore lists. Signed-off-by: Dirk Hohndel <dirk@hohndel.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-10-17HID: roccat: add support for Roccat LuaStefan Achatz
This patch adds support for Roccat Lua gaming mouse. Userland tools can soon be found at http://sourceforge.net/projects/roccat Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-10-01Merge tag 'staging-3.6' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging tree update from Greg Kroah-Hartman: "Here is the big staging tree update for the 3.7-rc1 merge window. There are a few patches in here that are outside of the staging area, namely HID and IIO patches, but all of them have been acked by the relevant subsystem maintainers. The IIO stuff is still coming in through this tree as it hasn't entirely moved out of the staging tree, but is almost there. Other than that, there wa a ton of work on the comedi drivers to make them more readable and the correct style. Doing that removed a lot of code, but we added a new driver to the staging tree, so we didn't end up with a net reduction this time around: 662 files changed, 51649 insertions(+), 26582 deletions(-) All of these patches have been in the linux-next tree already. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>" * tag 'staging-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (1094 commits) staging: comedi: jr3_pci: fix iomem dereference staging: comedi: drivers: use comedi_fc.h cmdtest helpers Staging: winbond: usb_free_urb(NULL) is safe Staging: winbond: checkpatch cleanup Staging: winbond: Removed undesired spaces, lines and tabs Staging: winbond: Typo corrections in comments Staging: winbond: Changed c99 comments to c89 comments staging: r8712u: Do not queue cloned skb staging: comedi: ni_mio_common: always lock in ni_ai_poll() staging: comedi: s626: add FIXME comment staging: comedi: s626: don't dereference insn->data staging: comedi: s526: fix if() check in s526_gpct_winsn() staging: comedi: s626: cleanup comments in s626_initialize() staging: comedi: s626: remove clear of kzalloc'ed data staging: comedi: s626: remove 'WDInterval' from private data staging: comedi: s626: remove 'ChargeEnabled' from private data staging: comedi: s626: remove 'IsBoardRevA' comment staging: comedi: s626: #if 0 out the "SAA7146 BUG WORKAROUND" staging: comedi: s626: remove 'allocatedBuf' from private data staging: comedi: s626: add final attach message ...
2012-10-01Merge branch 'upstream' into for-linusJiri Kosina
Conflicts: drivers/hid/usbhid/hid-quirks.c
2012-10-01Merge branches 'from-henrik', 'hidraw', 'logitech', 'picolcd', 'ps3', ↵Jiri Kosina
'uclogic', 'wacom' and 'wiimote' into for-linus
2012-10-01HID: Add support for Sony PS3 BD Remote ControlDavid Dillow
The Sony PS3 Blue-ray Disc Remote Control used to be supported by the BlueZ project's user space, but the code that handled it was recently removed as its functionality conflicted with a real HSP implementation and the mapping was thought to be better handled in the kernel. This is a port of the mapping logic from the fakehid driver by Marcel Holtmann to the in-kernel HID layer. We also add support for the Logitech Harmony Adapter for PS3, which emulates the BD Remote. Signed-off-by: David Dillow <dave@thedillows.org> Signed-off-by: Antonio Ospite <ospite@studenti.unina.it> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-10-01HID: keep dev_rdesc unmodified and use it for comparisonsKevin Daughtridge
The dev_rdesc member of the hid_device structure is meant to store the original report descriptor received from the device, but it is currently passed to any report_fixup method before it is copied to the rdesc member. This patch uses a temporary buffer to shield dev_rdesc from the side effects of many HID drivers' report_fixup implementations. usbhid's hid_post_reset checks the report descriptor currently returned by the device against a descriptor that may have been modified by a driver's report_fixup method. That leaves some devices nonfunctional after a resume, with a "reset_resume error 1" reported. This patch checks the new descriptor against the unmodified dev_rdesc instead and uses the original, instead of modified, report size. BugLink: http://bugs.launchpad.net/bugs/1049623 Signed-off-by: Kevin Daughtridge <kevin@kdau.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-09-17HID: roccat: conditional blacklisting of Roccat modulesStefan Achatz
Roccat devices are standard compatible, specific drivers are only needed for extended functionality. If Roccat drivers are not configured, hid-generic binds these devices now. Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-09-17HID: Fix return values in open_collection()Sachin Kamat
Return -ENOMEM instead of -1 if memory allocation fails. Return -EINVAL instead of -1 for stack overflow and underflow errors. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-09-16Merge 3.6-rc6 into staging-nextGreg Kroah-Hartman
This pulls in the staging tree fixes in 3.6-rc6 into our branch to resolve the merge issues. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-07HID: tpkbd: work even if the new Lenovo Keyboard driver is not configuredAndres Freund
c1dcad2d32d0252e8a3023d20311b52a187ecda3 added a new driver configured by HID_LENOVO_TPKBD but made the hid_have_special_driver entry non-optional which lead to a recognized but non-working device if the new driver wasn't configured (which is the correct default). Signed-off-by: Andres Freund <andres@anarazel.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-09-06HID: sensors: add to special driver listsrinivas pandruvada
Adding Intel and STM sensor hub in the list of drivers with specialized driver. Signed-off-by: srinivas pandruvada <srinivas.pandruvada@intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-02HID: update hid_have_special_driver[] explanationJiri Kosina
Update the comment of hid_have_special_driver[] field to reflect the fact that multitouch devices don't need to be present there. Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-09-02HID: Only dump input if someone is listeningHenrik Rydberg
Going through the motions of printing the debug message information takes a long time; using the keyboard can lead to a 160 us irqsoff latency. This patch skips hid_dump_input() when there are no open handles, which brings latency down to 100 us. Signed-off-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-08-27HID: uclogic: Add support for UC-Logic TWHA60Nikolai Kondrashov
Add support for UC-Logic Tablet TWHA60. It is known to be sold as Genius EasyPen M610 and Monoprice MP1060-HA60. As this tablet has several variations with different number and different assignments of frame buttons, they are simply mapped to F1-F24 range and are left for users to remap in userspace. Signed-off-by: Jiri Kosina <jkosina@suse.cz>