aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input (follow)
AgeCommit message (Collapse)AuthorFilesLines
2012-10-25Input: arc_ps2 - switch to using managed resourcesDmitry Torokhov1-64/+59
Using managed resources simplifies error handling and shrinks size of arc_ps2_remove(). Tested-by: Mischa Jonker <mischa.jonker@synopsys.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-10-22Input: serio - add ARC PS/2 driverMischa Jonker3-0/+289
This adds support for the PS/2 block that is used in various ARC FPGA platforms. Signed-off-by: Mischa Jonker <mischa.jonker@synopsys.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-10-17Input: edt-ft5x06 - convert to use simple_open()Wei Yongjun1-9/+1
This removes an open coded simple_open() function and replaces file operations references to the function with simple_open() instead. dpatch engine is used to auto generate this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-10-17Input: i8042-io - fix up region handling on MIPSAaro Koskinen1-1/+1
i8042_platform_init() skips reguest_region() on MIPS, but in i8042_platform_exit() release_region() is still called. Fix this by reserving the region also on MIPS. The patch eliminates the following error message seen on MIPS: [ 2.112000] Trying to free nonexistent resource <0000000000000060-000000000000006f> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-10-11Input: mms114 - add device tree bindingsTomasz Figa1-2/+60
Add device tree bindings for mms114 touchscreen. [Dmitry Torokhov: added #ifdef CONFIG_OF guards] Signed-off-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-10-11Input: wm831x-on - convert to devm_kzalloc()Mark Brown1-3/+2
Saves a small amount of code and reduces the potential for leaks. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-10-11Input: wm831x-ts - convert to devm_kzalloc()Mark Brown1-3/+2
Saves a little code and eliminates the possibility of introducing some leaks. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-10-11Input: wm831x-ts - remove unneeded clearing of driver dataMark Brown1-1/+0
This is unneeded, only a bound driver can use driver data and a driver relying on the state prior to probe() is buggy. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-10-11Input: as5011 - use C99-style structure initializatorsShubhrajyoti D1-3/+16
Convert the struct i2c_msg initialization to C99 format. This makes maintaining and editing the code simpler. Also helps once other fields like transferred are added in future. Thanks to Julia Lawall <julia.lawall@lip6.fr> for automating the conversion. Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-10-11Input: cy8ctmg110_ts - use C99-style structure initializatorsShubhrajyoti Datta1-2/+11
Convert the struct i2c_msg initialization to C99 format. This makes maintaining and editing the code simpler. Also helps once other fields like transferred are added in future. Thanks to Julia Lawall <julia.lawall@lip6.fr> for automating the conversion. Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-10-08Input: extend the number of event (and other) devicesDmitry Torokhov4-253/+180
Extend the amount of character devices, such as eventX, mouseX and jsX, from a hard limit of 32 per input handler to about 1024 shared across all handlers. To be compatible with legacy installations input handlers will start creating char devices with minors in their legacy range, however once legacy range is exhausted they will start allocating minors from the dynamic range 256-1024. Reviewed-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-10-08Input: mousedev - mark mousedev interfaces as non-seekableDmitry Torokhov1-0/+1
Seeking does not make sense for mousedev, so let's use nonseekable_open() to mark its devices as non-seekable. Reviewed-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-10-08Input: mousedev - rename mixdev_open to opened_by_mixdevDmitry Torokhov1-8/+8
Do the rename to make the logic more clear and also change it to bool while at it. Reviewed-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-10-08Input: mousedev - reformat structure initializersDmitry Torokhov1-15/+15
Reformat structure initializers to match the rest of input handlers Reviewed-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-10-08Input: mousedev - factor out psaux code to reduce #ifdeferyDmitry Torokhov1-17/+30
Reviewed-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-10-04Input: samsung-keypad - add clk_prepare and clk_unprepareThomas Abraham1-1/+10
Add calls to clk_prepare and clk_unprepare as required by commom clock framework. Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-10-04Input: atmel_mxt_ts - simplify mxt_dump_messageAndy Shevchenko1-4/+2
Use %*ph format specifier to print small buffer. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-10-04Input: wacom - clean up wacom_query_tablet_dataJason Gerecke1-39/+35
Rewrites this function to be easier to read and understand. The new function 'wacom_set_device_mode' now handles the grunt work of assembling the proper feature report, sending it to the device, and ensuring the setting "sticks". Signed-off-by: Jason Gerecke <killertofu@gmail.com> Tested-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-10-04Input: wacom - introduce wacom_fix_phy_from_hidJason Gerecke1-0/+71
The Cintiq 24HD touch cannot use wacom_set_phy_from_res to determine the physical size of the touch sensor since the pen and touch are on separate USB devices. The physical size is, however, provided in the HID descriptor, just scaled to a unit we don't use. This patch introduces the function wacom_fix_phy_from_hid to let us make use of the unit and exponent data provided by HID to set the [xy]_phy variables to an appropriate value. This function relies on a trimmed-down version of hidinput_calc_abs_res from the hid-input.c. Signed-off-by: Jason Gerecke <killertofu@gmail.com> Tested-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-10-03Input: wacom - allow any multi-input Intuos device to set proxJason Gerecke1-2/+2
The ability to set the proximity flag should apply to any device that has both pen and touch input. Rather than listing classes of devices known to meet this criteria, simply filter on the quirk defining all such devices. Signed-off-by: Jason Gerecke <killertofu@gmail.com> Tested-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-10-03Input: wacom - report correct touch contact size for I5/BambooJason Gerecke1-4/+22
This changes how the touch packets for Intuos5 and 3rd-gen Bamboo are interpreted, so that proper values for the MAJOR and MINOR axes are reported. Instead of using the amplitude field (data[6]), we use the size field (data[5]) and do some calculation to transform it from a scaled-down area into axis lengths. Note that even though we assume a circular contact, both MAJOR and MINOR are reported since the resolution of the X and Y axes differ. Signed-off-by: Jason Gerecke <killertofu@gmail.com> Reviewed-by: Chris Bagwell <chris@cnpbagwell.com> Acked-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-10-01Merge branch 'for-next' of git://github.com/rydberg/linux into nextDmitry Torokhov18-350/+671
Merge Henrik's updates to multitouch code. Even though Jiri already pulled them in I need to do it too since my changes to evdev using dynamic major would clash with them.
2012-09-19Input: bcm5974 - Convert to MT-BHenrik Rydberg1-45/+28
Use of the in-kernel tracking code to convert the driver to MT-B. With ten fingers on the pad, the in-kernel tracking adds approximately 25 us to the maximum irqsoff latency. Under normal workloads, however, the tracking has no measurable effect. Tested-by: Benjamin Tissoires <benjamin.tissoires@enac.fr> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
2012-09-19Input: bcm5974 - Drop the logical dimensionsHenrik Rydberg1-144/+111
The logical scale is used to produce special finger width values to userspace, but has become an unnecessary restriction for everything else. Also, the bcm5974 trackpads are very accurate and work well without hysteresis. This patch simplifies the driver and device data by removing the logical scale, and by moving the special synaptics code out of the main path. Also add the orientation range, needed in a subsequent patch, to the device configuration. Tested-by: Benjamin Tissoires <benjamin.tissoires@enac.fr> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
2012-09-19Input: bcm5974 - Preparatory renamesHenrik Rydberg1-12/+13
Rename touch properties to match established nomenclature, and define the maximum number of fingers. Tested-by: Benjamin Tissoires <benjamin.tissoires@enac.fr> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
2012-09-19Input: bcm5974 - only setup button urb for TYPE1 devicesHenrik Rydberg1-17/+26
The early generations with this trackpad used the separate mouse interface to produce button events. With the introduction of the button pads, this information was moved to the trackpad interface, leaving the mouse interface unused. The driver is still setting up both interfaces, which has not caused any problems - until now. It turns out that without the CONFIG_USB_EHCI_TT_NEWSCHED option, the driver may return an ENOSPC upon bt_urb submission, resulting in a failure to open the device. This happens everytime on the MacBookPro Retina (and likely on other mid-2012 models), but earlier MacBook models seem to work fine. This patch skips the bt_urb setup for TYPE2 devices, which arguably should have been done in the first place. Tested-by: Benjamin Tissoires <benjamin.tissoires@enac.fr> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
2012-09-19Input: MT - Allow legacy pressure computationHenrik Rydberg1-3/+7
Some drivers like to report ABS_PRESSURE in a special way. Allow this when ABS_MT_PRESSURE is not defined. Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
2012-09-19Input: MT - Get slot by keyHenrik Rydberg1-0/+32
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 <benjamin.tissoires@enac.fr> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
2012-09-19Input: MT - Add in-kernel trackingHenrik Rydberg1-2/+142
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 <benjamin.tissoires@enac.fr> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
2012-09-19Input: MT - Handle frame synchronization in coreHenrik Rydberg1-2/+68
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 <benjamin.tissoires@enac.fr> Tested-by: Ping Cheng <pingc@wacom.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
2012-09-19Input: MT - Add flags to input_mt_init_slots()Henrik Rydberg15-19/+21
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 <benjamin.tissoires@enac.fr> Tested-by: Ping Cheng <pingc@wacom.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
2012-09-19Input: evdev - Add the events() callbackHenrik Rydberg1-21/+47
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 <djkurtz@chromium.org> Tested-by: Benjamin Tissoires <benjamin.tissoires@enac.fr> Tested-by: Ping Cheng <pingc@wacom.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
2012-09-19Input: Send events one packet at a timeHenrik Rydberg1-53/+123
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 <djkurtz@chromium.org> Tested-by: Benjamin Tissoires <benjamin.tissoires@enac.fr> Tested-by: Ping Cheng <pingc@wacom.com> Tested-by: Sedat Dilek <sedat.dilek@gmail.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
2012-09-19Input: Move autorepeat to the event-passing phaseHenrik Rydberg1-21/+25
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 <benjamin.tissoires@enac.fr> Tested-by: Ping Cheng <pingc@wacom.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
2012-09-19Input: Make sure we follow all EV_KEY eventsHenrik Rydberg1-7/+13
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 <benjamin.tissoires@enac.fr> Tested-by: Ping Cheng <pingc@wacom.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
2012-09-19Input: Improve the events-per-packet estimateHenrik Rydberg2-4/+7
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 <pingc@wacom.com> Tested-by: Benjamin Tissoires <benjamin.tissoires@enac.fr> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
2012-09-19Input: Break out MT dataHenrik Rydberg3-35/+43
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 <benjamin.tissoires@enac.fr> Tested-by: Ping Cheng <pingc@wacom.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
2012-09-12Input: hgpk - use %*ph to dump small bufferAndy Shevchenko1-6/+3
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-09-12Input: gpio_keys_polled - fix dt pdata->nbuttonsAlexandre Pereira da Silva1-0/+1
pdata->nbuttons should be updated by the dt code. Signed-off-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-09-04Input: omap-keypad - fixed formattingJosh1-4/+4
Fixed spacing error on if statements and fixed tab error. Signed-off-by: Josh <joshua.taylor0@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-09-04Merge tag 'v3.6-rc4' into nextDmitry Torokhov12-16/+225
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 <torvalds@linux-foundation.org>"
2012-09-04Input: tegra - move platform data headerStephen Warren1-1/+1
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 <swarren@nvidia.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-09-04Input: wacom - add support for EMR on Cintiq 24HD touchJason Gerecke1-1/+5
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 <killertofu@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-08-31Input: s3c2410_ts - make s3c_ts_pmops constSachin Kamat1-1/+1
Fixes the following warning: WARNING: struct dev_pm_ops should normally be const Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-08-21Input: samsung-keypad - use of_get_child_count() helperTobias Klauser1-4/+2
Use of_get_child_count() instead of custom implementation. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-08-21Input: samsung-keypad - use of_match_ptr()Tobias Klauser1-3/+1
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 <tklauser@distanz.ch> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-08-21Input: uinput - fix formattingDmitry Torokhov1-10/+18
Reformat the code to keep it within 80 columns. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-08-21Input: uinput - specify exact bit sizes on userspace APIsDmitry Torokhov1-5/+6
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 <dtor@mail.ru>
2012-08-21Input: uinput - mark failed submission requests as freeDmitry Torokhov1-38/+40
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 <dtor@mail.ru>
2012-08-21Input: uinput - fix race that can block nonblocking readDmitry Torokhov1-30/+44
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 <dh.herrmann@googlemail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>