aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/usbhid (follow)
AgeCommit message (Collapse)AuthorFilesLines
2010-10-23Merge branch 'waltop' into for-linusJiri Kosina1-0/+2
2010-10-23Merge branch 'uc-logic' into for-linusJiri Kosina1-0/+2
Conflicts: drivers/hid/hid-ids.h drivers/hid/hid-lg.c drivers/hid/usbhid/hid-quirks.c
2010-10-23Merge branches '3m', 'egalax', 'logitech', 'magicmouse', 'ntrig' and 'roccat' into for-linusJiri Kosina2-2/+1
2010-10-23Merge branches 'upstream' and 'upstream-fixes' into for-linusJiri Kosina3-46/+2
2010-10-22Merge branch 'llseek' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bklLinus Torvalds1-0/+1
* 'llseek' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl: vfs: make no_llseek the default vfs: don't use BKL in default_llseek llseek: automatically add .llseek fop libfs: use generic_file_llseek for simple_attr mac80211: disallow seeks in minstrel debug code lirc: make chardev nonseekable viotape: use noop_llseek raw: use explicit llseek file operations ibmasmfs: use generic_file_llseek spufs: use llseek in all file operations arm/omap: use generic_file_llseek in iommu_debug lkdtm: use generic_file_llseek in debugfs net/wireless: use generic_file_llseek in debugfs drm: use noop_llseek
2010-10-15llseek: automatically add .llseek fopArnd Bergmann1-0/+1
All file_operations should get a .llseek operation so we can make nonseekable_open the default for future file operations without a .llseek pointer. The three cases that we can automatically detect are no_llseek, seq_lseek and default_llseek. For cases where we can we can automatically prove that the file offset is always ignored, we use noop_llseek, which maintains the current behavior of not returning an error from a seek. New drivers should normally not use noop_llseek but instead use no_llseek and call nonseekable_open at open time. Existing drivers can be converted to do the same when the maintainer knows for certain that no user code relies on calling seek on the device file. The generated code is often incorrectly indented and right now contains comments that clarify for each added line why a specific variant was chosen. In the version that gets submitted upstream, the comments will be gone and I will manually fix the indentation, because there does not seem to be a way to do that using coccinelle. Some amount of new code is currently sitting in linux-next that should get the same modifications, which I will do at the end of the merge window. Many thanks to Julia Lawall for helping me learn to write a semantic patch that does all this. ===== begin semantic patch ===== // This adds an llseek= method to all file operations, // as a preparation for making no_llseek the default. // // The rules are // - use no_llseek explicitly if we do nonseekable_open // - use seq_lseek for sequential files // - use default_llseek if we know we access f_pos // - use noop_llseek if we know we don't access f_pos, // but we still want to allow users to call lseek // @ open1 exists @ identifier nested_open; @@ nested_open(...) { <+... nonseekable_open(...) ...+> } @ open exists@ identifier open_f; identifier i, f; identifier open1.nested_open; @@ int open_f(struct inode *i, struct file *f) { <+... ( nonseekable_open(...) | nested_open(...) ) ...+> } @ read disable optional_qualifier exists @ identifier read_f; identifier f, p, s, off; type ssize_t, size_t, loff_t; expression E; identifier func; @@ ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off) { <+... ( *off = E | *off += E | func(..., off, ...) | E = *off ) ...+> } @ read_no_fpos disable optional_qualifier exists @ identifier read_f; identifier f, p, s, off; type ssize_t, size_t, loff_t; @@ ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off) { ... when != off } @ write @ identifier write_f; identifier f, p, s, off; type ssize_t, size_t, loff_t; expression E; identifier func; @@ ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off) { <+... ( *off = E | *off += E | func(..., off, ...) | E = *off ) ...+> } @ write_no_fpos @ identifier write_f; identifier f, p, s, off; type ssize_t, size_t, loff_t; @@ ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off) { ... when != off } @ fops0 @ identifier fops; @@ struct file_operations fops = { ... }; @ has_llseek depends on fops0 @ identifier fops0.fops; identifier llseek_f; @@ struct file_operations fops = { ... .llseek = llseek_f, ... }; @ has_read depends on fops0 @ identifier fops0.fops; identifier read_f; @@ struct file_operations fops = { ... .read = read_f, ... }; @ has_write depends on fops0 @ identifier fops0.fops; identifier write_f; @@ struct file_operations fops = { ... .write = write_f, ... }; @ has_open depends on fops0 @ identifier fops0.fops; identifier open_f; @@ struct file_operations fops = { ... .open = open_f, ... }; // use no_llseek if we call nonseekable_open //////////////////////////////////////////// @ nonseekable1 depends on !has_llseek && has_open @ identifier fops0.fops; identifier nso ~= "nonseekable_open"; @@ struct file_operations fops = { ... .open = nso, ... +.llseek = no_llseek, /* nonseekable */ }; @ nonseekable2 depends on !has_llseek @ identifier fops0.fops; identifier open.open_f; @@ struct file_operations fops = { ... .open = open_f, ... +.llseek = no_llseek, /* open uses nonseekable */ }; // use seq_lseek for sequential files ///////////////////////////////////// @ seq depends on !has_llseek @ identifier fops0.fops; identifier sr ~= "seq_read"; @@ struct file_operations fops = { ... .read = sr, ... +.llseek = seq_lseek, /* we have seq_read */ }; // use default_llseek if there is a readdir /////////////////////////////////////////// @ fops1 depends on !has_llseek && !nonseekable1 && !nonseekable2 && !seq @ identifier fops0.fops; identifier readdir_e; @@ // any other fop is used that changes pos struct file_operations fops = { ... .readdir = readdir_e, ... +.llseek = default_llseek, /* readdir is present */ }; // use default_llseek if at least one of read/write touches f_pos ///////////////////////////////////////////////////////////////// @ fops2 depends on !fops1 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @ identifier fops0.fops; identifier read.read_f; @@ // read fops use offset struct file_operations fops = { ... .read = read_f, ... +.llseek = default_llseek, /* read accesses f_pos */ }; @ fops3 depends on !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @ identifier fops0.fops; identifier write.write_f; @@ // write fops use offset struct file_operations fops = { ... .write = write_f, ... + .llseek = default_llseek, /* write accesses f_pos */ }; // Use noop_llseek if neither read nor write accesses f_pos /////////////////////////////////////////////////////////// @ fops4 depends on !fops1 && !fops2 && !fops3 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @ identifier fops0.fops; identifier read_no_fpos.read_f; identifier write_no_fpos.write_f; @@ // write fops use offset struct file_operations fops = { ... .write = write_f, .read = read_f, ... +.llseek = noop_llseek, /* read and write both use no f_pos */ }; @ depends on has_write && !has_read && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @ identifier fops0.fops; identifier write_no_fpos.write_f; @@ struct file_operations fops = { ... .write = write_f, ... +.llseek = noop_llseek, /* write uses no f_pos */ }; @ depends on has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @ identifier fops0.fops; identifier read_no_fpos.read_f; @@ struct file_operations fops = { ... .read = read_f, ... +.llseek = noop_llseek, /* read uses no f_pos */ }; @ depends on !has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @ identifier fops0.fops; @@ struct file_operations fops = { ... +.llseek = noop_llseek, /* no read or write fn */ }; ===== End semantic patch ===== Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Julia Lawall <julia@diku.dk> Cc: Christoph Hellwig <hch@infradead.org>
2010-10-12HID: Add MULTI_INPUT quirk for turbox/mosart touchscreenPierre BAILLY1-0/+1
This device generates ABS_Z and ABS_RX events, while it should be generating ABS_X and ABS_Y instead. Using the MULTI_INPUT quirk solves this issue. Reference: https://bugs.launchpad.net/ubuntu/+bug/620609/ Signed-off-by: Pierre BAILLY <pierre@substantiel.fr> Signed-off-by: Anisse Astier <anisse@astier.eu> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-10-01HID: Fix for problems with eGalax/DWAV multi-touch-screenPhilipp Merkel1-1/+0
This patch fixes three problems with the eGalax/DWAV multi-touch screen found in the Eee PC T101MT: 1) While there is a dedicated multitouch driver for the screen (hid-egalax.c), the MULTI_INPUT quirk is also applied, preventing the hid-egalax driver from working. This patch removes the quirk so the hid-egalax driver can handle the device correctly. 2) The x and y coordinates sent by the screen in multi-touch mode are shifted by three bits from the events sent in single-touch mode, thus the coordinates are out of range, leading to the pointer being stuck in the bottom-right corner if no additional calibration is applied (e.g. in the X evdev driver). This patch shifts the coordinates back. This does not decrease accuracy as the last three bits of the "wrong" coordinates are always 0. 3) Only multi-touch pressure events are sent, single touch emulation is missing pressure information. This patch adds single-touch ABS_PRESSURE events. Signed-off-by: Philipp Merkel <mail@philmerk.de> Acked-by: Stéphane Chatty <chatty@enac.fr> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-10-01HID: add NOGET quirk for AXIS 295 Video Surveillance JoystickRok Mandeljc1-0/+1
This patch adds the NOGET quirk for AXIS 295 Video Surveillance Joystick (despite AXIS brand the vendor is actually CH Products). Without the quirk, the joystick is detected but does not generate any events. Signed-off-by: Rok Mandeljc <rok.mandeljc@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-09-24HID: usbhid: remove unused hiddev_driverAlan Stern2-46/+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>
2010-09-24Merge branch 'master' into upstreamJiri Kosina4-2/+13
2010-09-22HID: trivial formatting fixAlan Ott1-0/+1
Added blank line after declarations. Signed-off-by: Alan Ott <alan@signal11.us> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-09-22HID: don't Send Feature Reports on Interrupt EndpointAlan Ott1-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>
2010-09-14HID: fix hiddev's use of usb_find_interfaceGuillaume Chazarain3-1/+7
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>
2010-09-03HID: add no-get quirk for eGalax touch controllerJohan Hovold1-1/+1
Add no-get quirk for eGalax touch controller to avoid timeout at probe. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-09-01HID: waltop: add Media Tablet 14.1 inch supportNikolai Kondrashov1-0/+1
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>
2010-08-30HID: Add quirk for eGalax touch controler.Thierry Reding1-0/+1
This patch adds a quirk for the eGalax touch controller which reports two pairs of axes. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-08-24HID: Set Report ID properly for Output reports on the Control endpoint.Alan Ott1-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>
2010-08-24HID: Kanvus Note A5 tablet needs HID_QUIRK_MULTI_INPUTDecio Fonini1-0/+1
The Kanvus Note A5 tablet (with USB ID 5543:6001, USB vendor UC_Logic) needs the HID_QUIRK_MULTI_INPUT in order to work out of the box; otherwise, we get the usual "cursor stuck at the upper left corner of the screen". Signed-off-by: Decio Fonini <fonini@techk.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-08-23HID: add support for two Waltop tabletsNikolai Kondrashov1-0/+1
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>
2010-08-19HID: Add support for chicony multitouch screens.David Gow1-0/+2
Adds a hid quirk for the chicony multitouch screen found in the Acer Aspire 1820pt notebook. Signed-off-by: David Gow <david@ingeniumdigital.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-08-13HID: hiddev: fix memory corruption due to invalid intfdataJiri Kosina1-2/+3
Commit bd25f4dd6972755579d0 ("HID: hiddev: use usb_find_interface, get rid of BKL") introduced using of private intfdata in hiddev for purpose of storing hiddev pointer. This is a problem, because intf pointer is already being set to struct hid_device pointer by HID core. This obviously lead to memory corruptions at device disconnect time, such as WARNING: at lib/kobject.c:595 kobject_put+0x37/0x4b() kobject: '(null)' (ffff88011e9cd898): is not initialized, yet kobject_put() is being called. Convert hiddev into accessing hiddev through struct hid_device which is in intfdata already. Reported-and-tested-by: Markus Trippelsdorf <markus@trippelsdorf.de> Reported-and-tested-by: Heinz Diehl <htd@fritha.org> Reported-and-tested-by: Alan Ott <alan@signal11.us> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-08-13HID: hiddev: protect against disconnect/NULL-dereference raceChris Ball1-2/+4
One of our users reports consistently hitting a NULL dereference that resolves to the "hid_to_usb_dev(hid);" call in hiddev_ioctl(), when disconnecting a Lego WeDo USB HID device from an OLPC XO running Scratch software. There's a FIXME comment and a guard against the dereference, but that happens farther down the function than the initial dereference does. This patch moves the call to be below the guard, and the user reports that it fixes the problem for him. OLPC bug report: http://dev.laptop.org/ticket/10174 Signed-off-by: Chris Ball <cjb@laptop.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-08-09HID: Add support for UC-Logic WP????U tabletsNikolai Kondrashov1-1/+2
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>
2010-08-04Merge branch 'bkl' into for-linusJiri Kosina1-42/+12
2010-07-19HID: Force input registration for "VEC footpedal"Daniel Mack1-0/+2
These devices report a usage page of type "consumer" and a usage of "Programmable buttons". They are hence ignored by the hid-input layer. Force the registration of an input device by using the new quirk type HID_QUIRK_HIDINPUT_FORCE. 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>
2010-07-13HID: hiddev: use usb_find_interface, get rid of BKLArnd Bergmann1-42/+12
This removes the private hiddev_table in the usbhid driver and changes it to use usb_find_interface instead. The advantage is that we can avoid the race between usb_register_dev and usb_open and no longer need the big kernel lock. This doesn't introduce race condition -- the intf pointer could be invalidated only in hiddev_disconnect() through usb_deregister_dev(), but that will block on minor_rwsem and not actually remove the device until usb_open(). Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Jiri Kosina <jkosina@suse.cz> Cc: "Greg Kroah-Hartman" <gregkh@suse.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-07-11HID: Send Report ID when numbered reports are sent over the control endpoint.Alan Ott1-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>
2010-07-11HID: Enable HID_QUIRK_MULTI_INPUT for Retro AdaptorPeter Edwards1-0/+1
Patch for linux-2.6.35-rc4 mainline kernel to enable Paul Qureshi's Retro Adapter [http://keio.dk/retroadapter.html], an open source USB device which allows controllers and joysticks from classic computers and consoles to work on modern PCs, to appear as two separate devices under Linux. Signed-off-by: Peter Edwards <samwise@bagshot-row.org> Acked-by: Paul Qureshi <retro@world3.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-07-11HID: add support for CH Eclipse yokeJonathan Rockway1-0/+1
This USB flight yoke needs the NOGET quirk, like most of CH's other products. This patch adds that. Signed-off-by: Jonathan Rockway <jon@jrock.us> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-21Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hidLinus Torvalds4-15/+79
* '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 ...
2010-05-20USB: rename usb_buffer_alloc() and usb_buffer_free() usersDaniel Mack3-13/+13
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>
2010-05-20USB: remove uses of URB_NO_SETUP_DMA_MAPAlan Stern3-11/+6
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>
2010-05-19Merge branches 'ntrig', 'picolcd', 'prodikeys' and 'roccat-kone' into for-linusJiri Kosina1-0/+1
Conflicts: drivers/hid/Makefile
2010-05-19Merge branch 'egalax' into for-linusJiri Kosina1-1/+1
Conflicts: drivers/hid/hid-ids.h
2010-05-19Merge branches 'upstream-fixes', 'bkl-removal', 'debugfs-fixes' and 'hid-suspend' into for-linusJiri Kosina2-3/+40
2010-05-19Merge branch 'upstream' into for-linusJiri Kosina3-12/+38
Conflicts: drivers/hid/hid-wacom.c
2010-05-18HID: hidraw: Use Interrupt Endpoint for OUT Transfers if AvailableAlan Ott1-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>
2010-05-10HID: add multi-input quirk for eGalax TouchcontrollerPeter Hutterer1-0/+1
I've got one of these devices on my desk and it seems that it suffers from the ABS_Z/ABS_RX issue that we've seen in other devices before. This patch uses the same reasoning as 9db630b48 ("HID: add multi-input quirk for NextWindow Touchscreen"). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-07HID: fix suspend crash by moving initializations earlierAlan Stern1-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>
2010-05-03Merge branch 'hid-suspend' into picolcdJiri Kosina3-1/+26
2010-04-27HID: add suspend/resume hooks for hid driversBruno Prémont1-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>
2010-04-19HID: add HID_QUIRK_HIDDEV_FORCE and HID_QUIRK_NO_IGNOREBastien Nocera1-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>
2010-04-05Merge branch 'master' into export-slabhTejun Heo1-0/+1
2010-04-03HID: usbhid: enable remote wakeup for keyboardsAlan Stern2-2/+6
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>
2010-03-31HID: add framebuffer support to PicoLCD deviceBruno Prémont1-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>
2010-03-30include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.hTejun Heo2-0/+2
percpu.h is included by sched.h and module.h and thus ends up being included when building most .c files. percpu.h includes slab.h which in turn includes gfp.h making everything defined by the two files universally available and complicating inclusion dependencies. percpu.h -> slab.h dependency is about to be removed. Prepare for this change by updating users of gfp and slab facilities include those headers directly instead of assuming availability. As this conversion needs to touch large number of source files, the following script is used as the basis of conversion. http://userweb.kernel.org/~tj/misc/slabh-sweep.py The script does the followings. * Scan files for gfp and slab usages and update includes such that only the necessary includes are there. ie. if only gfp is used, gfp.h, if slab is used, slab.h. * When the script inserts a new include, it looks at the include blocks and try to put the new include such that its order conforms to its surrounding. It's put in the include block which contains core kernel includes, in the same order that the rest are ordered - alphabetical, Christmas tree, rev-Xmas-tree or at the end if there doesn't seem to be any matching order. * If the script can't find a place to put a new include (mostly because the file doesn't have fitting include block), it prints out an error message indicating which .h file needs to be added to the file. The conversion was done in the following steps. 1. The initial automatic conversion of all .c files updated slightly over 4000 files, deleting around 700 includes and adding ~480 gfp.h and ~3000 slab.h inclusions. The script emitted errors for ~400 files. 2. Each error was manually checked. Some didn't need the inclusion, some needed manual addition while adding it to implementation .h or embedding .c file was more appropriate for others. This step added inclusions to around 150 files. 3. The script was run again and the output was compared to the edits from #2 to make sure no file was left behind. 4. Several build tests were done and a couple of problems were fixed. e.g. lib/decompress_*.c used malloc/free() wrappers around slab APIs requiring slab.h to be added manually. 5. The script was run on all .h files but without automatically editing them as sprinkling gfp.h and slab.h inclusions around .h files could easily lead to inclusion dependency hell. Most gfp.h inclusion directives were ignored as stuff from gfp.h was usually wildly available and often used in preprocessor macros. Each slab.h inclusion directive was examined and added manually as necessary. 6. percpu.h was updated not to include slab.h. 7. Build test were done on the following configurations and failures were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my distributed build env didn't work with gcov compiles) and a few more options had to be turned off depending on archs to make things build (like ipr on powerpc/64 which failed due to missing writeq). * x86 and x86_64 UP and SMP allmodconfig and a custom test config. * powerpc and powerpc64 SMP allmodconfig * sparc and sparc64 SMP allmodconfig * ia64 SMP allmodconfig * s390 SMP allmodconfig * alpha SMP allmodconfig * um on x86_64 SMP allmodconfig 8. percpu.h modifications were reverted so that it could be applied as a separate patch and serve as bisection point. Given the fact that I had only a couple of failures from tests on step 6, I'm fairly confident about the coverage of this conversion patch. If there is a breakage, it's likely to be something in one of the arch headers which should be easily discoverable easily on most builds of the specific arch. Signed-off-by: Tejun Heo <tj@kernel.org> Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-30HID: update BKL comment in hiddevJiri Kosina1-2/+17
Update comment explaining BKL usage in legacy hiddev driver. Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-03-29HID: Add NOGET quirk for Quanta Pixart touchscreenAnisse Astier1-0/+1
Add the NOGET quirk for the Quanta optical touchscreen present on MSI AE2220, Otherwise, the hid-quanta driver timeouts at load time: drivers/hid/usbhid/hid-core.c: usb_submit_urb(ctrl) failed quanta-touch 0003:0408:3001.0003: timeout initializing reports input: PixArt Imaging Inc. Optical Touch Screen as /class/input/input7 quanta-touch 0003:0408:3001.0003: input: USB HID v1.10 Device [PixArt Imaging Inc. Optical Touch Screen] on usb-0000:00:06.0-2/input0 Signed-off-by: Anisse Astier <anisse@astier.eu> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-03-18Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hidLinus Torvalds1-0/+1
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: HID: avoid '\0' in hid debugfs events file HID: Add RGT Clutch Wheel clutch device id HID: ntrig: fix touch events HID: add quirk for UC-Logik WP4030 tablet HID: magicmouse: fix oops after device removal