summaryrefslogtreecommitdiffstats
path: root/drivers/hid/usbhid/hid-core.c
Commit message (Collapse)AuthorAgeFilesLines
* HID: Add Support for Setting and Getting Feature Reports from hidrawAlan Ott2011-02-111-0/+35
| | | | | | | | | | | | | | | | Per the HID Specification, Feature reports must be sent and received on the Configuration endpoint (EP 0) through the Set_Report/Get_Report interfaces. This patch adds two ioctls to hidraw to set and get feature reports to and from the device. Modifications were made to hidraw and usbhid. New hidraw ioctls: HIDIOCSFEATURE - Perform a Set_Report transfer of a Feature report. HIDIOCGFEATURE - Perform a Get_Report transfer of a Feature report. Signed-off-by: Alan Ott <alan@signal11.us> Signed-off-by: Antonio Ospite <ospite@studenti.unina.it> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: usbhid: base runtime PM on modern APIOliver Neukum2010-12-221-38/+19
| | | | | | | | | This patch doesn't alter functionality, but removes a dedicated kernel thread. Signed-off-by: Oliver Neukum <oneukum@suse.de> Tested-by: Maulik Mankad <x0082077@ti.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: Add and use hid_<level>: dev_<level> equivalentsJoe Perches2010-12-101-25/+23
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
*---. Merge branches '3m', 'egalax', 'logitech', 'magicmouse', 'ntrig' and ↵Jiri Kosina2010-10-231-1/+1
|\ \ \ | | | | | | | | | | | | 'roccat' into for-linus
| | * | HID: don't Send Feature Reports on Interrupt EndpointAlan Ott2010-09-221-1/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Feature reports should only be sent on the control endpoint. The USB HID standard is unclear and confusing on this issue. It seems to suggest that Feature reports can be sent on a HID device's Interrupt OUT endpoint. This cannot be the case because the report type is not encoded in transfers sent out the Interrput OUT endpoint. If Feature reports were sent on the Interrupt OUT endpint, they would be indistinguishable from Output reports in the case where Report IDs were not used. Further, Windows and Mac OS X do not send Feature reports out the interrupt OUT Endpoint. They will only go out the Control Endpoint. In addition, many devices simply do not hande Feature reports sent out the Interrupt OUT endpoint. Reported-by: simon@mungewell.org Signed-off-by: Alan Ott <alan@signal11.us> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | | HID: usbhid: remove unused hiddev_driverAlan Stern2010-09-241-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Now that hiddev_driver isn't being used for anything, there's no reason to keep it around. This patch (as1419) gets rid of it entirely. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | | Merge branch 'master' into upstreamJiri Kosina2010-09-241-1/+7
|\ \ \ | |/ /
| * | HID: fix hiddev's use of usb_find_interfaceGuillaume Chazarain2010-09-141-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | My macbook infrared remote control was broken by commit bd25f4dd6972755579d0ea50d1a5ace2e9b00d1a ("HID: hiddev: use usb_find_interface, get rid of BKL"). This device appears in dmesg as: apple 0003:05AC:8242.0001: hiddev0,hidraw0: USB HID v1.11 Device [Apple Computer, Inc. IR Receiver] on usb-0000:00:1d.2-1/input0 It stopped working as lircd was getting ENODEV when opening /dev/usb/hiddev0. AFAICS hiddev_driver is a dummy driver so usb_find_interface(&hiddev_driver) does not find anything. The device is associated with the usbhid driver, so let's do usb_find_interface(&hid_driver) instead. $ ls -l /sys/devices/pci0000:00/0000:00:1d.2/usb7/7-1/7-1:1.0/usb/hiddev0/device/driver lrwxrwxrwx 1 root root 0 2010-09-12 16:28 /sys/devices/pci0000:00/0000:00:1d.2/usb7/7-1/7-1:1.0/usb/hiddev0/device/driver -> ../../../../../../bus/usb/drivers/usbhid Signed-off-by: Guillaume Chazarain <guichaz@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | HID: Set Report ID properly for Output reports on the Control endpoint.Alan Ott2010-08-241-1/+2
| |/ | | | | | | | | | | | | | | | | When I made commit 29129a98e6fc89 ("HID: Send Report ID when numbered reports are sent over the control endpoint"), I didn't account for *buf not being the report ID anymore, as buf is incremented. Signed-off-by: Alan Ott <alan@signal11.us> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | HID: trivial formatting fixAlan Ott2010-09-221-0/+1
|/ | | | | | | Added blank line after declarations. Signed-off-by: Alan Ott <alan@signal11.us> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: Send Report ID when numbered reports are sent over the control endpoint.Alan Ott2010-07-111-3/+10
| | | | | | | | The Report ID wasn't sent as part of the payload for reports which were sent over the control endpoint. This is required by section 8.1 of the HID spec. Signed-off-by: Alan Ott <alan@signal11.us> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* Merge branch 'for-linus' of ↵Linus Torvalds2010-05-211-13/+60
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (59 commits) HID: fix up 'EMBEDDED' mess in Kconfig HID: roccat: cleanup preprocessor macros HID: roccat: refactor special event handling HID: roccat: fix special button support HID: roccat: Correctly mark init and exit functions HID: hidraw: Use Interrupt Endpoint for OUT Transfers if Available HID: hid-samsung: remove redundant key mappings HID: add omitted hid-zydacron.c file HID: hid-samsung: add support for Creative Desktop Wireless 6000 HID: picolcd: Eliminate use after free HID: Zydacron Remote Control driver HID: Use kmemdup HID: magicmouse: fix input registration HID: make Prodikeys driver standalone config option HID: Prodikeys PC-MIDI HID Driver HID: hidraw: fix indentation HID: ntrig: add filtering module parameters HID: ntrig: add sysfs access to filter parameters HID: ntrig: add sensitivity and responsiveness support HID: add multi-input quirk for eGalax Touchcontroller ...
| *---. Merge branches 'ntrig', 'picolcd', 'prodikeys' and 'roccat-kone' into for-linusJiri Kosina2010-05-191-0/+1
| |\ \ \ | | | | | | | | | | | | | | | | | | | | Conflicts: drivers/hid/Makefile
| | | * \ Merge branch 'hid-suspend' into picolcdJiri Kosina2010-05-031-1/+23
| | | |\ \
| | | * | | HID: add framebuffer support to PicoLCD deviceBruno Prémont2010-03-311-0/+1
| | | | |/ | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add framebuffer support to PicoLCD device with use of deferred-io. Only changed areas of framebuffer get sent to device in order to save USB bandwidth and especially resources on PicoLCD device or allow higher refresh rate for a small area. Changed tiles are determined while updating shadow framebuffer. Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| | | | |
| | \ \ \
| | \ \ \
| | \ \ \
| *---. \ \ \ Merge branches 'upstream-fixes', 'bkl-removal', 'debugfs-fixes' and ↵Jiri Kosina2010-05-191-1/+23
| |\ \ \ \ \ \ | | | |_|/ / / | | |/| | / / | | | | |/ / | | | |/| / | | | | |/ 'hid-suspend' into for-linus
| | | | * HID: add suspend/resume hooks for hid driversBruno Prémont2010-04-271-1/+23
| | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add suspend/resume hooks for HID drivers so these can do some additional state adjustment when device gets suspended/resumed. Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | | Merge branch 'upstream' into for-linusJiri Kosina2010-05-191-12/+36
| |\ \ \ | | |/ / | |/| | | | | | | | | | Conflicts: drivers/hid/hid-wacom.c
| | * | HID: hidraw: Use Interrupt Endpoint for OUT Transfers if AvailableAlan Ott2010-05-181-10/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes the hidraw driver use the first Interrupt OUT endpoint for HID transfers to the device if such an endpoint exists. This is consistent with the behavior of the hiddev driver, and the logic is similar. From the USB HID specification: The Interrupt Out pipe is optional. If a device declares an Interrupt Out endpoint then Output reports are transmitted by the host to the device through the Interrupt Out endpoint. If no Interrupt Out endpoint is declared then Output reports are transmitted to a device through the Control endpoint, using Set_Report(Output) requests. Signed-off-by: Alan Ott <alan@signal11.us> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| | * | HID: add HID_QUIRK_HIDDEV_FORCE and HID_QUIRK_NO_IGNOREBastien Nocera2010-04-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * | HID: usbhid: enable remote wakeup for keyboardsAlan Stern2010-04-031-2/+5
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch (as1365) enables remote wakeup by default for USB keyboard devices. Keyboards in general are supposed to be wakeup devices, but the correct place to enable it depends on the device's bus; no single approach will work for all keyboard devices. In particular, this covers only USB keyboards (and then only those supporting the boot protocol). Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | | USB: rename usb_buffer_alloc() and usb_buffer_free() usersDaniel Mack2010-05-201-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For more clearance what the functions actually do, usb_buffer_alloc() is renamed to usb_alloc_coherent() usb_buffer_free() is renamed to usb_free_coherent() They should only be used in code which really needs DMA coherency. All call sites have been changed accordingly, except for staging drivers. Signed-off-by: Daniel Mack <daniel@caiaq.de> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Pedro Ribeiro <pedrib@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | | USB: remove uses of URB_NO_SETUP_DMA_MAPAlan Stern2010-05-201-5/+3
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch (as1350) removes all usages of coherent buffers for USB control-request setup-packet buffers. There's no good reason to reserve coherent memory for these things; control requests are hardly ever used in large quantity (the major exception is firmware transfers, and they aren't time-critical). Furthermore, only seven drivers used it. We might as well always use streaming DMA mappings for setup-packet buffers, and remove some extra complexity from usbcore. The DMA-mapping portion of hcd.c is currently in flux. A separate patch will be submitted to remove support for URB_NO_SETUP_DMA_MAP after everything else settles down. The removal should go smoothly, as by then nobody will be using it. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | HID: fix suspend crash by moving initializations earlierAlan Stern2010-05-071-7/+6
|/ | | | | | | | | | | | | | | | Although the usbhid driver allocates its usbhid structure in the probe routine, several critical fields in that structure don't get initialized until usbhid_start(). However if report descriptor parsing fails then usbhid_start() is never called. This leads to problems during system suspend -- the system will freeze. This patch (as1378) fixes the bug by moving the initialization statements up into usbhid_probe(). Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Reported-by: Bruno Prémont <bonbons@linux-vserver.org> Tested-By: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* Merge branches 'upstream', 'raw_report_modifications' and ↵Jiri Kosina2010-02-251-2/+3
|\ | | | | | | | | | | | | 'apple_magic_mouse' into for-linus Conflicts: drivers/hid/Kconfig
| * HID: make raw reports possible for both feature and output reportsJiri Kosina2010-02-031-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit 2da31939a42 ("Bluetooth: Implement raw output support for HIDP layer"), support for Bluetooth hid_output_raw_report was added, but it pushes the data to the intr socket instead of the ctrl one. This has been fixed by 6bf8268f9a91f1 ("Bluetooth: Use the control channel for raw HID reports") Still, it is necessary to distinguish whether the report in question should be either FEATURE or OUTPUT. For this, we have to extend the generic HID API, so that hid_output_raw_report() callback provides means to specify this value so that it can be passed down to lower level hardware drivers (currently Bluetooth and USB). Based on original patch by Bastien Nocera <hadess@hadess.net> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | HID: usbhid: initialize interface pointers early enoughJiri Kosina2010-02-171-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Move the initialization of USB interface pointers from _start() over to _probe() callback, which is where it belongs. This fixes case where interface is NULL when parsing of report descriptor fails. LKML-Reference: <20100213135720.603e5f64@neptune.home> Reported-by: Alan Stern <stern@rowland.harvard.edu> Tested-by: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | HID: usbhid: introduce timeout for stuck ctrl/out URBsOliver Neukum2010-02-121-2/+26
| | | | | | | | | | | | | | | | | | | | | | Some devices do not react to a control request (seen on APC UPS's) resulting in a slow stream of messages, "generic-usb ... control queue full". Therefore request needs a timeout. Cc: stable@kernel.org Signed-off-by: Oliver Neukum <oliver@neukum.org> Signed-off-by: David Fries <david@fries.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | Merge branch 'master' into upstreamJiri Kosina2010-02-021-4/+4
|\ \ | |/ | | | | | | Conflicts: drivers/hid/hid-ids.h
| * USB: remove the auto_pm flagAlan Stern2009-12-111-4/+4
| | | | | | | | | | | | | | | | | | | | | | This patch (as1302) removes the auto_pm flag from struct usb_device. The flag's only purpose was to distinguish between autosuspends and external suspends, but that information is now available in the pm_message_t argument passed to suspend methods. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | HID: update copyrightJiri Kosina2010-02-021-1/+1
| | | | | | | | Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | HID: make USB device id constantMárton Németh2010-01-121-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The id_table field of the struct usb_device_id is constant in <linux/usb.h> so it is worth to make the initialization data also constant. The semantic match that finds this kind of pattern is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r@ disable decl_init,const_decl_init; identifier I1, I2, x; @@ struct I1 { ... const struct I2 *x; ... }; @s@ identifier r.I1, y; identifier r.x, E; @@ struct I1 y = { .x = E, }; @c@ identifier r.I2; identifier s.E; @@ const struct I2 E[] = ... ; @depends on !c@ identifier r.I2; identifier s.E; @@ + const struct I2 E[] = ...; // </smpl> Signed-off-by: Márton Németh <nm127@freemail.hu> Cc: Julia Lawall <julia@diku.dk> Cc: cocci@diku.dk Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: fixup quirk for NCR devicesJiri Kosina2009-11-051-1/+2
| | | | | | | | | | | | | | | | | | | | | NCR devices are terminally broken by design -- they claim themselves to contain proper input applications in their HID report descriptor, but behave very badly if treated in standard way. According to NCR developers, the devices get confused when queried for reports in a standard way, rendering them unusable. NCR is shipping application called "RPSL" that can be used to drive these devices through hiddev, under the assumption that in-kernel driver doesn't perform initial report query. If it does, neither in-kernel nor hiddev-based driver can operate with these devices any more. Introduce a quirk that skips the report query for all NCR devices. The previous NOGET quirk was wrong and had been introduced because I misunderstood the nature of brokenness of these devices. Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: remove useless DRIVER_VERSION macroJiri Kosina2009-10-131-3/+1
| | | | | | | 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>
* HID: fix MODULE_AUTHOR usage in HID modulesJiri Kosina2009-10-131-2/+3
| | | | | | | 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>
* HID: consolidate connect and disconnect into core codeJiri Kosina2009-09-171-11/+5
| | | | | | | | | | | 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>
*-. Merge branches 'upstream', 'upstream-fixes' and 'debugfs' into for-linusJiri Kosina2009-09-131-7/+1
|\ \
| | * HID: use debugfs for report dumping descriptorJiri Kosina2009-06-121-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | HID: local function should be staticH Hartley Sweeten2009-08-181-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | __usbhid_submit_report() is a local function wrapped by the exported symbol usbhid_submit_report(). As such, it should be static. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | | HID: Avoid double spin_lock_init on usbhid->lockSergey Senozhatsky2009-07-231-1/+0
|/ / | | | | | | | | | | | | Avoid double spin_lock_init on usbhid->lock. Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@mail.by> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | headers: smp_lock.h reduxAlexey Dobriyan2009-07-121-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | * Remove smp_lock.h from files which don't need it (including some headers!) * Add smp_lock.h to files which do need it * Make smp_lock.h include conditional in hardirq.h It's needed only for one kernel_locked() usage which is under CONFIG_PREEMPT This will make hardirq.h inclusion cheaper for every PREEMPT=n config (which includes allmodconfig/allyesconfig, BTW) Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* | HID: no more reinitializtion is needed in post_resetJiri Kosina2009-06-041-4/+3
|/ | | | | | | | | No more reinitialization is needed in the post reset hook, remove the FIXME comment. While at it, clean up whitespaces in the immediate surrounding. Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: fix dropped device-specific quirksZoltan Karcagi2009-05-111-1/+1
| | | | | | | | | | | Device-specific quirks are set up correctly in their respective vendor-specific driver, then get overwritten in usbhid_parse(). This is only issue for device-specific NOGET quirks being set by driver for a few devices out there. Signed-off-by: Zoltan Karcagi <zkr@freemail.hu> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: fix possible deadlock in usbhid_close()Oliver Neukum2009-04-291-1/+1
| | | | | | | | | | | This patch switches usbhid_close() from flush_scheduled_work() to canceling the outstanding work. This fixes a possible deadlock due to work taking the mutex usbhid_close() holds. Lockdep reported the problem. Signed-off-by: Oliver Neukum <oliver@neukum.org> -- Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* Merge branch 'autosuspend' into for-nextJiri Kosina2009-03-301-105/+367
|\ | | | | | | | | | | Conflicts: drivers/hid/hid-core.c
| * HID: autosuspend -- fix lockup of hid on resetOliver Neukum2009-03-251-1/+1
| | | | | | | | | | | | | | | | | | This fixes a use of flush_scheduled_work() in USB HID's reset logic that can deadlock. Tested-by: Valdis Kletniks <Valdis.Kletnieks@vt.edu> Signed-off-by: Oliver Neukum <oliver@neukum.name> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * HID: hid_reset_resume() needs to be defined only when CONFIG_PM is setJiri Kosina2009-03-251-50/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | There is no point of having hid_reset_resume() when CONFIG_PM is not set, and even the corresponding .reset_resume pointer in hid_driver struct is properly ifdefed. Move the definition into the ifdef CONFIG_PM part of the source to avoid drivers/hid/usbhid/hid-core.c:1337: warning: 'hid_reset_resume' defined but not used Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * HID: fix USB HID devices after STD with autosuspendOliver Neukum2009-03-251-1/+10
| | | | | | | | | | | | | | | | | | | | | | This patch fixes a bug caused by reset_resume not changing the internal status flags for a device that is resumed via reset_resume. To do so the reset handlers, which correctly assume that a device is awake, can no longer do all the work of reset_resume handling. Signed-off-by: Oliver Neukum <oneukum@suse.de> Tested-by: Laurent Riffard <laurent.riffard@free.fr> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * HID: do not try to compile PM code with CONFIG_PM unsetJiri Kosina2009-03-251-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes this build breakage in case when CONFIG_PM is not set drivers/hid/usbhid/hid-core.c: In function 'hid_suspend': drivers/hid/usbhid/hid-core.c:1220: error: 'struct usb_device' has no member named 'auto_pm' drivers/hid/usbhid/hid-core.c:1245: error: 'struct usb_device' has no member named 'auto_pm' drivers/hid/usbhid/hid-core.c:1258: error: 'struct usb_device' has no member named 'auto_pm' by throwing both the hid_suspend() and hid_resume() away completely in such case, as they won't be used anyway. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * HID: autosuspend support for USB HIDOliver Neukum2009-03-251-94/+341
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
OpenPOWER on IntegriCloud