History log of /drivers/hid/hid-core.c
Revision Date Author Comments
9c5c6ed7b5078ba42b1c769a1c29b3ae4a6bee36 03-Nov-2014 Benjamin Tissoires <benjamin.tissoires@redhat.com> HID: core: cleanup .claimed field on disconnect

When a subdriver is rmmod-ed then re-insmod-ed, the hid device is not
destroyed as it is owned by the transport layer.
So when we re-probed the device, the hid device is assumed to be already
claimed, and can lead to page faults if hid-core tries to forward the
emitted data to the to-be-created claimed node.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
7704ac937345d4b502062952657027234aa86a37 23-Sep-2014 Benjamin Tissoires <benjamin.tissoires@redhat.com> HID: wacom: implement generic HID handling for pen generic devices

ISDv4 and v5 are plain HID devices. We can directly implement a generic
HID parsing/handling and remove the need to manually add those PID in
the list of supported devices.

This patch implements the pen support only. The finger part will come in
a later patch.

To be properly notified of an .event() and a .report(), we need to force
hid-core to go through the HID parsing. By default, wacom.ko binds only
hidraw, so the hid parsing is not done by hid-core. When a true HID device
is there, we add the flag HID_CLAIMED_DRIVER to hid->claimed which will
force hid-core to parse the incoming reports.
(Note that this can be easily backported by directly setting the .claimed
flag to HID_CLAIMED_DRIVER even if hid-core does not support
HID_CONNECT_DRIVER)

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Jason Gerecke <killertofu@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
5df4eb054fe056ecb15875e812fdadbc47568d7d 05-Sep-2014 John DeSilva <desilvjo@umich.edu> HID: Add Holtek USB ID 04d9:a0c2 ETEKCITY Scroll

The report descriptor for the HOLTEK USB ID 04d9:a0c2 (ETEKCITY Scroll
T-140 Gaming Mouse) is set to a very large amount of consumer usages
(2^16), exceeding HID_MAX_USAGES. Added id, bindings and comments for
the mouse, added to hid_have_special_driver, and reduced the usage and
logical maximums to 0x2fff, consistent with the other mice in the
category. Tested on the hardware.

Signed-off-by: John C. DeSilva <desilvjo@umich.edu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
643727a92e92efd657fbbbe70b3c35a49e537010 08-Sep-2014 Hans Petter Selasky <hps@selasky.org> HID: fix ignore_special_drivers modparam description

Signed-off-by: Hans Petter Selasky <hps@selasky.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
ffe51d0d8abce3139a970c640ed48e73e9c360bb 03-Sep-2014 Christian Gmeiner <christian.gmeiner@gmail.com> HID: add support for PenMount HID TouchScreen Driver

This patch adds a seperate hid-penmount driver to work
around an issue with the HID report descriptor. The
descriptor does not contain the ContactID usage and as
result the touchscreen is represented as normal mouse
to the system.

This driver maps the button 0 emitted by the touchscreen
to BTN_TOUCH. This makes it possible to use touch events
in userspace.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
81af7e61a774e687ed4a7f37992ef75da57c5ddf 06-Aug-2014 Benjamin Tissoires <benjamin.tissoires@redhat.com> Input: wacom - handle Intuos 4 BT in wacom.ko

A good point of this change is that now, the Intuos4 bluetooth can handle
the different tools (artpen, airbrush, mice), and we get a common interface
between USB and BT for accessing the LEDs/OLEDs.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: Ping Cheng <pingc@wacom.com>
Tested-by: Przemo Firszt <przemo@firszt.eu>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
387142bb8fcb263771e1fa6b1a96e6a7ca36e820 06-Aug-2014 Benjamin Tissoires <benjamin.tissoires@redhat.com> Input: wacom - handle Graphire BT tablets in wacom.ko

First, merge the Graphire BT tablet.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: Ping Cheng <pingc@wacom.com>
Tested-by: Przemo Firszt <przemo@firszt.eu>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
43c1a0a9db2d9213812766065f6a07a215ed70ad 05-Jul-2014 Patrick Plattes <patrick@erdbeere.net> HID: ignore jabra gn9350e

Ignore Jabra GN9350E HID interface. USB audio is working nicely, but
registering as HID blocks USB mouse buttons. Since special userspace programs
are needed we will avoid attaching usbhid drivers in general.

Signed-off-by: Patrick Plattes <patrick@erdbeere.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
e19ff99f256aeeff6c07b373e01883b72e049552 18-Jul-2014 Andrew Duggan <aduggan@synaptics.com> HID: rmi: only bind the hid-rmi driver to the mouse interface of composite USB devices

On composite HID devices there may be multiple HID devices on separate interfaces, but hid-rmi
should only bind to the mouse interface. One example is the Dell Venue 11 Pro's keyboard dock
which contains a composite USB device with a HID touchpad and HID keyboard on separate intefaces.
Since the USB Vendor ID is Synaptic's, hid-core is currently trying to bind hid-rmi to all\of
the HID devices. This patch ensures that hid-rmi only binds to the mouse interface.

related bug:
https://bugzilla.kernel.org/show_bug.cgi?id=80091

Signed-off-by: Andrew Duggan <aduggan@synaptics.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
f3d4ff0e04cc4450bdc7a4140020913b1280d205 24-Jul-2014 Jamie Lentin <jm@lentin.co.uk> HID: lenovo: Add support for Compact (BT|USB) keyboard

Add support for both ThinkPad Compact Bluetooth Keyboard with
TrackPoint and ThinkPad Compact USB Keyboard with TrackPoint.

Signed-off-by: Jamie Lentin <jm@lentin.co.uk>
Reviewed-by: Antonio Ospite <ao2@ao2.it>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
94723bfa7bf1b647fe49c9717ee02e99d7a59957 24-Jul-2014 Jamie Lentin <jm@lentin.co.uk> HID: lenovo: Rename hid-lenovo-tpkbd to hid-lenovo

Rename module and all functions within so we can add support for other
keyboards in the same file. Rename the _tp postfix to _tpkbd, to
signify functions relevant to the TP USB keyboard.

Signed-off-by: Jamie Lentin <jm@lentin.co.uk>
Reviewed-by: Antonio Ospite <ao2@ao2.it>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
e917e98f4829a5842ea8283548bf5dedfd88b2d0 23-Jul-2014 Nikolai Kondrashov <spbnick@gmail.com> HID: huion: Use "tablet" instead of specific model

Use word "tablet" in identifiers and comments instead of referring to specific
Huion tablet model name, as the product ID is used by at least several tablet
models.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
29b4739134c73a2873adec93346f09bb76d6a794 24-Jul-2014 Benjamin Tissoires <benjamin.tissoires@redhat.com> Input: wacom - switch from an USB driver to a HID driver

All USB Wacom tablets are actually HID devices.
For historical reasons, they are handled as plain USB devices.
The current code makes more and more reference to the HID subsystem
like implementing its own HID report descriptor parser to handle new
devices.

From the user point of view, we can transparently switch from this state
to a driver handled in the HID subsystem and clean up a lot of USB specific
code in the wacom.ko driver.

The other benefit once the USB dependecies have been removed is that we can
use a tool like uhid to make regression tests and allow further cleanup or
new implementations without risking breaking current behaviors.

To match the current handling of devices in wacom_wac.c, we rely on the
hid_type set by usbhid. usbhid sets the hid_type to HID_TYPE_USBMOUSE when
it sees a USB boot mouse protocol declared and HID_TYPE_USBNONE when the
device is plain HID. There is thus a one to one matching between the list
of supported devices before and after the switch from USB to HID.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: Jason Gerecke <killertofu@gmail.com>
Tested-by: Jason Gerecke <killertofu@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
f471d9480275796dea2ac7ec249b050e70a2888d 18-Jun-2014 Janne Kanniainen <janne.kanniainen@gmail.com> HID: add support for MSI GT683R led panels

This driver adds support for USB controlled led panels that exists in
MSI GT683R laptop

Signed-off-by: Janne Kanniainen <janne.kanniainen@gmail.com>
Reviewed-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Bryan Wu <cooloney@gmail.com>
ba391e5a5ac6697b8bcae8c0d01439cb765d9ef8 21-May-2014 Benjamin Tissoires <benjamin.tissoires@redhat.com> HID: rmi: do not handle touchscreens through hid-rmi

Currently, hid-rmi drives every Synaptics product, but the touchscreens
on the Windows tablets should be handled through hid-multitouch.

Instead of providing a long list of PIDs, rely on the scan_report
capability to detect which should go to hid-multitouch, and which
should not go to hid-rmi.

related bug:
https://bugzilla.kernel.org/show_bug.cgi?id=74241
https://bugzilla.redhat.com/show_bug.cgi?id=1089583

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
37c492c8f6a99870551fe2964b2dfce5d9e87375 20-May-2014 Harald Brinkmann <hbrinkmann@braincalibration.de> HID: quirk for Saitek RAT7 and MMO7 mices' mode button

Some saitek mice implement a tristate button (for switching button mappings in
the original driver) by keeping one of three (non-physical)
buttons constantly pressed.

This breaks X and probably other userspace software.

This patch implements a quirk for the R.A.T.7 and M.M.O.7, tracking the mode
and generating presses of a single button if it changes. Also the missing
release event is generated instantly.

Signed-off-by: Harald Brinkmann <hbrinkmann@braincalibration.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1b15d2e5b8077670b1e6a33250a0d9577efff4a5 17-Apr-2014 Kees Cook <keescook@chromium.org> HID: core: fix validation of report id 0

Some drivers use the first HID report in the list instead of using an
index. In these cases, validation uses ID 0, which was supposed to mean
"first known report". This fixes the problem, which was causing at least
the lgff family of devices to stop working since hid_validate_values
was being called with ID 0, but the devices used single numbered IDs
for their reports:

0x05, 0x01, /* Usage Page (Desktop), */
0x09, 0x05, /* Usage (Gamepad), */
0xA1, 0x01, /* Collection (Application), */
0xA1, 0x02, /* Collection (Logical), */
0x85, 0x01, /* Report ID (1), */
...

Cc: stable@vger.kernel.org
Reported-by: Simon Wood <simon@mungewell.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
19e4ec525b37cdecbdb4f86edaae7f56a67339ee 30-Apr-2014 Benjamin Tissoires <benjamin.tissoires@redhat.com> HID: core: fix computation of the report size

The extra seven bits are only required when allocating the report buffer.
We can not use those extra bytes for the length of the report in the
generic implementation of .request because the device might (will) refuse
the set_report command.
This has been verified on the Atmel touchpad found on the Samsung Ativ 9
plus, which uses hid-multitouch and HID over I2C. Without this fix, the
device refuses to switch to the multitouch mode, and it becomes unresponsive
from the user point of view.

Actually, this has been discussed during the initial submission of the
commit 4fa5a7f76cc7b6ac87f57741edd2b124851d119f, see
https://patchwork.kernel.org/patch/3621751/

Unfortunately, I completely forgot about it later.

Reported-by: Matthias Bayer <thematthiasbayer@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9fb6bf02e3ad04c20edb8e46536ce3eeda32c736 07-Apr-2014 Benjamin Tissoires <benjamin.tissoires@redhat.com> HID: rmi: introduce RMI driver for Synaptics touchpads

This driver add support for RMI4 over USB or I2C.
The current state is that it uses its own RMI4 implementation, but once
RMI4 is merged upstream, the driver will be a transport driver for the
RMI4 library.

Part of this driver should be considered as temporary. Most of the RMI4
processing and input handling will be deleted at some point.

I based my work on Andrew's regarding its port of RMI4 over HID (see
https://github.com/mightybigcar/synaptics-rmi4/tree/rmihid )
This repo presents how the driver may looks like at the end:
https://github.com/mightybigcar/synaptics-rmi4/blob/rmihid/drivers/input/rmi4/rmi_hid.c

Without this temporary solution, the workaround we gave to users
is to disable i2c-hid, which leads to disabling the touchscreen on the
XPS 11 and 12 (Haswell generation).

Related bugs:
https://bugzilla.redhat.com/show_bug.cgi?id=1048314
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1218973

Signed-off-by: Andrew Duggan <aduggan@synaptics.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
e24d0d399b2fce71b627043e900ef28283850482 31-Mar-2014 Benjamin Tissoires <benjamin.tissoires@redhat.com> HID: core: do not scan constant input report

The Microsoft Surface Type/Touch Cover 2 is a fancy device which advertised
itself as a multitouch device but with constant input reports.
This way, hid_scan_report() gives the group MULTITOUCH to it, but
hid-multitouch can not handle it due to the constant collection ignored
by hid-input.

To prevent such crap in the future, and while we do not fix this particular
device, make the scan_report coherent with hid-input.c, and ignore constant
input reports.

CC: stable@vger.kernel.org # 3.12+
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
f3b0cbce01cd5c242b420d986b208d306bdc5083 31-Mar-2014 Derya <derya.kiran@yahoo.de> Revert "HID: microsoft: Add ID's for Surface Type/Touch Cover 2"

This reverts commit 117309c51dca42121f70cacec801511b76acf75c.

The MS Surface Pro 2 has an USB composite device with 3 interfaces
- interface 0 - sensor hub
- interface 1 - wacom digitizer
- interface 2 - the keyboard cover, if one is attached
This USB composite device changes it product id dependent on if and which
keyboard cover is attached. Adding the covers to hid_have_special_driver
prevents loading the right hid drivers for the other two interfaces, all 3
get loaded with hid-microsoft. We don't even need hid-microsoft for the
keyboards. We have to revert this to load the right hid modules for each
interface.

CC: stable@vger.kernel.org # kernel 3.14 only
Signed-off-by: Derya <derya.kiran@yahoo.de>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
3c86726cfe38952f0366f86acfbbb025813ec1c2 20-Feb-2014 Benjamin Tissoires <benjamin.tissoires@redhat.com> HID: make .raw_request mandatory

SET_REPORT and GET_REPORT are mandatory in the HID specification.
Make the corresponding API in hid-core mandatory too, which removes the
need to test against it in some various places.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
e932d817866770d456815c9a84b7ed94f0589d80 04-Feb-2014 David Barksdale <dbarksdale@uplogix.com> HID: add hid-cp2112 driver

This patch adds support for the Silicon Labs CP2112 "Single-Chip HID USB to
SMBus Master Bridge."

This is a HID device driver which registers as an i2c adapter and gpiochip to
expose these functions of the CP2112. The customizable USB descriptor fields
are exposed as sysfs attributes. The SMBus byte-read, byte-data-read/write,
and word-data-read transfer modes have been tested by talking to an i2c
sensor. The GPIO functions and USB descriptor field programming have also
been tested.

Signed-off-by: David Barksdale <dbarksdale@uplogix.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
4fa5a7f76cc7b6ac87f57741edd2b124851d119f 10-Feb-2014 Benjamin Tissoires <benjamin.tissoires@redhat.com> HID: core: implement generic .request()

.request() can be emulated through .raw_request()
we can implement this emulation in hid-core, and make .request
not mandatory for transport layer drivers.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
759db9ead2c064203e9cb46bfff7c8ef25417b65 12-Feb-2014 Christian Vogel <vogelchr@vogel.cx> usbhid/quirks: Ignore Riso Kagaku Webmail Notifier

The "Webmail Notifier" is a USB controlled LED that appears as a HID
device. When trying to change the LED via hidraw it returns malformed
reports. As "usbled" supports it, we blacklist it in usbhid.

Signed-off-by: Christian Vogel <vogelchr@vogel.cx>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
bd4a7ce1da061d97c45673e1ca1a6a474bfb4cff 06-Feb-2014 Huei-Horng Yo <hiroshi@ghostsinthelab.org> HID: apple: add Apple wireless keyboard 2011 JIS model support

Add Apple wireless keyboard 2011 JIS model (05ac:0257).

Signed-off-by: Huei-Horng Yo <hiroshi@ghostsinthelab.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
3faed1aff786a007b3ea0549ac469e09f48c98f9 29-Jan-2014 Hans de Goede <hdegoede@redhat.com> HID: hid-microsoft: Add support for scrollwheel and special keypad keys

The Microsoft Office keyboard has a scrollwheel as well as some special keys
above the keypad which are handled through the custom MS usage page, this
commit adds support for these.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
117309c51dca42121f70cacec801511b76acf75c 28-Jan-2014 Reyad Attiyat <reyad.attiyat@gmail.com> HID: microsoft: Add ID's for Surface Type/Touch Cover 2

The Microsoft Surface Type/Touch cover 2 devices have the flag HID_DG_CONTACTID
in their reports.This causes the device to bind to the hid-multitouch driver,
which doesn't handle generic keyboard/mouse input events. The patch adds
the hardware id's of the device to hid-microsoft and to the HID special
driver array, which makes the device get handled by hid-generic/hid-input
properly.

Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=64811

Singed-off-by: Reyad Attiyat <reyad.attiyat@gmail.com>
Reviewed-by: Benjamin Tissoires<benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
274be3eb653c421d68514684024c6d915c94b728 14-Jan-2014 Kharlamov Alexey <derlafff@yandex.ru> HID: hid-holtek-mouse: add new a070 mouse

Added support of RITMIX ROM-316 mouse to hid-holtek-mouse workaround module

Signed-off-by: Alexey Kharlamov <derlafff@ya.ru>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
0bd88dd3dd5e73e5d43b8d1e7a96b841978df562 11-Jan-2014 Frank Praznik <frank.praznik@oh.rr.com> HID: sony: Add force-feedback support for the Dualshock 4

Adds the Dualshock 4 to the HID device list and enables force-feedback.

Adds a Dualshock 4 specific worker function since the Dualshock 4 needs a
different report than the Sixaxis.

The right motor in the Dualshock 4 is variable so the full rumble value
is now passed to the worker function and clamped there if necessary.

Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
adc232592337d3ac4c5473ba8bdaf7c202bf215d 15-Oct-2013 Dinesh Ram <Dinesh.Ram@cern.ch> [media] si4713: HID blacklist Si4713 USB development board

The Si4713 development board contains a Si4713 FM transmitter chip
and is handled by the radio-usb-si4713 driver.
The board reports itself as (10c4:8244) Cygnal Integrated Products, Inc.
and misidentifies itself as a HID device in its USB interface descriptor.
This patch ignores this device as an HID device and hence loads the custom driver.

Signed-off-by: Dinesh Ram <dinesh.ram@cern.ch>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Eduardo Valentin <edubezval@gmail.com>
Acked-by: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
7a5d49a33ca4b753b66c9b288dc4af60c2b787f7 13-Dec-2013 Jiri Kosina <jkosina@suse.cz> HID: remove SIS entries from hid_have_special_driver[]

The entries are not needed, as hid-multitouch gets bound correctly
automatically by contact ID.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
954bb3da814e794f546f55449c508299a127fef8 13-Dec-2013 Emanuel Krenz <emanuelkrenz@web.de> HID: add support for SiS multitouch panel in the touch monitor LG 23ET83V

[jkosina@suse.cz: refresh to apply after SIS quirk merging]
Signed-off-by: Emanuel Krenz <emanuelkrenz@web.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
6d16e9c301290268b92ce3d48114f982e9c4b00a 02-Dec-2013 Wanlong Gao <gaowanlong@cn.fujitsu.com> HID: usbhid: fix sis quirk

Since commit 765e5fbd merged the sis quirk,
then USB_VENDOR_ID_SIS2_TOUCH remains undefined.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
4a2c94c9b6c03af61b04993340bd9559e2277de4 20-Nov-2013 Benjamin Tissoires <benjamin.tissoires@redhat.com> HID: kye: Add report fixup for Genius Manticore Keyboard

Genius Manticore Keyboard presents the same problem in its report
descriptors than Genius Gila Gaming Mouse and Genius Imperator Keyboard.
Use the same fixup.

Reported-and-tested-by: Adam Kulagowski <fidor@fidor.org>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9316e58076f47bd242c3700d6f4aa1563fdb7192 19-Nov-2013 Jiri Kosina <jkosina@suse.cz> Revert "HID: wiimote: add LEGO-wiimote VID"

This reverts commit 86b84167d4e67372376a57ea9955c5d53dae232f as it introduced a
VID/PID conflict with its original owner: hid-wiimote got
hid:b0005g*v0000054Cp00000306 added but hid-sony already has this id for the
PS3 Remote (and the ID is oficically assigned to Sony).

Revert the commit to avoid hid-sony regression. David is working on a
bluez patch to force proper ID on the wiimote.

Reported-by: David Herrmann <dh.herrmann@gmail.com>
Reported-by: Michel Kraus <mksolpa@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
e17f5d7667c5414b8f12a93ef14aae0824bd2beb 12-Nov-2013 Tristan Rice <rice@outerearth.net> HID: enable Mayflash USB Gamecube Adapter

This is a patch that adds the new Mayflash Gamecube Controller to USB adapter
(ID 1a34:f705 ACRUX) to the ACRUX driver (drivers/hid/hid-axff.c) with full
force feedback support.

Signed-off-by: Tristan Rice <rice@outerearth.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
95d50b6c5e18ff7351c5f2a6ff53afaed5f7e664 21-Oct-2013 Forest Bond <forest.bond@rapidrollout.com> HID: don't ignore eGalax/D-Wav/EETI HIDs

Certain devices with class HID, protocol None did not work with the HID
driver at one point, and as a result were bound to usbtouchscreen
instead as of commit 139ebe8 ("Input: usbtouchscreen - fix eGalax HID
ignoring"). This change was prompted by the following report:

https://lkml.org/lkml/2009/1/25/127

Unfortunately, the device mentioned in this report is no longer
available for testing.

We've recently discovered that some devices with class HID, protocol
None do not work with usbtouchscreen, but do work with usbhid. Here is
the report that made this evident:

http://comments.gmane.org/gmane.linux.kernel.input/31710

Driver binding for these devices has flip-flopped a few times, so both
of the above reports were regressions.

This situation would appear to leave us with no easy way to bind every
device to the right driver. However, in my own testing with several
devices I have not found a device with class HID that does not work with
the current HID driver. It is my belief that changes to the HID driver
since the original report have likely fixed the issue(s) that made it
unsuitable at the time, and that we should prefer it over usbtouchscreen
for these devices. In particular, HID quirks affecting these devices
were added/removed in the following commits since then:

fe6065d HID: add multi-input quirk for eGalax Touchcontroller
77933c3 Merge branch 'egalax' into for-linus
ebd11fe HID: Add quirk for eGalax touch controler.
d34c4aa HID: add no-get quirk for eGalax touch controller

This patch makes the HID driver no longer ignore eGalax/D-Wav/EETI
devices with class HID. If there are in fact devices with class HID
that still do not work with the HID driver, we will see another round of
regressions. In that case I propose we investigate why the device is
not working with the HID driver rather than re-introduce regressions for
functioning HID devices by again binding them to usbtouchscreen.

The corresponding change to usbtouchscreen will be made separately.

Signed-off-by: Forest Bond <forest.bond@rapidrollout.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
e078809df5611600965f4d3420c3256260fc3e3d 08-Nov-2013 Stefan Achatz <erazor_de@users.sourceforge.net> HID: roccat: add missing special driver declarations

Forgot two special driver declarations and sorted the list.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
556483e2ad4961bd2770e3b65f3a0eb2825d5791 08-Oct-2013 Felix Rueegg <felix.rueegg@gmail.com> HID: remove self-assignment from hid_input_report

The ternary expression will always result in a self-assignment, which is
pointless.

Signed-off-by: Felix Rueegg <felix.rueegg@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
6f3a19360545bf8c646a4d079a8c023ae06838de 28-Oct-2013 Stefan Achatz <erazor_de@users.sourceforge.net> HID: roccat: add support for Ryos MK keyboards

Added support for 3 keyboards with increasing illumination capabilities

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
f1a4914bd04911fbeaee23445112adae8977144a 21-Oct-2013 Anders F. U. Kiær <ablacksheep@gmail.com> HID: add support for LEETGION Hellion Gaming Mouse

Added id, bindings and comments for Holtek USB ID 04d9:a072
LEETGION Hellion Gaming mouse to use the same corrections of the report
descriptor as Holtek 04d9:a067. As the mouse exceed HID_MAX_USAGES at the
same offsets in the reported descriptor.
Tested on the hardware.

Signed-off-by: Anders F. U. Kiær <ablacksheep@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
a6802e008e19845fd9669511b895f7515ef9c48b 21-Oct-2013 Forest Bond <forest.bond@rapidrollout.com> HID: hid-multitouch: add support for SiS panels

Add support for SiS multitouch panels.

Signed-off-by: Forest Bond <forest.bond@rapidrollout.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
86b84167d4e67372376a57ea9955c5d53dae232f 18-Oct-2013 David Herrmann <dh.herrmann@gmail.com> HID: wiimote: add LEGO-wiimote VID

The LEGO-wiimote uses a different VID than the Nintendo ID. The device is
technically the same so add the ID.

Cc: <stable@vger.kernel.org> # 3.11+
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
ad0e669b922c7790182cf19f8015b30e23ad9499 13-Oct-2013 Nikolai Kondrashov <spbnick@gmail.com> HID: Fix unit exponent parsing again

Revert some changes done in 774638386826621c984ab6994439f474709cac5e.

Revert all changes done in hidinput_calc_abs_res as it mistakingly used
"Unit" item exponent nibbles to affect resolution value. This wasn't
breaking resolution calculation of relevant axes of any existing
devices, though, as they have only one dimension to their units and thus
1 in the corresponding nible.

Revert to reading "Unit Exponent" item value as a signed integer in
hid_parser_global to fix reading specification-complying values. This
fixes resolution calculation of devices complying to the HID standard,
including Huion, KYE, Waltop and UC-Logic graphics tablets which have
their report descriptors fixed by the drivers.

Explanations follow.

There are two "unit exponents" in HID specification and it is important
not to mix them. One is the global "Unit Exponent" item and another is
nibble values in the global "Unit" item. See 6.2.2.7 Global Items.

The "Unit Exponent" value is just a signed integer and is used to scale
the integer resolution unit values, so fractions can be expressed.

The nibbles of "Unit" value are used to select the unit system (nibble
0), and presence of a particular basic unit type in the unit formula and
its *exponent* (or power, nibbles 1-6). And yes, the latter is in two
complement and zero means absence of the unit type.

Taking the representation example of (integer) joules from the
specification:

[mass(grams)][length(centimeters)^2][time(seconds)^-2] * 10^-7

the "Unit Exponent" would be -7 (or 0xF9, if stored as a byte) and the
"Unit" value would be 0xE121, signifying:

Nibble Part Value Meaning
----- ---- ----- -------
0 System 1 SI Linear
1 Length 2 Centimeters^2
2 Mass 1 Grams
3 Time -2 Seconds^-2

To give the resolution in e.g. hundredth of joules the "Unit Exponent"
item value should have been -9.

See also the examples of "Unit" values for some common units in the same
chapter.

However, there is a common misunderstanding about the "Unit Exponent"
value encoding, where it is assumed to be stored the same as nibbles in
"Unit" item. This is most likely due to the specification being a bit
vague and overloading the term "unit exponent". This also was and still
is proliferated by the official "HID Descriptor Tool", which makes this
mistake and stores "Unit Exponent" as such. This format is also
mentioned in books such as "USB Complete" and in Microsoft's hardware
design guides.

As a result many devices currently on the market use this encoding and
so the driver should support them.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
bd04363d3990c0727b7512a79a08c68436878bb0 07-Oct-2013 Elias Vanderstuyft <Elias.vds@gmail.com> HID: logitech - lg2ff: Add IDs for Formula Vibration Feedback Wheel

Add USB IDs for Logitech Formula Vibration Feedback Wheel (046d:ca04).

The lg2ff force feedback subdriver is used for vibration and
HID_GD_MULTIAXIS is set to avoid deadzone like other Logitech wheels.

Kconfig description etc are also updated accordingly.

Signed-off-by: Elias Vanderstuyft <Elias.vds@gmail.com>
[anssi.hannula@iki.fi: added description and CCs]
Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Simon Wood <simon@mungewell.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
7da7cbbbeb60e0939fecdf9723b388136c175e5c 01-Oct-2013 Anders F. U. Kiær <ablacksheep@gmail.com> HID: add Holtek USB ID 04d9:a081 SHARKOON DarkGlider

Added id, bindings and comments for Holtek USB ID 04d9:a081 SHARKOON
DarkGlider Gaming mouse to use the same corrections of the report
descriptor as Holtek 04d9:a04a. As the mouse exceed HID_MAX_USAGES
at the same offsets in the reported descriptor.
Tested on the hardware.

Signed-off-by: Anders F. U. Kiær <ablacksheep@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
cc6b54aa54bf40b762cab45a9fc8aa81653146eb 11-Sep-2013 Benjamin Tissoires <benjamin.tissoires@redhat.com> HID: validate feature and input report details

When dealing with usage_index, be sure to properly use unsigned instead of
int to avoid overflows.

When working on report fields, always validate that their report_counts are
in bounds.
Without this, a HID device could report a malicious feature report that
could trick the driver into a heap overflow:

[ 634.885003] usb 1-1: New USB device found, idVendor=0596, idProduct=0500
...
[ 676.469629] BUG kmalloc-192 (Tainted: G W ): Redzone overwritten

CVE-2013-2897

Cc: stable@vger.kernel.org
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
331415ff16a12147d57d5c953f3a961b7ede348b 11-Sep-2013 Kees Cook <keescook@chromium.org> HID: provide a helper for validating hid reports

Many drivers need to validate the characteristics of their HID report
during initialization to avoid misusing the reports. This adds a common
helper to perform validation of the report exisitng, the field existing,
and the expected number of values within the field.

Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: stable@vger.kernel.org
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
be67b68d52fa28b9b721c47bb42068f0c1214855 28-Aug-2013 Kees Cook <keescook@chromium.org> HID: check for NULL field when setting values

Defensively check that the field to be worked on is not NULL.

Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: stable@kernel.org
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
a4be0ed39f2b1ea990804ea54e39bc42d17ed5a5 30-Aug-2013 Stefan Achatz <erazor_de@users.sourceforge.net> HID: roccat: add support for KonePureOptical v2

KonePureOptical is a KonePure with different sensor.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
43622021d2e2b82ea03d883926605bdd0525e1d1 28-Aug-2013 Kees Cook <keescook@chromium.org> HID: validate HID report id size

The "Report ID" field of a HID report is used to build indexes of
reports. The kernel's index of these is limited to 256 entries, so any
malicious device that sets a Report ID greater than 255 will trigger
memory corruption on the host:

[ 1347.156239] BUG: unable to handle kernel paging request at ffff88094958a878
[ 1347.156261] IP: [<ffffffff813e4da0>] hid_register_report+0x2a/0x8b

CVE-2013-2888

Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: stable@kernel.org
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
f961bd3516e4f699bbacff5d7f5247d6d87c59f0 22-Aug-2013 Benjamin Tissoires <benjamin.tissoires@redhat.com> HID: detect Win 8 multitouch devices in core

Detecting Win 8 multitouch devices in core allows us to set quirks
before the device is parsed through hid_hw_start().
It also simplifies the detection of those devices in hid-multitouch and
makes the handling of those devices cleaner.

As Win 8 multitouch panels are in the group multitouch and rely on a
special feature to be detected, this patch adds a bitfield in the parser.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: Henrik Rydberg <rydberg@euromail.se>
Tested-by: Srinivas Pandruvada<srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
3dc8fc083dbfeede7b63a0c07581192e97711365 22-Aug-2013 Benjamin Tissoires <benjamin.tissoires@redhat.com> HID: Use hid_parser for pre-scanning the report descriptors

The Win 8 detection is sufficiently complex to warrant use of the full
parser code, in spite of the inferred memory usage. Therefore, we can use
the existing HID parser in hid-core for hid_scan_report() by re-using the
code from hid_open_report(). hid_parser_global, hid_parser_local and
hid_parser_reserved does not have any side effects. We just need to
reimplement the MAIN_ITEM callback to have a proper parsing without side
effects.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: Henrik Rydberg <rydberg@euromail.se>
Tested-by: Srinivas Pandruvada<srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
0d4260e04d6e6c25dd091b1605c1d05c37891387 23-Aug-2013 Greg Kroah-Hartman <gregkh@linuxfoundation.org> HID: convert bus code to use dev_groups

The dev_attrs field of struct bus_type is going away soon, dev_groups
should be used instead. This converts the HID bus code to use
the correct field.

Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
cb2c9e3f92480a292670e2cc261723ce4de8059e 27-Jul-2013 Olivier Scherler <oscherler@ithink.ch> HID: Add new driver for non-compliant Xin-Mo devices.

The driver currently only supports the Dual Arcade controller.
It fixes the negative axis event values (the devices sends -2) to match the
logical axis minimum of the HID report descriptor (the report announces -1).
It is needed because hid-input discards out of bounds values.

Signed-off-by: Olivier Scherler <oscherler@ithink.ch>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
27ce405039bfe6d3f4143415c638f56a3df77dca 10-Jul-2013 Jiri Kosina <jkosina@suse.cz> HID: fix data access in implement()

implement() is setting bytes in LE data stream. In case the data is not
aligned to 64bits, it reads past the allocated buffer. It doesn't really
change any value there (it's properly bitmasked), but in case that this
read past the boundary hits a page boundary, pagefault happens when
accessing 64bits of 'x' in implement(), and kernel oopses.

This happens much more often when numbered reports are in use, as the
initial 8bit skip in the buffer makes the whole process work on values
which are not aligned to 64bits.

This problem dates back to attempts in 2005 and 2006 to make implement()
and extract() as generic as possible, and even back then the problem
was realized by Adam Kroperlin, but falsely assumed to be impossible
to cause any harm:

http://www.mail-archive.com/linux-usb-devel@lists.sourceforge.net/msg47690.html

I have made several attempts at fixing it "on the spot" directly in
implement(), but the results were horrible; the special casing for processing
last 64bit chunk and switching to different math makes it unreadable mess.

I therefore took a path to allocate a few bytes more which will never make
it into final report, but are there as a cushion for all the 64bit math
operations happening in implement() and extract().

All callers of hid_output_report() are converted at the same time to allocate
the buffer by newly introduced hid_alloc_report_buf() helper.

Bruno noticed that the whole raw_size test can be dropped as well, as
hid_alloc_report_buf() makes sure that the buffer is always of a proper
size.

Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
0adb9c2c5ed42f199cb2a630c37d18dee385fae2 15-Jul-2013 Benjamin Tissoires <benjamin.tissoires@redhat.com> HID: kye: Add report fixup for Genius Gx Imperator Keyboard

Genius Gx Imperator Keyboard presents the same problem in its report
descriptors than Genius Gila Gaming Mouse.
Use the same fixup for both.

Fixes:
https://bugzilla.redhat.com/show_bug.cgi?id=928561

Reported-and-tested-by: Honza Brazdil <jbrazdil@redhat.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
38ead6ef1d94e782bec49002ff65f2bdaddfeb15 07-Jul-2013 Paul Chavent <paul.chavent@onera.fr> HID: core: fix hid delimiter local tag parsing.

When device with the DELIMITER tag in its report descriptor is encountered
during parsing, it's mistakenly immediately refused by HID core for no
justifiable reason.

[jkosina@suse.cz: polish changelog]
Signed-off-by: Paul Chavent <paul.chavent@onera.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
3685c18e17f12438d0a83331c1b6a5b00fade7a1 02-Jul-2013 Benjamin Tissoires <benjamin.tissoires@redhat.com> HID: kye: Add report fixup for Genius Gila Gaming mouse

Genius Gila Gaming Mouse presents an obviously wrong report descriptor.
the Consumer control (report ID 3) is the following:
0x05, 0x0c, // Usage Page (Consumer Devices) 105
0x09, 0x01, // Usage (Consumer Control) 107
0xa1, 0x01, // Collection (Application) 109
0x85, 0x03, // Report ID (3) 111
0x19, 0x00, // Usage Minimum (0) 113
0x2a, 0xff, 0x7f, // Usage Maximum (32767) 115
0x15, 0x00, // Logical Minimum (0) 118
0x26, 0xff, 0x7f, // Logical Maximum (32767) 120
0x75, 0x10, // Report Size (16) 123
0x95, 0x03, // Report Count (3) 125
0x81, 0x00, // Input (Data,Arr,Abs) 127
0x75, 0x08, // Report Size (8) 129
0x95, 0x01, // Report Count (1) 131
0x81, 0x01, // Input (Cnst,Arr,Abs) 133
0xc0, // End Collection 135

So the first input whithin this report has a count of 3 but a usage range
of 32768. So this value is obviously wrong as it should not be greater than
the report count.

Fixes:
https://bugzilla.redhat.com/show_bug.cgi?id=959721

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9d9a04ee758b4c1fcc7586d065cdde7a7607e156 01-Jul-2013 Dmitry Torokhov <rydberg@euromail.se> HID: apple: Add support for the 2013 Macbook Air

This patch adds keyboard support for MacbookAir6,2 as WELLSPRING8
(0x0291, 0x0292, 0x0293). The touchpad is handled in a separate
bcm5974 patch, as usual.

Cc: stable@vger.kernel.org
Reported-and-tested-by: Brad Ford <plymouthffl@gmail.com>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
b1a1442a23776756b254b69786848a94d92445ba 03-Jun-2013 Jiri Kosina <jkosina@suse.cz> HID: core: fix reporting of raw events

hdrw->raw event can return three different return value types:

- ret < 0 indicates that the hdrv driver found an error while parsing
- ret == 0 indicates no error has been encountered, and the driver has
processed the report
- ret > 0 indicates that there was no parsing error, and the driver hasn't
processed the event.

Calling hid_report_raw_event() has to be called appropriately so that it
reflects what has been done by ->raw_event() callback, otherwise we might
updates of the in-kernel structure are lost upon arrival of the report, which
is wrong.

Reported-and-tested-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Reported-and-tested-by: Daniel Leung <daniel.leung@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
d23efc19478ac7fb517038922b920a6979cbd958 07-May-2013 Jiri Slaby <jslaby@suse.cz> HID: add driver for ELO 4000/4500

This is a driver for ELO 4000/4500 devices which report themselves as
HID devices, but do not really send HID events on touch. So we
introduce a new HID 'quirk' driver with a raw_event handler where we
take care of those events.

What we need additionally is an input_configured hook, because the
device does not mention anything about PRESSURE and TOUCH in its
report descriptor, but it actually generate those. So we set the bits
in the corresponding input_dev in that hook.

Thanks to Petr Ostadal who was willing to test the driver. The rest of
Cc's listed below had something to do with that driver over the years
in our enterprise tree.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Tested-by: Petr Ostadal <postadal@suse.cz>
Cc: Oliver Neukum <oliver@neukum.org>
Cc: Vojtech Pavlik <vojtech@suse.cz>
Cc: Egbert Eich <eich@suse.com>
Cc: Libor Pechacek <lpechacek@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
68e353fe476e7dab4644b9e7b4979b72726397ae 28-May-2013 Martin Rusko <martin.rusko@gmail.com> HID: add support for Huion 580 tablet

Add hid-huion.c with support for Huion 580 tablet, which is simple
8x5" tablet with 4000LPI resolution and 2048 levels pressure-sensitive
pen manufactured by the Chinese company Huion.

The driver fixes incorrect report descriptor sent by the device,
performs custom initialization required to switch the tablet into
its native resolution mode and inverts the in-range bit.

Signed-off-by: Martin Rusko <martin.rusko@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
40d3597fc988dbe3bc902c501f88a73391c7da0d 28-May-2013 Jiri Kosina <jkosina@suse.cz> HID: holtek: PIDs 0xa04a and 0xa067 need to be in hid_have_special_driver[]

Add device IDs of devices driven by hid-holtek-mouse to
hid_have_special_driver[].

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
f04d51404f51947d3feabf2518495ba5aa3bb2c4 27-May-2013 Colin Leitner <colin.leitner@googlemail.com> HID: driver for PS2/3 Buzz controllers

This patch adds support for PS2/3 Buzz controllers into hid-sony

It has been tested on Debian 7 with kernel version 3.10.0-rc2. Unfortunately
I can't test the patch with a regular six-axis controller myself.

Signed-off-by: Colin Leitner <colin.leitner@gmail.com>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: linux-input@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
31b9779cb292e2ea3312b15c5eda96b69edbb4da 22-May-2013 Vincent Palatin <vpalatin@chromium.org> HID: ignore Jabra speakerphones HID interface

Add a quirk to ignore Jabra speakerphone 410 and 510 devices HID
interface.
On those devices, the USB audio interface is working nicely,
but the HID interface is not working with the kernel usbhid driver,
and it requires a specific userspace program.
We could unbind it from userspace but just attaching the usbhid driver has
sometimes nasty effects:
either confusing the device state machine or triggering a storm of volume key
events making eventual sound UI blinking like crazy.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1deb9d341d475ff84262e927d6c0e36fecb9942e 06-May-2013 Jiri Kosina <jkosina@suse.cz> HID: debug: fix RCU preemption issue

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>
c1e0ac192b48b37f31801c17534ab3d2a9282d84 01-May-2013 Fernando Luis Vázquez Cao <fernando_b1@lab.ntt.co.jp> HID: reintroduce fix-up for certain Sony RF receivers

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>
2353f2bea307390e015493118e425152b8a5a431 17-Apr-2013 Jiri Kosina <jkosina@suse.cz> HID: protect hid_debug_list

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>
a5f04b9df1113e0c16271afe5e43028f0d763f13 17-Apr-2013 Benjamin Tissoires <benjamin.tissoires@redhat.com> HID: debug: break out hid_dump_report() into hid-debug

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>
89759e20d9571e0496c7e12fc4a3ce2a5233f18e 29-Apr-2013 Adam Jiang <jiang.adam@gmail.com> HID: Add PID for Japanese version of NE4K keyboard

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>
9a4a5574ce427c364d81746fc7fb82d86b5f1a7e 17-Apr-2013 Benjamin Tissoires <benjamin.tissoires@redhat.com> HID: appleir: add support for Apple ir devices

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>
a33042fafdda4c4fb11981c2db95df86682e1083 02-Apr-2013 David Herrmann <dh.herrmann@gmail.com> HID: wiimote: add 2nd generation Wii Remote IDs

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>
5b4617d82020addf244c8c5206270e49ef9933d6 27-Mar-2013 Alexey Klimov <klimov.linux@gmail.com> HID: fix Masterkit MA901 hid quirks

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>
8936aa31cd5fd0bea828416a3c07efd303269a45 10-Mar-2013 Stefan Achatz <erazor_de@users.sourceforge.net> HID: roccat: add support for Roccat Kone Pure gaming mouse

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>
c849a6143bec520aff2a6646518b0d041402428b 18-Feb-2013 Andrew de los Reyes <adlr@chromium.org> HID: Separate struct hid_device's driver_lock into two locks.

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>
6399f335c2c5fb9c244bbb2b8a437498d260bed7 19-Feb-2013 Mika Westerberg <mika.westerberg@linux.intel.com> HID: make sensor autodetection independent of underlying bus

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>
30ba2fbde1840db440915491cdde235b72a11384 22-Jan-2013 Vivien Didelot <vivien.didelot@savoirfairelinux.com> HID: add ThingM blink(1) USB RGB LED support

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>
30b6b7d8d340f41d11eb75e5238d33dbc438fde4 13-Feb-2013 Ian Abbott <abbotti@mev.co.uk> HID: blacklist Velleman data acquisition boards

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>
fa79f5ec534eaae59a7cb2ca208178f03f9b75ec 10-Feb-2013 Mika Westerberg <mika.westerberg@linux.intel.com> HID: extend autodetect to handle I2C sensors as well

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>
6d85d037d6247b06e1060b5e5ad0e4854a7d1e3b 31-Jan-2013 Benjamin Tissoires <benjamin.tissoires@gmail.com> HID: core: add "report" hook, called once the report has been parsed

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>
75dbb9530f73da521b871ba3c4bd32f301a62635 31-Jan-2013 Simon Wood <simon@mungewell.org> USB: HID: SRW-S1 Gaming Wheel Driver

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>
aaca9cc0165f06a037a1e07770f6b379ff496288 17-Jan-2013 Michael Karcher <kernel@mkarcher.dialup.fu-berlin.de> HID: Support Jess/Saitek Color Rumble Pad

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>
a464918419f94a0043d2f549d6defb4c3f69f68a 15-Jan-2013 Fernando Luis Vázquez Cao <fernando_b1@lab.ntt.co.jp> HID: add support for Sony RF receiver with USB product id 0x0374

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>
0322bd3980b3ebf7dde8474e22614cb443d6479a 12-Nov-2012 Alexey Klimov <klimov.linux@gmail.com> [hid] usb hid quirks for Masterkit MA901 usb radio

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>
68fd32b8228a62ca7f46ed64da8267daad29480b 09-Dec-2012 Alexander Holler <holler@ahsoftware.de> Revert "HID: sensors: add to special driver list"

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>
83499b52c61f50292f0aae36499de8a8fc3e37c3 09-Dec-2012 Alexander Holler <holler@ahsoftware.de> HID: sensors: autodetect USB HID sensor hubs

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>
4529eefad087f97b33c0f31984d924b1f15d7bae 06-Dec-2012 Lamarque V. Souza <lamarque@gmail.com> HID: hidp: fallback to input session properly if hid is blacklisted

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>
f9af7b9edccb87d4d80b58687ab63e58f3b64c4c 02-Dec-2012 Ben Hutchings <ben@decadent.org.uk> HID: Add Apple wireless keyboard 2011 ANSI to special driver list

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>
f262d1fa2c651a5e2f92b6aee8779597631cd5d4 14-Nov-2012 Benjamin Tissoires <benjamin.tissoires@gmail.com> HID: add usage_index in struct hid_usage.

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>
774638386826621c984ab6994439f474709cac5e 14-Nov-2012 Benjamin Tissoires <benjamin.tissoires@gmail.com> HID: fix unit exponent parsing

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>
729b814acec20db66fc891b5392cb653ad6598ef 06-Nov-2012 Forest Bond <forest.bond@rapidrollout.com> HID: Ignore D-WAV/eGalax devices handled by usbtouchscreen

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>
4ddfe0289bd4622a2a84747ab90c0614da4673e0 31-Oct-2012 Bastien Nocera <hadess@hadess.net> HID: Add driver for ION iCade

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>
8d80da90f53d37cf6caefc61353e1cc3a145b9e0 30-Oct-2012 Dirk Hohndel <dirk@hohndel.org> HID: Add support for the MacBook Pro 10,2 keyboard / touchpad

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>
4424f616e48e0a48ac31de8d223ba1bdb46a84f1 16-Oct-2012 Stefan Achatz <erazor_de@users.sourceforge.net> HID: roccat: add support for Roccat Lua

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>
5844c1cdb630b537a2ecdf74dab2985e51dc1bd9 25-Sep-2012 David Dillow <dave@thedillows.org> HID: Add support for Sony PS3 BD Remote Control

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>
86e6b77eb7cf9ca2e9c7092b4dfd588f0a3307b6 20-Sep-2012 Kevin Daughtridge <kevin@kdau.com> HID: keep dev_rdesc unmodified and use it for comparisons

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>
ca9bbdcc89ecc1018215ec7f7e881840d40404c4 17-Sep-2012 Stefan Achatz <erazor_de@users.sourceforge.net> HID: roccat: conditional blacklisting of Roccat modules

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>
a6fbaacfb990580c080e4fad6623b7108f5a0507 17-Sep-2012 Sachin Kamat <sachin.kamat@linaro.org> HID: Fix return values in open_collection()

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>
aad932e75c573aec37a0652ff1c27a975d8d5373 30-Aug-2012 Andres Freund <andres@anarazel.de> HID: tpkbd: work even if the new Lenovo Keyboard driver is not configured

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>
c8147d9ea19bfe7d8e569351bc7239e118dd6997 05-Sep-2012 srinivas pandruvada <srinivas.pandruvada@intel.com> HID: sensors: add to special driver list

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>
00315e4f5343bf8b0858f840884f6e19464698c7 02-Sep-2012 Jiri Kosina <jkosina@suse.cz> HID: update hid_have_special_driver[] explanation

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>
9bfc8da00b1e74f55a52cc06a0d364f1f7f61ed8 01-Sep-2012 Henrik Rydberg <rydberg@euromail.se> HID: Only dump input if someone is listening

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>
eb4e426a480ce99004134ee22e6a3b7ab88f979c 26-Aug-2012 Nikolai Kondrashov <spbnick@gmail.com> HID: uclogic: Add support for UC-Logic TWHA60

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>
53c84983549230495156d7da666cd1acdb9c9015 22-Aug-2012 Simon Farnsworth <simon.farnsworth@onelan.co.uk> HID: Remove QUANTA from special drivers list

This QUANTA device is driven by the generic hid-multitouch.ko driver, and
therefore shouldn't be in the special drivers list.

This has been an oversight in 4fa3a58 ("HID: hid-multitouch: Switch to
device groups").

Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
23408f95fa92483527de3206ebeb55c37e0f679c 05-Aug-2012 Marek Vasut <marex@denx.de> HID: Bump maximum global item tag report size to 128 bytes

The Freescale i.MX28 BootROM USB recovery mode implements the USB HID
protocol, yet the global item tag report size is 128. Linux checks if
this is 96 as of now, see [1]. This causes Linux to refuse to communicate
with this device, making it impossible to use the recovery mode.

This is not a standard HID device per se, but rather a software emulation
implemented within the BootROM code and realized through USB OTG-capable
port switched to device mode present on the device.

Previous attempt to discuss this issue dates back to 2011, see [2]. There
has been not much response. Also noteworthy is the [3], where there seems
to be a pointing device that has issue similar to this one.

The tool making use of the USB recovery mode is available at [4].

[1] http://comments.gmane.org/gmane.linux.kernel.input/22328
[2] http://www.spinics.net/lists/linux-usb/msg43463.html
[3] https://bbs.archlinux.org/viewtopic.php?pid=1141340
[4] http://git.bfuser.eu/?p=marex/mxsldr.git;a=summary

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chen Peter <B29397@freescale.com>
Cc: Greg KH <greg@kroah.com>
Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8e2ce73e932b629c3e12546e5fffac7ee54d0093 21-May-2012 Hans de Goede <hdegoede@redhat.com> [media] radio-shark: New driver for the Griffin radioSHARK USB radio receiver

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2d8767bb421574dfcf48e4be0751ce7d8f73d5d7 23-Jul-2012 Cyrus Lien <cyrus.lien@canonical.com> HID: add ASUS AIO keyboard model AK1D

Add Asus All-In-One PC keyboard model AK1D.

BugLink: https://bugs.launchpad.net/bugs/1027789

Signed-off-by: Cyrus Lien <cyrus.lien@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
76c9d8fe2c7fc34ffc387d8022c5828d6ff9df48 22-Jul-2012 Lionel Vaux <lionel.vaux@free.fr> HID: add support for Cypress barcode scanner 04B4:ED81

Add yet another device to the list of Cypress barcode scanners
needing the CP_RDESC_SWAPPED_MIN_MAX quirk.

Signed-off-by: Lionel Vaux (iouri) <lionel.vaux@free.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
4bc19f62c57b8ccdd1c48e875752bd59abfb7aae 20-Jul-2012 David Herrmann <dh.herrmann@googlemail.com> HID: Allow drivers to be their own listener

hid-picolcd and hid-wiimote do not allow any of hidinput, hiddev or hidraw
to claim the device but still want to remain on the bus. Hence, if a
driver uses the raw_event callback but no other listener claimed the
device, we still leave it on the bus as the driver handles everything by
itself. It thus becomes its own listener.

Under some circumstances (eg., hidinput_connect() fails and raw_event set)
a device may be left on the bus even though it requires external
listeners. But then if hidinput_connect() fails there are bigger issues
than a device that is left unhandled. So we can safely use this heuristic
to avoid adding another flag for special devices like hid-picolcd and
hid-wiimote.

This also removes the ugly hack from hid-picolcd as this is no longer
required.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Acked-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
b94e3c94aae04a911d61f620f4ff5b575fc196ad 28-Jun-2012 Matthieu CASTET <matthieu.castet@parrot.com> HID: hid-core: optimize in case of hidraw

When using hidraw, hid buffer can be big and take lot's of
time to process (interrupt) kernel context.
Don't try to parse report if we are only interrested in hidraw.

Also don't prepare data for debug stuff if no debugfs file
are opened.

Signed-off-by: Matthieu CASTET <matthieu.castet@parrot.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
ff9bf5a2eff6e726406bcc097e8a578822d38859 06-Jul-2012 Tom Harwood <tomharwood@fastmail.fm> HID: Add driver for Holtek based keyboards with broken HID

Corrects two HID descriptor issues, which prevent some Holtek based
(USB ID 04d9:a055) keyboards from working. The error when not using
the driver is: generic-usb: probe ... failed with error -22 .

Signed-off-by: Tom Harwood <tomharwood@fastmail.fm>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
3ffb62cb9ac2430c2504c6ff9727d0f2476ef0bd 11-Jul-2012 Yuri Khan <yurivkhan@gmail.com> Input: xpad - handle all variations of Mad Catz Beat Pad

The device should be handled by xpad driver instead of generic HID driver.

Signed-off-by: Yuri Khan <yurivkhan@gmail.com>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
b2e6ad7dfe26aac5bf136962d0b11d180b820d44 10-Jul-2012 Ryan Bourgeois <bluedragonx@gmail.com> HID: add support for 2012 MacBook Pro Retina

Add support for the 15'' MacBook Pro Retina. The keyboard is
the same as recent models.

The patch needs to be synchronized with the bcm5974 patch for
the trackpad - as usual.

Patch originally written by clipcarl (forums.opensuse.org).

[rydberg@euromail.se: Amended mouse ignore lines]
Signed-off-by: Ryan Bourgeois <bluedragonx@gmail.com>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
6a2a6390cf098b899a30146ef5c1fb85c9fefb3c 20-May-2012 Stefan Achatz <erazor_de@users.sourceforge.net> HID: roccat: add support for Roccat Savu

This patch adds rupport for Roccat Savu gaming mouse.

In comparison to the other Roccat modules I tried to move even more
functionality to userland.

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>
110301833d6f6c74e4da3a31fc3d327eb3436812 15-May-2012 Hans de Goede <hdegoede@redhat.com> [media] radio/si470x: Add support for the Axentia ALERT FM USB Receiver

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
c1dcad2d32d0252e8a3023d20311b52a187ecda3 15-Feb-2012 Bernhard Seibold <mail@bernhard-seibold.de> HID: Driver for Lenovo Keyboard with Trackpoint

This driver for the "Lenovo ThinkPad USB Keyboard with Trackpoint" supports
setting various device attributes, controlling mute and microphone mute
LEDs and enables use of the microphone mute key.

Signed-off-by: Bernhard Seibold <mail@bernhard-seibold.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
d1257081aecf44455fcab8675f1d54e8b242faa1 14-May-2012 Nikolai Kondrashov <spbnick@gmail.com> HID: uclogic: Add support for UC-Logic TWHL850

Add support for UC-Logic Wireless Tablet TWHL850.
It is known to be sold as Genius MousePen M508W.

This tablet has a bug in the default (compatibility) mode which is used in this
driver: frame button assignments are mixed up. This is to be fixed with a driver
supporting the vendor-specific protocol.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
bb2e19769533cc7c11257c67690358473099be9a 14-May-2012 Jiri Kosina <jkosina@suse.cz> HID: explain the signed/unsigned handling in hid_add_field()

Put a comment that clarifies the condition that handles both signed
and unsigned case for logical min/max in hid_add_field().

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
0cd516c246759bb57b69d836b625d8f8c566e8ca 11-May-2012 srinivas pandruvada <srinivas.pandruvada@intel.com> HID: handle logical min/max signedness properly in parser

When logical maximum is 0xffffffff, the parser fails even if
logical minimum is more than 0.

By HID specification this is a valid combination.

Signed-off-by: srinivas pandruvada <srinivas.pandruvada@intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
4fa3a5837b8427faab9b064b1948795eb77b9f8d 01-May-2012 Henrik Rydberg <rydberg@euromail.se> HID: hid-multitouch: Switch to device groups

Switch the driver over to device group handling. By adding the
HID_GROUP_MULTITOUCH group to hid-core, hid-generic will no longer
match multitouch devices. By adding the HID_GROUP_MULTITOUCH entry to
the device list, hid-multitouch will match all unknown multitouch
devices, and udev will automatically load the module.

Since HID_QUIRK_MULTITOUCH never gets set, the special quirks handling
can be removed. Since all HID MT devices have HID_DG_CONTACTID, they
can be removed from the hid_have_special_driver list.

With this patch, the unknown device ids are no longer NULL, so the code
is modified to check for the generic entry instead.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
070748ed0b52399858a5967026a452bbb903a64c 23-Apr-2012 Henrik Rydberg <rydberg@euromail.se> HID: Create a generic device group

Devices that do not have a special driver are handled by the generic
driver. This patch does the same thing using device groups; Instead of
forcing a particular driver, the appropriate driver is picked up by
udev. As a consequence, one can now move a device from generic to
specific handling by a simple rebind. By adding a new device id to the
generic driver, the same thing can be done in reverse.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
7431fb767d896b7f0048039f2e17707ea057d35a 23-Apr-2012 Henrik Rydberg <rydberg@euromail.se> HID: Allow bus wildcard matching

Most HID drivers do not need to know what bus driver is in use.
A generic group driver can drive any hid device, and the device
list should not need to be duplicated for each new bus.

This patch adds wildcard matching to the HID bus, simplifying device
list handling for group drivers.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
734c660931095ae165c0db6ff60558fc4173bfd0 23-Apr-2012 Henrik Rydberg <rydberg@euromail.se> HID: Scan the device for group info before adding it

In order to allow the report descriptor to influence the hid device
properties, one needs to parse the descriptor early, without reference
to any driver. Scan the descriptor for group information during device
add, before the device has been broadcast to userland. The device
modalias will contain group information which can be used to
differentiate between modules. For starters, just handle the generic
group.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
4d53b8012f1f01ddb3f24db2031b042bb4cbd0d0 23-Apr-2012 Henrik Rydberg <rydberg@euromail.se> HID: Add device group to modalias

HID devices are only partially presented to userland. Hotplugged
devices emit events containing a modalias based on the basic bus,
vendor and product entities. However, in practise a hid device can
depend on details such as a single usb interface or a particular item
in a report descriptor.

This patch adds a device group to the hid device id, and broadcasts it
using uevent and the device modalias. The module alias generation is
modified to match. As a consequence, a device with a non-zero group
will be processed by the corresponding group driver instead of by the
generic hid driver.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
a7197c2e4120ce40e7e3f5580336b9a1dc791220 22-Apr-2012 Henrik Rydberg <rydberg@euromail.se> HID: Handle driver-specific device descriptor in core

The low-level driver can read the report descriptor, but it cannot
determine driver-specific changes to it. The hid core can fixup
and parse the report descriptor during driver attach, but does
not have direct access to the descriptor when doing so.

To be able to handle attach/detach of hid drivers properly,
a semantic change to hid_parse_report() is needed. This function has
been used in two ways, both as descriptor reader in the ll drivers and
as a parsor in the probe of the drivers. This patch splits the usage
by introducing hid_open_report(), and modifies the hid_parse() macro
to call hid_open_report() instead. The only usage of hid_parse_report()
is then to read and store the device descriptor. As a consequence, we
can handle the report fixups automatically inside the hid core.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Tested-by: Nikolai Kondrashov <spbnick@gmail.com>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
b6787242f32700377d3da3b8d788ab3928bab849 27-Apr-2012 Jiri Kosina <jkosina@suse.cz> HID: hidraw: add proper error handling to raw event reporting

If kmemdup() in hidraw_report_event() fails, we are not propagating
this fact properly.

Let hidraw_report_event() and hid_report_raw_event() return an error
value to the caller.

Reported-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9ed326951806c424b42dcf2e1125e25a98fb13d1 20-Apr-2012 Jiri Kosina <jkosina@suse.cz> HID: multitouch: Add support for Baanto touchscreen

Reported-by: Tvrtko Ursulin <tvrtko.ursulin@onelan.co.uk>
Tested-by: Tvrtko Ursulin <tvrtko.ursulin@onelan.co.uk>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
212da74da783ba9d4459799f4aaecd5de217a312 11-Apr-2012 Josenivaldo Benito Junior <jrbenito@benito.qsl.br> HID: Aureal Remote Control Device Driver

Devices like Aureal Cy se W-01RN USB_V3.1 and some derived hardware
have a bogus HID Report Descriptor. According to that report descriptor,
the maximum logical value for key events is 1 and not 101 (101 keys).

This quirk fixes this wrong Report Descriptor.

Signed-off-by: Josenivaldo Benito Junior <jrbenito@benito.qsl.br>
Signed-off-by: Franco Catrin <fcatrin@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
d2ee4dd9a4d68543bddddb69d38cba51b4373e6b 20-Mar-2012 Nikolai Kondrashov <spbnick@gmail.com> HID: waltop: Add support for Sirius tablet

Add support for Waltop Sirius Battery Free Tablet. VisTablet Muse and Princeton
PTB-S1BK are other possible names of this tablet.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
4d5df5d11e8027c11c1079205757527cbaade62d 19-Mar-2012 Andreas Nielsen <eas@svep.se> HID: multitouch: add PID for Fructel product

Adds multitouch support for the Gametel Android game controller.

The multitouch events are emulated by the Gametel device. Each physical button
is configured to generate a MT event on a specific coordinate. This seems to be
the only way for us to support Android games that doesn't support HID gamepads.
It is possible to inject MT events at Android level, but this requires root on
the phone.

Signed-off-by: Andreas Nielsen <eas@svep.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
740363fb75f421f9a00a183f673b477c3029b572 13-Mar-2012 Jiri Kosina <jkosina@suse.cz> HID: tivo: add support for BT-version (0x1200)

Add support for BT-driven configuration of the TiVo remote.

Reported-by: Joshua Dillon <jvdillon@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8d179a9ef25a64b451e2bbd46f6a6c16c6a72eb1 06-Mar-2012 Benjamin Tissoires <benjamin.tissoires@enac.fr> HID: handle all multitouch devices through hid-multitouch

When the quirk HID_QUIRK_MULTITOUCH is present and when hid-multitouch
is loaded, let's pass the device to hid-multitouch even if it has
not been registered in hid-multitouch.

If any other driver wants to take precedence over hid-multitouch,
the usual way of adding it to hid_have_special_driver will work as
the quirk HID_QUIRK_MULTITOUCH won't be set by the generic hid layer.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
6b1968d5b6e223237bca98879f31c5616b3b325f 09-Mar-2012 Jiri Kosina <jkosina@suse.cz> HID: make it possible to force hid-core claim the device

Introduce 'hid_ignore_special_drivers' module parameter that makes hid-core
claim the device even if it's listed in hid_have_special_driver[]. This
is useful mostly for debugging purposes and specialized initrds, where
all the hid drivers are not avaiable.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
fd1d152583e6ce02b47cb7315295ab58014aa26d 06-Mar-2012 Benjamin Tissoires <benjamin.tissoires@enac.fr> HID: multitouch: add more eGalax devices

This is a list of devices that should be handled by hid-multitouch. They all
present the HID usage "Contact ID" and won't be handled by hid-input. Some of
them have _not_ been tested (though I have their report descriptors), but I've
been guaranted by eeti that they follow the same protocol. The tested ones are
also blacklisted in hid-core.c.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Acked-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
a786e83cb088f1afcd1d55e44efd4b89d78c32d1 06-Mar-2012 Nikolai Kondrashov <spbnick@gmail.com> HID: waltop: Add support for tablet with PID 0038

Add support for unknown Waltop tablet with product ID 0x0038.
This tablet is sold as Genius G-Pen F509.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
22ca20b250f5c9672a53b34f032f43dd2c4a4aaf 28-Feb-2012 Nikolai Kondrashov <spbnick@gmail.com> HID: kye: Add support for 3 tablets

Add support for three KYE tablets: EasyPen i405X, MousePen i608X, EasyPen M610X.
Update Kconfig entry accordingly, remove EXPERT dependency.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1e93674a8ea169320950c5e6d1fa29a20b534e60 22-Feb-2012 Andreas Hübner <andreas@k4n.de> HID: add new driver for non-compliant Saitek devices

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 <andreas@k4n.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
0944e964b23baee17d40abbd314695289380c2fd 13-Feb-2012 Konstantin Khlebnikov <khlebnikov@openvz.org> HID: use generic driver for Logitech Unifying receivers if !CONFIG_HID_LOGITECH_DJ

Before commit 534a7b8e1 ("HID: Add full support for Logitech Unifying
receivers") Logitech Unifying receiver can work as generic device
without special driver, after that commit these devices does not works
without special driver.

After this patch they will use generic driver if special driver is disabled.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
42fc04e5f8190a6cae7aa5bf5b64fb5bc32a034f 18-Feb-2012 Sean Young <sean@mess.org> HID: sjoy: Add device ID for Super Joy Box 3

Also correct the quirks for the Super Joy Box 3 Pro and Super Dual Box.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2258e863b451be319d374f89688000ab858b13c3 14-Feb-2012 Denis Kovalev <Denis.Kovalev@dataart.com> HID: multitouch: add support of Panasonic multitouch panels

While at it, also fix some minor codingstyle issues.

Signed-off-by: Denis Kovalev <Denis.Kovalev@dataart.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
65dd3b699f38b9252e5e1aa2ad7fb37ef9c61f37 13-Jan-2012 Hans Verkuil <hans.verkuil@cisco.com> [media] hid-core: ignore the Keene FM transmitter

The Keene FM transmitter USB device has the same USB ID as
the Logitech AudioHub Speaker, but it should ignore the hid.
Check if the name is that of the Keene device.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
4fdc18d15151f3e7cc43070ec8d13570431b5abc 06-Feb-2012 Nikolai Kondrashov <spbnick@gmail.com> HID: waltop: Add support for Waltop Q Pad

Add support for Waltop Q Pad by fixing its report descriptor.

This tablet is also sold as Aiptek HyperPen Mini. Other possible names
include: NGS Flexi Style, VisTablet PenPad, iVistaTablet Q Flex Pad, Bravod
Q-PD65-S.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
44ea35c138d400b3aeeb2a5317edd4634e6823e3 14-Oct-2011 Jarod Wilson <jarod@redhat.com> 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>
8491ee1093c476ea3a9a19ab8593d8531cab40f7 03-Feb-2012 Jan Steinhoff <mail@jan-steinhoff.de> Input: add Synaptics USB device driver

This patch adds a driver for Synaptics USB touchpad or pointing stick
devices. These USB devices emulate an USB mouse by default, so one can
also use the usbhid driver. However, in combination with special user
space drivers this kernel driver allows one to customize the behaviour
of the device.

An extended version of this driver with support for the cPad background
display can be found at
<http://jan-steinhoff.de/linux/synaptics-usb.html>.

Signed-off-by: Jan Steinhoff <mail@jan-steinhoff.de>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
3596bb929f2abd3433c2eaa5755fad48ac207af1 02-Feb-2012 Keng-Yu Lin <kengyu@canonical.com> HID: add extra hotkeys in Asus AIO keyboards

The Asus All-In-One PC has a wireless keyboard with wifi toggle,
brightness up, brightness down and display off hotkeys.

This patch adds suppoort for these hotkeys.

Signed-off-by: Keng-Yu Lin <kengyu@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
cef9bc56e1e944afd11f96de569657117a138c6d 24-Jan-2012 Alan Stern <stern@rowland.harvard.edu> Dynamic ID addition doesn't need get_driver()

As part of the removal of get_driver()/put_driver(), this patch
(as1511) changes all the places that add dynamic IDs for drivers.
Since these additions are done by writing to the drivers' sysfs
attribute files, and the attributes are removed when the drivers are
unregistered, there is no reason to take an extra reference to the
drivers.

The one exception is the pci-stub driver, which calls pci_add_dynid()
as part of its registration. But again, there's no reason to take an
extra reference here, because the driver can't be unloaded while it is
being registered.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Dmitry Torokhov <dmitry.torokhov@gmail.com>
CC: Jiri Kosina <jkosina@suse.cz>
CC: Jesse Barnes <jbarnes@virtuousgeek.org>
CC: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
bbc21cfd55858d7c3e55bfaa91fa934b0b13ad4d 02-Dec-2011 Jeremy Fitzhardinge <jeremy@goop.org> hid-input/battery: add quirks for battery

Some devices always report percentage, despite having 0/255 as their
min/max, so add a quirk for them.

Signed-off-by: Jeremy Fitzhardinge <jeremy@goop.org>
11576c6114c3b6505aea2e0c988bedb856a0e20c 05-Jan-2012 Masatoshi Hoshikawa <hoshikawa@xiroku.com> HID: hid-multitouch: add support 9 new Xiroku devices

This patch adds support for the Xiroku Inc. panels (SPX/MPX/CSR/etc.).

Signed-off-by: Masatoshi Hoshikawa <hoshikawa@xiroku.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
b7ea95ff9baab144dacdc30d752307938c5ab6bf 15-Dec-2011 Aaron Tian <aaron_tian@pixart.com.tw> HID: multitouch: support PixArt optical touch screen

This patch modifies hid-multitouch driver for supporting PixArt optical touch
screen. Because of the device does not have to set initial report, we apply
"HID_QUIRK_NO_INIT_REPORTS" quirk and add the device into hid_blacklist[]

Signed-off-by: Aaron Tian <aaron_tian@pixart.com.tw>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8c3d52fc393b5be8b14dad67053ed83195f0d002 15-Dec-2011 Jiri Kosina <jkosina@suse.cz> HID: make parser more verbose about parsing errors by default

Most of the parsing errors (typically resulting in device not being claimed
by HID subsystem at all) are reported only in debugging mode, which makes
root-causing problems with buggy devices unnecessarily more difficult.

Convert reporting of important HID report descriptor parsing errors to
be reported through hid_err() / hid_warn() instead of dbg_hid().

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
d41c2a7011dffc60571eab8dc4e2a297ef106f44 24-Nov-2011 Stefan Achatz <erazor_de@users.sourceforge.net> HID: roccat: Add support for Isku keyboard

This patch adds support for Roccat Isku keyboard.
Userland tools can 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>
545803651da8dde248eeb8ce3ed1e547e9e4ac0a 29-Nov-2011 Benjamin Tissoires <benjamin.tissoires@enac.fr> HID: hid-multitouch: add support for new Hanvon panels

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Acked-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
b1807719f6acdf18cc4bde3b5400d05d77801494 16-Nov-2011 Benjamin Tissoires <benjamin.tissoires@gmail.com> HID: Correct General touch PID

Genera Touch told us that 0001 is their single point device
and 0003 is the multitouch one. Apparently, we made the tests
someone having a prototype, and not the final product.
They said it should be safe to do the switch.

This partially reverts 5572da0 ("HID: hid-mulitouch: add support
for the 'Sensing Win7-TwoFinger'").

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
bb9ff21072043634f147c05ac65dbf8185d4af6d 23-Nov-2011 Marek Vasut <marek.vasut@gmail.com> HID: multitouch: Add egalax ID for Acer Iconia W500

This patch adds USB ID for the touchpanel in Acer Iconia W500. The panel
supports up to five fingers, therefore the need for a new addition of panel
types.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
e36f690b37945e0a9bb1554e1546eeec93f7d1f6 23-Nov-2011 Benjamin Tissoires <benjamin.tissoires@enac.fr> HID: multitouch: cleanup with eGalax PID definitions

This is just a renaming of USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH{N}
to USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_{PID} to handle more eGalax
devices.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1fd8f047490dd0ec4e4db710fcbc1bd4798d944c 23-Nov-2011 Chris Bagwell <chris@cnpbagwell.com> HID: hid-multitouch - add another eGalax id

This allows ASUS Eee Slate touchscreens to work.

Signed-off-by: Chris Bagwell <chris@cnpbagwell.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
789aaa2ee0af1a0fba4c73f1874ad524d7be0771 20-Nov-2011 Dan Delaney <drdelaney@loclhst.com> HID/usbled: add support for Dream Cheeky DL100B Mailbox Friends Alert

Adding support for Dream Cheeky DL1800B Friend Alert device.

Signed-off-by: Dan Delaney <drdelaney@loclhst.com>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
e46e927b9b7e8d95526e69322855243882b7e1a3 07-Nov-2011 Chase Douglas <chase.douglas@canonical.com> HID: bump maximum global item tag report size to 96 bytes

This allows the latest N-Trig devices to function properly.

BugLink: https://bugs.launchpad.net/bugs/724831

Cc: stable@vger.kernel.org
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
78761ff9bc4e944e0b4e5df1e7eedcfdbb1a9a1a 05-Nov-2011 Przemo Firszt <przemo@firszt.eu> HID: wacom: Initial driver for Wacom Intuos4 Wireless (Bluetooth)

This is very basic driver for Wacom Intuos4 Wireless tablet. It supports only
position, pressure and pen buttons. More features will be added in the future.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
Acked-by: Ping Cheng <pinglinux@gmail.com>
Reviewed-by: Chris Bagwell <chris@cnpbagwell.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
ad734bc1565364f9e4b70888d3ce5743b3c1030a 28-Oct-2011 Andreas Krist <andreas.krist@gmail.com> HID: hid-apple: add device ID of another wireless aluminium

I've recently bought a Apple wireless aluminum keyboard (model 2011) which is
not yet supported by the kernel - it seems they just changed the device id.
After applying the attached patch, the device is fully functional.

Signed-off-by: Andreas Krist <andreas.krist@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
213f9da80533940560bef8fa43b10c590895459c 22-Oct-2011 Gökçen Eraslan <gokcen@pardus.org.tr> HID: Add device IDs for Macbook Pro 8 keyboards

This patch adds keyboard support for Macbook Pro 8 models which has
WELLSPRING5A model name and 0x0252, 0x0253 and 0x0254 USB IDs. Trackpad
support for those models are added to bcm5974 in
c331eb580a0a7906c0cdb8dbae3cfe99e3c0e555 ("Input: bcm5974 - Add
support for newer MacBookPro8,2).

Signed-off-by: Gökçen Eraslan <gokcen@pardus.org.tr>
Acked-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1bcc20675a1ac1ba47eaa201e02a89b0508e17b2 20-Oct-2011 Sean Young <sean@mess.org> HID: Add device IDs for more SJOY adapters

Support the following models: Super Joy Box 3 Pro, Super Dual Box Pro
and Super Joy Box 5 Pro. These models have support for pressure
sensitive buttons and they can force the controller to either digital
or analog mode, both of which are not supported yet.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
f6a04605f303852963f3f357d19b967aa83c172f 15-Oct-2011 Terry Lambert <tlambert@chromium.org> HID: support primax keyboards violating USB HID spec

Primax keyboards with the issue this driver addresses report modifier
keys as in band key events instead of as out of band modifier bits,
resulting in the modifier keys generating key up events immediately
before the keys they are intended to modify. This driver rewrites
the raw report data from such keyboards into USB HID 1.11 compliant
report data. It only matches the USB vendor and product IDs for the
keyboard it has been tested on. Since there are several keyboards,
notably a number of laptops and folding USB keyboards known to have
similar unresolved problem reports, the list is expected to grow.

Signed-off-by: Terry Lambert <tlambert@chromium.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
4b086910ad1b889ddf3ef5598caec03178cf2bb4 04-Oct-2011 Jiri Kosina <jkosina@suse.cz> HID: MacbookAir4,1 and MacbookAir4,2 need entry in hid_mouse_ignore_list[]

The respective mouse devices are already supported by bcm5974. Now that
Nobuhiro Iwamatsu added support for keyboard to hid-apple driver, we need
to ignore the mouse interfaces of these so that they can still be properly
claimed by bcm5974 driver.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
d762cc290b9f17e346f4297fd5984b70ce71ef66 01-Oct-2011 Nobuhiro Iwamatsu <iwamatsu@nigauri.org> HID: Add support MacbookAir 4,1 keyboard

Added USB device IDs and keyboard map for MacBookAir 4,1 keyboard.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
b77c3920e90e96103e4f41442999402925fe5f73 21-Sep-2011 Benjamin Tissoires <benjamin.tissoires@gmail.com> HID: add autodetection of multitouch devices

As mentioned by http://www.microsoft.com/whdc/device/input/DigitizerDrvs_touch.mspx
multitouch devices are those that have the input report HID_CONTACTID.

This patch detects this and unloads the generic-usb driver.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
e00ddc9b8f978ffbc6c212f780a2bb83aafe2fbd 10-Sep-2011 Michal Malý <madcatxster@gmail.com> HID: "hid-logitech" driver with Logitech Driving Force GT

There's been a small oversight when adding support for Logitech Driving Force
GT. Entry in hid-core was missing so the generic driver instead of hid-logitech
was being used.

Signed-off-by: Michal Malý <madcatxster@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
a062cc5a76fa1d12f0821e56e3746cad2dc2fc65 17-Sep-2011 Stephane Chatty <chatty@lii-enac.fr> HID: hid-multitouch: add support for the IDEACOM 6650 chip

The IDEACOM 6650 multitouch chip, present in various all-in-one computers,
uses the serial version of the HID multitouch protocol. No existing class
supports this.

In principle, the new MT_CLS_SERIAL should work for other
serial panels as well, perhaps including some eGalax panels.

Signed-off-by: Stephane Chatty <chatty@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
534a7b8e10ec55d9f521e68c20dbb3634c25b98a 15-Sep-2011 Nestor Lopez Casado <nlopezcasad@logitech.com> HID: Add full support for Logitech Unifying receivers

With this driver, all the devices paired to a single Unifying
receiver are exposed to user processes in separated /input/dev
nodes.

Keyboards with different layouts can be treated differently,
Multiplayer games on single PC (like home theater PC) can
differentiate input coming from different kbds paired to the
same receiver.

Up to now, when Logitech Unifying receivers are connected to a
Linux based system, a single keyboard and a single mouse are
presented to the HID Layer, even if the Unifying receiver can
pair up to six compatible devices. The Unifying receiver by default
multiplexes all incoming events (from multiple keyboards/mice)
into these two.

Signed-off-by: Nestor Lopez Casado <nlopezcasad@logitech.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
ba623a774f5b529f89b3d63e0837df52e16ffb3b 24-Aug-2011 Dan Carpenter <error27@gmail.com> HID: unlock on error path in hid_device_probe()

We recently introduced locking into this function, but we missed an
error path which needs an unlock.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
c50bb1a4005630f47b5da26336f74a485033a515 16-Aug-2011 Jeff Brown <jeffbrown@android.com> HID: hid-multitouch: Add LG Display Multitouch device.

This panel is also known as the Dell ST2220Tc.

Signed-off-by: jeffbrown@android.com
Reviewed-By: Benjamin Tissoires <Benjamin_Tissoires@logitech.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
ad395ccadb6b2f0a4f9e004c9e6f2a8c22091ed0 14-Aug-2011 Sean Young <sean@mess.org> IHD: Support force feedback on MP-8866

Support force feedback on the Dual USB Force Feedback Joypad (MP-8866).

Signed-off-by: Sean Young <sean@mess.org>
Acked-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
f6f554f09c5b831efdaf67c449e18ca06ee648fe 10-Aug-2011 Jiri Kosina <jkosina@suse.cz> HID: add MacBookAir4,2 to hid_have_special_driver[]

Otherwise the generic driver wouldn't unbind from it and wouldn't
let hid-apple to automatically take over.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
45dc1ac73d28b3adb5819818785e758b1f369b74 10-Aug-2011 Jiri Kosina <jkosina@suse.cz> HID: propagate return value correctly in hid_input_report()

Fix a return value propagation that was omitted in David Herrmann's
locking fix around hid_input_report().

Reported-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
4ea5454203d991ec85264f64f89ca8855fce69b0 10-Aug-2011 David Herrmann <dh.herrmann@googlemail.com> HID: Fix race condition between driver core and ll-driver

HID low level drivers register new devices with the HID core which then
adds the devices to the HID bus. The HID bus normally immediately probes
an appropriate driver which then handles HID input for this device.
The ll driver now uses the hid_input_report() function to report input
events for a specific device. However, if the HID bus unloads the driver
at the same time (for instance via a call to
/sys/bus/hid/devices/<dev>/unbind) then the hdev->driver pointer may be
used by hid_input_report() and hid_device_remove() at the same time
which may cause hdev->driver to point to invalid memory.

This fix adds a semaphore to every hid device which protects
hdev->driver from asynchronous access. This semaphore is locked during
driver *_probe and *_remove and also inside hid_input_report(). The
*_probe and *_remove functions may sleep so the semaphore is good here,
however, hid_input_report() is in atomic context and hence only uses
down_trylock(). If it cannot acquire the lock it simply drops the input
package.

The low-level drivers report input events synchronously so
hid_input_report() should never be entered twice at the same time on the
same device. Hence, the lock should always be available. But if the
driver is currently probed/removed then the lock is not available and
dropping the package should be safe because this is what would have
happened if the package arrived some milliseconds earlier/later.

This also fixes another race condition while probing drivers:
First the *_probe function of the driver is called and only if that
succeeds, the related input device of hidinput is registered. If the low
level driver reports input events after the *_probe function returned
but before the input device is registered, then a NULL pointer
dereference will occur. (Equivalently on driver remove function).
This is not possible anymore, since the semaphore lock drops all
incoming packages until the driver/device is fully initialized.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
4a4c879904aa0cc64629e14a49b64fb3d149bf1a 31-Jul-2011 Dan Bastone <dan@pwienterprises.com> HID: add support for new revision of Apple aluminum keyboard

Add USB device ids for the new revision (MB110LL/B) of Apple's wired aluminum
keyboard. I have only confirmed that the ANSI version is correct - it is
assumed that the ISO and JIS versions follow the standard numbering convention.

Signed-off-by: Dan Bastone <dan@pwienterprises.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
b580169affd7ccc9347cbf4d5f4db1480ee7ee06 22-Jul-2011 Jiri Kosina <jkosina@suse.cz> HID: fix support for Microsoft comfort mouse 4500

Add forgotten entry into the global blacklist.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
bc8a2a9b4e5c418bebaa6bb812982b7ecd298821 15-Jul-2011 ice chien <ice.chien@accupoint.com.tw> HID: hid-multitouch: add one new multitouch device's VID/PID

This patch adds support for the CSR panel built by XAT.

Signed-off-by: Ice Chien <ice.chien@accupoint.com.tw>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
6be914f11db8e88d11b08d6c496624dbbd642d80 06-Jul-2011 Nikolai Kondrashov <spbnick@gmail.com> HID: uclogic: Add support for UC-Logic WP1062

Add support for UC-Logic Tablet WP1062 by fixing its report descriptor.

This tablet is sold as Monoprice 10X6.25 Inches Graphic Drawing Tablet.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
02fb72a06ae1ed55b4373a4c678f25d70fd65902 05-Jul-2011 David Herrmann <dh.herrmann@googlemail.com> HID: wiimote: Register wiimote hid driver stub

The wiimote uses a fake HID protocol. Hence, we need to prevent
HIDINPUT and HIDDEV from parsing wiimote data and instead parse
raw hid events.
Add VID/PID to hid-core so the special driver is loaded on new
wiimotes.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
d946e65e2ab885c05b8cacf292be65fa292d08f6 26-Jun-2011 Anssi Hannula <anssi.hannula@iki.fi> HID: add FF support for Holtek On Line Grip based gamepads

Add force feedback support for Holtek On Line Grip based HID devices.

The protocol is more complex than that of most other rumblepads, but the
device still needs to be handled as a memoryless one.

Tested by Cleber de Mattos Casali with a 1241:5015 "Clone Joypad Super
Power Fire" gamepad, with help from Hendrik Iben <hendrik_iben@web.de>.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Tested-by: Cleber de Mattos Casali <clebercasali@yahoo.com.br>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
c3ead6de4f6bd1c08a81f84e629e3dbf4a9078f0 21-Jun-2011 Benjamin Tissoires <benjamin.tissoires@enac.fr> HID: hid-multitouch: add support for a new Lumio dual-touch panel

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
f3b83d71a1b1a1569dba774c3a4f6e2a3b9fef99 13-Jun-2011 Jiri Kosina <jkosina@suse.cz> HID: add support for MS Digital Media 3000

The Digital Media 3000 keyboard (USB id: 0x0730) features the same 1-5
Application Launch keys that the Natural Ergonomic 4000 has. Add its
usb id to the list of quirks.

Reported-by: Khelben Blackstaff <eye.of.the.8eholder@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
74bc6953135ae1478acc18046321bfca05b0e823 27-May-2011 Stefan Kriwanek <mail@stefankriwanek.de> HID: Add driver to fix Speedlink VAD Cezanne support

Speedlink VAD Cezanne have a hardware bug that makes the cursor "jump" from one
place to another every now and then. The issue are relative motion events
erroneously reported by the device, each having a distance value of +256. This
256 can in fact never occur due to real motion, therefore those events can
safely be ignored. The driver also drops useless EV_REL events with a value of
0, that the device sends every time it sends an "real" EV_REL or EV_KEY event.

Signed-off-by: Stefan Kriwanek <mail@stefankriwanek.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
942fd4225f72826b31d893582b6ae7e172bb3202 27-May-2011 Austin Zhang <zhang.austin@gmail.com> HID: hid-multitouch: add support for Chunghwa multi-touch panel

Added Chunghwa hid multitouch panel support into hid-multitouch.

Signed-off-by: Austin Zhang <zhang.austin@gmail.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
6dc1418e13144162e8bc4858789010d8f0e1e65c 24-May-2011 Tomoki Sekiyama <tomoki.sekiyama@gmail.com> HID: yurex: recognize GeneralKeys wireless presenter as generic HID

Unfortunately, the device seems to have the same Vendor ID and Product ID
as YUREX leg-shakes sensors, and the commit 6bc235a2e2 ("USB: add driver
for Meywa-Denki & Kayac YUREX") added the ID to hid_ignore_list.

I believe that we can distinguish YUREX and the Wireless Presenter by
device type. The patch below makes the driver ignore only YUREX
(bInterfaceProtocol==0), and recognize Wireless Presenter
(bInterfaceProtocol is keyboard or mouse) as generic HID. (I don't have
the Wireless Presenter, so not yet ested.)

** YUREX lsusb information:
Bus 002 Device 007: ID 0c45:1010 Microdia
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x0c45 Microdia
idProduct 0x1010
bcdDevice 0.03
iManufacturer 1 JESS
iProduct 2 YUREX
iSerial 3 10000269
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 34
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xa0
(Bus Powered)
Remote Wakeup
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 1 Boot Interface Subclass
bInterfaceProtocol 0 None
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.10
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 31
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 10
Device Status: 0x0002
(Bus Powered)
Remote Wakeup Enabled

Addresses https://bugzilla.kernel.org/show_bug.cgi?id=26922

Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama@gmail.com>
Cc: Greg KH <gregkh@suse.de>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Maciej Rutecki <maciej.rutecki@gmail.com>
Reported-by: Thomas B?chler <thomas@archlinux.org>
Tested-by: Thomas B?chler <thomas@archlinux.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
617b64f97708be26a061e6c8178ad46b4c49d031 19-May-2011 Benjamin Tissoires <benjamin.tissoires@enac.fr> HID: hid-multitouch: add support for Unitec panels

This patch introduce support for Unitec panels.
This device has not been optimized in term of kernel processing
operations (default class), but it will work.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
5e74e56da03f581482c104628951eeb1455848ea 19-May-2011 Benjamin Tissoires <benjamin.tissoires@enac.fr> HID: hid-multitouch: add support for Touch International panels

This patch introduce support for Touch International panels.
This device has not been optimized in term of kernel processing
operations (default class), but it will work.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
ee0fbd149182d91e3b9df7b306eb03cd1f1dd4a1 19-May-2011 Benjamin Tissoires <benjamin.tissoires@enac.fr> HID: hid-multitouch: add support for GoodTouch panels

This patch introduce support for GoodTouch panels.
This device has not been optimized in term of kernel processing
operations (default class), but it will work.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
79603dc9a8223856cf3194dcabad32b9828c7be9 19-May-2011 Benjamin Tissoires <benjamin.tissoires@enac.fr> HID: hid-multitouch: add support for CVTouch panels

This patch introduce support for CVTouch panels.
This device has not been optimized in term of kernel processing
operations (default class), but it will work.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
e6aac3427ef03f61e7478514d0648b58359d05d1 19-May-2011 Benjamin Tissoires <benjamin.tissoires@enac.fr> HID: hid-multitouch: add support for ActionStar panels

This patch introduce support for ActionStar panels.
This device has not been optimized in term of kernel processing
operations (default class), but it will work.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
966922f26c7fb5eddbe3c506b66bb5659f57b76f 19-May-2011 Armando Visconti <armando.visconti@st.com> HID: fix a crash in hid_report_raw_event() function.

I'm using a Data Modul EasyTouch USB multitouch controller,
which is issuing a hid report with a size equals to 0. The rsize
value gets set to 536870912 and Linux is crashing in the memset
because the value is too big.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
c04abeeff9d76a703cac1e6d312853b0fc8136f5 19-May-2011 Benjamin Tissoires <benjamin.tissoires@enac.fr> HID: hid-multitouch: add support for Elo TouchSystems 2515 IntelliTouch Plus

This patch adds support for Elo TouchSystems 2515 IntelliTouch Plus
that can be found in Lenovo A700 all-in-one.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Tested-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
df167c4a0d68a9dbde044a39a77f255ac666f93e 18-May-2011 Benjamin Tissoires <benjamin.tissoires@enac.fr> HID: hid-multitouch: Add support for Lumio panels

This patch enables support for Lumio optical devices.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
4e61f0d75aa86c9e59451f6bcffcdceb355b4fc4 09-May-2011 Austin Zhang <zhang.austin@gmail.com> HID: hid-multitouch: add support for Ilitek dual-touch panel

Added ILITEK hid dual touch panel support into hid-multitouch.

Signed-off-by: Austin Zhang <zhang.austin@gmail.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
ce97cac813340eb8ecb1c5410041c9eade58f870 03-May-2011 Michael Hund <mhund@ld-didactic.de> USB: ldusb: add several new devices

Added several new devices to ldusb and excluded them from the HID driver.

Signed-off-by: Michael Hund <mhund@ld-didactic.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fdc6807fcd09416c5537f479e1dcd624118e234c 03-May-2011 Peter Gundermann <slim-one@users.sourceforge.net> HID: add support for Logitech G27 wheel

Gere's a small patch to add support for the Logitech G27 wheel, since
the prior patch only added FF support for the Driving Force Pro and G25.
The patch contains the changes from the G25 and DFP, too.

I tested the changes with wine/LFS and got full support for all axes and
buttons.

Signed-off: Peter Gundermann <slim-one@users.sourceforge.net>

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
35dca5b4a67a93bbb75c2753d6dc432dc8f82e5d 28-Apr-2011 Jiri Kosina <jkosina@suse.cz> HID: add support for Sony Navigation Controller

Sony Navigation Controller needs a special report to be sent to it
before it is able to operate, the same way as other Sony controllers
do.

Tested-by: Jacek Lukas Wotka <jlw@team-fatal.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
6ab3a9a63fc16b04f7de48eb0190d516dd7574df 21-Apr-2011 John Sung <penmount.touch@gmail.com> HID: hid-multitouch: add support for PenMount dual-touch panel

This patch adds PenMount support to hid-multitouch. A new class
MT_CLS_CONFIDENCE is defined for PenMount, since it uses HID_DG_CONFIDENCE as
the valid flag.

Signed-off-by: John Sung <penmount.touch@gmail.com>
[benjamin.tissoires@enac.fr: rebased on top of last_index_field changes]
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Acked-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
25985edcedea6396277003854657b5f3cb31a628 31-Mar-2011 Lucas De Marchi <lucas.demarchi@profusion.mobi> Fix common misspellings

Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
3fce224608f38eac6d6b032b0619c1655acaf61d 23-Mar-2011 Stefan Achatz <erazor_de@users.sourceforge.net> HID: roccat: Add support for wireless variant of Pyra

Wireless variant of Roccat Pyra finally has been tested with
existing driver.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
d586dca06adddc6cee7177b013ee93eaffc9fe0e 21-Mar-2011 Jiri Kosina <jkosina@suse.cz> HID: add support for Skycable 0x3f07 wireless presenter

This device contains the very same bug in report descriptor as the
Ortek ones do (i.e. LogicalMinimum == 1, which is wrong for the key
array).

As we have more reports for the Ortek devices, we are keeping the driver
name for now. Apparently there is a chip producer which sells chip with
this buggy descriptor to multiple vendors. Thus if such reports start
to come at highger frequency, we'll either have to rename the driver
accordingly, or come up with more generic workaround.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
5623a24a80814fe471e777f12b9dbbb0f77e002e 17-Mar-2011 Jiri Kosina <jkosina@suse.cz> HID: add support for Logitech Driving Force Pro wheel

Add force feedback support for Logitech Driving Force Pro wheel.

Device IDs reported by Michal Malý.

Reported-by: Michal Malý <madcatxster@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
270fdc0748bd3f7b625caff985f2fcf8e2185ec7 16-Mar-2011 Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com> HID: add support for Ortek PKB-1700

As reported on http://ubuntuforums.org/showthread.php?t=1594007 the
PKB-1700 needs same special handling as WKB-2000. This change is
originally based on patch posted by user asmoore82 on the Ubuntu
forums.

Cc: stable@kernel.org
Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
47340bd9fefb571888836da942b5aee0e85e959c 13-Mar-2011 Andy Botting <andy@andybotting.com> Input: bcm5974 - add support for MacBookPro8

This patch add multitouch support for the MacBookPro8,1 and
MacBookPro8,2 models.

Cc: stable@kernel.org
Signed-off-by: Andy Botting <andy@andybotting.com>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
0ae43810976bc969ee158510c4acbe70ed136e61 11-Mar-2011 Dmitry Torokhov <dmitry.torokhov@gmail.com> HID: ACRUX - activate the device immediately after binding

This device does not tolerate delayed opening and goes into a coma if
we try to that. Ubuntu even has a crutch for udev that opened the device
upon seeing it for the first time, but it did not work if we happened to
boot with the device attached, since by the time userspace got around
opening the device it was too late. Let's start the device immediately
to deal with this issue.

Reported-by: Sergei Kolzun <x0r@dv-life.ru>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
177900e8c9ab28cdf097314fe7dd3877774df97d 17-Feb-2011 Jiri Kosina <jkosina@suse.cz> HID: add support for Keytouch IEC 60945

The keyboard has several bugs in its report descriptor, most
importantly the Logical Min/Max are completely off.

Replace it with simplified descriptor which describes it properly.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
6d3bfb74341c2c1454fcf5ec9c4dd707011f78e5 24-Jan-2011 Alan Ott <alan@signal11.us> HID: Add HID Report Descriptor to sysfs

Add a new binary sysfs entry called report_descriptor which contains
the HID report descriptor.

Signed-off-by: Alan Ott <alan@signal11.us>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
b2e7617e09a8e774d7819c629a0989cbddb5d1ab 15-Feb-2011 Benjamin Tissoires <benjamin.tissoires@enac.fr> HID: add IRTOUCH infrared USB to hid_have_special_driver

Without this patch, the device is handled by hidinput and does
not have the right behavior.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
75b07022462fc33d6be15669ad604118653210a9 03-Feb-2011 Chris Schlund <chrisschlund@gmx.de> HID: add support for wireless remote LC Power model RC1000MCE

Signed-off-by: Chris Schlund <chrisschlund@gmx.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
0e70f97f257edcef4daa92ab9371a9aac0c851ed 30-Jan-2011 Stefan Achatz <erazor_de@users.sourceforge.net> HID: roccat: Add support for Kova[+] mouse

This patch adds support for Roccat Kova[+] 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>
e05eefb9be109e6cbbfd362b49ee83397130a7e4 28-Jan-2011 Nikolai Kondrashov <spbnick@gmail.com> HID: add support for DragonRise PID 0011 gamepad

Add support for DragonRise Inc. gamepad with USB PID 0x0011 by fixing its report
descriptor. This mainly removes spurious axis.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
e68cc603b063416c85f3e408184219fb71d4a9ff 06-Jan-2011 Stefan Achatz <erazor_de@users.sourceforge.net> HID: roccat: Add support for Roccat Arvo keyboard

This patch add support for Roccat Arvo keyboard. Arvo has 5 additional
configurable buttons and the ability to deactivate certain keys.
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>
c64f6f934c7490faff76faf96217066a1b3570a0 08-Jan-2011 Benjamin Tissoires <benjamin.tissoires@enac.fr> HID: Switch turbox/mosart touchscreen to hid-mosart

This device used the MULTI_INPUT quirk whereas it could be used
with hid-mosart instead to support the multitouch part.

Reference: https://bugs.launchpad.net/ubuntu/+bug/620609/

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
bc5ab083a68bfec212780281f8e57d871d8882a0 08-Jan-2011 Benjamin Tissoires <benjamin.tissoires@enac.fr> HID: add Add Cando touch screen 10.1-inch product id

This device has been reported to be an hid-cando one.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
5572da08a784621f2ab4fdc8dc65471261871795 07-Jan-2011 Benjamin Tissoires <benjamin.tissoires@enac.fr> HID: hid-mulitouch: add support for the 'Sensing Win7-TwoFinger'

Added support for the 'Sensing Win7-TwoFinger' panel by GeneralTouch found on some tablets.

Because of conflicting VID/PID, this conflicts with previous support for some
single-touch panels by GeneralTouch

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Stéphane Chatty <chatty@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
a3b5e577d96bfccbc41ebf4df784e3a153072273 07-Jan-2011 Benjamin Tissoires <benjamin.tissoires@enac.fr> HID: hid-multitouch: add support for Cypress TrueTouch panels

Added support for Cypress TrueTouch panels, which detect up to 10 fingers

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Stéphane Chatty <chatty@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
5519cab477b61326963c8d523520db0342862b63 07-Jan-2011 Benjamin Tissoires <benjamin.tissoires@enac.fr> HID: hid-multitouch: support for PixCir-based panels

Created a driver for PixCir based dual-touch panels, including the one
in the Hanvon tablet. This is done in a code structure aimed at unifying
support for several existing HID multitouch panels.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Stéphane Chatty <chatty@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
47dbdbffe15b9582a41727766d43f1d4208e977e 26-Nov-2010 Stefan Achatz <erazor_de@users.sourceforge.net> HID: roccat: Add support for Roccat Kone[+] v2

This patch adds support for Roccat Kone[+] gaming mouse. Kone[+] is an enhanced version
of the old Kone with more memory for macros, a better sensor and more functionality.
This driver is conceptual similar to the existing Kone and Pyra drivers.
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>
73bc7d315f56e260071bdb5f15e25b53bddc1402 22-Dec-2010 Melchior FRANZ <mfranz@aon.at> USB: add support for Dream Cheeky DL100B Webmail Notifier (1d34:0004)

So far the USBLED driver only supports Delcom's "USB Visual Signal
Indicator" (http://www.delcomproducts.com/products_USBLMP.asp). The
driver generates virtual files "red", "green", and "blue" under the
device's /sys/ directory, where color values can be read from and
written to.

This patch adds support for Dream Cheeky's "DL100B Webmail Notifier"
(http://www.dreamcheeky.com/webmail-notifier -- available from several
shops, such as http://www.conrad.at/ce/de/product/777048/USB-WEBMAIL).
This device isn't as pretty as Delcom's, but it's *far* cheaper, and
its 3 LEDs can be set in 32 brightness steps each. The grey envelope
contour can easily be removed, leaving a rather neutral white box (with
a few small holes), which is useful for generic signalling purposes.
Of course, the small circuit board can easily be put into a prettier
case.

The DL100B device pretends to be a HID, but the HID descriptor shows
that it's not overly useful as such (see below). The patch therefore
removes the "HID-ness" (hid-core.c, hid-ids.h), and adds the necessary
commands to usbled.c. The protocol info comes from the developer's
manual that Dream Cheeky kindly provided (815DeveloperManual.pdf).

HID descriptor:

0: 05 01 Usage Page 'Generic Desktop Controls'
2: 09 10 Usage 'Reserved'
4: a1 01 Collection 'Application (mouse, keyboard)'
6: 05 00 Usage Page 'Undefined'
8: 19 10 Usage Minimum = 16
10: 29 11 Usage Maximum = 17
12: 15 00 Logical Minimum = 0
14: 25 0f Logical Maximum = 15
16: 75 08 Report Size = 8
18: 95 08 Report Count = 8
20: 91 02 Output data *var abs lin pref-state null-pos non-vol bit-field
22: 19 10 Usage Minimum = 16
24: 29 11 Usage Maximum = 17
26: 15 00 Logical Minimum = 0
28: 25 0f Logical Maximum = 15
30: 75 08 Report Size = 8
32: 95 08 Report Count = 8
34: 81 00 Input data array abs lin pref-state null-pos non-vol bit-field
36: c0 End Collection

Signed-off-by: Melchior FRANZ <mfranz@aon.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
4dd295a73e80b55c3fec25555bf0a5d253023740 17-Dec-2010 Andy Ross <andy@plausible.org> hid: egalax: Add support for Wetab (726b)

This patch adds support for another Wetab device (726b), and grabs it
accordingly in hid-core.

[rydberg@euromail.se: rename and log message changes]
Signed-off-by: Andy Ross <andy@plausible.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
28906ad6d7c8a8090f720cf7c39461df0b1460f6 14-Dec-2010 Richard Nauber <richard.nauber@googlemail.com> hid: egalax: Add support for Samsung NB30 netbook

The Samsung NB30 touch has a DWAV dual-touch device. This patch adds
the NB30 to the list of supported devices, and grabs it accordingly in
hid-core.

[rydberg@euromail.se: rename and log message changes]
Signed-off-by: Richard Nauber <Richard.Nauber@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
4e93db23bf95cd763c9182b5d6187412fe6ce747 29-Nov-2010 Henrik Rydberg <rydberg@euromail.se> hid: egalax: Add support for Wetab

The Wetab tablet dual-touch controller works the same way as the one
in the Joojoo tablet. This patch adds the Wetab to the list of
supported devices, and grabs it accordingly in hid-core.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Cc: Stephane Chatty <chatty@enac.fr>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
504499f22c08a03e2e19dc88d31aa0ecd2ac815e 10-Dec-2010 Joe Perches <joe@perches.com> HID: simplify an index check in hid_lookup_collection

Save the struct hid_collection * in a temporary to shorten
the generated code a bit and perhaps improve readability.

$ size drivers/hid/hid-core.o*
text data bss dec hex filename
16460 78 8 16546 40a2 drivers/hid/hid-core.o.new
16469 78 8 16555 40ab drivers/hid/hid-core.o.old

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
a3789a1783d37f2772ba5046b26416c98dfe1bfa 10-Dec-2010 Joe Perches <joe@perches.com> HID: Hoist assigns from ifs

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
16ee4cc82b5dbb81a5dbfedcdb268b9467fe4605 10-Dec-2010 Joe Perches <joe@perches.com> HID: Remove superfluous __inline__

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
fe2580204d8bbcd18540736a283ed0b784c6a024 10-Dec-2010 Joe Perches <joe@perches.com> HID: Use vzalloc for vmalloc/memset(,0...)

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
4291ee305e9bb0699504a66f0e2b7aefcf0512a5 10-Dec-2010 Joe Perches <joe@perches.com> HID: Add and use hid_<level>: dev_<level> equivalents

Neaten current uses of dev_<level> by adding and using
hid specific hid_<level> macros.

Convert existing uses of dev_<level> uses to hid_<level>.
Convert hid-pidff printk uses to hid_<level>.

Remove err_hid and use hid_err instead.

Add missing newlines to logging messages where necessary.
Coalesce format strings.

Add and use pr_fmt(fmt) KBUILD_MODNAME ": " fmt

Other miscellaneous changes:

Add const struct hid_device * argument to hid-core functions
extract() and implement() so hid_<level> can be used by them.
Fix bad indentation in hid-core hid_input_field function
that calls extract() function above.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
d65c3768afb47fb93c43fbfcafef53502edaaa85 29-Nov-2010 Simon Wood <simon@mungewell.org> HID: add support for F430 Force Feedback Wheel

This patch adds USB IDs to enable force feedback on the Thrustmaster
F430 wheel.

Antonio did the work, I just converted to git patch to include in Kernel.

Reported-by: Antonio Orefice <aorefice77@gmail.com>
Signed-off-by: Simon Wood <simon@mungewell.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
ce06b9d6d33fd2ed799b6e825d68fe95077da354 28-Nov-2010 Dmitry Torokhov <dmitry.torokhov@gmail.com> HID: hid-core - rename hid_blacklist to hid_have_special_driver

To avoid confusion with hid_blacklist describing various quirks in
usbhid code, let's rename this one.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
b9e4b1e0cd401e915e3ba97afc152946f78f9f0b 23-Nov-2010 Dennis Kügler <dennis.kuegler@gmx.de> HID: Add support for Perixx PERIBOARD-707 (Plus)

This patch adds support for the media keys of the Perixx PERIBOARD-707 (Plus)
keyboard / remote control.

Signed-off-by: Dennis Kügler <dennis.kuegler@gmx.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
99b9f758bbc904f22faffcf4d83205f4a5e7bc0c 03-Nov-2010 Edgar (gimli) Hucek <gimli@dark-green.com> HID: add MacBookAir 3,1 and 3,2 support

This patch add support for the MacBookAir3,1 and MacBookAir3,2 to the hid
driver.

Signed-off-by: Edgar (gimli) Hucek <gimli@dark-green.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
04561c5aa243c98cae93cde27e05740df787e692 01-Nov-2010 Ignaz Forster <ignaz.forster@gmx.de> HID: Add Force Feedback support for EMS Trio Linker Plus II

The device has connections for GameCube, PlayStation 2 and Dreamcast
controllers, however Force Feedback is only supported for PS2 and GC
controllers.

When using a PS2 controller it may be necessary to press the "Analog" button to
enable support for both motors (this behavior is identical to the Windows
driver, I have found no way to avoid that).

Signed-off-by: Ignaz Forster <ignaz.forster@gmx.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
6bc235a2e24a5ef677daee3fd4f74f6cd643e23c 28-Sep-2010 Tomoki Sekiyama <tomoki.sekiyama@gmail.com> USB: add driver for Meywa-Denki & Kayac YUREX

Meywa-Denki/Kayac YUREX is a leg-shakes sensor device.
See http://bbu.kayac.com/en/about/ for further information.
This driver support read/write the leg-shakes counter in the device
via a device file /dev/yurex[0-9]*.

[minor coding style cleanups fixed by gregkh]

Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama@gmail.com>
Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
272036edb77e5967c175ac48b8c88e9b3358285f 13-Oct-2010 François Jaouen <francois.jaouen@laposte.net> HID: Add Cando touch screen 15.6-inch product id

This add the product id of the touch screen found on ACER Aspire 5738PZ. Works
with hid-cando driver.

Signed-off-by: Francois Jaouen<francois.jaouen@laposte.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2c6118e43040034d80894daeba41960bf0035b31 04-Oct-2010 Hendrik Iben <Hendrik_Iben@web.de> HID: force feedback support for Logitech RumblePad gamepad

This patch adds force feedback support for Logitech WingMan RumblePad
gamepads by extending the Logitech Rumblepad 2 force feedback code.

Signed-off-by: Hendrik Iben <Hendrik_Iben@web.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
b6dc79929fa18a97bbc08400db72405ad835622f 01-Oct-2010 Pascal Auriel - Stantum <P.Auriel@stantum.com> HID: support STmicroelectronics and Sitronix with hid-stantuml driver

New VendorsIds/ProductIds using hid-stantum driver.

Signed-off-by: Stantum <software@stantum.com>
Acked-by: Stephane Chatty <chatty@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
00e7f9649b3061281fe4b463263da26155dc9be4 25-Sep-2010 Nikolai Kondrashov <spbnick@gmail.com> HID: waltop: add support for Waltop Slim Tablet 12.1 inch

Add support for Waltop Slim Tablet 12.1 inch by fixing its report descriptor.
This mainly fixes button reporting.

This tablet is also sold as Genius G-Pen F610.
Other possible names of this tablet: VisTablet Original 12", Adesso CyberTablet
Z12, Adesso CT-Z12A, PenPower Tooya Pro, Aiptek Slim 12.1 Inch

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
32c88cbc3080f43c429f6456aa9cd845e37f3778 22-Sep-2010 Simon Wood <simon@mungewell.org> HID: Add support for Logitech Speed Force Wireless gaming wheel

The following patch adds support for the Logitech Speed Force Wireless gaming
wheel. Originally designed for the WII console. Details on the protocol:

http://wiibrew.org/wiki/Logitech_USB_steering_wheel

This patch relies on previous patch:
"Don't Send Feature Reports on Interrupt Endpoint"

Logitech as produce a very similar wheel for the PS2/PS3, it is expected that
this patch could also support the PS2/PS3 wheel if the USB ID's are added and
(if required) the HID descriptor is modified.

Signed-off-by: Simon Wood <simon@mungewell.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
b7e1b2039de3a028fba46fbaca58a45c23a417ec 16-Sep-2010 Lech Perczak <lech.perczak@multivision.pl> HID: fix A4Tech RP-649 horizontal scrollwheel

Enable fix for their horizontal scroll wheel behaviour, associate
it with B8 hack.

Signed-off-by: Lech Perczak <lech.perczak@multivision.pl>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
eaca1386207a9e0314647d3a88967acb17cc30e3 08-Sep-2010 Jiri Kosina <jkosina@suse.cz> HID: fixup blacklist entry for Asus T91MT

The device is handled by hid-mosart driver, and therefore should
be present in hid_blacklist[], not hid_ignore_list[].

Cc: Stephane Chatty <chatty@lii-enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
cec15a0ece19116b6c2c53fedf9696c20124d491 08-Sep-2010 Roland Baum <rba@tr33.de> HID: add device ID for new Asus Multitouch Controller

The following patch instructs usbhid/hid-mosart to handle a new multitouch
controller, built-in by some Asus EeePC T101MT models.

Signed-off-by: Roland Baum <rba@tr33.de>
Tested-by: Roland Baum <rba@tr33.de>
Acked-by: Stéphane Chatty <chatty@enac.fr>
CC: Stéphane Chatty <chatty@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
a462230e16acc8664145216da3c928d03556691a 01-Sep-2010 Chase Douglas <chase.douglas@canonical.com> HID: magicmouse: enable Magic Trackpad support

The trackpad speaks a similar, but different, protocol from the magic
mouse. However, only small code tweaks here and there are needed to make
basic multitouch work.

Extra logic is required for single-touch emulation of the touchpad. The
changes made here take the approach that only one finger may emulate the
single pointer when multiple fingers have touched the screen. Once that
finger is raised, all touches must be raised before any further single
touch events can be sent.

Sometimes the magic trackpad sends two distinct touch reports as one big
report. Simply splitting the packet in two and resending them through
magicmouse_raw_event ensures they are handled properly.

I also added myself to the copyright statement.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Acked-by: Michael Poole <mdpoole@troilus.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
67168fd7d4044f21c542128529216cfaad23c03e 22-Aug-2010 Nikolai Kondrashov <spbnick@gmail.com> HID: rdesc parser: remove local item size limit

The HID report descriptor parser requires local items, except "delimiters",
to have data. I.e. to have non-zero size. This removes the restriction.

The HID specification doesn't seem to have such restriction and, for
example, a "usage" item could have zero size if the usage ID is zero.
At least one usage page - Keyboard/Keypad lists zero ID as valid.

This doesn't seem to happen in the wild, probably because the official tool
for authoring report descriptors always puts data even for zero values for
some items, including "usage" items.

However, this makes little sense and at least one open source tool for
descriptor authoring generates zero data size "usage" items, which saves
some space, especially if many such items are used in a descriptor.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
bba5394ad3bd23fff6987fc8bc3aaf9d12433c63 02-Sep-2010 Xing Wei <weixing@hanwang.com.cn> Input: add support for Hanwang tablets

Add support for Art Master III tablet of BeiJing HanwangTechnology Co, Ltd.

Signed-off-by: Xing Wei <weixing@hanwang.com.cn>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
cb7cf3da0daa9830e00640da8f7d2380f4b4de42 29-Aug-2010 Stefan Achatz <erazor_de@users.sourceforge.net> HID: roccat: add driver for Roccat Pyra mouse

This patch add support for Pyra mobile gaming mouse from Roccat.
It provides access to profiles, settings, actual settings etc.
through sysfs attributes.
This driver is conceptual similar to the existing Kone driver.
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>
8f1acc32bbdb1784bcb0be98fb02f4b20e6f328f 30-Aug-2010 Nikolai Kondrashov <spbnick@gmail.com> HID: waltop: add Media Tablet 14.1 inch support

Add support for Waltop Media Tablet 14.1 inch by fixing report descriptor.

This tablet is also sold as Genius G-Pen M712 (older version) and M712X
(newer version). Both are supported.

Trust Wide Screen Design Tablet (TB-7300, item no 15358) seems to be the
older version of this tablet (similar to Genius G-Pen M712), and could be
supported as well.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
c3dc66de59531c921c4638b1285075ea1c831186 30-Aug-2010 Jiri Kosina <jkosina@suse.cz> HID: add support for another BTC Emprex remote control

Add device ID for another variant of this remote control.

Reported-by: Gregor Fuis <gujs.lists@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
41fa92302be7fa37c5c38e17e2097d3e5e9da13a 23-Aug-2010 Nikolai Kondrashov <spbnick@gmail.com> HID: uclogic: add proper support for PF1209

This removes extra event device and fixes reported button codes of UC-Logic
Tablet PF1209.

This tablet is also sold as Genius PenSketch 12x9 (or 9x12) and possibly
under other names.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
72a46344867111c3e019b169ddfa9e1a1f55c759 20-Aug-2010 Nikolai Kondrashov <spbnick@gmail.com> HID: add support for two Waltop tablets

Add support for Waltop Slim Tablet 5.8 inch and Media Tablet 10.6 inch.

These (and other Waltop) tablets are usually sold by different companies
(such as Genius and Trust) and with different names, but with the same USB
vendor/product IDs.

Slim Tablet 5.8 inch is known to also be sold as Genius G-Pen F350 and Trust
Widescreen Mini Tablet (item no 16485).

Media Tablet 10.6 inch is known to also be sold as Genius G-Pen M609 and
M609X. Of these only the latter is known to be supported.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
83e4491818040ae6b2d9fc60434616304a101d39 16-Aug-2010 Chris Ball <cjb@laptop.org> USB HID: Add ID for eGalax Multitouch used in JooJoo tablet

The JooJoo tablet (http://thejoojoo.com/) contains an "eGalax Inc. USB
TouchController", and this patch hooks it up to the egalax-touch driver.
Without the patch we don't get any cursor motion, since it comes through
Z/RX rather than X/Y.

(The egalax-touch driver does not yet generate a correct event sequence
for the "serial" protocol used by this device, though -- see the note
added to the code, which comes from research by Stéphane Chatty.)

Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Stéphane Chatty <chatty@enac.fr>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
f8a489cc5f7adafa9f1420279be793de0fba481c 09-Aug-2010 Nikolai Kondrashov <spbnick@gmail.com> HID: Add support for UC-Logic WP????U tablets

Add support for UC-Logic WP4030U, WP5540U and WP8060U tablets.
These tablets are usually sold by Genius, Trust and possibly others under
different names and in different cases, but with the original USB
vendor/product IDs.

Currently, these tablets are supported by standalone X.org driver WizardPen.
This patch aims to fix them in the kernel and make them supported by the
generic evdev X.org driver. Still, some minor fixes in the X.org driver are
to be made for the full stack support.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
73e4008ddddc84d5f2499c17012b340a0dae153e 06-Aug-2010 Nikolai Kondrashov <spbnick@gmail.com> HID: allow resizing and replacing report descriptors

Update hid_driver's report_fixup prototype to allow changing report
descriptor size and/or returning completely different report descriptor.
Update existing usage accordingly.

This is to give more freedom in descriptor fixup and to allow having a whole
fixed descriptor in the code for the sake of readability.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
d5e0a06f17a0ffb0eb08a5bd7b18f00af70d9a12 20-Jul-2010 Jiri Kosina <jkosina@suse.cz> Revert "HID: add support for the Wacom Intuos 4 wireless"

This reverts commit ed9eac5b493c679ef5fc52273758fe334de82714. As
reported by Bastien Nocera, the device actually uses a completely
different protocol, so simply adding VID/PID doesn't work and
completely new driver will need to be written.

Reported-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
c0dbcc33c652a0646542560de29a1c3f1ab7169f 19-Jul-2010 Sergei Kolzun <x0r@dv-life.ru> HID: add ACRUX game controller force feedback support

Adds force feedback support for ACRUX USB game controllers.
These devices are mass produced in China by several vendors.

Signed-off-by: Sergei Kolzun <x0r@dv-life.ru>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
3a343ee4509c982552b35fbc99d3213f3bb1acde 12-Jul-2010 Daniel Mack <daniel@caiaq.de> HID: add HID_QUIRK_HIDINPUT_FORCE

For devices with exotic HID report descriptors, it might be necessary to
make the HID core force the registration of an input device. Make that
possible by introducing a new quirk type.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
540010812179a16d3d00fb8363bb06ee83af25b8 13-Jul-2010 Kees Bakker <kees.bakker@xs4all.nl> HID: Add support for Conceptronic CLLRCMCE

There is only one extra button for Conceptronic that wasn't yet present.
The button has code 0xffbc0027 and the description is "Toggle between
display ratios". So I picked KEY_MODE for this button.

Signed-off-by: Kees Bakker <kees.bakker@xs4all.nl>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
64b386ea16112564e0b93473e2c347125effb6b2 28-Jun-2010 Richard Nauber <richard.nauber@googlemail.com> HID: add proper support for Elecom BM084 bluetooth mouse

This patch removes the annoying feature of Elecoms BM084 to constantly scroll to the right.
The device can be found at:
http://www.dealextreme.com/details.dx/sku.15402

Signed-off-by: Richard Nauber <Richard.Nauber@gmail.com>
[jkosina@suse.cz: fix build error]
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
df506f2c0023380ffa67a946fa36eee4150773a3 28-Jun-2010 Petr Štetiar <ynezz@true.cz> HID - blacklist ET&T TC4UH touchscreen controller

The device is handled by usbtouchscreen driver.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
6e32819e12ffbd507eced11a1871700a387d5407 19-Jun-2010 micki <micki@micki-laptop.(none)> HID: ntrig: add support for new firwmare versions

Signed-off-by: Micki Balanga <micki@n-trig.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
e5a2a04c264e693eafcc78fec5add34c9e15e471 03-Jun-2010 Jindrich Makovicka <makovick@gmail.com> HID: check for HID_QUIRK_IGNORE during probing

While the hardcoded ignore list is checked in hid_add_device(), the
user supplied ignore flags are not. Thus, the IGNORE quirk (0x0004)
cannot be used to stop usbhid from binding devices like iBuddy, which
has been recently removed from the ignore list due to product ID
conflict.

This patch adds the user quirk check to hid_add_device(), and makes
hid_add_device() return -ENODEV when HID_QUIRK_IGNORE bit is set.

HID_QUIRK_NO_IGNORE still takes precedence over HID_QUIRK_IGNORE.

With the patch, iBuddy works properly using libusb when the following
option is added to modprobe.d:

options usbhid quirks=0x1130:0x0002:0x0004

Signed-off-by: Jindrich Makovicka <makovick@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
c2fd1a4ebf9127c280d227acb635eb1df213439c 22-May-2010 Cory Maccarrone <darkstar6262@gmail.com> HID: Add the GYR4101US USB ID to hid-gyration

This change adds in the USB product ID for the Gyration
GYR4101US USB media center remote control. This remote
is similar enough to the other two devices that this driver
can be used without any other changes to get full support
for the remote.

Signed-off-by: Cory Maccarrone <darkstar6262@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
b355850ba383232d4e0e357c1cda8cb7bfcc60bc 17-May-2010 Don Prince <dhprince.devel@yahoo.co.uk> HID: hid-samsung: add support for Creative Desktop Wireless 6000

Add support for the multimedia buttons of the Creative Desktop Wireless 6000
keyboard/mouse combo which are not currently handled by the default/samsung HID
driver.

Signed-off-by: Don Prince <dhprince-devel@yahoo.co.uk>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
a9885c8f7bf62e251fc178f838b9f0ee897c158a 14-May-2010 Don Prince <dhprince.devel@yahoo.co.uk> HID: Zydacron Remote Control driver

A specialised HID driver for the Zydacron Remote Control (usb id: 13ec:0006).

The specialised HID driver adds support for the buttons which are not

currently handled by the default HID driver.

Signed-off-by: Don Prince <dhprince-devel@yahoo.co.uk>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1721a238ba5df9e870ed952464d38714261f5be9 15-May-2010 Julia Lawall <julia@diku.dk> HID: Use kmemdup

Use kmemdup when some other buffer is immediately copied into the
allocated region.

A simplified version of the semantic patch that makes this change is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression from,to,size,flag;
statement S;
@@

- to = \(kmalloc\|kzalloc\)(size,flag);
+ to = kmemdup(from,size,flag);
if (to==NULL || ...) S
- memcpy(to, from, size);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
3a370ca1dcf8c80aff7a0a21d6b0f50ca2a151e9 12-May-2010 Don Prince <dhprince-devel@yahoo.co.uk> HID: Prodikeys PC-MIDI HID Driver

A specialised HID driver for the Creative Prodikeys PC-MIDI USB Keyboard.

The Prodikeys PC-MIDI is a multifunction keyboard comprising a qwerty keyboard,
multimedia keys and a touch sensitive musical keyboard.

The specialised HID driver adds full support for the musical keyboard and extra
multimedia keys which are not currently handled by the default HID driver.

The specialised HID driver interfaces with ALSA, and presents the midi keyboard
as a rawmidi device. Sustain duration, octave shifting and the midi output
channel can be read/written form userspace via sysfs.

Signed-off-by: Don Prince <dhprince-devel@yahoo.co.uk>
ALSA parts:
Acked-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
bf280628fca93c4c341587ec914863dcc395af72 29-Apr-2010 Wayne Thomas <waynethomas69@gmail.com> HID: add support for BTC Emprex 3009URF III Vista MCE Remote

The Behavior Tech. Computer Corp. (BTC) remote branded as "Emprex 3009URF III
Vista Remote Controller" uses non-standard mappings for all of its 'special
purpose' keys (0xffbc usage page). This patch modifies the existing
hid-topseed quirky driver to support both remotes in order to prevent
proliferation of in-kernel quirky drivers until such a time that udev remapping
works with these devices. Tested successfully with both the "Emprex" remote
and the "CyberLink" remote originally supported by the hid-topseed driver.

Signed-off-by: Wayne Thomas <waynethomas69@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
5a38f2c7c4dd53d5be097930902c108e362584a3 27-Apr-2010 Alan Ott <alan@signal11.us> HID: hidraw: fix numbered reports

Make hidraw not stick an extra byte on the beginning of an IN transfer
when a HID device contains multiple reports.

Signed-off-by: Alan Ott <alan@signal11.us>
Acked-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
96a7813736a6aa1e2561ecc0d499817daecb4860 23-Apr-2010 Jiri Kosina <jkosina@suse.cz> HID: fix build failure

Fix build failure introduced by 4afb032068f ("HID: fix
support for Wacom Intuos 4 wireless") due to missing coma.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
ba4d8abb31def963f49b7c239a8acce57fe1d1cc 22-Apr-2010 Stephane Chatty <chatty@lii-enac.fr> HID: Support for the 11.6" Cando panel

Added support for the 11.6" Cando panel found on the Acer Timeline 1825PTZ.

Signed-off-by: Stephane Chatty <chatty@enac.fr>
Tested-by: Johannes Klug <johannesklug@room2web.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
4afb032068ff78b4fef5bb2dc33e8ac7d1079e98 21-Apr-2010 Jiri Kosina <jkosina@suse.cz> HID: fix support for Wacom Intuos 4 wireless

Commit ed9eac5b493c679 ("HID: add support for the Wacom Intuos 4 wireles")
forgot to add VID/PID to hid_blacklist[]. Fix that up.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
b5e5a37e36cd4d355b875665312d7aaae4e5833c 16-Apr-2010 Bastien Nocera <hadess@hadess.net> HID: add HID_QUIRK_HIDDEV_FORCE and HID_QUIRK_NO_IGNORE

Add two quirks to make it possible for usbhid module options to
override whether a device is ignored (HID_QUIRK_NO_IGNORE) and
whether to connect a hiddev device (HID_QUIRK_HIDDEV_FORCE).

Passing HID_QUIRK_NO_IGNORE for your device means that it will
not be ignored by the HID layer, even if present in a blacklist.

HID_QUIRK_HIDDEV_FORCE will force the creation of a hiddev for that
device, making it accessible from user-space.

Tested with an Apple IR Receiver, switching it from using appleir
to using lirc's macmini driver.

Signed-off-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
36213e1e40fb863e2e8ef607b2958504b48f6b8e 15-Apr-2010 Stephane Chatty <chatty@lii-enac.fr> HID: added support for the Cando dual touch panel

Added support for the Cando dual touch panels, found in the Lenovo S10-3t.

Signed-off-by: Stephane Chatty <chatty@enac.fr>
Tested-by: Priya Vijayan <priya.vijayan@intel.com>
Tested-by: Florian Echtler <floe@butterbrot.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
75c28df87eb6d8e1389af67f26fbe2394e28385e 12-Apr-2010 Pete Zaitcev <zaitcev@redhat.com> HID: non-overlapping zeroing of extra bits

From my review of the way the unused bits of report are being zeroed,
it seems like there must be a bug. Currently, the zeroing is done
in hid_output_field and it covers any bits between the last used bit
and the end of the byte. But in case of, say, my keyboard, NumLock is
mask 0x01 and CapsLock is 0x02. Invoking hid_output_field for NumLock
definitely zeroes across CapsLock. The only reason this works is that
the fields are sorted by the offset.

It would be more correct and simpler to zero-fill the buffer into
which the fields are set.

The patch is tested with an IBM keyboard that is improperly sensitive
to out-of-report pad bits, the extra bits are still zeroed and the
fields continue to work as expected. It is also tested with good
keyboards.

In case, a related bug in RHEL 5 is tracked with Red Hat bug 513934.

Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
6dec143a50c01ca0cc0afcbf5ea4bb8e87981edf 11-Apr-2010 Stephane Chatty <chatty@lii-enac.fr> HID: add support for 3M multitouch 22" display

Now support the 22" display and its updated firmware, including touch
width and height.

The number of touches can now go up to 60, and our single touch emulation
will fail when there are more than 6-7 touches; further work is needed on
this.

Signed-off-by: Stephane Chatty <chatty@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
0c3910c255d3f9caeef4ebad5d5a1156a2d33f69 10-Apr-2010 Stephane Chatty <chatty@lii-enac.fr> HID: add support for the eGalax dual-touch panel

Added support for the eGalax dual-touch panel, found on the Asus EeePC T101MT

Signed-off-by: Stephane Chatty <chatty@enac.fr>
Tested-by: Philipp Merkel <linux@philmerk.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1ce31b255cf8b06470dfbd469055b6fd8d2274bc 08-Apr-2010 Raphaël Doursenaud <rdoursenaud@free.fr> HID: add support for cymotion master solar keyboard

Support the solar version of the Cherry's cymotion keyboard line using
existing cherry driver.

Signed-off-by: Raphaël Doursenaud <rdoursenaud@free.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
236db47c2b3b69464d50c695ab2ddd516cf64520 30-Mar-2010 Bruno Prémont <bonbons@linux-vserver.org> HID: new driver for PicoLCD device

Add basic driver for PicoLCD graphics device.
Initially support keypad with input device and provide support
for debugging communication via events file from debugfs.

Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
14bf62cde79423a02a590e02664ed29a36facec1 18-Mar-2010 Stefan Achatz <erazor_de@users.sourceforge.net> HID: add driver for Roccat Kone gaming mouse

This Patch adds support for Kone gaming mouse from Roccat.
It provides access to profiles, settings, firmware, weight,
actual settings etc. through sysfs attributes.
Event handling of this mouse differs from standard hid behaviour
in that tilt button press is reported in each move event which
results in strange behaviour if not handled by the driver.

This is a heavily reworked version of the previously introduced driver.
The changes include most of the previously raised concerns,
memory leak and other fixes, code cleanups, adoption of additional
achieved knowlege about the hardware and is (IMHO) a much better version
than before even when I exchanged reduced USB-IO with a bigger memory
consumption.

I refused to implement one mentioned point:
Removing the 'just-because-we-can' attributes. Motivation:
Reading the clipped in weight: I'm no gamer and can't determine the
usefulness of this feature but if the manufacturer implements such a
feature it might make sense to someone and I would unwillingly limit the
functionality besides its such a small feature.
Reading the actual profile and dpi settings: Here I can testify that one
can get lost of the actual settings when switching back and forth.
The manufacturers windows driver has the ability for on-screen-display
of the values and there is a mouse in the market that has an lcd on the
underside of it to show these values. So I think this feature makes sense
not only for me and shouldn't be removed.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
f77e347bd44e3640bdc56003b7402c63ddb1241d 18-Mar-2010 Jiri Kosina <jkosina@suse.cz> HID: simplify error handling in hid_input_report()

The handling of failed debugging buffer allocation got overly
complicated. We simply want to skip the debugging code if allocation
fails and go on with event processing.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1caea61eda5c4d446147aa0e712ba395bb6b81c3 18-Mar-2010 Jiri Kosina <jkosina@suse.cz> HID: output event in debugfs even if hid_get_report() fails

if hid_get_report() fails for whatever reason, the raw output of
the report doesn't make it into 'events' file in debugfs at all, because
we leave hid_input_report() too soon.

We want the report to be always present for debugging reasons. Move the
code around, so that the event makes it to 'events' file all the time,
even if we are going to discard the report.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
4da361b69102cdffe73006771eae7504d2cb8736 15-Mar-2010 Bruno Prémont <bonbons@linux-vserver.org> HID: register debugfs entries before adding device

Register debugfs entries before calling device_add() so debugfs entries are
already present when HID driver's probe function gets called on device hotplug.

Also undo debugfs entry registration if device_add() fails so status
HID_STAT_ADDED and debugfs registration status remain consistent and we don't
leak the debugfs entries.

Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
3ee8f0a2b1c81f0472b25d40aa5c1c7c6a0edc2a 13-Mar-2010 Markus Rathgeb <rathgeb.markus@googlemail.com> HID: Add RGT Clutch Wheel clutch device id

This patch enables force feedback for the "RGT Force Feedback CLUTCH Racing Wheel".
It only modifies hid-core.c (hid_blacklist) and hid-tmff.c to add the new USB IDs.

Signed-off-by: Markus Rathgeb <rathgeb.markus@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
128537cea464d919febeaea2000e256749f317eb 06-Feb-2010 Michael Poole <mdpoole@troilus.org> HID: add a device driver for the Apple Magic Mouse.

The Magic Mouse requires that a driver send an unlock Report(Feature) command,
similar to the Wacom wireless tablet and Sixaxis controller quirks. This turns
on an Input Report that isn't published in the input Report descriptor that
contains touch data (and usually overrides the normal motion and click Report).

Because the mouse has only one switch and no scroll wheel, the driver
(under control of parameters) emulates a middle button and scroll wheel.
User space could also ignore and/or re-synthesize those events based on
the reported events.

Some user-space tools to talk to the mouse directly (that is, when it is not
associated with the host's HIDP stack) are at
http://github.com/entrope/linux-magicmouse

Signed-off-by: Michael Poole <mdpoole@troilus.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
90a006abf8015c8cab893555244d8fc673b24839 25-Jan-2010 Michael Poole <mdpoole@troilus.org> HID: Export hid_register_report

The Apple Magic Mouse (and probably other devices) publish reports that are not
called out in their HID report descriptors -- they only send them when enabled
through other writes to the device. This allows a driver to handle these
unlisted reports.

Signed-off-by: Michael Poole <mdpoole@troilus.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
77f720b71d88a3cbf574c113566a31c93099f97d 06-Feb-2010 Stephane Chatty <chatty@lii-enac.fr> HID: Support for MosArt multitouch panel

Added support for MosArt dual-touch panels, present in the Asus T91MT notebook.

Signed-off-by: Stephane Chatty <chatty@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
f9ce7c283c16538955d5d094101889792bcde109 20-Jan-2010 Bastien Nocera <hadess@hadess.net> HID: Enable Sixaxis controller over Bluetooth

Now that hid_output_raw_report works, port the PS3 Sixaxis
Bluetooth quirk from user-space, into kernel-space.

Signed-off-by: Bastien Nocera <hadess@hadess.net>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
f54405db66fbec11679241daefd16fd8291a5762 03-Feb-2010 Alex Neblett <alexneblett01@yahoo.com> HID: add support for Pixart Imaging Optical Touch Screen

Added support for the Pixart Imaging Inc. Optical Touch Screen found in the MSI
AE2220 and other new all in one computers to the Quanta Optical Touch
dual-touch panel driver found in the latest git clone
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git.

Signed-off-by: Alex Neblett <alexneblett01@yahoo.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
7d39e849912f0c3c8c6fc94be7bf7d120b1ee0ba 02-Feb-2010 Jiri Kosina <jkosina@suse.cz> HID: update copyright

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
cd9ec30da58bcd8ab154eba9eb54d16c67e7ef3b 21-Jan-2010 Johnathon Harris <jmharris@gmail.com> HID: add support for Ortek WKB-2000

This patch adds a new USB HID driver for the Ortek WKB-2000, working around an
incorrect LogicalMaximum value in the USB resource descriptor.

Tracked by http://bugzilla.kernel.org/show_bug.cgi?id=14787
Bug originally reported by Ubuntu users: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/405390

Signed-off-by: Johnathon Harris <jmharris@gmail.com>
Tested-by: Daniel J Blueman <daniel.blueman@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
4bb9508bbbb06f10bc3e249dd34375b4a4d6bfc0 23-Dec-2009 Jiri Kosina <jkosina@suse.cz> HID: remove TENX iBuddy from blacklist

There were multiple reports which indicate that vendor messed up horribly
and the same VID/PID combination is used for completely different devices,
some of them requiring the blacklist entry and other not.

Remove the blacklist entry for this combination of VID/PID completely, and let
the user decide and unbind the driver via sysfs eventually, if needed. Proper
fix would be fixing the vendor.

References:

http://lkml.org/lkml/2009/2/10/434
http://bugzilla.kernel.org/show_bug.cgi?id=13411

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
23aeb61e7e1f02fb0f3b8f9e798e75537ca1731d 06-Jan-2010 Christian Schuerer-Waldheim <csw@xray.at> HID: add device IDs for new model of Apple Wireless Keyboard

Added device IDs for the new model of the Apple Wireless Keyboard
(November 2009).

Signed-off-by: Christian Schuerer-Waldheim <csw@xray.at>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
49e4739a0cf681cbfe08c72232c1dcc130b66dde 13-Jan-2010 Stephane Chatty <chatty@lii-enac.fr> HID: add support for Acer T230H multitouch

Add support for the Quanta Optical Touch dual-touch panel, present in the Acer
T230H monitor, HP L2105tm, and Packard-Bell Video 200t.

Signed-off-by: Stephane Chatty <chatty@enac.fr>
Tested-by: Jerome Vidal <jerom3@free.fr>
Tested-by: Cedric Berthier <berthiec@gmail.com>
Acked-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
74f292ca8c7a2b9370f80d97a49e48174f4c7635 13-Jan-2010 Gary Stein <LordCnidarian@gmail.com> HID: add driver for the Logitech Flight System G940

Implements a new USB-HID for Force Feedback based on the normal
Logitech Force Feedback code and FF-Memless.

Currently only supports the FF_CONSTANT effect although the joystick
appears to support additional non-standard ones.

Signed-off-by: Gary Stein <LordCnidarian@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
722612cd51cf1b574c89dff57cc5dbedf1f645bb 05-Jan-2010 Jiri Kosina <jkosina@suse.cz> HID: fix parsing of local delimiter with size 0

Acording to HID standard 1.11, value 0 allows for size being 0.
Local delimiter tag has has 0 one of the possible values.

Therefore we need to handle this case properly, to be fully compliant
with the specification.

Reported-by: Marcin Tolysz <tolysz@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
d3fb5454a8474d5d22c8f8fe4d043b05732d91d5 04-Jan-2010 Stephane Chatty <chatty@lii-enac.fr> HID: add support for Stantum multitouch panel

Added support for the Stantum multitouch panel.

Signed-off-by: Stephane Chatty <chatty@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
b6353f4f36f03a12edaf3fa5365b475a28106035 22-Dec-2009 Stephane Chatty <chatty@lii-enac.fr> HID: Support for 3M multitouch panel

Add support for 3M multitouch panels.

Signed-off-by: Stephane Chatty <chatty@enac.fr>
[jkosina@suse.cz: fix build failure because of inconsistent 3M/MMM defines]
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
70c66567d1e41d8b2186a2d198997a1c8d79c0c4 09-Dec-2009 Petr Štetiar <ynezz@true.cz> HID: blacklist ET&T TC5UH touchscreen controller

This patch adds ET&T TC5UH touchscreen controller to HID blacklist,
because this device is handled by input/usbtouchscreen driver.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
e8d0eab4d9eda9f5e97852f780f020bfb134f9f0 02-Dec-2009 Jiri Kosina <jkosina@suse.cz> HID: add support for Acan FG-8100 barcode reader

Acan FG-8100 barcode reader (0x04b4/0xbca1) has vendor ID of
cypress and requires the same MIN/MAX swap descriptor quirk
as other barcode readers from cypress.

Reported-by: Stijn Ghesquiere <stijn@applesnail.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
24985cf68612a5617d396b0b188cec807641cde1 13-Nov-2009 Jiri Kosina <jkosina@suse.cz> HID: support Logitech/3DConnexion SpaceTraveler and SpaceNavigator

These devices wrongly report their axes as relative instead of absolute.

Fix this in up report descriptor of the device before it enters the parser.

Reported-by: simon.windows@gmail.com
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
ccabcd2dbe08c3b44ebae18e43ba212dfcb706d1 02-Oct-2009 Jiri Kosina <jkosina@suse.cz> HID: remove useless DRIVER_VERSION macro

DRIVER_VERSION has no use whatosoever, it has been set to "2.6"
for ages. Remove it.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
88adb72bcf3b1cc6b440fda9fa97bc2151245fc5 02-Oct-2009 Jiri Kosina <jkosina@suse.cz> HID: fix MODULE_AUTHOR usage in HID modules

Remove unused (in usbhid module) DRIVER_AUTHOR macrco and properly
use multiple MODULE_AUTHOR() instances in both modules.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
eb8141ccd32d422fa11c6e2108cae4c40456d811 02-Oct-2009 Lamarque Vieira Souza <lamarque@gmail.com> HID: blacklist Acer Ferrari 4005 optical mouse

Marks Acer Bluetooth Optical Rechargeable Mouse from Ferrari 4005 notebook to
be ignored by hid core. This change makes hid core to use input session instead
of hid session with that mouse. With hid session the mouse cursor moves too
laggy, using input session corrects this problem.

Signed-off-by: Lamarque V. Souza <lamarque@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
ff9b00a226ccea66e6ce70e9083c42f5b6001f73 01-Oct-2009 Jiri Kosina <jkosina@suse.cz> HID: fix kerneldoc comment for hid_input_report()

The kerneldoc comment for 'interrupt' has already confused a lot
of people, as it is simply wrong. It doesn't carry the information
about the context, but is used to distinguish between two fundamental
types of low-level transport transfers -- interrupt vs. control.

Make this clear in the comment.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
c4c259bcc27c4242b012106afdba183622b1735f 15-Sep-2009 Jiri Kosina <jkosina@suse.cz> HID: consolidate connect and disconnect into core code

HID core registers input, hidraw and hiddev devices, but leaves
unregistering it up to the individual driver, which is not really nice.
Let's move all the logic to the core.

Reported-by: Marcel Holtmann <marcel@holtmann.org>
Reported-by: Brian Rogers <brian@xyzw.org>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
d1ff65226c5afe55f9af38a439058f41b71e114f 15-Sep-2009 Jiri Kosina <jkosina@suse.cz> HID: fix non-atomic allocation in hid_input_report

'interrupt' variable can't be used to safely determine whether
we are running in atomic context or not, as we might be called from
during control transfer completion through hid_ctrl() in atomic
context with interrupt == 0.

Reported-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
42960a13001aa6df52ca9952ce996f94a744ea65 26-Aug-2009 Jan Scholz <Scholz@fias.uni-frankfurt.de> HID: completely remove apple mightymouse from blacklist

Commit fa047e4f6fa63a6e9d0ae4d7749538830d14a343 "HID: fix inverted
wheel for bluetooth version of apple mighty mouse" is incomplete. If
we remove Apple MightyMouse (bluetooth version) from the list of
apple_devices in drivers/hid/hid-apple.c we have to remove it from
hid_blacklist in drivers/hid/hid-core.c as well.

Signed-off-by: Jan Scholz <Scholz@fias.uni-frankfurt.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
4cfae3e80431fd113f0f4a8e1d4fff84aafe045c 02-Aug-2009 Henning Glawe <glaweh@debian.org> HID: ignore Philips IEEE802.15.4 RF Dongle

This usb device claims to be of HID class, but is in fact a 802.15.4
lowpan transceiver, therefore the generic HID driver cannot operate this
device. A separate driver for this device will be written for this using
the new 802.15.4 stack.

Signed-off-by: Henning Glawe <glaweh@debian.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
31f7fd795d17b264c3c05e4a976f963012c17c68 31-Jul-2009 Jarod Wilson <jarod@redhat.com> HID: ignore all recent SoundGraph iMON devices

After some inspection of the Windows iMON driver, several additional
device IDs were added to the lirc_imon driver. At least a few of these
have been seen in the wild, and require manual quirking to keep the
usbhid driver from binding to them. Rather than list out every single
device, ignore the entire device ID range, 0x0034 - 0x0046. Some of
these may not advertise themselves as HID devices, but no harm done to
such devices anyway. Does the right thing in brief testing w/my 0x0045
device.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Acked-by: Anssi Hannula <anssi.hannula@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
711a680e35059bc5c7c28d3c4bd0bebd3b7bb6ee 13-Jul-2009 Bruno Premont <bonbons@linux-vserver.org> HID: driver for Twinhan USB 6253:0100 remote control

Add explicit key mappings for TwinHan USB HID remote control.

All dummy Ctrl, Alt, Meta, ... key press/release events generated
by the remote are silenced by "unmapping" them. This makes Power and
Volume keys single-key and strips the regular (even while idle) key
release events for Ctrl, Alt, Meta, ...

Signed-off-by: Bruno Premont <bonbons@linux-vserver.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
7a84b1336a145d683fb8cdfd6c2c67545a58b126 29-Jun-2009 Ruben Aos Garralda <rubenatch@gmail.com> HID: add rumble support for Thrustmaster Dual Trigger 3-in-1

This patch enables rumble in Thrustmaster Dual 3-in-1 trigger gamepads (in both
PC and PS3 modes). It uses the same code as Thrustmaster FireStorm Dual Power 2,
so it only adds new USB IDs to hid-core.c and hid-tmff.c

Signed-off-by: Ruben Aos Garralda <rubenatch@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
fd30ea8c871552ddd6a5e1c0886de8fef4df53bc 23-Jun-2009 Jiri Kosina <jkosina@suse.cz> HID: add force feedback support for Logitech WingMan Formula Force GP

Add force feedback support for Logitech WingMan Formula Force GP
(0x046d/0xc293).

Reported-by: wylda@volny.cz
Tested-by: wylda@volny.cz
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
76c317d6e5cb7f58541879006d39774596962715 19-Jul-2009 Julia Lawall <julia@diku.dk> HID: Move dereferences below a NULL test

If the NULL test is necessary, then the dereferences should be moved below
the NULL test.

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
type T;
expression E,E1;
identifier i,fld;
statement S;
@@

- T i = E->fld;
+ T i;
... when != E=E1
when != i
if (E == NULL||...) S
+ i = E->fld;
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
55dba52458a11126ff4445b5b94ebde03afcf47a 26-Jun-2009 Jiri Kosina <jkosina@suse.cz> HID: fix memory leak on error path in debug code

If hid_get_report() fails, we forgot to free the already allocated buffer
for debugging messages on error path. Fix that up.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
cd667ce24796700e1a0e6e7528efc61c96ff832e 12-Jun-2009 Jiri Kosina <jkosina@suse.cz> HID: use debugfs for events/reports dumping

This is a followup patch to the one implemeting rdesc representation in debugfs
rather than being dependent on compile-time CONFIG_HID_DEBUG setting.

The API of the appropriate formatting functions is slightly modified -- if
they are passed seq_file pointer, the one-shot output for 'rdesc' file mode
is used, and therefore the message is formatted into the corresponding seq_file
immediately.

Otherwise the called function allocated a new buffer, formats the text into the
buffer and returns the pointer to it, so that it can be queued into the ring-buffer
of the processess blocked waiting on input on 'events' file in debugfs.

'debug' parameter to the 'hid' module is now used solely for the prupose of inetrnal
driver state debugging (parser, transport, etc).

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
a635f9dd83f3382577f4544a96df12356e951a40 12-Jun-2009 Jiri Kosina <jkosina@suse.cz> HID: use debugfs for report dumping descriptor

It is a little bit inconvenient for people who have some non-standard
HID hardware (usually violating the HID specification) to have to
recompile kernel with CONFIG_HID_DEBUG to be able to see kernel's perspective
of the HID report descriptor and observe the parsed events. Plus the messages
are then mixed up inconveniently with the rest of the dmesg stuff.

This patch implements /sys/kernel/debug/hid/<device>/rdesc file, which
represents the kernel's view of report descriptor (both the raw report
descriptor data and parsed contents).

With all the device-specific debug data being available through debugfs, there
is no need for keeping CONFIG_HID_DEBUG, as the 'debug' parameter to the
hid module will now only output only driver-specific debugging options, which has
absolutely minimal memory footprint, just a few error messages and one global
flag (hid_debug).

We use the current set of output formatting functions. The ones that need to be
used both for one-shot rdesc seq_file and also for continuous flow of data
(individual reports, as being sent by the device) distinguish according to the
passed seq_file parameter, and if it is NULL, it still output to kernel ringbuffer,
otherwise the corresponding seq_file is used for output.

The format of the output is preserved.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
fac733f029251a393c42a8313432f2d9fe43bb83 13-May-2009 Jussi Kivilinna <jussi.kivilinna@mbnet.fi> HID: force feedback support for SmartJoy PLUS PS2/USB adapter

This driver adds force feedback support for SmartJoy PLUS PS2/USB adapter. I
made this driver one device spesific instead of making generic 'wisegroup-ff'
because I have another Wisegroup PS2/USB adapter that doesn't work same way as
SmartJoy PLUS. If another device that is compatible pops up, this driver could
be then renamed to something more generic.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
ca2dcd40f54c8928b3994712a6cadd2078a087fa 11-May-2009 Bastien Nocera <hadess@hadess.net> HID: Wacom Graphire Bluetooth driver

Based on the work by Andrew Zabolotny, an HID driver for the Bluetooth
Wacom tablet. This is required as it uses a slightly different
protocols from what's currently support by the drivers/input/wacom*
driver, and those only support USB.

A user-space patch is required to activate mode 2 of the Wacom tablet,
as hidp does not support hid_output_raw_report.

Signed-off-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
e5288eb5ea89bd82d897cb687348bc608278f920 02-May-2009 Jiri Kosina <jkosina@suse.cz> HID: fix oops in hid_check_keys_pressed()

If the device is not claimed by hid-input (i.e devices driver by userspace
hiddev/hidraw-based drivers, or completely detached from HID
and driver by libusb), we must not check the hid->inptus, as it
is not guaranteed to be initialized, as this is performed only for devices
handled by hid-input.

Reported-by: Guillaume Chazarain <guichaz@gmail.com>
Tested-by: Guillaume Chazarain <guichaz@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
243b706d8a71364ad6080328d45b73516c8af5f3 17-Apr-2009 Christophe Borivant <christophe.borivant@wanadoo.fr> HID: Add support for the G25 force feedback wheel in native mode

Add Product Id 0xc299 for the Logitech G25 force feedback wheel
The Logitech G25 force feedback wheel, is first recognize by the kernel
with the product id "0xc294". In this mode, we can't use all the axes
and buttons of the wheel.

Using a userland utility, it is possible to make the wheel switch to native
mode -- http://svn.vdrift.net/viewvc.cgi/trunk/tools/G25manage/?root=VDrift
In native mode, the wheel change its id number to "0xc299".

The packet that needs to be sent to the wheel to swtich to native mode and
change its PID is

{ 0xf8, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00 }

Signed-off-by: Christophe Borivant <christophe.borivant@wanadoo.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
afa5eb7c68689ced4284f01c96feed44a2d0a127 18-Mar-2009 Jiri Slaby <jirislaby@gmail.com> HID: remove compat stuff

This removal was scheduled and there is no problem with later
distros to adapt for the new bus, thanks to aliases.

module-init-tools map files are deprecated nowadays, so that
the patch which introduced hid ones into the m-i-t won't be
accepted and hence there is no reason for leaving compat stuff in.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
794227415f8f5f395a9ed4269a4ee7a3c34f66a5 11-Mar-2009 Jiri Kosina <jkosina@suse.cz> HID: add support for Kye/Genius Ergo 525V

This device sends several buttons in a separate field, which is
wrongly described in the report descriptor. Fix it in the following
way:

- change led usage page to button
- report size 8 count 1 becomes report size 1 count 8
- the button usage range changed to 4-7 (the mouse has three buttons in
a different field already).

Reported-by: Tomas Hanak <tomas.hanak@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
fef3f571ecc2a82395c531d97b3f71a59e04e946 05-Mar-2009 Ryan Finnie <ryan@finnie.org> HID: Support Apple mini aluminum keyboard

New USB device ids and quirks for the "mini" Apple USB aluminum
keyboards released Tuesday, model A1242. Note that while I own the ANSI
(0x021d) version and cannot verify that the ISO (0x021e) and JIS
(0x021f) versions exist, previous releases have followed the triple id
convention for awhile now, and the device ids fit perfectly between
USB_DEVICE_ID_APPLE_GEYSER4_* and USB_DEVICE_ID_APPLE_ALU_*.

Signed-off-by: Ryan Finnie <ryan@finnie.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
fdf93aa33268889e126aa677f2072238bd76adb0 04-Mar-2009 Jiri Kosina <jkosina@suse.cz> HID: support for Kensington slimblade device

0x47d/0x2041 device sends two extra buttons in 0xff00 usage
page and therefore requires special handling.

Reported-by: Jason Noble <nobleja@polezero.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
3f866fbd52d1863db5c07700e560aef22c4fdc01 04-Mar-2009 Richard Walmsley <richwalm@gmail.com> HID: DragonRise game controller force feedback driver

Adds force feedback support for USB DragonRise Inc. game controllers.
These devices are mass produced in China and distributed under several vendors.

Signed-off-by: Richard Walmsley <richwalm@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
0361a28d3f9a4315a100c7b37ba0b55cfe15fe07 17-Dec-2008 Oliver Neukum <oliver@neukum.org> HID: autosuspend support for USB HID

This uses the USB busy mechanism for aggessive autosuspend of USB
HID devices. It autosuspends all opened devices supporting remote wakeup
after a timeout unless

- output is being done to the device
- a key is being held down (remote wakeup isn't triggered upon key release)
- LED(s) are lit
- hiddev is opened

As in the current driver closed devices will be autosuspended even if they
don't support remote wakeup.

The patch is quite large because output to devices is done in hard interrupt
context meaning a lot a queuing and locking had to be touched. The LED stuff
has been solved by means of a simple counter. Additions to the generic HID code
could be avoided. In addition it now covers hidraw. It contains an embryonic
version of an API to let the generic HID code tell the lower levels which
capabilities with respect to power management are needed.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
daedb3d6a91f9626ab4c921378ac52e44de833d5 14-Feb-2009 Anssi Hannula <anssi.hannula@gmail.com> HID: move tmff and zpff devices from ignore_list to blacklist

The devices handled by hid-tmff and hid-zpff were added in the
hid_ignore_list[] instead of hid_blacklist[] in hid-core.c, thus
disabling them completely.

hid_ignore_list[] causes hid layer to skip the device, while
hid_blacklist[] indicates there is a specific driver in hid bus.

Re-enable the devices by moving them to the correct list.

Signed-off-by: Anssi Hannula <anssi.hannula@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
35cfd1d964f3c2420862f2167a0eb85ff1208999 01-Feb-2009 Michael Tokarev <mjt@tls.msk.ru> HID: blacklist Powercom USB UPS

For quite some time users with various UPSes from Powercom were forced to play
magic with bind/unbind in /sys in order to be able to see the UPSes. The
beasts does not work as HID devices, even if claims to do so. cypress_m8
driver works with the devices instead, creating a normal serial port with which
normal UPS controlling software works.

The manufacturer confirmed the upcoming models with proper HID support will
have different device IDs. In any way, it's wrong to have two completely
different modules for one device in kernel.

Blacklist the device in HID (add it to hid_ignore_list) to stop this mess,
finally.

Signed-off-By: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
bae7eb33b25387fdc7ccae08768bef1f9484a5b0 28-Jan-2009 Jiri Kosina <jkosina@suse.cz> HID: document difference between hid_blacklist and hid_ignore_list

Many people get it wrong and add device IDs into hid_blacklist instead
of hid_ignore_list. Let's put a little comment in place.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
656f1fb90aa2261daa316c0dd8f75e3420f81e9e 28-Jan-2009 Jarod Wilson <jarod@redhat.com> HID: add antec-branded soundgraph imon devices to blacklist

hid_ignore_list additions for the Antec-branded SoundGraph iMon VFD and LCD
devices (0x15c2:0x0044 and 0x0045).

These devices are driven by lirc.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
5f6108cf9be4a77d6bee96750aa4fe18b6b97dee 08-Dec-2008 Alexey Klimov <klimov.linux@gmail.com> HID: don't allow DealExtreme usb-radio be handled by usb hid driver

This device is already handled by radio-si470x driver, and we therefore
want usbhid to ignore it. Patch places usb ids of that device in
ignore section of hid-core.c

Signed-off-by: Alexey Klimov <klimov.linux@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
f14f526d02b14fd0b8c1ac4ec413e4577ad5f62e 04-Jan-2009 Lev Babiev <harley@hosers.org> HID: driver for TopSeed Cyberlink quirky remote

I recently picked up a Cyberlink branded remote control produced
by TopSeed Tech Corp. Alas, it appears that this device is using
non-standard mappings for some of it's keys (Usage page 0xffbc).

Signed-off-by: Lev Babiev <harley@hosers.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
42859e0bd21daba9974757fcfe4a4dde265fe28d 11-Dec-2008 Lukasz Lubojanski <lukasz@lubojanski.info> HID: force feedback driver for GreenAsia 0x12 PID

I have implemented Force Feedback driver for another "GreeAsia" based device
(0e8f:0012 "GreenAsia Inc. USB Joystick"). The functionality was tested with
MANTA Warior MM816 and SpeedLink Strike2 SL-6635 and fftest software -
everything seems to work right.

Signed-off-by: Lukasz Lubojanski <lukasz@lubojanski.info>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
3a6f82f7a22cf19687f556997c6978b31c109360 24-Nov-2008 Jiri Slaby <jirislaby@gmail.com> HID: add dynids facility

Allow adding new devices to the hid drivers on the fly without
a need of kernel recompilation.

Now, one can test a driver e.g. by:
echo 0003:045E:00F0.0003 > ../generic-usb/unbind
echo 0003 045E 00F0 > new_id
from some driver subdir.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
94011f93f2cd7410401e22390cf7a14fe5495a22 19-Nov-2008 Rafi Rubin <rafi@seas.upenn.edu> HID: add n-trig digitizer support

Added quirks for the N-Trig digitizer.

Signed-off-by: Rafi Rubin <rafi@seas.upenn.edu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
6bbe586fd4d94439f3960e200056ff057f7db5c6 31-Oct-2008 Kay Sievers <kay.sievers@vrfy.org> HID: struct device - replace bus_id with dev_name(), dev_set_name()

This patch is part of a larger patch series which will remove
the "char bus_id[20]" name string from struct device. The device
name is managed in the kobject anyway, and without any size
limitation, and just needlessly copied into "struct device".

To set and read the device name dev_name(dev) and dev_set_name(dev)
must be used. If your code uses static kobjects, which it shouldn't
do, "const char *init_name" can be used to statically provide the
name the registered device should have. At registration time, the
init_name field is cleared, to enforce the use of dev_name(dev) to
access the device name at a later time.

We need to get rid of all occurrences of bus_id in the entire tree
to be able to enable the new interface. Please apply this patch,
and possibly convert any remaining remaining occurrences of bus_id.

We want to submit a patch to -next, which will remove bus_id from
"struct device", to find the remaining pieces to convert, and finally
switch over to the new api, which will remove the 20 bytes array
and does no longer have a size limitation.

CC: Jiri Kosina <jkosina@suse.cz>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
08ef08ee8c5a8d538ca9a3c433d4213c128af863 30-Oct-2008 Alan Stern <stern@rowland.harvard.edu> HID: automatically call usbhid_set_leds in usbhid driver

This patch (as1146c) makes usbhid automatically call usbhid_set_leds()
for any device that supports the keyboard boot protocol.

In theory this should be perfectly safe. BIOSes send the LED output
report as part of their normal device initialization, so any keyboard
device supporting the boot protocol has to be able to handle it.

As a side effect, the hid-dell and hid-bright drivers are no longer
needed, and the Logitech keyboard driver can be removed from hid-lg.

CC: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
ac26fca3e14c8882e382daa7e96ab73e0186cf03 20-Nov-2008 Jiri Kosina <jkosina@suse.cz> HID: ignore mouse interface for unibody macbooks

The mouse interface on unibody macbooks is going to be handled by
bcm59743 driver in 2.6.29.

Reported-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
ee8a1a0a1a5817accd03ced7e7ffde3a4430f485 26-Nov-2008 Jan Scholz <Scholz@fias.uni-frankfurt.de> HID: Apple ALU wireless keyboards are bluetooth devices

While parsing 'hid_blacklist' in the apple alu wireless keyboard is not found.
This happens because in the blacklist it is declared with HID_USB_DEVICE
although the keyboards are really bluetooth devices. The same holds for
'apple_devices' list.

This patch fixes it by changing HID_USB_DEVICE to HID_BLUETOOTH_DEVICE in those
two lists.

Signed-off-by: Jan Scholz <Scholz@fias.uni-frankfurt.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
578f3a35fecabff49bad808c5301313f785b5462 20-Nov-2008 Jiri Kosina <jkosina@suse.cz> HID: add USB ID for another dual gameron adapter

0x0810/0x0002 needs the very same handling as 0x0001.

Reported-by: Steve Conklin <sconklin@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
06d2148ed3b3fa997fa5a848f6405709c464b3ba 20-Nov-2008 Jiri Kosina <jkosina@suse.cz> HID: unignore mouse on unibody macbooks

In commit a96d6ef34, the mouse interfaces on the unibody macbooks were
put into hid mouse ignore list. This was a little bit too premature
though, as the corresponding bcm5974 changes are scheduled for 2.6.29.

Remove these devices from the ignore list for now, in order to provide at
least basic functionality with the HID driver.

Will be reintroduced in 2.6.29

Reported-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
5181e594512faeac7d7fd9620ce91105f45bf643 17-Nov-2008 Jiri Kosina <jkosina@suse.cz> HID: fix blacklist entries for greenasia/pantherlord

Fix misplaced quirk entries for devices driven by hid-pl driver. The
devices shouls be only blacklisted by generic HID driver, not completely
ignored.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
62a56582e01b1c5139b235004548e233201df9aa 13-Nov-2008 Alexey Klimov <klimov.linux@gmail.com> HID: fix radio-mr800 hidquirks

This patch fixes radio-mr800 hidqurks. Removes it from blacklist entry
and places it in ignore entry in hid/hid-core.c

Signed-off-by: Alexey Klimov <klimov.linux@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
c91c21c5a6facddce936d82e5bc0c655d04288aa 13-Nov-2008 Alexey Klimov <klimov.linux@gmail.com> HID: fix kworld fm700 radio hidquirks

This patch fixes kworld fm700 usb-radio hidqurks that handled by
radio-si470x. Removes it from blacklist entry and places it in ignore
entry in hid/hid-core.c

The bug went in through the V4L/DVB tree by commit 6a13378a without
HID maintainer being involved at all.

Signed-off-by: Alexey Klimov <klimov.linux@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
43ff3a48c13f3ddc085271c2eea2985d28c8aa08 10-Nov-2008 Andi Kleen <andi@firstfloor.org> HID: use single threaded work queue for hid_compat

Use single threaded work queue for hid_compat

I doubt HID really needs to scale over multiple CPUs. So only use a
single threaded workqueue for HID_COMPAT. This avoids some excessive
thread use on systems with a larger number of CPUs.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
a96d6ef34751093797c3a6c6080733dd7af23d35 04-Nov-2008 Henrik Rydberg <rydberg@euromail.se> HID: support for new unibody macbooks

The unibody MacBook 5 and MacBook Pro 5 come with a new version of
the bcm5974 trackpad. This patch adds the USB device ids and all
the appropriate quirks, including hid_blacklist.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
6a13378a56ce06afca9db75f3d4e663fba5f0992 20-Oct-2008 Alexey Klimov <klimov.linux@gmail.com> V4L/DVB (9337a): HID: Don't allow KWorld radio fm700 be handled by usb hid drivers

This device is already handled by radio-si470x driver, and we
therefore want usbhid to ignore it.

Signed-off-by: Alexey Klimov <klimov.linux@gmail.com>
Acked-by: Tobias Lorenz <tobias.lorenz@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
fa157bdfe87c5ea98a80b96cb08f1ab509e21a52 30-Oct-2008 Alan Stern <stern@rowland.harvard.edu> HID: add quirk entry for no-name keyboard (0x13ba/0x0017)

This patch (as1157) adds a no-name PS/2-to-USB keyboard+mouse adapter
to the hid-dell driver. (The device shows up with a Product string
saying "Generic USB K/B", nothing more.) This will force an initial
"Set-LEDs" report to be sent to the device, without which it won't
send any keystroke information. Several bug reports mentioning this
device have been filed in various forums; the patch should resolve
them.

This is just a temporary stop-gap for 2.6.28. A later patch for
2.6.29 will introduce a more generic mechanism for "Set-LEDs", making
this change (and the entire hid-dell driver) unnecessary.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
cc6e0bbb47f02fd36cd55b3189c0c79079096ab8 23-Oct-2008 Jiri Kosina <jkosina@suse.cz> HID: Add support for Sony Vaio VGX-TP1E

The Sony Vaio VGX-TP1E multimedia PC has a wireless keyboard with
a touchpad.

The mouse pointer is wrongly declared as constant non-data variable, which make
HID code to completely ignore all the "Pointer" usages.
Fix the report descriptor before it enters the parser to contain touchpad
pointer description that is correctly parsable (declaring data rather than
constant).

Reported-by: Stefan Hundhammer <sh@suse.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
b4d8e4736c94e78fd846dca0c95a3a0710582584 22-Oct-2008 Jiri Slaby <jirislaby@gmail.com> HID: fix hidbus/appletouch device binding regression

The appletouch mouse devices are grabbed by the hid bus and not
released even if apple driver says ENODEV (as expected) -- these
are composite USB devices, for which we only ignore the mouse
interface. This is currently not handled by hidbus code properly.

Move the ignoring one level upper to forbid the hid layer to grab the
device.

Reported-by: Justin Mattock <justinmattock@gmail.com>
Reported-by: Steven Noonan <steven@uplinklabs.net>
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
ac2d98998c32fcdc8d8919b7a4536a7945fd0422 20-Oct-2008 Jiri Kosina <jkosina@suse.cz> HID: quirk for OLED devices present in ASUS G50/G70/G71

The new revision of OLED device (0x0b05/0x175b) found in ASUS G50/G70/G71
should be ignored the same way we currently do for 0x1726, so that asus_oled
driver can make use of the device.

Reported-by: Costin Grigoras <costin.grigoras@cern.ch>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1e093206734568e780c2717da1c89b97e9471954 17-Oct-2008 Jiri Kosina <jkosina@suse.cz> HID: add support for another Gyration remote control

There is a slightly different Gyration remote control, which
requires the quirks we already have in place for the 0x0002 PID,
plus KEY_MEDIA mapping is different.

Reported-by: Marc Randolph <mrand@pobox.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
022b7024d4bb1f9a2f30021a2672a0f940ebfa7a 17-Oct-2008 Dan Nicholson <dbn.lists@gmail.com> Revert "HID: Invert HWHEEL mappings for some Logitech mice"

This reverts commit 740f370dc61dc478d891d7d47660bb3ae39ddb4f.

It turned out to be correct in the first place: a positive value should
be sent when the wheel is moved to the right, and a negative value when
moved to the left. This is the behavior expected by the Xorg evdev
driver. I must have had a remapping somewhere else in my system when
originally testing this. Testing on another system shows that the
unpatched kernel is correct.

Here is a bug report from Mandriva that brought the problem to my
attention:

https://qa.mandriva.com/show_bug.cgi?id=44309#c19

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
24c88eb671b437d700fbfa7aa79adeb9690db1eb 16-Oct-2008 Jarod Wilson <jarod@redhat.com> HID: blacklist additional SoundGraph iMon LCD models

hid_ignore_list additions for more SoundGraph iMon LCD devices

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
df9bcace7b1c29e9be1c13b034ff04f4f4c90ede 14-Oct-2008 Jiri Kosina <jkosina@suse.cz> HID: add missing blacklist entry for Apple ATV ircontrol

This device is already handled by hid-apple driver, but the blacklist entry
was missing in generic driver.

Reported-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
a48c65b35a6f993aec13d18a37f6ea71fbcb0c06 14-Oct-2008 Mauro Carvalho Chehab <mchehab@redhat.com> 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>
ffcf70fb0693f1ab0133f973b5b9c552be766b16 14-Oct-2008 Mauro Carvalho Chehab <mchehab@redhat.com> HID: Don't let Avermedia Radio FM800 be handled by usb hid drivers

Based on an original patch from Alexey Klimov <klimov.linux@gmail.com>,
against kernel version 2.6.27.

This device is already handled by radio-mr800 driver, and we therefore
want usbhid not to touch it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
0dc491682f6e673a14c643d9a3e7305ce4616b96 14-Oct-2008 Mauro Carvalho Chehab <mchehab@redhat.com> HID: fix numlock led on Dell device 0x413c/0x2105

This keyboard needs to re-sync numlock after probing.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
987fbc1f7d446f4bf7063d3b756ae29db80be75e 18-Sep-2008 Jiri Slaby <jirislaby@gmail.com> HID: move zeroplus FF processing

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10e41a711e55f485709b4ca157e587cf36ef5a69 18-Sep-2008 Jiri Slaby <jirislaby@gmail.com> HID: move thrustmaster FF processing

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
5f022298aab58ddff9bccdb28b82a59109789da9 18-Sep-2008 Jiri Slaby <jirislaby@gmail.com> HID: move pantherlord FF processing

Move the force feedback processing into a separate module.

[jkosina@suse.cz: fix Kconfig texts a little bit]

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
d92870ddd248e8c2562a8c4047885d3ad221ece7 09-Sep-2008 Jiri Slaby <jirislaby@gmail.com> HID: fix tty<->hid deadlock

hid_compat_load() runs on the default workqueue, it request_module(), it
execs modprobe, it exits, tty flushes default workqueue, it hangs, because
we are still in it.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Tested-by: <Valdis.Kletnieks@vt.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
d1d3a5f6eaee337d793ab9ac28e696f0262c3c8a 09-Sep-2008 Remi Cattiau <remi@cattiau.com> HID: ignore iBuddy devices

iBuddy devices claim to be HID devices, but they are not.
Add them to the blacklist.

Signed-off-by: Remi Cattiau <remi@cattiau.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
c0bd6a429819f794f626f9e73be4564e18e132db 27-Aug-2008 Richard Hughes <rhughes@redhat.com> HID: remove ignore quirk for MGE UPS devices

This patch reverts the change made four years ago here:
http://www.vg.kernel.org/pub/linux/kernel/people/gregkh/usb/2.4/usb-hid-2.4.25-pre7.patch

UPS's made by MGE can be used with usbhid just fine, and by removing the
ignore quirk allows them to be used with HAL so they just work when plugged
in, without needing to be manually configured.

With the ignore quirk in place a user would have to configure NUT before the
UPS could be used, as NUT uses it's own internal USB matching framework
to match against the USB devices, do low level control messages on the
device and then parse the HID tables all in userspace.

This is not needed, as allowing the device to be claimed as a usbhid device
allows it to be used like any other USB UPS device. The devices correctly
advertise the power device page which can be queried for the device state.

I assume the quirk was changed so that people using < libusb 0.1.8 could
still use NUT's internal HID code to manage the UPS.
libusb 0.1.8 was released quite some time ago: 2004-02-11.

This patch does not break NUT as in drivers/libusb.c the device is force
unbound from the kernel driver using usb_detach_kernel_driver_np () where
it can be controlled like normal.

[jkosina@suse.cz: adapt to the new hidbus code]

Signed-off-by: Richard Hughes <rhughes@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
0f37cd0306463ad35f958d8f74a2b00e5b190b4b 20-Aug-2008 Jiri Kosina <jkosina@suse.cz> HID: introduce list for hiddev creation forcing

Introduce a list of devices for which there is need to
force a creation of the hiddev interface, but still they
are operated by generic driver (i.e. certain UPS).

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
606bd0a8616a0e59021cb2997e942513f24f641d 04-Jul-2008 Jiri Slaby <jirislaby@gmail.com> HID: move logitech FF processing

Merge the logitech force feedback processing directly into logitech
driver from the usbhid core.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
93c10132a7ac160df3175b53f7ee857625412165 27-Jun-2008 Jiri Slaby <jirislaby@gmail.com> HID: move connect quirks

Move connecting from usbhid to the hid layer and fix also hidp in
that manner.
This removes all the ignore/force hidinput/hiddev connecting quirks.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
fea6f1833b5bbff7066bcde1fa1141c9717bbad2 26-Jun-2008 Jiri Slaby <jirislaby@gmail.com> HID: move dell quirks

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
bd28ce008bdc68ef5902f68d2d62cbb7fa78c415 25-Jun-2008 Jiri Slaby <jirislaby@gmail.com> HID: move sony quirks

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
980a3da6acdd577ee3ae192e868dc52fe4b7f2e5 25-Jun-2008 Jiri Slaby <jirislaby@gmail.com> HID: move samsung quirks

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
949f8fef77186c7361d22e1ea6f42c76ceda42b0 24-Jul-2008 Jiri Slaby <jirislaby@gmail.com> HID: move gyration quirks

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
3b8006e51038ef263a0404756d9e190c9a9f74d5 25-Jun-2008 Jiri Slaby <jirislaby@gmail.com> HID: move monterey quirks

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1e76253220dbe66e048e55680266dd1f4af0be85 24-Jun-2008 Jiri Slaby <jirislaby@gmail.com> HID: move petalynx quirks

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
b5635b129b3ca3a9c879a36f58f5b8c4903d267a 24-Jun-2008 Jiri Slaby <jirislaby@gmail.com> HID: move belkin quirks

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
fcfacfd3594d5d2fa99fb5e7d33dee3904b1a156 24-Jun-2008 Jiri Slaby <jirislaby@gmail.com> HID: move chicony quirks

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1f243e302cea1561ac881eb5d27041c5342beba4 24-Jun-2008 Jiri Slaby <jirislaby@gmail.com> HID: move ezkey quirks

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
3b239cd739a9499da08326356add3d9d992c7911 24-Jun-2008 Jiri Slaby <jirislaby@gmail.com> HID: move cherry quirks

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
14a21cd459f97e3b3cc4fcde48fc5bcdb81d097e 23-Jun-2008 Jiri Slaby <jirislaby@gmail.com> HID: move a4tech quirks

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
0f2213208f8da51bcb665309e3468f000489c04f 23-Jun-2008 Jiri Slaby <jirislaby@gmail.com> HID: move cypress quirks

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
90231e7eaf752856a2c13f786f36ec7f641bad28 23-Jun-2008 Jiri Slaby <jirislaby@gmail.com> HID: move sunplus quirks

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
78a849a682a1d5ee7b7187b08abdc48656326a4e 20-Jun-2008 Jiri Slaby <jirislaby@gmail.com> HID: move microsoft quirks

Move them from the core code to a separate driver.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
880d29f109428be1d027adf919a7457d8fe41fd3 18-Jun-2008 Jiri Slaby <jirislaby@gmail.com> HID: indent switches/cases

Bring switch and cases into coding style and save thus some
indentation to make the code tighter.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
02ae9a1a8bc1d08a8fd5f6a0b8bde400b0f891b9 16-May-2008 Jiri Slaby <jirislaby@gmail.com> HID: add compat support

Add compat option to hid code to allow loading of all modules on
systems which don't allow autoloading because of old userspace.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8c19a51591d06f5226499972567f528cf6066bb7 18-Jun-2008 Jiri Slaby <jirislaby@gmail.com> HID: move apple quirks

Move them from the core code to a separate driver.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
d458a9dfc4de24870b8c747484b1988726534bee 16-May-2008 Jiri Slaby <jirislaby@gmail.com> HID: move ignore quirks

Move ignore quirks from usbhid-quirks into hid-core code. Also don't output
warning when ENODEV is error code in usbhid and try ordinal input in hidp
when that error is returned.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
5f22a7992349c5ca3842190be52d5e9a1dd7adf4 16-May-2008 Jiri Slaby <jirislaby@gmail.com> HID: move logitech quirks

Move them from the core and input code to a separate driver.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
c500c9714011edab021591340042787722db9cf0 16-May-2008 Jiri Slaby <jirislaby@gmail.com> HID: hid, make parsing event driven

Next step for complete hid bus, this patch includes:
- call parser either from probe or from hid-core if there is no probe.
- add ll_driver structure and centralize some stuff there (open, close...)
- split and merge usb_hid_configure and hid_probe into several functions
to allow hooks/fixes between them

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
85cdaf524b7ddab627e7d15405693f2511ef7505 16-May-2008 Jiri Slaby <jirislaby@gmail.com> HID: make a bus from hid code

Make a bus from hid core. This is the first step for converting all the
quirks and separate almost-drivers into real drivers attached to this bus.

It's implemented to change behaviour in very tiny manner, so that no driver
needs to be changed this time.

Also add generic drivers for both usb and bt into usbhid or hidp
respectively which will bind all non-blacklisted device. Those blacklisted
will be either grabbed by special drivers or by nobody if they are broken at
the very rude base.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
6f0168d2dacd7972d887e1ca27943ef8af7512a5 16-May-2008 Harvey Harrison <harvey.harrison@gmail.com> HID: use get/put_unaligned_* helpers

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
c105068f2b35343eecf2bf16ee29a362b6121fa3 29-Apr-2008 Harvey Harrison <harvey.harrison@gmail.com> hid-core: use get_unaligned_* helpers

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
abdff0f7749a6696ba2a4238b675cbc55abcdb7a 31-Mar-2008 Adrian Bunk <bunk@kernel.org> HID: make hid_input_field and usbhid_modify_dquirk static

This patch makes the following needlessly global functions static:
- hid-core.c:hid_input_field()
- usbhid/hid-quirks.c:usbhid_modify_dquirk()

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
b54ec3c13cf77d21bab25d8bb117f642561fdf4f 28-Mar-2008 Jiri Kosina <jkosina@suse.cz> HID: pass numbered reports properly to hidraw

The numbered reports need to be passed properly to hidraw (i.e. with the first
data field indicating the report number), otherwise userspace has no idea
about the identification of the report.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
282bfd4cbcc2bbeb1a2cad1f42debd378e0b5ac9 28-Mar-2008 Jiri Slaby <jirislaby@gmail.com> HID: fix sparse warnings

Fix these sparse warnings:
.../hid/hid-core.c:100:15: warning: incorrect type in assignment (different signedness)
.../hid/hid-core.c:100:15: expected signed int [usertype] *value
.../hid/hid-core.c:100:15: got unsigned int *<noident>
by unsigned -> s32

.../hid/hid-input-quirks.c:336:10: warning: Using plain integer as NULL pointer
by 0 -> NULL

.../hid/usbhid/hid-core.c:786:46: warning: incorrect type in argument 3 (different signedness)
.../hid/usbhid/hid-core.c:786:46: expected int *max
.../hid/usbhid/hid-core.c:786:46: got unsigned int *<noident>
.../hid/usbhid/hid-core.c:787:47: warning: incorrect type in argument 3 (different signedness)
.../hid/usbhid/hid-core.c:787:47: expected int *max
.../hid/usbhid/hid-core.c:787:47: got unsigned int *<noident>
.../hid/usbhid/hid-core.c:788:48: warning: incorrect type in argument 3 (different signedness)
.../hid/usbhid/hid-core.c:788:48: expected int *max
.../hid/usbhid/hid-core.c:788:48: got unsigned int *<noident>
by int -> unsigned int

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
377e10fbb4ef219f540d06796e9fb0d3ec35a58f 22-Mar-2008 Anssi Hannula <anssi.hannula@gmail.com> HID: only dump report traffic with debug level 2

Currently using debug=1 with hid module prints out all sent and received
reports to the kernel log, while in many cases we only want to see the
report descriptors and hid-input mappings that are printed when a device
is probed.

Add new level debug=2, and only dump the report traffic with that level.

Signed-off-by: Anssi Hannula <anssi.hannula@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
dfd347f09c66beed2ae621aad5fd75535b1838d4 04-Mar-2008 Jiri Kosina <jkosina@suse.cz> HID: fix comment in hid_input_report()

The hid_input_report() in debug mode of course outputs the report itself, not
the device report descriptor.

Fix this error in comment.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
c4124c9b68bf8ecf1e8afedad3a22e18666cb6f3 30-Nov-2007 Jiri Kosina <jkosina@suse.cz> HID: remove redundant WARN_ON()s in order not to scare users

The WARN_ON() in implement() and extract() spit out stacktraces and
a lot of other information that might make users think that there is
something seriously wrong with the system. WARN_ON() should not be
deliberately triggerable by userspace application, which these can be.
Usually this WARN_ON() triggers when hid2hci utility is sending the
data that don't correspond to the device's report descriptor.

Convert these messages to more friendly printk().

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
86166b7bcda0bcb53525114fa1c87ac432be478e 14-May-2007 Jiri Kosina <jkosina@suse.cz> HID: add hidraw interface

hidraw is an interface that is going to obsolete hiddev one
day.

Many userland applications are using libusb instead of using
kernel-provided hiddev interface. This is caused by various
reasons - the HID parser in kernel doesn't handle all the
HID hardware on the planet properly, some devices might require
its own specific quirks/drivers, etc.

hiddev interface tries to do its best to parse all the received
reports properly, and presents only parsed usages into userspace.
This is however often not enough, and that's the reason why
many userland applications just don't use hiddev at all, and
rather use libusb to read raw USB events and process them on
their own.

Another drawback of hiddev is that it is USB-specific.

hidraw interface provides userspace readers with really raw HID
reports, no matter what the low-level transport layer is (USB/BT),
and gives the userland applications all the freedom to process
the HID reports in a way they wish to.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
58037eb961f859607b161c50d9d4ecb374de1e8f 30-May-2007 Jiri Kosina <jkosina@suse.cz> HID: make debugging output runtime-configurable

There have been many reports recently about broken HID devices, the
diagnosis of which required users to recompile their kernels in order
to be able to provide debugging output needed for coding a quirk for
a particular device.

This patch makes CONFIG_HID_DEBUG default y if !EMBEDDED and makes it
possible to control debugging output produced by HID code by supplying
'debug=1' module parameter.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
e63340ae6b6205fef26b40a75673d1c9c0c8bb90 08-May-2007 Randy Dunlap <randy.dunlap@oracle.com> header cleaning: don't include smp_lock.h when not used

Remove includes of <linux/smp_lock.h> where it is not used/needed.
Suggested by Al Viro.

Builds cleanly on x86_64, i386, alpha, ia64, powerpc, sparc,
sparc64, and arm (all 59 defconfigs).

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
f142b3a4f64eca235f5890d9cecb68482f62ed26 16-Apr-2007 Jiri Kosina <jkosina@suse.cz> HID: update copyright and authorship macro

Updates Copyright and DRIVER_AUTHOR in HID and USB HID sources.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
46386b587086c8d2698222a031bf749688464032 12-Mar-2007 Simon Budig <simon@budig.de> HID: introduce proper zeroing of unused bits in output reports

Some HID devices are looking on the unused bits in the HID reports they
receive. This is violating the specification, but we want to make those
devices work. Well-behaving devices are unaffected, as they don't care
about the unused bits.

If bitsused % 8 is 0 all bits in data[] get used and we don't need to
clear anything. Otherwise (bitsused % 8) bits of the last byte get used.
By shifting 1 for (bitsused % 8) bits and subtracting 1 we create a mask
consisting of (bitsused % 8) ones and remaining zeroes. By ANDing we
clear the upper unused bits.

Signed-off-by: Simon Budig <simon@budig.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8da7d1bae512aee155ef02f7ab1266358842e1fd 05-Apr-2007 Adam Kropelin <akropel1@rochester.rr.com> HID: Do not discard truncated input reports

Truncated reports should not be discarded since it prevents buggy
devices from communicating with userspace.

Prior to the regession introduced in 2.6.20, a shorter-than-expected
report in hid_input_report() was passed thru after having the missing
bytes cleared. This behavior was established over a few patches in the
2.6.early-teens days, including commit
cd6104572bca9e4afe0dcdb8ecd65ef90b01297b.

This patch restores the previous behavior and fixes the regression.

Signed-off-by: Adam Kropelin <akropel1@rochester.rr.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
b87496aa493a540b9c084b16b73f915705ebdbcc 14-Mar-2007 Al Viro <viro@ftp.linux.org.uk> [PATCH] hid-core endianness annotations

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
d108d4fe34730135647fe32a4f8091491d3542ea 10-Mar-2007 Jiri Kosina <jkosina@suse.cz> HID: zeroing of bytes in output fields is bogus

This patch removes bogus zeroing of unused bits in output reports,
introduced in Simon's patch in commit d4ae650a.
According to the specification, any sane device should not care
about values of unused bits.

What is worse, the zeroing is done in a way which is broken and
might clear certain bits in output reports which are actually
_used_ - a device that has multiple fields with one value of
the size 1 bit each might serve as an example of why this is
bogus - the second call of hid_output_report() would clear the
first bit of report, which has already been set up previously.

This patch will break LEDs on SpaceNavigator, because this device
is broken and takes into account the bits which it shouldn't touch.
The quirk for this particular device will be provided in a separate
patch.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
47a80edb1d80ae644ea374a016c8e68d43d2671f 12-Mar-2007 Jiri Kosina <jkosina@suse.cz> HID: allocate hid_parser in a proper way

hid_parser is non-trivially large structure, so it should be allocated
using vmalloc() to avoid unsuccessful allocations when memory fragmentation
is too high.
This structue has a very short life, it's destroyed as soon as the report
descriptor has been completely parsed.

This should be considered a temporary solution, until the hid_parser is
rewritten to consume less memory during report descriptor parsing.

Acked-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
776c0e96edecf77f827a62d2a1641cc2ca479043 21-Feb-2007 Jiri Kosina <jkosina@suse.cz> HID: fix possible double-free on error path in hid parser

Freeing of device->collection is properly done in hid_free_device() (as
this function is supposed to free all the device resources and could be
called from transport specific code, e.g. usb_hid_configure()).

Remove all kfree() calls preceeding the hid_free_device() call.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
4237081e573b99a48991aa71364b0682c444651c 20-Feb-2007 Jiri Kosina <jkosina@suse.cz> HID: fix bug in zeroing the last field byte in output reports

d4ae650a904612ffb7edd3f28b69b022988d2466 introduced zeroing of the
last field byte in output reports in order to make sure the unused
bits are set to 0. This is done in a wrong way, resulting in a
wrong bits being zeroed out (not properly shifted by the field offset
in the report). Fix this.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
cd354f1ae75e6466a7e31b727faede57a1f89ca5 14-Feb-2007 Tim Schmielau <tim@physik3.uni-rostock.de> [PATCH] remove many unneeded #includes of sched.h

After Al Viro (finally) succeeded in removing the sched.h #include in module.h
recently, it makes sense again to remove other superfluous sched.h includes.
There are quite a lot of files which include it but don't actually need
anything defined in there. Presumably these includes were once needed for
macros that used to live in sched.h, but moved to other header files in the
course of cleaning it up.

To ease the pain, this time I did not fiddle with any header files and only
removed #includes from .c-files, which tend to cause less trouble.

Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha,
arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig,
allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all
configs in arch/arm/configs on arm. I also checked that no new warnings were
introduced by the patch (actually, some warnings are removed that were emitted
by unnecessarily included header files).

Signed-off-by: Tim Schmielau <tim@physik3.uni-rostock.de>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
dd64c151b978dc78ed535433d930c75b5c15deeb 30-Jan-2007 Jiri Kosina <jkosina@suse.cz> HID: move away from DEBUG defines in favor of CONFIG_HID_DEBUG

CONFIG_INPUT_DEBUG is non-existent option, so remove anything depending
on it.

Also, as we have new CONFIG_HID_DEBUG, this should be used on places
where ifdef DEBUG was used before.

Suggested by Adrian Bunk.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
c080d89ad91e98fec0e8fc5f448a1ad899bd85c7 25-Jan-2007 Jiri Kosina <jkosina@suse.cz> HID: hid debug from hid-debug.h to hid layer

hid-debug.h contains a lot of code, and should not therefore
be a header.

This patch moves the code to generic hid layer as .c source, and
introduces CONFIG_HID_DEBUG to conditionally compile it, instead
of playing with #define DEBUG and including hid-debug.h.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
767fe7877c2928b5633992ee60a49ad4516dc2af 24-Jan-2007 Jiri Kosina <jkosina@suse.cz> HID: fix memleaking of collection

hid_free_device() doesn't free device->collection (but it does
free device->rdesc and device itself). This imposes memory leak.
Fix it.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
e54dea69bac12dae2ff27c1c7a472d4eee70638d 15-Jan-2007 Jiri Kosina <jkosina@suse.cz> HID: compilation fix when DEBUG_DATA is defined

hid/hid-core.c references 'len' variable when DEBUG_DATA is defined,
but the actual name of the variable is 'size'. Fix it.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
d4ae650a904612ffb7edd3f28b69b022988d2466 15-Jan-2007 Simon Budig <simon@budig.de> HID: proper LED-mapping for SpaceNavigator

This change introduces a mapping for LED indicators between the HID
specification and the Linux input subsystem. The previous code properly
mapped the LEDs relevant for Keyboards, but garbeled the remaining ones.
With this change all LED enums from the input system get mapped to more
or less equivalent LED numbers from the HID specification.

This patch also ensures that the unused bits in a HID report to the
device are zeroed out. This makes the 3Dconnexion SpaceNavigator fully
usable with the linux input system.

Signed-off-by: Simon Budig <simon@budig.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
531498013163c72cee8540e98e12c0c430c7fe87 09-Jan-2007 Jiri Kosina <jkosina@suse.cz> HID: Fix DRIVER_DESC macro

DRIVER_DESC macro is wrong in drivers/hid/hid-core.c. Its value
is legacy from original usb+hid code and clashes with current
usbhid implementation. Fix it.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
4d503ecc86a14b86ab7bcdfa8b755994143eba19 08-Jan-2007 Jiri Kosina <jkosina@suse.cz> HID: mousepoll parameter makes no sense for generic HID

mousepoll parameter makes no sense for generic HID code. It
belongs to (and is implemented by) usbhid. This is also where
all users are expecting it.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
d6509c36ba333282362e5f9769869f8a8d790aaf 06-Jan-2007 Ahmed S. Darwish <darwish.07@gmail.com> HID: tiny patch to remove a kmalloc cast

Remove unnecessary cast.

Signed-off-by: Ahmed Darwish <darwish.07@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
aa8de2f038baec993f07ef66fb3e94481d1ec22b 08-Dec-2006 Jiri Kosina <jkosina@suse.cz> [PATCH] Generic HID layer - input and event reporting

hid_input_report() was needlessly USB-specific in USB HID. This patch
makes the function independent of HID implementation and fixes all
the current users. Bluetooth patches comply with this prototype.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
aa938f7974b82cfd9ee955031987344f332b7c77 08-Dec-2006 Jiri Kosina <jkosina@suse.cz> [PATCH] Generic HID layer - hiddev

- hiddev is USB-only (agreed with Marcel Holtmann that Bluetooth currently
doesn't need it, and future planned interface (rawhid) will be more flexible
and usable)
- both HID and USB-hid can be now compiled as modules (wasn't possible before
hiddev was fully separated from generic HID layer)

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
229695e51efc4ed5e04ab471c82591d0f432909d 08-Dec-2006 Jiri Kosina <jkosina@suse.cz> [PATCH] Generic HID layer - API

- fixed generic API (added neccessary EXPORT_SYMBOL, fixed hid.h to provide correct
prototypes)
- extended hid_device with open/close/event function pointers to driver-specific
functions
- added driver specific driver_data to hid_device

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
dde5845a529ff753364a6d1aea61180946270bfa 08-Dec-2006 Jiri Kosina <jkosina@suse.cz> [PATCH] Generic HID layer - code split

The "big main" split of USB HID code into generic HID code and
USB-transport specific HID handling.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>