summaryrefslogtreecommitdiff
path: root/drivers/hid
AgeCommit message (Collapse)Author
2012-08-15HID: picoLCD: Improve unplug handlingBruno Prémont
Stop earlier attempting to submit new reports/URBs (though locking and usbhid still prevents to bail out early enough to not produce multiple hid-picolcd 0003:04D8:C002.0003: usb_submit_urb(out) failed: -19 messages in kernel log. Strengthen framebuffer removal to be less racy. Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-08-15HID: picoLCD: satify some checkpatch warningsBruno Prémont
WARNING: static const char * array should probably be static const char * const +static const char *error_codes[] = { WARNING: min() should probably be min_t(size_t, 20, s) + raw_data[2] = min((size_t)20, s); Note: the second min_t suggestion cannot be followed because GCC is not smart enough to track constants through it and make copy_from_user_overflow() check happy. WARNING: min() should probably be min_t(u8, 20, raw_data[2]) + if (copy_from_user(raw_data+3, u, min((u8)20, raw_data[2]))) return -EFAULT; Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-08-15HID: picoLCD: prevent NULL pointer dereference on unplugBruno Prémont
[ 679.807480] BUG: unable to handle kernel NULL pointer dereference at 00000074 [ 679.814457] IP: [<de93b5bf>] picolcd_led_set_brightness+0x1f/0xb0 [hid_picolcd] [ 679.814457] *pde = 00000000 [ 679.814457] Oops: 0000 [#1] [ 679.814457] Modules linked in: hid_picolcd fb_sys_fops sysimgblt sysfillrect syscopyarea drm_kms_helper nfs lockd nfs_acl sunrpc [last unloaded: hid_picolcd] [ 679.814457] [ 679.814457] Pid: 272, comm: khubd Not tainted 3.5.0-jupiter-00006-g463a4c0 #1 NVIDIA Corporation. nFORCE-MCP/MS-6373 [ 679.814457] EIP: 0060:[<de93b5bf>] EFLAGS: 00010246 CPU: 0 [ 679.814457] EIP is at picolcd_led_set_brightness+0x1f/0xb0 [hid_picolcd] [ 679.814457] EAX: 00000000 EBX: d9f0c4e0 ECX: 00000000 EDX: 00000000 [ 679.814457] ESI: 00000000 EDI: dd6b79c0 EBP: dd4f7d90 ESP: dd4f7d80 [ 679.814457] DS: 007b ES: 007b FS: 0000 GS: 00e0 SS: 0068 [ 679.814457] CR0: 8005003b CR2: 00000074 CR3: 1d74e000 CR4: 000007d0 [ 679.814457] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000 [ 679.814457] DR6: ffff0ff0 DR7: 00000400 [ 679.814457] Process khubd (pid: 272, ti=dd4f6000 task=dd442470 task.ti=dd4f6000) [ 679.814457] Stack: [ 679.814457] 1d6c3300 d9f0c4e0 d9f0c4e0 dd6b79c0 dd4f7da0 c132912a 00000000 d9f0c4e0 [ 679.814457] dd4f7dac c132935d 00000000 dd4f7dc0 de93b847 dd6b79c0 00000282 c700ecc8 [ 679.814457] dd4f7ddc de93924f 00000004 c700ecc8 c700e060 c700ecbc c15ee300 dd4f7dec [ 679.814457] Call Trace: [ 679.814457] [<c132912a>] led_brightness_set+0x2a/0x30 [ 679.814457] [<c132935d>] led_classdev_unregister+0xd/0x50 [ 679.814457] [<de93b847>] picolcd_exit_leds+0x27/0x40 [hid_picolcd] [ 679.814457] [<de93924f>] picolcd_remove+0xbf/0x110 [hid_picolcd] [ 679.814457] [<c132c5dd>] hid_device_remove+0x3d/0x80 [ 679.814457] [<c1294126>] __device_release_driver+0x56/0xa0 [ 679.814457] [<c1294190>] device_release_driver+0x20/0x30 [ 679.814457] [<c1293bbf>] bus_remove_device+0x9f/0xc0 [ 679.814457] [<c1291a1d>] device_del+0xdd/0x150 [ 679.814457] [<c132c205>] hid_destroy_device+0x25/0x60 [ 679.814457] [<c13368cb>] usbhid_disconnect+0x1b/0x40 [ 679.814457] [<c12f4976>] usb_unbind_interface+0x46/0x170 [ 679.814457] [<c1294126>] __device_release_driver+0x56/0xa0 [ 679.814457] [<c1294190>] device_release_driver+0x20/0x30 [ 679.814457] [<c1293bbf>] bus_remove_device+0x9f/0xc0 [ 679.814457] [<c1291a1d>] device_del+0xdd/0x150 [ 679.814457] [<c12f2975>] usb_disable_device+0x85/0x1a0 [ 679.814457] [<c1053146>] ? __cond_resched+0x16/0x30 [ 679.814457] [<c12ebdb0>] usb_disconnect+0x80/0xf0 [ 679.814457] [<c12ed61f>] hub_thread+0x3df/0x1030 [ 679.814457] [<c10484a0>] ? wake_up_bit+0x30/0x30 [ 679.814457] [<c12ed240>] ? usb_remote_wakeup+0x40/0x40 [ 679.814457] [<c1047f94>] kthread+0x74/0x80 [ 679.814457] [<c1047f20>] ? flush_kthread_worker+0x90/0x90 [ 679.814457] [<c140e33e>] kernel_thread_helper+0x6/0xd [ 679.814457] Code: e0 25 00 e0 ff ff ff 48 14 eb 99 90 55 89 e5 83 ec 10 89 5d f4 89 75 f8 89 c3 89 7d fc 8b 40 1c 89 d6 8b 00 e8 13 89 95 e2 31 c9 <39> 5c 88 74 74 13 41 83 f9 08 75 f4 8b 5d f4 8b 75 f8 8b 7d fc [ 679.814457] EIP: [<de93b5bf>] picolcd_led_set_brightness+0x1f/0xb0 [hid_picolcd] SS:ESP 0068:dd4f7d80 [ 679.814457] CR2: 0000000000000074 [ 680.116438] ---[ end trace 6f0d9d63bff280ff ]--- Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-08-15HID: picoLCD: Replace own refcounting with fbdev'sBruno Prémont
Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-08-15HID: picoLCD: split driver codeBruno Prémont
In order to make code maintenance easier, split the vairous functions into individial files (this removes a bunch of #ifdefs). Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-07-24Merge branch 'uhid' into for-linusJiri Kosina
Conflicts: drivers/hid/Kconfig
2012-07-24Merge branches 'hidraw', 'magicmouse', 'multitouch', 'roccat', ↵Jiri Kosina
'suspend-fixes' and 'upstream' into for-linus
2012-07-23HID: add ASUS AIO keyboard model AK1DCyrus Lien
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>
2012-07-22HID: add support for Cypress barcode scanner 04B4:ED81Lionel Vaux
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>
2012-07-20HID: Allow drivers to be their own listenerDavid Herrmann
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>
2012-07-20HID: usbhid: fix error paths in suspendAlan Stern
This patch (as1597) fixes some of the error paths in usbhid's suspend routine. The driver was not careful to restart everything that might have been stopped, in cases where a suspend failed. For example, once the HID_SUSPENDED flag is set, an output report submission would not restart the corresponding URB queue. If a suspend fails, it's therefore necessary to check whether the queues need to be restarted. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> CC: Oliver Neukum <oliver@neukum.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-07-20HID: usbhid: check for suspend or reset before restartingAlan Stern
This patch (as1596) improves the queue-restart logic in usbhid by checking to see if the device is suspended or a reset is about to occur. There's no point submitting an URB if either of those is true. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> CC: Oliver Neukum <oliver@neukum.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-07-20HID: usbhid: replace HID_REPORTED_IDLE with HID_SUSPENDEDAlan Stern
This patch (as1595) improves the usbhid driver by using the HID_SUSPENDED bitflag to indicate that the device is suspended rather than using HID_REPORTED_IDLE, which the patch removes. Since HID_SUSPENDED was not being used for anything, and since the name "HID_REPORTED_IDLE" doesn't convey much meaning, the end result is easier to read and understand. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> CC: Oliver Neukum <oliver@neukum.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-07-20HID: usbhid: inline some simple routinesAlan Stern
This patch (as1594) simplifies the usbhid driver by inlining a couple of routines. As a result of an earlier patch, irq_out_pump_restart() and ctrl_pump_restart() are each used in only one place. Since they don't really do what their names say, and since they each involve only about two lines of actual code, there's no reason to keep them as separate functions. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> CC: Oliver Neukum <oliver@neukum.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-07-20HID: usbhid: fix autosuspend callsAlan Stern
This patch (as1593) fixes some logic errors in the usbhid driver relating to runtime PM. The driver does not balance its calls to usb_autopm_get_interface_async() and usb_autopm_put_interface_async(). For example, when the control queue is restarted the driver does a _get. But the resume won't happen immediately, so the driver leaves the queue stopped. When the resume does occur, the queue is restarted and a second _get occurs, with no balancing _put. The patch fixes the problem by rearranging the logic for restarting the queues. All the _get/_put calls and bitflag settings in __usbhid_submit_report() are moved into the queue-restart routines. A balancing _put call is added for the case where the queue is still suspended. A call to irq_out_pump_restart(), which doesn't take all the right actions for restarting the irq-OUT queue, is replaced by a call to usbhid_restart_out_queue(), which does. Similarly for ctrl_pump_restart(). Finally, new code is added to prevent an autosuspend from happening every time an URB is cancelled, and the comments explaining what happens when an URB needs to be cancelled are expanded and clarified. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> CC: Oliver Neukum <oliver@neukum.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-07-20HID: usbhid: fix use-after-free bugAlan Stern
This patch (as1592) fixes an obscure problem in the usbhid driver. Under some circumstances, a control or interrupt-OUT URB can be submitted twice. This will happen if the first submission fails; the queue pointers aren't updated, so the next time the queue is restarted the same URB will be submitted again. The problem is that raw_report gets deallocated during the first submission. The second submission will then dereference and try to free an already-freed region of memory. The patch fixes the problem by setting raw_report to NULL when it is deallocated and checking for NULL before dereferencing it. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> CC: Oliver Neukum <oliver@neukum.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-07-20HID: hid-core: optimize in case of hidrawMatthieu CASTET
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>
2012-07-20HID: hidraw: fix list->buffer memleakMatthieu CASTET
If we don't read fast enough hidraw device, hidraw_report_event will cycle and we will leak list->buffer. Also list->buffer are not free on release. After this patch, kmemleak report nothing. Signed-off-by: Matthieu CASTET <matthieu.castet@parrot.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-07-20HID: uhid: Fix sending events with invalid dataVinicius Costa Gomes
This was detected because events with invalid types were arriving to userspace. The code before this patch would only work for the first event in the queue (when uhid->tail is 0). Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org> Reviewed-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-07-20HID: roccat: added sensor sysfs attribute for SavuStefan Achatz
The sensor attr can be used to tweak the optical sensor of the Savu. Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-07-19Merge branch 'upstream-fixes' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid Pull HID update from Jiri Kosina: "A final round of changes for HID for 3.5: just device ID additions." * 'upstream-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: HID: hid-multitouch: add support for Zytronic panels HID: add Sennheiser BTD500USB device support HID: add battery quirk for Apple Wireless ANSI
2012-07-19HID: hid-multitouch: add support for Zytronic panelsBenjamin Tissoires
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-07-13Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input layer fixes from Dmitry Torokhov: "The changes are limited to adding new VID/PID combinations to drivers to enable support for new versions of hardware, most notably hardware found in new MacBook Pro Retina boxes." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: xpad - add Andamiro Pump It Up pad Input: xpad - add signature for Razer Onza Tournament Edition Input: xpad - handle all variations of Mad Catz Beat Pad Input: bcm5974 - Add support for 2012 MacBook Pro Retina HID: add support for 2012 MacBook Pro Retina
2012-07-12HID: Add driver for Holtek based keyboards with broken HIDTom Harwood
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>
2012-07-11Input: xpad - handle all variations of Mad Catz Beat PadYuri Khan
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>
2012-07-10HID: add support for 2012 MacBook Pro RetinaRyan Bourgeois
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>
2012-07-09HID: Add suport for the brightness control keys on HP keyboardsKeng-Yu Lin
The keys are found on the keyboards bundled with HP All-In-One machines with USB VID/PID of 04ca:004d and 04f2:1061. Signed-off-by: Keng-Yu Lin <kengyu@canonical.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-07-09HID: add Sennheiser BTD500USB device supportFrank Kunz
The Sennheiser BTD500USB composit device requires the HID_QUIRK_NOGET flag to be set for working proper. Without the flag the device crashes during hid intialization. Signed-off-by: Frank Kunz <xxxxxmichl@googlemail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-07-04HID: magicmouse: Implement Multi-touch Protocol B (MT-B)Yufeng Shen
The driver for Apple Magic Trackpad/Mouse currently uses Multi-touch Protocol A (MT-A) to report touch events and uses ABS_MT_TRACKING_ID to do finger tracking. The fact of the device being able to track individual finger makes it possible to report touch events using MT-B. This patch converts the driver to use MT-B as it is preferred to MT-A. V4: Removed BTN_TOUCH evnet. V3: Removed the single touch related logic. V2: Converting entirely to MT-B as Henrik Rydberg suggested. Signed-off-by: Yufeng Shen <miletus@chromium.org> Reviewed-and-tested-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-07-04HID: magicmouse: Removing report_touches switchYufeng Shen
Remove the report_touches switch as it is not so useful to turn off reporting touch events for a touch device. Let the userspace to do the filtering if the turning off is needed. V2: Remove report_touches as suggeted by Chase Douglas Signed-off-by: Yufeng Shen <miletus@chromium.org> Reviewed-and-tested-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-07-04HID: add battery quirk for Apple Wireless ANSIDaniel Nicoletti
Add USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI, to the quirk list since it report wrong feature type and wrong percentage range. Signed-off-by: Daniel Nicoletti <dantti12@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-06-28HID: roccat: rename roccat_common functions to roccat_common2Stefan Achatz
Did this to illustrate my understanding of the firmware generations: Valo and Kone were 1st generation Arvo was externaly developed and lies in the middle All others until now are considered 2nd generation Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-06-28HID: roccat: fix wrong hid_err usage on struct usb_deviceStefan Achatz
Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-06-28HID: roccat: move functionality to roccat-commonStefan Achatz
Reduced code duplication by moving functions from individual drivers to roccat-common module. Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-06-28HID: roccat: add support for Roccat SavuStefan Achatz
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>
2012-06-28HID: hid-multitouch: add support for Zytronic panelsBenjamin Tissoires
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-06-28HID: hid-multitouch: fix input mode feature commandBenjamin Tissoires
Zytronic panels shows a new way of setting the Input Mode feature. This feature is put in the second usage in the HID feature, instead of the first, as the majority of the multitouch devices. This patch adds a detection step when the feature is presented to know where the feature is located in the report. We can then trigger the right command to the device. This removes the magic number "0" in the function mt_set_input_mode. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-06-26Merge branch 'upstream-fixes' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid Pull HID fixes from Jiri Kosina: "The most important one is a purification of Kconfig for CONFIG_HID; the inclusion of HID groups and autoloading didn't leave the Kconfig in a really consistent state. Henrik's patch fixes that. In addition to that, there are two small fixes for logitech and magicmouse drivers." * 'upstream-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: HID: Fix the generic Kconfig options HID: magicmouse: Correct report range of major / minor axes HID: logitech: don't use stack based dj_report structures
2012-06-25Merge branch 'v4l_for_linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media fixes from Mauro Carvalho Chehab. Trivial conflict due to new USB HID ID's being added next to each other (Baanto vs Axentia). * 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (44 commits) [media] smia: Fix compile failures [media] Fix VIDIOC_DQEVENT docbook entry [media] s5p-fimc: Fix control creation function [media] s5p-mfc: Fix checkpatch error in s5p_mfc_shm.h file [media] s5p-mfc: Fix setting controls [media] v4l/s5p-mfc: added image size align in VIDIOC_TRY_FMT [media] v4l/s5p-mfc: corrected encoder v4l control definitions [media] v4l: mem2mem_testdev: Fix race conditions in driver [media] s5p-mfc: Bug fix of timestamp/timecode copy mechanism [media] cxd2820r: Fix an incorrect modulation type bitmask [media] em28xx: Show a warning if the board does not support remote controls [media] em28xx: Add remote control support for Terratec's Cinergy HTC Stick HD [media] USB: Staging: media: lirc: initialize spinlocks before usage [media] Revert "[media] media: mx2_camera: Fix mbus format handling" [media] bw-qcam: driver and pixfmt documentation fixes [media] cx88: fix firmware load on big-endian systems [media] cx18: support big-endian systems [media] ivtv: fix support for big-endian systems [media] tuner-core: return the frequency range of the correct tuner [media] v4l2-dev.c: fix g_parm regression in determine_valid_ioctls() ...
2012-06-25HID: Fix the generic Kconfig optionsHenrik Rydberg
The generic HID driver is obviously not a special driver, so move it outside of the special drivers menu. Explain the usage and make the default follow the HID setting. This should simplify migration from older kernels. While at it, remove the redundant HID_SUPPORT option and modify the HID and USB_HID entries to better explain the bus structure. Reported-by: Jan Beulich <jbeulich@suse.com> Signed-off-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-06-25HID: magicmouse: Correct report range of major / minor axesYufeng Shen
In patch "HID: magicmouse: Adjust major / minor axes to scale", touch_major and touch_minor axes are scaled by a factor of four when reported but the max touch_major/minor is not scaled accordingly. This patch scales the max touch_major/minor to be consistent with the reported value. Signed-off-by: Yufeng Shen <miletus@chromium.org> Acked-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-06-18HID: uhid: silence gcc warningJiri Kosina
gcc is giving me: drivers/hid/uhid.c: In function ‘uhid_hid_get_raw’: drivers/hid/uhid.c:157: warning: ‘len’ may be used uninitialized in this function which is clearly bogus, as - when used as memcpy() argument, it's initialized properly - the code is structured in a way that either 'ret' or 'len' is always initialized, so the return statement always has an initialized value. Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-06-18HID: select NEW_LEDS for driver of Lenovo ThinkPad USB Keyboard with TrackPointBryan Wu
commit 'HID: Driver for Lenovo Keyboard with Trackpoint' (c1dcad2d32d0252e8a3023d20311b52a187ecda3) introduced a compiling error due to unmetting dependency of CONFIG_LEDS_CLASS. on i386: ERROR: "led_brightness_set" [drivers/leds/led-class.ko] undefined! ERROR: "leds_list" [drivers/leds/led-class.ko] undefined! ERROR: "leds_list_lock" [drivers/leds/led-class.ko] undefined! Reported-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Bryan Wu <bryan.wu@canonical.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-06-18HID: uhid: implement feature requestsDavid Herrmann
HID standard allows sending a feature request to the device which is answered by an HID report. uhid implements this by sending a UHID_FEATURE event to user-space which then must answer with UHID_FEATURE_ANSWER. If it doesn't do this in a timely manner, the request is discarded silently. We serialize the feature requests, that is, there is always only a single active feature-request sent to user-space, other requests have to wait. HIDP and USB-HID do it the same way. Because we discard feature-requests silently, we must make sure to match a response to the corresponding request. We use sequence-IDs for this so user-space must copy the ID from the request into the answer. Feature-answers are ignored if they do not contain the same ID as the currently pending feature request. Internally, we must make sure that feature-requests are synchronized with UHID_DESTROY and close() events. We must not dead-lock when closing the HID device, either, so we have to use separate locks. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-06-18HID: uhid: forward raw output reports to user-spaceDavid Herrmann
Some drivers that use non-standard HID features require raw output reports sent to the device. We now forward these requests directly to user-space so the transport-level driver can correctly send it to the device or handle it correspondingly. There is no way to signal back whether the transmission was successful, moreover, there might be lots of messages coming out from the driver flushing the output-queue. However, there is currently no driver that causes this so we are safe. If some drivers need to transmit lots of data this way, we need a method to synchronize this and can implement another UHID_OUTPUT_SYNC event. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-06-18HID: uhid: forward output request to user-spaceDavid Herrmann
If the hid-driver wants to send standardized data to the device it uses a linux input_event. We forward this to the user-space transport-level driver so they can perform the requested action on the device. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-06-18HID: uhid: forward open/close events to user-spaceDavid Herrmann
HID core notifies us with *_open/*_close callbacks when there is an actual user of our device. We forward these to user-space so they can react on this. This allows user-space to skip I/O unless they receive an OPEN event. When they receive a CLOSE event they can stop I/O again to save energy. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-06-18HID: uhid: add UHID_START and UHID_STOP eventsDavid Herrmann
We send UHID_START and UHID_STOP events to user-space when the HID core starts/stops the device. This notifies user-space about driver readiness and data-I/O can start now. This directly forwards the callbacks from hid-core to user-space. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-06-18HID: uhid: forward hid report-descriptor to hid coreDavid Herrmann
When the uhid_hid_parse callback is called we simply forward it to hid_parse_report() with the data that we got in the UHID_CREATE event. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-06-18HID: uhid: allow feeding input data into uhid devicesDavid Herrmann
This adds a new event type UHID_INPUT which allows user-space to feed raw HID reports into the HID subsystem. We copy the data into kernel memory and directly feed it into the HID core. There is no error handling of the events couldn't be parsed so user-space should consider all events successfull unless read() returns an error. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>