summaryrefslogtreecommitdiffstats
path: root/drivers/input
Commit message (Collapse)AuthorAgeFilesLines
* Input: wacom - add touch sensor support for Cintiq 24HD touchJason Gerecke2012-10-253-3/+104
| | | | | | | | | Decode multitouch reports from the touch sensor of the Cintiq 24HD touch. Signed-off-by: Jason Gerecke <killertofu@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* Input: wacom - handle split-sensor devices with internal hubsJason Gerecke2012-10-253-2/+35
| | | | | | | | | | | | | | | | | | | | Like our other pen-and-touch products, the Cintiq 24HD touch needs data to be shared between its two sensors to facilitate proximity-based palm rejection. Unlike other tablets that report sensor data through separate interfaces of the same USB device, the Cintiq 24HD touch has separate USB devices that are connected to an internal USB hub. This patch makes it possible to designate the USB VID/PID of the other device so that the two may share data. To ensure we don't accidentally link to a sensor from a physically separate device (if several have been plugged in), we limit the search to siblings (i.e., devices directly connected to the same hub). Signed-off-by: Jason Gerecke <killertofu@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* Input: fix use-after-free introduced with dynamic minor changesDmitry Torokhov2012-10-223-6/+3
| | | | | | | | | | | | | | | | | | Commit 7f8d4cad1e4e ("Input: extend the number of event (and other) devices") made evdev, joydev and mousedev to embed struct cdev into their respective structures representing input devices. Unfortunately character device structure may outlive the parent structure unless we do not set it up as parent of character device so that it will stay pinned until character device is freed. Also, now that parent structure is pinned while character device exists we do not need to pin and unpin it every time user opens or closes it. Reported-by: Dave Jones <davej@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Acked-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* Merge branch 'for-linus' of ↵Linus Torvalds2012-10-138-342/+375
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input layer updates from Dmitry Torokhov: "2nd round of updates for the input subsystem. With it input core no longer limits number of character devices per event handler (such as evdev) to 32, but switches to dynamic minors once legacy range is exhausted. This should get multi-seat installations that currently run our of event devices very quickly. You will also get an update for Wacom driver and a couple of driver fixes." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: extend the number of event (and other) devices Input: mousedev - mark mousedev interfaces as non-seekable Input: mousedev - rename mixdev_open to opened_by_mixdev Input: mousedev - reformat structure initializers Input: mousedev - factor out psaux code to reduce #ifdefery Input: samsung-keypad - add clk_prepare and clk_unprepare Input: atmel_mxt_ts - simplify mxt_dump_message Input: wacom - clean up wacom_query_tablet_data Input: wacom - introduce wacom_fix_phy_from_hid Input: wacom - allow any multi-input Intuos device to set prox Input: wacom - report correct touch contact size for I5/Bamboo
| * Merge branch 'next' into for-linusDmitry Torokhov2012-10-1122-691/+1045
| |\ | | | | | | | | | | | | Prepare second set of updates for 3.7 merge window (Wacom driver update and patches extending number of input minors).
| | * Input: extend the number of event (and other) devicesDmitry Torokhov2012-10-084-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>
| | * Input: mousedev - mark mousedev interfaces as non-seekableDmitry Torokhov2012-10-081-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>
| | * Input: mousedev - rename mixdev_open to opened_by_mixdevDmitry Torokhov2012-10-081-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>
| | * Input: mousedev - reformat structure initializersDmitry Torokhov2012-10-081-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>
| | * Input: mousedev - factor out psaux code to reduce #ifdeferyDmitry Torokhov2012-10-081-17/+30
| | | | | | | | | | | | | | | Reviewed-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
| | * Input: samsung-keypad - add clk_prepare and clk_unprepareThomas Abraham2012-10-041-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>
| | * Input: atmel_mxt_ts - simplify mxt_dump_messageAndy Shevchenko2012-10-041-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>
| | * Input: wacom - clean up wacom_query_tablet_dataJason Gerecke2012-10-041-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>
| | * Input: wacom - introduce wacom_fix_phy_from_hidJason Gerecke2012-10-041-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>
| | * Input: wacom - allow any multi-input Intuos device to set proxJason Gerecke2012-10-031-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>
| | * Input: wacom - report correct touch contact size for I5/BambooJason Gerecke2012-10-031-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>
| | * Merge branch 'for-next' of git://github.com/rydberg/linux into nextDmitry Torokhov2012-10-0118-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.
* | | \ Merge branch 'release' of ↵Linus Torvalds2012-10-081-16/+1
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux Pul ACPI & Power Management updates from Len Brown: - acpidump utility added - intel_idle driver now supports IVB Xeon - turbostat utility can now count SMIs - ACPI can now bind to USB3 hubs - misc fixes * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux: (49 commits) ACPI: Add new sysfs interface to export device description ACPI: Harden acpi_table_parse_entries() against BIOS bug tools/power/turbostat: add option to count SMIs, re-name some options tools/power turbostat: add [-d MSR#][-D MSR#] options to print counter deltas intel_idle: enable IVB Xeon support tools/power turbostat: add [-m MSR#] option tools/power turbostat: make -M output pretty tools/power turbostat: print more turbo-limit information tools/power turbostat: delete unused line tools/power turbostat: run on IVB Xeon tools/power/acpi/acpidump: create acpidump(8), local make install targets tools/power/acpi/acpidump: version 20101221 - find dynamic tables in sysfs ACPI: run _OSC after ACPI_FULL_INITIALIZATION tools/power/acpi/acpidump: create acpidump(8), local make install targets tools/power/acpi/acpidump: version 20101221 - find dynamic tables in sysfs tools/power/acpi/acpidump: version 20071116 tools/power/acpi/acpidump: version 20070714 tools/power/acpi/acpidump: version 20060606 tools/power/acpi/acpidump: version 20051111 xo15-ebook: convert to module_acpi_driver() ...
| | \ \ \
| | \ \ \
| | \ \ \
| | \ \ \
| *---. \ \ \ Merge branches 'acpica', 'acpidump', 'intel-idle', 'misc', ↵Len Brown2012-10-061-16/+1
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'module_acpi_driver-simplify', 'turbostat' and 'usb3' into release add acpidump utility intel_idle driver now supports IVB Xeon turbostat can now count SMIs ACPI can now bind to USB3 hubs misc fixes
| | | | * | | | Input: atlas_btns - convert to module_acpi_driver()Mika Westerberg2012-09-211-16/+1
| | | |/ / / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Len Brown <len.brown@intel.com>
* | | | | | | Merge tag 'mfd-3.7-1' of ↵Linus Torvalds2012-10-052-18/+127
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6 Pull MFD changes from Samuel Ortiz: "MFD bits for the 3.7 merge window. As usual we have a few new drivers: - TI LP8788 - TI OMAP USB TLL - Maxim MAX8907 - SMSC ECE1099 - Dialog Semiconductor DA9055 - A simpler syscon driver that allow us to get rid of the anatop one. Drivers are also gradually getting Device Tree and IRQ domain support. The following drivers got DT support: - palmas, 88pm860x, tc3589x and twl4030-audio And those ones now use the IRQ domain APIs: - 88pm860x, tc3589x, db8500_prcmu Also some other interesting changes: - Intel's ICH LPC now supports Lynx Point - TI's twl4030-audio added a GPO child - tps6527 enabled its backlight subdevice - The twl6030 pwm driver moved to the new PWM subsystem And finally a bunch of cleanup and casual fixes for mc13xxx, 88pm860x, palmas, ab8500, wm8994, wm5110, max8907 and the tps65xxx family." Fix up various annoying conflicts: the DT and IRQ domain support came in twice and was already in 3.6. And then it was apparently rebased. Guys, DON'T REBASE! * tag 'mfd-3.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: (89 commits) ARM: dts: Enable 88pm860x pmic mfd: 88pm860x: Move gpadc init into touch mfd: 88pm860x: Device tree support mfd: 88pm860x: Use irqdomain mfd: smsc: Add support for smsc gpio io/keypad driver backlight: tps65217_bl: Add missing platform_set_drvdata in tps65217_bl_probe mfd: DA9055 core driver mfd: tps65910: Add alarm interrupt of TPS65910 RTC to mfd device list mfd: wm5110: Add register patches for revision B mfd: wm5110: Disable control interface error report for WM5110 rev B mfd: max8907: Remove regulator-compatible from DT docs backlight: Add TPS65217 WLED driver mfd: Add backlight as subdevice to the tps65217 mfd: Provide the PRCMU with its own IRQ domain mfd: Fix max8907 sparse warning mfd: Add lp8788 mfd driver mfd: dbx500: Provide a more accurate smp_twd clock mfd: rc5t583: Fix warning messages regulator: palmas: Add DT support mfd: palmas: Change regulator defns to better suite DT ...
| * | | | | | | mfd: 88pm860x: Move gpadc init into touchHaojian Zhuang2012-10-021-6/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The initilization of GPADC is moved from core driver to touch driver with DT support. Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
| * | | | | | | mfd: 88pm860x: Device tree supportHaojian Zhuang2012-10-021-15/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
| * | | | | | | input: twl4030-vibra: Support for DT booted kernelPeter Ujfalusi2012-09-181-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <peter.ujfalusi@ti.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* | | | | | | | Merge branch 'for-linus' of ↵Linus Torvalds2012-10-0219-274/+520
|\ \ \ \ \ \ \ \ | | |_|_|_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input updates from Dmitry Torokhov: "A few drivers were updated with device tree bindings and others got a few small cleanups and fixes." Fix trivial conflict in drivers/input/keyboard/omap-keypad.c due to changes clashing with a whitespace cleanup. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (28 commits) Input: wacom - mark Intuos5 pad as in-prox when touching buttons Input: synaptics - adjust threshold for treating position values as negative Input: hgpk - use %*ph to dump small buffer Input: gpio_keys_polled - fix dt pdata->nbuttons Input: Add KD[GS]KBDIACRUC ioctls to the compatible list Input: omap-keypad - fixed formatting Input: tegra - move platform data header Input: wacom - add support for EMR on Cintiq 24HD touch Input: s3c2410_ts - make s3c_ts_pmops const Input: samsung-keypad - use of_get_child_count() helper Input: samsung-keypad - use of_match_ptr() Input: uinput - fix formatting Input: uinput - specify exact bit sizes on userspace APIs Input: uinput - mark failed submission requests as free Input: uinput - fix race that can block nonblocking read Input: uinput - return -EINVAL when read buffer size is too small Input: uinput - take event lock when fetching events from buffer Input: get rid of MATCH_BIT() macro Input: rotary-encoder - add DT bindings Input: rotary-encoder - constify platform data pointers ...
| * | | | | | | Merge branch 'next' into for-linusDmitry Torokhov2012-10-0117-266/+497
| |\ \ \ \ \ \ \ | | | |_|_|_|/ / | | |/| | | | | | | | | | | | | Prepare first set of updates for 3.7 merge window.
| | * | | | | | Input: hgpk - use %*ph to dump small bufferAndy Shevchenko2012-09-121-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
| | * | | | | | Input: gpio_keys_polled - fix dt pdata->nbuttonsAlexandre Pereira da Silva2012-09-121-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>
| | * | | | | | Input: omap-keypad - fixed formattingJosh2012-09-041-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>
| | * | | | | | Merge tag 'v3.6-rc4' into nextDmitry Torokhov2012-09-0412-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>"
| | * | | | | | Input: tegra - move platform data headerStephen Warren2012-09-041-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>
| | * | | | | | Input: wacom - add support for EMR on Cintiq 24HD touchJason Gerecke2012-09-041-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>
| | * | | | | | Input: s3c2410_ts - make s3c_ts_pmops constSachin Kamat2012-08-311-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>
| | * | | | | | Input: samsung-keypad - use of_get_child_count() helperTobias Klauser2012-08-211-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>
| | * | | | | | Input: samsung-keypad - use of_match_ptr()Tobias Klauser2012-08-211-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>
| | * | | | | | Input: uinput - fix formattingDmitry Torokhov2012-08-211-10/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reformat the code to keep it within 80 columns. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
| | * | | | | | Input: uinput - specify exact bit sizes on userspace APIsDmitry Torokhov2012-08-211-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>
| | * | | | | | Input: uinput - mark failed submission requests as freeDmitry Torokhov2012-08-211-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>
| | * | | | | | Input: uinput - fix race that can block nonblocking readDmitry Torokhov2012-08-211-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>
| | * | | | | | Input: uinput - return -EINVAL when read buffer size is too smallDavid Herrmann2012-08-211-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <dh.herrmann@googlemail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
| | * | | | | | Input: uinput - take event lock when fetching events from bufferDmitry Torokhov2012-08-211-3/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <dtor@mail.ru>
| | * | | | | | Input: get rid of MATCH_BIT() macroDmitry Torokhov2012-08-211-17/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <chenbdchenbd@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
| | * | | | | | Input: rotary-encoder - add DT bindingsDaniel Mack2012-08-211-16/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <zonque@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
| | * | | | | | Input: rotary-encoder - constify platform data pointersDmitry Torokhov2012-08-211-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Drivers should not be changing platform data attached to the device because they do not own it. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
| | * | | | | | Input: rotary-encoder - use gpio_request_one()Daniel Mack2012-08-211-25/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use gpio_request_one() instead of separate calls to gpio_request() and gpio_direction_input() to simplify the code. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
| | * | | | | | Input: rotary-encoder - defer calls gpio_to_irq()Daniel Mack2012-08-211-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <zonque@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
| | * | | | | | Input: gpio_keys_polled - convert to dtAlexandre Pereira da Silva2012-08-211-5/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
| | * | | | | | Input: gpio-keys-polled - constify pointers to platform dataDmitry Torokhov2012-08-211-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
| | * | | | | | Input: random formatting fixesBaodong Chen2012-08-216-17/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes for some coding style issues reported by scripts/checkpatch.pl utility. Signed-off-by: Baodong Chen <chenbdchenbd@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
| | * | | | | | Input: twl4030-pwrbutton - report a wakeup_event on button pressNeilBrown2012-08-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As the power button causes a wake from suspend, we need to register the event with the pm sustem to avoid racing with suspend. As the input event is reported in the interrupt handler, as simple pm_wakeup_event() is sufficient. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>