aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/joystick/gf2k.c (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2012-12-12Revert "HID: sensors: add to special driver list"Alexander Holler2-11/+0
Those IDs aren't necessary anymore. This reverts commit c8147d9ea19bfe7d8e569351bc7239e118dd6997. Signed-off-by: Alexander Holler <holler@ahsoftware.de> Acked-by: "Pandruvada, Srinivas" <srinivas.pandruvada@intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-12-12HID: sensors: autodetect USB HID sensor hubsAlexander Holler4-33/+13
It should not be necessary to add IDs for HID sensor hubs to lists in hid-core.c and hid-sensor-hub.c. So instead of a whitelist, autodetect such USB HID sensor hubs, based on a collection of type physical inside a useage page of type sensor. If some sensor hubs stil must be usable as raw devices, a blacklist might be created. Signed-off-by: Alexander Holler <holler@ahsoftware.de> Acked-by: "Pandruvada, Srinivas" <srinivas.pandruvada@intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-12-07HID: hidp: fallback to input session properly if hid is blacklistedLamarque V. Souza3-4/+17
This patch against kernel 3.7.0-rc8 fixes a kernel oops when turning on the bluetooth mouse with id 0458:0058 [1]. The mouse in question supports both input and hid sessions, however it is blacklisted in drivers/hid/hid-core.c so the input session is one that should be used. Long ago (around kernel 3.0.0) some changes in the bluetooth subsystem made the kernel do not fallback to input session when hid session is not supported or blacklisted. This patch restore that behaviour by making the kernel try the input session if hid_add_device returns ENODEV. The patch exports hid_ignore() from hid-core.c so that it can be used in the bluetooth subsystem. [1] https://bugzilla.kernel.org/show_bug.cgi?id=39882 Signed-off-by: Lamarque V. Souza <lamarque@gmail.com> Acked-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-12-06HID: i2c-hid: fix ret_count checkJiri Kosina1-1/+1
ret_count has to be at least 3, as we have to count the 2 bytes that are used for the size of the reply. Without this, memcpy() might be called with zero or negative count. Reported-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-12-06HID: i2c-hid: fix i2c_hid_get_raw_report count mismatchesBenjamin Tissoires1-4/+12
The previous memcpy implementation relied on the size advertized by the device. There were no guarantees that buf was big enough. Some gymnastic is also required with the +2/-2 to take into account the first 2 bytes of the returned buffer where the total returned length is supplied by the device. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-12-06HID: i2c-hid: remove extra .irq field in struct i2c_hidBenjamin Tissoires1-10/+5
There is no point in keeping the irq in i2c_hid as it's already there in client. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-12-06HID: i2c-hid: reorder allocation/free of buffersBenjamin Tissoires1-40/+28
Simplifies i2c_hid_alloc_buffers tests, and makes this function responsible of the assignment of ihid->bufsize. The condition for the reallocation in i2c_hid_start is then simpler. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-12-06HID: i2c-hid: fix memory corruption due to missing hid declarationBenjamin Tissoires1-1/+8
HID descriptors contains 4 bytes of reserved field. The previous implementation was overriding the next fields in struct i2c_hid. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-12-05HID: i2c-hid: remove superfluous includeJiri Kosina1-1/+0
The pointless WARN_ON() has been removed from i2c_hid_remove(), so we don't need bug.h any more. Reported-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-12-05HID: i2c-hid: remove unneeded test in i2c_hid_removeBenjamin Tissoires1-3/+0
ihid can not be null, so there are no reasons to test it. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-12-05HID: i2c-hid: i2c_hid_get_report may failBenjamin Tissoires1-2/+3
If i2c_hid_get_report fails, exit i2c_hid_init_report. The printk log is already called by i2c_hid_get_report, so no need to add some more printks. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-12-05HID: i2c-hid: also call i2c_hid_free_buffers in i2c_hid_removeBenjamin Tissoires1-0/+3
In the case where the hid driver in charge of handling the hid part of the device (hid-generic for instance) fails at probe, neither i2c_hid_start nor i2c_hid_stop are called. Thus, the buffers allocated in i2c_hid_probe are never freed. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-12-05HID: i2c-hid: fix error messagesBenjamin Tissoires1-5/+6
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-12-05HID: i2c-hid: fix return pathsBenjamin Tissoires1-12/+12
Forwards appropriate return values. As noone use the error returned by i2c_hid_get_input, let's make it returning void. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-12-05HID: i2c-hid: remove unused static declarationsBenjamin Tissoires1-15/+10
These definitions are not used here, but are defined by the specification. Keeping some of them for documentation purposes. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-12-05HID: i2c-hid: fix i2c_hid_dbg macroBenjamin Tissoires1-3/+5
This avoids the problematic case: if (condition) i2c_hid_dbg(ihid, "Blah blah %d\n", i); else do_something_very_important(); Which looks correct, however with the previous macro definition, this expands to the unexpected: if (condition) { if (debug) \ dev_printk(KERN_DEBUG, &ihid->client->dev, "Blah blah %d\n", i); else do_something_very_important(); } Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-12-05HID: i2c-hid: fix checkpatch.pl warningBenjamin Tissoires1-1/+1
We should not initialize to 0 static declarations. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-12-05HID: i2c-hid: enhance KconfigBenjamin Tissoires1-5/+2
The "comment" part can never be displayed, so we can remove it. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-12-05HID: i2c-hid: change I2C nameBenjamin Tissoires1-1/+1
no I2C driver has "i2c" in its name. It makes more sense to call this i2c driver "hid". Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-12-02HID: Add Apple wireless keyboard 2011 ANSI to special driver listBen Hutchings1-0/+1
Commit 0a97e1e9f9a6 ('HID: apple: Add Apple wireless keyboard 2011 ANSI PID') did not update the special driver list in hid-core.c, so hid-generic may still bind to this device. Reported-by: Ari Pollak <ari@scvngr.com> References: http://bugs.debian.org/694546 Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Cc: <stable@vger.kernel.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-11-29HID: hid-input: factorize hid_input allocationBenjamin Tissoires1-27/+34
This just refactors the allocation of hid_input. No semantic changes. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-11-28HID: hidraw: fix signaling SIGIO when hidraw reports an eventAndrew Duggan1-0/+8
This patch fixes sending SIGIO from hidraw_report_event by creating a fasync handler which adds the fasync entry. Signed-off-by: Andrew Duggan <aduggan@synaptics.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-11-28HID: hiddev: fix nonblocking read semantics wrt EIO/ERESTARTSYSJiri Kosina1-4/+4
When the file has been open in non-blocking mode, EIO or ERESTARTSYS would never be returned even if they should (for example when device has been unplugged, you want EIO and not EAGAIN to be returned). Move the O_NONBLOCK check after other checks have been performed. Base on similar patch done to hidraw by Founder Fang <founder.fang@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-11-26HID: add battery quirk for Apple 2009_ISO keyboardOrtwin Glück1-0/+3
Support battery capacity on another Apple wireless keyboard. Signed-off-by: Ortwin Glück <odi@odi.ch> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-11-26HID: add quirk for Freescale i.MX23 ROM recoveryMarek Vasut2-0/+4
The USB recovery mode present in i.MX23 ROM emulates USB HID. It needs this quirk to behave properly. Even if the official branding of the chip is Freescale i.MX23, I named it Sigmatel STMP3780 since that's what the chip really is and it even reports itself as STMP3780. Signed-off-by: Marek Vasut <marex@denx.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-11-26HID: hidraw: fix nonblock read return EAGAIN after device removedFounder Fang1-4/+4
When nonblock read the condition check (file->f_flags & O_NONBLOCK) always be true, signal_pending and device exist checking never get a chance to run, so the user mode code always get EAGAIN even if device removed. move nonblock mode checking to the last can fix this problem. Signed-off-by: Founder Fang <founder.fang@gmail.com> Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-11-22HID: add support to novatec wireless mouseMarco Biscaro2-0/+2
This patch adds support to Novatec wireless mouse (device ID 0603:1602). Fixes bug https://bugzilla.kernel.org/show_bug.cgi?id=47031 Signed-off-by: Marco Biscaro <marcobiscaro2112@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-11-20HID: i2c-hid: fix memory leak during probeJiri Kosina1-0/+1
In case we are returning from i2c_hid_probe() through the 'err' or 'err_mem_free' labels, there is noone freeing the buffers allocated by i2c_hid_alloc_buffers(). Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-11-20HID: sensor-hub: Remove pointless NULL checkAlan Cox1-4/+0
report cannot be NULL, fortunately as we use it before we check ! Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-11-19HID: i2c-hid: introduce HID over i2c specification implementationBenjamin Tissoires6-0/+1038
Microsoft published the protocol specification of HID over i2c: http://msdn.microsoft.com/en-us/library/windows/hardware/hh852380.aspx This patch introduces an implementation of this protocol. This implementation does not includes the ACPI part of the specification. This will come when ACPI 5.0 devices enumeration will be available. Once the ACPI part is done, OEM will not have to declare HID over I2C devices in their platform specific driver. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-11-18HID: roccat: fix wrong attr size for koneplus tcuStefan Achatz1-1/+1
More thorough testing revealed a typo in last koneplus cleanups. Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-11-16HID: hiddev: Remove redundant check on unsigned variableTushar Behera1-1/+1
No need to check whether unsigned variable is less than 0. CC: Jiri Kosina <jkosina@suse.cz> CC: linux-usb@vger.kernel.org CC: linux-input@vger.kernel.org Signed-off-by: Tushar Behera <tushar.behera@linaro.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-11-16drm/ttm: remove unneeded preempt_disable/enableAkinobu Mita1-4/+0
It is unnecessary to disable preemption explicitly while calling copy_highpage(). Because copy_highpage() will do it again through kmap_atomic/kunmap_atomic. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-16ttm: Clear the ttm page allocated from high memory zone correctlyZhao Yakui1-1/+4
The TTM page can be allocated from high memory. In such case it is wrong to use the page_address(page) as the virtual address for the high memory page. bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=50241 Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Cc: stable@vger.kernel.org Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-16vmwgfx: return an -EFAULT if copy_to_user() failsDan Carpenter1-0/+2
copy_to_user() returns the number of bytes remaining to be copied, but we want to return a negative error code here. I fixed a couple of these last year, but I missed this one. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-15clk: remove inline usage from clk-provider.hIgor Mazanov1-2/+2
Users of GCC 4.7 have reported compiler errors due to having inline applied to function declarations in clk-provider.h. The definitions exist in drivers/clk/clk.c. An example error: In file included from arch/arm/mach-omap2/clockdomain.c:25:0: arch/arm/mach-omap2/clockdomain.c: In function ‘clkdm_clk_disable’: include/linux/clk-provider.h:338:12: error: inlining failed in call to always_inline ‘__clk_get_enable_count’: function body not available arch/arm/mach-omap2/clockdomain.c:1001:28: error: called from here make[1]: *** [arch/arm/mach-omap2/clockdomain.o] Error 1 make: *** [arch/arm/mach-omap2] Error 2 This patch removes the use of inline from include/linux/clk-provider.h but keeps the function definitions in drivers/clk/clk.c as inlined since they are one-liners. Signed-off-by: Igor Mazanov <i.mazanov@gmail.com> Acked-by: Paul Walmsley <paul@pwsan.com> Signed-off-by: Mike Turquette <mturquette@linaro.org> [mturquette@linaro.org: improved subject, added changelog]
2012-11-15s390/3215: fix tty close handlingHeiko Carstens1-7/+5
The 3215 console always has the RAW3215_FIXED flag set, which causes raw3215_shutdown() not to wait for outstanding I/O requests if an attached tty gets closed. The flag however can be simply removed, so we can guarantee that all requests belonging to the tty have been processed when the tty is closed. However the tasklet that belongs to the 3215 device may be scheduled even if there is no tty attached anymore, since we have a race between console and tty processing. Thefore unconditional tty_wakekup() in raw3215_wakeup() can cause the following NULL pointer dereference: 3.465368 Unable to handle kernel pointer dereference at virtual kernel address (null) 3.465448 Oops: 0004 #1 SMP 3.465454 Modules linked in: 3.465459 CPU: 1 Not tainted 3.6.0 #1 3.465462 Process swapper/1 (pid: 0, task: 000000003ffa4428, ksp: 000000003ffb7ce0) 3.465466 Krnl PSW : 0404100180000000 0000000000162f86 (__wake_up+0x46/0xb8) 3.465480 R:0 T:1 IO:0 EX:0 Key:0 M:1 W:0 P:0 AS:0 CC:1 PM:0 EA:3 Krnl GPRS: fffffffffffffffe 0000000000000000 0000000000000160 0000000000000001 3.465492 0000000000000001 0000000000000004 0000000000000004 000000000096b490 3.465499 0000000000000001 0000000000000100 0000000000000001 0000000000000001 3.465506 070000003fc87d60 0000000000000160 000000003fc87d68 000000003fc87d00 3.465526 Krnl Code: 0000000000162f76: e3c0f0a80004 lg %r12,168(%r15) 0000000000162f7c: 58000370 l %r0,880 #0000000000162f80: c007ffffffff00 xilf %r0,4294967295 >0000000000162f86: ba102000 cs %r1,%r0,0(%r2) 0000000000162f8a: 1211 ltr %r1,%r1 0000000000162f8c: a774002f brc 7,162fea 0000000000162f90: b904002d lgr %r2,%r13 0000000000162f94: b904003a lgr %r3,%r10 3.465597 Call Trace: 3.465599 (<0400000000000000> 0x400000000000000) 3.465602 <000000000048c77e> raw3215_wakeup+0x2e/0x40 3.465607 <0000000000134d66> tasklet_action+0x96/0x168 3.465612 <000000000013423c> __do_softirq+0xd8/0x21c 3.465615 <0000000000134678> irq_exit+0xa8/0xac 3.465617 <000000000046c232> do_IRQ+0x182/0x248 3.465621 <00000000005c8296> io_return+0x0/0x8 3.465625 <00000000005c7cac> vtime_stop_cpu+0x4c/0xb8 3.465629 (<0000000000194e06> tick_nohz_idle_enter+0x4e/0x74) 3.465633 <0000000000104760> cpu_idle+0x170/0x184 3.465636 <00000000005b5182> smp_start_secondary+0xd6/0xe0 3.465641 <00000000005c86be> restart_int_handler+0x56/0x6c 3.465643 <0000000000000000> 0x0 3.465645 Last Breaking-Event-Address: 3.465647 <0000000000403136> tty_wakeup+0x46/0x98 3.465652 3.465654 Kernel panic - not syncing: Fatal exception in interrupt 01: HCPGIR450W CP entered; disabled wait PSW 00020001 80000000 00000000 0010F63C The easiest solution is simply to check if tty is NULL in the tasklet. If it is NULL nothing is to do (no tty attached), otherwise tty_wakeup() can be called, since we hold a reference to the tty. This is not nice... but it is a small patch and it works. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2012-11-15drm/radeon: fix logic error in atombios_encoders.cAlex Deucher1-1/+1
Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=50431 Reported-by: David Binderman <dcb314@hotmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-11-15HID: usbhid: add quirk HID_QUIRK_NOGET to TPV optical touchscreenBenjamin Tissoires2-0/+4
Without this, the device is blocked in dmesg at: hid-multitouch 0003:25AA:8883.000X: usb_submit_urb(ctrl) failed: -1 hid-multitouch 0003:25AA:8883.000X: timeout initializing reports Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-11-15HID: multitouch: fix Win 8 protocolBenjamin Tissoires1-0/+12
The Win 8 protocol specify the fact that each valid touch must be reported within a frame until it is released. We can therefore use the always_valid quirk and dismiss reports when we see duplicate contacts ID. We recognize Win8 certified devices from their vendor feature 0xff0000c5 where Microsoft put a signed blob in the report to check if the device passed the certification. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-11-15HID: multitouch: support for hovering devicesBenjamin Tissoires1-3/+15
Win8 devices supporting hovering must provides InRange HID field. The information that the finger is here but is not touching the surface is sent to the user space through ABS_MT_DISTANCE as required by the multitouch protocol. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-11-15HID: multitouch: add MT_QUIRK_IGNORE_DUPLICATESBenjamin Tissoires1-0/+9
This quirk allows a device to reuse a contact id when sending garbage inactive contacts at the end of a report. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-11-15Input: mt: add input_mt_is_usedBenjamin Tissoires2-1/+7
This patch extracts the test (slot->frame == mt->frame) so that it can be used in third party drivers. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-11-15Input: introduce EV_MSC TimestampBenjamin Tissoires2-0/+12
Some devices provides the actual timestamp (hid_dg_scan_time in win8 ones) computed by the hardware itself. This value is global to the frame and is not specific to the multitouch protocol. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Henrik Rydberg <rydberg@euromail.se> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-11-15HID: multitouch: move ALWAYS_VALID quirk checkBenjamin Tissoires1-4/+2
Win 8 device specification changed the requirements for the hid usages of the multitouch devices. Now InRange is optional and must be only used when the device supports hovering. This ensures that the quirk ALWAYS_VALID is taken into account and also ensures its precedence over the other VALID* quirks. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-11-15HID: multitouch: support T and C for win8 devicesBenjamin Tissoires1-9/+37
Win8 input specification clarifies the X and Y sent by devices. It distincts the position where the user wants to Touch (T) from the center of the ellipsoide (C). This patch enable supports for this distinction in hid-multitouch. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-11-15HID: multitouch: get maxcontacts also from logical_max valueBenjamin Tissoires1-0/+4
Win8 devices are required to present the feature "Maximum Contact Number". Fortunately all win7 devices I've seen presents this feature. If the current value is 0, then, the driver can get the actual supported contact count by refering to the logical_max. This win8 specification ensures that logical_max may not be above 250. This also allows us to detect when devices like irtouch or stantum reports an obviously wrong value of 255. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Acked-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-11-15HID: multitouch: support arrays for the split of the touches in a reportBenjamin Tissoires1-6/+9
Win8 certification introduced the ability to transmit two X and two Y per touch. The specification precises that it must be used in an array. This test guarantees that we split the touches on the last element in this array. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-11-15HID: add usage_index in struct hid_usage.Benjamin Tissoires2-0/+5
Currently, there is no way to know the index of the current field in the .input_mapping and .event callbacks when this field is inside an array of HID fields. This patch adds this index to the struct hid_usage so that this information is available to input_mapping and event callbacks. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Acked-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-11-15HID: fix unit exponent parsingBenjamin Tissoires3-5/+25
HID spec details special values for the HID field unit exponent. Basically, the range [0x8..0xf] correspond to [-8..-1], so this is a standard two's complement on a half-byte. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Acked-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Jiri Kosina <jkosina@suse.cz>