Some drivers like to report ABS_PRESSURE in a special way.
Allow this when ABS_MT_PRESSURE is not defined.
Acked-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Henrik Rydberg <[email protected]>
Some devices use an internal key for tracking which cannot be directly
mapped to slots. This patch provides a key-to-slot mapping, which can
be used by drivers of such devices.
Reviewed-and-tested-by: Benjamin Tissoires <[email protected]>
Acked-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Henrik Rydberg <[email protected]>
With the INPUT_MT_TRACK flag set, the function input_mt_assign_slots()
can be used to match a new set of contacts against the currently used
slots. The algorithm used is based on Lagrange relaxation, and performs
very well in practice; slower than mtdev for a few corner cases, but
faster in most commonly occuring cases.
Tested-by: Benjamin Tissoires <[email protected]>
Acked-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Henrik Rydberg <[email protected]>
Most MT drivers perform the same actions on frame synchronization.
Some actions, like dropping unseen contacts, are also unnecessarily
complex. Collect common frame synchronization tasks in a new function,
input_mt_sync_frame(). Depending on the flags set, it drops unseen
contacts and performs pointer emulation.
With init flags and frame synchronization in place, most MT drivers
can be simplified. First out are the bcm5974 and hid-multitouch
drivers, following this patch.
Reviewed-and-tested-by: Benjamin Tissoires <[email protected]>
Tested-by: Ping Cheng <[email protected]>
Acked-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Henrik Rydberg <[email protected]>
Preparing to move more repeated code into the mt core, add a flags
argument to the input_mt_slots_init() function.
Reviewed-and-tested-by: Benjamin Tissoires <[email protected]>
Tested-by: Ping Cheng <[email protected]>
Acked-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Henrik Rydberg <[email protected]>
By sending a full frame of events at the same time, the irqsoff
latency at heavy load is brought down from 200 us to 100 us.
Cc: Daniel Kurtz <[email protected]>
Tested-by: Benjamin Tissoires <[email protected]>
Tested-by: Ping Cheng <[email protected]>
Acked-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Henrik Rydberg <[email protected]>
On heavy event loads, such as a multitouch driver, the irqsoff latency
can be as high as 250 us. By accumulating a frame worth of data
before passing it on, the latency can be dramatically reduced. As a
side effect, the special EV_SYN handling can be removed, since the
frame is now atomic.
This patch adds the events() handler callback and uses it if it
exists. The latency is improved by 50 us even without the callback.
Cc: Daniel Kurtz <[email protected]>
Tested-by: Benjamin Tissoires <[email protected]>
Tested-by: Ping Cheng <[email protected]>
Tested-by: Sedat Dilek <[email protected]>
Acked-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Henrik Rydberg <[email protected]>
Preparing to split event filtering and event passing, move the
autorepeat function to the point where the event is actually passed.
Tested-by: Benjamin Tissoires <[email protected]>
Tested-by: Ping Cheng <[email protected]>
Acked-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Henrik Rydberg <[email protected]>
For some EV_KEY types, sending a larger-than-one value causes the
input state to oscillate. This patch makes sure this cannot happen,
clearing up the autorepeat bypass logic in the process.
Tested-by: Benjamin Tissoires <[email protected]>
Tested-by: Ping Cheng <[email protected]>
Acked-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Henrik Rydberg <[email protected]>
The events-per-packet estimate has so far been used by MT devices
only. This patch adjusts the packet buffer size to also accomodate the
KEY and MSC events. Keyboards normally send one or two keys at a
time. MT devices normally send a number of button keys along with the
MT information. The buffer size chosen here covers those cases, and
matches the default buffer size in evdev. Since the input estimate is
now preferred, remove the special input-mt estimate.
Reviewed-and-tested-by: Ping Cheng <[email protected]>
Tested-by: Benjamin Tissoires <[email protected]>
Acked-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Henrik Rydberg <[email protected]>
Move all MT-related things to a separate place. This saves some
bytes for non-mt input devices, and prepares for new MT features.
Reviewed-and-tested-by: Benjamin Tissoires <[email protected]>
Tested-by: Ping Cheng <[email protected]>
Acked-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Henrik Rydberg <[email protected]>
This reverts commit ca3b3faf9b.
There was a plan to place ab8500_irq_get_virq() calls in each AB8500
child device prior to requesting an IRQ, but as we're no longer using
Device Tree to collect our IRQ numbers, it's actually better to allow
the core to do this during device registration time. So the IRQ number
we pull from its resource has already been converted to a virtual IRQ.
Signed-off-by: Lee Jones <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
ARM is moving to stricter checks on readl/write functions,
so we need to use the correct types everywhere.
Cc: Dmitry Torokhov <[email protected]>
Cc: [email protected]
Signed-off-by: Arnd Bergmann <[email protected]>
Add support when the kernel has been booted with DT blob. In this case the
pdata is NULL, we need to reach up to the core node and check if the codec
part has been enabled to determine if we need to coexist with the codec or
not.
Signed-off-by: Peter Ujfalusi <[email protected]>
Acked-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
pdata->nbuttons should be updated by the dt code.
Signed-off-by: Alexandre Pereira da Silva <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Remove support for omap2+ as it's no longer needed since
it's using matrix-keypad. This way we can remove depency
to plat and mach headers which is needed for ARM common
zImage support.
Also remove INT_KEYBOARD by using omap_kp->irq.
Note that this patch depends on an earlier patch
"ARM: OMAP: Move gpio.h to include/linux/platform_data".
Cc: Dmitry Torokhov <[email protected]>
Cc: [email protected]
Acked-by: Sourav Poddar <[email protected]>
Reviewed-by: Felipe Balbi <[email protected]>
Signed-off-by: Tony Lindgren <[email protected]>
Linux 3.6-rc4
# gpg: Signature made Sat 01 Sep 2012 10:40:33 AM PDT using RSA key ID 00411886
# gpg: Good signature from "Linus Torvalds <[email protected]>"
Move the Tegra KBC platform data header out of arch/arm/mach-tegra, as
a pre-requisite of single zImage.
Signed-off-by: Stephen Warren <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
commit a1e636e6d3 (Input: imx_keypad - use clk_prepare_enable/
clk_disable_unprepare()) missed to update clk_enable/clk_disable
in imx_keypad_probe().
Fix it so that we do not get clk warnings at boot.
Signed-off-by: Fabio Estevam <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Certain eGalax devices expose an interface with class HID and protocol
None. Some work with usbhid and some work with usbtouchscreen, but
there is no easy way to differentiate. Sending an eGalax diagnostic
packet seems to kick them all into using the right protocol for
usbtouchscreen, so we can continue to bind them all there (as opposed to
handing some off to usbhid).
This fixes a regression for devices that were claimed by (and worked
with) usbhid prior to commit 139ebe8dc8
("Input: usbtouchscreen - fix eGalax HID ignoring"), which made
usbtouchscreen claim them instead. With this patch they will still be
claimed by usbtouchscreen, but they will actually report events
usbtouchscreen can understand. Note that these devices will be limited
to the usbtouchscreen feature set so e.g. dual touch features are not
supported.
I have the distinct pleasure of needing to support devices of both types
and have tested accordingly.
Signed-off-by: Forest Bond <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Adds support for the EMR digitizer on the Cintiq 24HD touch. The
EMR digitizer should work identically to that found on the Cintiq
24HD. The touch digitizer is a separate USB device similar to how
we split apart some other devices.
Signed-off-by: Jason Gerecke <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Instead of having to define the match table to NULL if CONFIG_OF isn't
set, use the of_match_ptr() macro which will do this for us.
Signed-off-by: Tobias Klauser <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Switch to using __u32/__s32 instead of ordinary 'int' in structures
forming userspace API.
Also internally make request_id unsigned int.
Signed-off-by: Dmitry Torokhov <[email protected]>
If uinput_request_submit() fails after new request ID was allocated
we need to mark that request ID as free, otherwise it will always
stay occupied and we may run out of available IDs.
Signed-off-by: Dmitry Torokhov <[email protected]>
Consider two threads calling read() on the same uinput-fd, both
non-blocking. Assume there is data-available so both will simultaneously
pass:
udev->head == udev->tail
Then the first thread goes to sleep and the second one pops the message
from the queue. Now assume udev->head == udev->tail. If the first thread
wakes up it will call wait_event_*() and sleep in the waitq. This
effectively turns the non-blocking FD into a blocking one.
We fix this by attempting to fetch events from the queue first and only
if we fail to retrieve any events we either return -EAGAIN (in case of
non-blocing read) or wait until there are more events.
This also fixes incorrect return code (we were returning 0 instead of
-EAGAIN for non-blocking reads) when an event is "stolen" by another
thread. Blocking reads will now continue to wait instead of returning 0
in this scenario.
Count of 0 continues to be a special case, as per spec: we will check for
device existence and whether there are events in the queue, but no events
will be actually retrieved.
Reported-by: David Herrmann <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Let's check whether the user-supplied buffer is actually big enough and
return -EINVAL if it is not. This differs from current behavior, which
caused 0 to be returned and actually does not make any sense, as
broken application will simply repeat the read getting into endless
loop.
Note that we treat 0 as a special case, according to the standard:
"Before any action described below is taken, and if nbyte is zero,
the read() function may detect and return errors as described below.
In the absence of errors, or if error detection is not performed,
the read() function shall return zero and have no other results."
Signed-off-by: David Herrmann <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
When fetching events form device's buffer in uinput_read() we need to
take input device's event_lock to avoid racing with new event delivery.
Signed-off-by: Dmitry Torokhov <[email protected]>
MATCH_BIT() is ugly and stupid, we have much nicer bitmap_subset() which
does the same and does not hide control flow.
Reported-by: Baodong Chen <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
This adds devicetree bindings to the rotary encoder driver and some
documentation about how to use them. Tested on a PXA3xx platform.
Signed-off-by: Daniel Mack <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Use gpio_request_one() instead of separate calls to gpio_request() and
gpio_direction_input() to simplify the code.
Signed-off-by: Daniel Mack <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Don't call gpio_to_irq() on GPIOs before gpio_request() succeeded on
them. This avoids Ooopses with incorrect DT bindings.
Signed-off-by: Daniel Mack <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>