aboutsummaryrefslogtreecommitdiff
path: root/include/linux/hid.h
AgeCommit message (Collapse)Author
2008-10-14HID: move cypress quirksJiri Slaby
Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14HID: move sunplus quirksJiri Slaby
Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14HID: move microsoft quirksJiri Slaby
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>
2008-10-14HID: add compat supportJiri Slaby
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>
2008-10-14HID: move apple quirksJiri Slaby
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>
2008-10-14HID: move ignore quirksJiri Slaby
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>
2008-10-14HID: move logitech quirksJiri Slaby
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>
2008-10-14HID: move usage input mapping to hid.hJiri Slaby
This mapping are currently used on 2 placces and will be needed by more quirk drivers, so move them to hid.h to allow them to use it. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14HID: hid, make parsing event drivenJiri Slaby
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>
2008-10-14HID: make a bus from hid codeJiri Slaby
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>
2008-10-14modpost: add support for hidJiri Slaby
Generate aliases for hid device modules to support autoloading. Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-07-23HID: add n-trig digitizer usageRafi Rubin
This adds a hid usage that is reported by the N-Trig digitizer in the Dell Latitude XT screen. Signed-off-by: Rafi Rubin <rafi@seas.upenn.edu> Signed-off-by: Vojtech Pavlik <vojtech@suse.cz> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-05-20HID: remove CVS keywordsAdrian Bunk
This patch removes CVS keywords that weren't updated for a long time from comments. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-05-20HID: split Numlock emulation quirk from HID_QUIRK_APPLE_HAS_FN.Diego 'Flameeyes' Petteno
Since 2.6.25 the HID_QUIRK_APPLE_HAS_FN quirk is enabled even for non-laptop Apple keyboards of the Aluminium series. The USB version of these don't need Numlock emulation, like the laptop (and Aluminium Wireless) do, as they have a proper keypad. This patch splits the Numlock emulation for Apple keyboards in a different quirk flag, so that it can be enabled for all the keyboards but the Aluminium USB ones. If the Numlock emulation is enabled for Aluminium USB keyboards, the JKL and UIO keys become the numeric pad, and the rest of the keyboard is disabled, included the key used to disable Numlock. Additionally, these keyboard should not have a Numlock at all, as the Numlock key is instead replaced by the 'Clear' key as usual for Apple USB keyboards. Signed-off-by: Diego 'Flameeyes' Petteno <flameeyes@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-04-28usbhid endianness annotations and fixesAl Viro
usb_control_msg() converts arguments to little-endian itself, doing that in caller means breakage on big-endian boxen. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-04-22HID: fix race between open() and disconnect() in usbhidOliver Neukum
There is a window: task A task B spin_lock_irq(&usbhid->inlock); /* Sync with error handler */ usb_set_intfdata(intf, NULL); spin_unlock_irq(&usbhid->inlock); usb_kill_urb(usbhid->urbin); usb_kill_urb(usbhid->urbout); usb_kill_urb(usbhid->urbctrl); del_timer_sync(&usbhid->io_retry); cancel_work_sync(&usbhid->reset_work); if (!hid->open++) { res = usb_autopm_get_interface(usbhid->intf); if (res < 0) { hid->open--; return -EIO; } } if (hid_start_in(hid)) if (hid->claimed & HID_CLAIMED_INPUT) hidinput_disconnect(hid); in which an open() to an already disconnected device will submit an URB to an undead device. In case disconnect() was called by an ioctl, this'll oops. Fix by introducing a new flag and checking it in hid_start_in(). Signed-off-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-04-22HID: make hid_input_field and usbhid_modify_dquirk staticAdrian Bunk
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>
2008-04-22HID: force feedback driver for Logitech Rumblepad 2Anssi Hannula
Add force feedback support for Logitech Rumblepad 2. Tested-By: Edgar Simo <bobbens@gmail.com> Signed-off-by: Anssi Hannula <anssi.hannula@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-04-22HID: move wait from hid to usbhidJiri Slaby
Since only place where this is used is usbhid, move it there. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-04-22HID: make function from dbg_hidJiri Slaby
To check paramters even if debug is disabled, convert dbg_hid to inline function with __attribute__(format) checking. Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-04-22HID: Sunplus Wireless Desktop needs report descriptor fixupJiri Kosina
This device has reports lower logical maximum compared to the real usages for Zoom+ and Zoom- it emits. This patch bumps the values in the report descriptor up, and also adjusts HID_MAX_USAGE accordingly. Reported-by: Khelben Blackstaff <eye.of.the.8eholder@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-04-22HID: quirk for MS Wireless Desktop Receiver (model 1028)Jim Duchek
Microsoft's wireless desktop receiver (Model 1028) has a bug in the report descriptor -- namely, in four seperate places it uses USAGE_MIN and _MAX when it quite obviously doesn't intend to. In other words, it reports that it has pretty much _everything_ in 'consumer' and 'generic desktop'. And then the X evdev driver believes I have a mouse with 36 absolute axes and a huge pile of keys and buttons, when I in fact, should have zero. 255/256 in three of the cases, and 0-1024 in another. This patch fixes the report descriptor of this device before it enters the HID parser. Signed-off-by: Jim Duchek <jim.duchek@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-04-22HID: fixup fullspeed interval on highspeed Afatech DVB-T IR kbdPekka Sarnila
Many vendors highspeed devices give erroneously fullspeed interval value in endpoint descriptor for interrupt endpoints. This quirk fixes up that by recalculating the right value for highspeed device. At the time of hid configuration this quirk calculates which highspeed interval value gives same interval delay as, or next smaller then, what it would be if the original value would be interpreted as fullspeed value. In subsequent urbs that new value is used instead. Forming the 'hid->name' in usb_hid_config() was moved up to accommodate more descriptive printk reporting the fixup. In this patch the quirk is set for one such device: Afatech DVB-T 2 infrared HID-keyboard. It reports value 16 which means 4,069s in highspeed while obviously 16ms was intended. In this case quirk calculates new value to be 8 which gives when interpreted as highspeed value 16ms as wanted. The behavior of the device was verified to be what expected both before and after the patch. Signed-off-by: Pekka Sarnila <sarnila@adit.fi> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-02-11HID: fix processing of event quirksJiri Kosina
The old code (before move) stopped further processing of the event after it has been already processed by the quirk handler. The new code didn't propagate the return value properly, and therefore the processing always proceeded, which was wrong. This patch fixes it. Pointed out in kernel.org bugzilla #9842 Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28HID: Support Samsung IR remoteRobert Schedel
Samsung USB remotes (0419:0001) are rejected by kernel 2.6.23, because the report descriptor from the remote contains a 48 bit HID report field. HID 1.11 states: Fields may span at most 4 bytes. This patch, based on 2.6.23, fixes this by modifying the internal report descriptor in hid-quirks.c. Additional user space support (e.g. LIRC) is required to fetch the information from the hiddev interface. The burden to reconstruct the data is moved into userspace (lirc through hiddev). There is no need to set HID_QUIRK_HIDDEV quirk, as the device has also output applications, which trigger the creation of hiddev device automatically. Signed-off-by: Robert Schedel <r.schedel@yahoo.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28HID: the `bit' in hidinput_mapping_quirks() is an out parameterFengguang Wu
Fix a panic, by changing hidinput_mapping_quirks(,, unsigned long *bit,) to hidinput_mapping_quirks(,, unsigned long **bit,) The `bit' in this function is an out parameter. Signed-off-by: Fengguang Wu <wfg@mail.ustc.edu.cn> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28HID: proper handling of MS 4k and 6k devicesJiri Kosina
This removes ugly macros IS_* to distinguish devices that need special handling in hid-input, and establish proper quirks for them. Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28HID: hid-input quirk for BTC 8193Jiri Kosina
BTC 8193 keyboard handles its scrollwheel in very non-standard way. It produces two non-standard usages for scrolling up and down, in both cases with postive value equaling to 1. We handle this by temporary mapping, which we then catch in quirk event handler, and remap to negative HWHEEL even in order to introduce correct behavior. Also the button requires special mapping, as it triggers standard-violating usage code. Reported in kernel.org bugzilla #9385 Reported-by: Kir Kolyshkin <kir@sacred.ru> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28HID: separate hid-input event quirks from generic codeJiri Kosina
This patch separates also the hid-input quirks that have to be applied at the time the event occurs, so that the generic code handling HUT-compliant devices is not messed up by them too much. Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28HID: refactor mapping to input subsystem for quirky devicesJiri Kosina
Currently, the handling of mapping between hid and input for devices that don't conform to HUT 1.12 specification is very messy -- no per-device handling, no blacklists, conditions on idVendor and idProduct placed all over the code. This patch moves all the device-specific input mapping to a separate file, and introduces a blacklist-style handling for non-standard device-specific mappings. Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28HID: add full support for Genius KB-29EJiri Kosina
Genius KB-29E has broken report descriptor, which causes some of the Consumer usages to appear incorrectly as Button usages. We fix it by fixing the report descriptor before it is being parsed. Also a few of the keys violate the HUT standard, so they need a special handling. They currently fall into "Reserved" range as per HUT 1.12. Reported-by: Szekeres Istvan <szekeres@iii.hu> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28HID: Implement horizontal wheel handling for A4 Tech X5-005DPavel Troller
This mouse distinguishes horizontal wheel from vertical by a special "pseudo event" GenericDesktop.00b8, with values of 0 for vertical and 8 for horizontal wheel. Because this event is supplied by the parser too late, we need to delay a wheel event, wait for this one and send either REL_WHEEL or REL_HWHEEL to input depending on the event value. Signed-off-by: Pavel Troller <patrol@sinus.cz> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28HID: Rename some code identifiers from PowerBook specific to Apple genericMichel Daenzer
Preserve identifiers exposed in build and run time configuration though in order not to break existing configurations. This is in preparation for adding support for Apple aluminum USB keyboards. Signed-off-by: Michel Daenzer <michel@tungstengraphics.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2007-10-19get rid of input BIT* duplicate definesJiri Slaby
get rid of input BIT* duplicate defines use newly global defined macros for input layer. Also remove includes of input.h from non-input sources only for BIT macro definiton. Define the macro temporarily in local manner, all those local definitons will be removed further in this patchset (to not break bisecting). BIT macro will be globally defined (1<<x) Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Cc: <dtor@mail.ru> Acked-by: Jiri Kosina <jkosina@suse.cz> Cc: <lenb@kernel.org> Acked-by: Marcel Holtmann <marcel@holtmann.org> Cc: <perex@suse.cz> Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org> Cc: <vernux@us.ibm.com> Cc: <malattia@linux.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-15HID: fix HIDIOCGRDESC memory access in hidrawJiri Kosina
Fix bogus copying of data into userspace when HIDIOCGRDESC is issued. HID-transport layer makes sure that dev->hid->rdesc is not larger than HID_MAX_DESCRIPTOR_SIZE. Noticed-by: Al Viro <viro@ftp.linux.org.uk> Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-14Merge branch 'hidraw' into for-linusJiri Kosina
2007-10-14HID: add hidraw interfaceJiri Kosina
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>
2007-10-14USBHID: report descriptor fix for MacBook JIS keyboardTomoya Adachi
This patch fixes the problem, that Japanese MacBook doesn't recognize some keys like '\'(yen, or backslash), '|'(pipe), and '_'(underscore). It is due to that MacBook JIS keyboard (jp106) sends wrong report descriptor. It saids "logical maximum = 0x65", so Keyboard.0089 is mapped to Key.Unknown, while it should be accepted as Key.Yen. Signed-off-by: Tomoya Adachi <adachi@il.is.s.u-tokyo.ac.jp> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2007-10-14HID: enable hiddev for the SantaRosa MacBookPro IR receiverStelian Pop
The infrared remote receiver found in the SantaRosa MacBookPro laptops (MacBookPro3,1) need to be forced to expose a HIDDEV interface (instead of HIDINPUT) so that lirc can access it using the 'macmini' driver. The patch below adds the required quirk for forcing the HIDDEV interface to be activated (HID_QUIRK_HIDDEV) and introduces a new quirk which forces the HIDINPUT interface to be ignored (HID_QUIRK_IGNORE_HIDINPUT). Note that Apple calls this receiver 'IRController4' (info taken from Apple's driver Info.plist). Older Mac{Book,Mini,Pro}s seem to all use the 'IRController1' device (USB id 05ac:8240) which doesn't need those quirks. Signed-off-by: Stelian Pop <stelian@popies.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2007-07-09Merge branches 'debug-module-param' and 'upstream' into for-linusJiri Kosina
2007-07-09HID: support for logitech cordless desktop LX500 special mappingRyo Dairiki
This keyboard has wireless mouse which has left, middle, right buttons and 2-dimensional scrolling wheel. Unfornetuly, this wheel reports side scrolling events and 11 or 12 button events at the same time. I've wrote a patch to fix this mapping. I'm not sure if this mapping is proper for buttons, because , for example, there is no entry for "burn cd" in input.h. The patch also supress 11 and 12 button events from mouse when you scroll the wheel left and right. With this patch, only side scrolling events are reported. (This mouse has only 4 buttons and 2D wheel. There is no such buttons like 11 and 12.) Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2007-07-09HID: separate quirks for report descriptor fixupJiri Kosina
Lately there have been quite a lot of bug reports against broken devices which require us to fix their report descriptor in the runtime, before it is passed to the HID parser. Those devices have eaten quite an amount of our quirks space, which isn't particularly necessary - the quirks are not needed after the report descriptor is parsed, and they just consume bits. Therefore this patch separates the quirks for report descriptor fixup, and moves their handling into separate code. The quirks are then forgotten as soon as the report descriptor has been parsed. Module parameter 'rdesc_quirks' is introduced to be able to modify these quirks in runtime in a similar way to 'quirks' parameter for ordinary HID quirks. Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2007-07-09HID: support for Petalynx Maxter remote controlJiri Kosina
Petalynx Maxter remote control [1] 0x18b1/0x0037 emits 0xfa and 0xfc from consumer page (reserved in HUT 1.12) for back and more keys. It also emits a few usages from LOGIVENDOR page, which need adding. Also, this device has broken report descriptor - the reported maximum is too low - it doesn't contain the range for 'back' and 'more' keys, so we need to bump it up before the report descriptor is being parsed. Besides all this, it also requires NOGET quirk. This patch does so. [1] http://www.elmak.pl/index.php?option=com_phpshop&page=shop.browse&category_id=14&ext=opis&lang=en Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2007-07-09HID: force hid-input for Microsoft SideWinder GameVoice deviceJiri Kosina
Microsoft SideWinder GameVoice driver is a trivial device with a few buttons (0x09 HID usage) and an audio connector, which just forwards the audio input into oridinary sound card present in the computer. Despite this fact, the only interface of this device reports itself as a Telephony/Headset type of HID device. This is apparently incorrect - the device itself doesn't provide any audio/telephony functionality. This is achieved in userland application which only needs to receive the button events from the HID driver. This patch establishes a new quirk which forces hid-input to claim a device it will otherwise leave untouched. Reported-by: Tomas Carnecky <tom@dbservice.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2007-07-09HID: make debugging output runtime-configurableJiri Kosina
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>
2007-05-09USB HID: report descriptor of Cypress USB barcode readers needs fixupJiri Kosina
Certain versions of Cypress USB barcode readers (this problem is known to happen at least with PIDs 0xde61 and 0xde64) have report descriptor which has swapped usage min and usage max tag. This results in HID parser failing for report descriptor of these devices, as it (wrongly) requires allocating more usages than HID_MAX_USAGES. Solve this by walking through the report descriptor for such devices, and swap the usage min and usage max items (and their values) to be in proper order. Reported-by: Bret Towe <magnade@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2007-04-19USB HID: add 'quirks' module parameterPaul Walmsley
Add a 'quirks' module parameter for the usbhid module, so users can add or modify quirks at module load time. Signed-off-by: Paul Walmsley <paul@booyaka.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2007-04-19USB HID: add support for dynamically-created quirksPaul Walmsley
Add internal support for dynamically-allocated HID quirks, "dquirks" (for "dynamic quirks"). Includes several functions to add/modify quirks from the list. This code is used by the next patch to implement quirk modification upon module load. Signed-off-by: Paul Walmsley <paul@booyaka.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2007-04-19USB HID: encapsulate quirk handling into hid-quirks.cPaul Walmsley
Move the USB_VENDOR* and USB_DEVICE* defines and the hid_blacklist[] array there from hid-core.c. Add hid-quirks.c:usbhid_lookup_any_quirks() to return quirk information to hid-core.c. Convert __u32, __u16 types to u32, u16. Signed-off-by: Paul Walmsley <paul@booyaka.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2007-04-11USB HID: numlock quirk for dell W7658 keyboardPete Zaitcev
On Dell W7658 keyboard, when BIOS sets NumLock LED on, it survives the takeover by kernel and thus confuses users. Eating of an increasibly scarce quirk bit is unfortunate. We do it for safety, given the history of nervous input devices which crash if anything unusual happens. Signed-off-by: Pete Zaitcev <zaitcev@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>