Commit Graph

4263 Commits

Author SHA1 Message Date
Dmitry Torokhov 8326bb5741 Input: ALPS - split protocol data from model info
In preparation of reworking the way we set protocol parameters let's
split certain protocol items from alps_model_info into a separate
structure.

Tested-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-02-15 15:44:17 -08:00
Dmitry Torokhov fb2dd7a61d Input: ALPS - make Rushmore a separate protocol
Even though Rushmore is very close to V3 protocol it is sufficiently
different to warrant it's own protocol name.

Tested-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-02-15 15:44:17 -08:00
Dmitry Torokhov d7c13d3470 Input: ALPS - renumber protocol numbers
In order to accommodate new protocol number for Rushmore touchpads
let's shift protocol numbers by 8 bits (i.e. 1 -> 0x100) - this way
we keep protocol version reported in input device id the same as it
was, but add some holes in numbering.

Tested-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-02-15 15:44:16 -08:00
Tejun Heo 0b480037e8 input: use %*pb[l] to print bitmaps including cpumasks and nodemasks
printk and friends can now format bitmaps using '%*pb[l]'.  cpumask
and nodemask also provide cpumask_pr_args() and nodemask_pr_args()
respectively which can be used to generate the two printf arguments
necessary to format the specified cpu/nodemask.

* Line termination only requires one extra space at the end of the
  buffer.  Use PAGE_SIZE - 1 instead of PAGE_SIZE - 2 when formatting.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-02-13 21:21:38 -08:00
Markus Elfring de3748f66f Input: adi - remove an unnecessary check
The input_free_device() function tests whether its argument is NULL and
then returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-02-11 23:07:13 -08:00
Dan Carpenter 2b2f514705 Input: pxa27x_keypad - remove an unneeded NULL check
Static checkers complain about this NULL check because we dereference it
without checking a couple lines later.  This function is only called
when "keypad->pdata" is non-NULL so we can just delete the NULL test.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
[Dmitry: remove the variable altogether given that it is used just once and
 dereference directly.]
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-02-11 23:07:12 -08:00
Bastien Nocera 791738be57 Input: soc_button_array - use "Windows" key for "Home"
KEY_HOME is the key to go back to the beginning of the line, not the key to
get into an overview mode, as Windows does. GNOME can already make use of
the Windows key on multiple form factors, and other desktop environments
can use it depending on the form factor.

Using "Windows" as the emitted key also means that the keycode sent out
matches the symbol on the key itself.

So switch KEY_HOME to KEY_LEFTMETA ("Windows" key).

Signed-off-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-02-10 15:45:00 -08:00
Dmitry Torokhov 4ba24fef3e Merge branch 'next' into for-linus
Prepare first round of input updates for 3.20.
2015-02-10 11:35:36 -08:00
Rasmus Villemoes 98a4a59ee3 Input: elan_i2c - fix wrong %p extension
There's no %px extension. From the context I think the intention was to
dump the five bytes which were not as expected, and for that one should use
%ph.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-02-06 15:32:18 -08:00
Dmitry Torokhov b881d53770 Input: evdev - do not queue SYN_DROPPED if queue is empty
There is no point in queueing EV_SYN/SYN_DROPPED on clock type change when
there are no events in the client's queue and doing so confuses tests in
libinput package, so let's not do that.

Reported-and-tested-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-02-05 19:29:02 -08:00
Geert Uytterhoeven 6c8afa88ad Input: gscps2 - fix MODULE_DEVICE_TABLE invocation
The patch "module: fix types of device tables aliases" newly requires
that invocations of

MODULE_DEVICE_TABLE(type, name);

come *after* the definition of `name'.  That is reasonable, but gscps2
wasn't doing this.  Fix it.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-02-04 11:35:54 -08:00
Benjamin Tissoires 6ab17a8484 Input: synaptics - use dmax in input_mt_assign_slots
When tapping a clickpad with two fingers, there is a chance that the sensor
sees first only one finger, and at the next scan only the second one.  In
this case, the sensors says that there has been only one finger on the
clickpad, which moved really fast between two scans.

We can try to counter this by adding a limit to what an actual finger can
move between 2 scans.  A distance of 1cm between two scans for one finger
seems reasonable.  However, this is not really accurate because the
resolution in X and in Y differs. But heh, that's how the in-kernel
tracking works right now, and its job is quite good, even with this
approximation.

This parameter solves most of the jumps observed, not all of them however.
But this is a hardware defect, and we might not be able to get something
better without much heavier computations.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=76722

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-02-03 15:36:32 -08:00
Rob Herring d05426779b Input: pxa27x_keypad - remove unnecessary ARM includes
Remove some left-over ARM only includes in order to enable building on
ARM64. __raw_{read,write}l were getting implicitly included, so add
linux/io.h include.

Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-02-03 15:14:05 -08:00
Vignesh R 83edfdf30b Input: ti_am335x_tsc - replace delta filtering with median filtering
Previously, delta filtering was applied TSC co-ordinate readouts before
reporting a single value to user space. This patch replaces delta filtering
with median filtering. Median filtering sorts co-ordinate readouts, drops
min and max values, and reports the average of remaining values. This
method is more sensible than delta filtering. Median filtering is applied
only if number of readouts is greater than 3 else just average of
co-ordinate readouts is reported.

Signed-off-by: Vignesh R <vigneshr@ti.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-02-03 11:50:39 -08:00
Vignesh R bf223612a4 Input: ti_am335x_tsc - read charge delay from DT
This patch reads charge delay from tsc DT node and writes to
REG_CHARGEDELAY register. If the charge delay is not specified in DT then
default value of 0x400(CHARGEDLY_OPENDLY) is used.

Signed-off-by: Vignesh R <vigneshr@ti.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-02-03 11:50:38 -08:00
Brad Griffis 344d635b9a Input: ti_am335x_tsc - remove udelay in interrupt handler
TSC interrupt handler had udelay to avoid reporting of false pen-up
interrupt to user space. This patch implements workaround suggesting in
Advisory 1.0.31 of silicon errata for am335x, thus eliminating udelay and
touchscreen lag. This also improves performance of touchscreen and
eliminates sudden jump of cursor at touch release.

IDLECONFIG and CHARGECONFIG registers are to be configured with same values
in order to eliminate false pen-up events. This workaround may result in
false pen-down to be detected, hence considerable charge step delay needs
to be added. The charge delay is set to 0xB000 (in terms of ADC clock
cycles) by default.

TSC steps are disabled at the end of every sampling cycle and EOS bit is
set. Once the EOS bit is set, the TSC steps need to be re-enabled to begin
next sampling cycle.

Signed-off-by: Brad Griffis <bgriffis@ti.com>
[vigneshr@ti.com: Ported the patch from v3.12 to v3.19rc1]
Signed-off-by: Vignesh R <vigneshr@ti.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-02-03 11:50:38 -08:00
Brad Griffis 3a59684ccc Input: ti_am335x_tsc - interchange touchscreen and ADC steps
This patch makes the initial changes required to workaround TSC-false
pen-up interrupts. It is required to implement these changes in order to
remove udelay in the TSC interrupt handler and false pen-up events.  The
charge step is to be executed immediately after sampling X+. Hence TSC is
made to use higher numbered steps (steps 5 to 16 for 5 co-ordinate
readouts, 4 wire TSC configuration) and ADC to use lower ones. Further X
co-ordinate readouts must be the last to be sampled, thus co-ordinates are
sampled in the order Y-Z-X.

Signed-off-by: Brad Griffis <bgriffis@ti.com>
[vigneshr@ti.com: Ported the patch from v3.12 to v3.19rc1]
Signed-off-by: Vignesh R <vigneshr@ti.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-02-03 11:50:37 -08:00
Linus Torvalds 3441456bfa Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input layer updates from Dmitry Torokhov:
 "Just a few quirks for PS/2 this time"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: elantech - add more Fujtisu notebooks to force crc_enabled
  Input: i8042 - add noloop quirk for Medion Akoya E7225 (MD98857)
  Input: synaptics - adjust min/max for Lenovo ThinkPad X1 Carbon 2nd
2015-02-01 13:16:40 -08:00
Rainer Koenig 47c1ffb2b6 Input: elantech - add more Fujtisu notebooks to force crc_enabled
Add two more Fujitsu LIFEBOOK models that also ship with the Elantech
touchpad and don't work with crc_disabled to the quirk list.

Signed-off-by: Rainer Koenig <Rainer.Koenig@ts.fujitsu.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-02-01 11:51:26 -08:00
Henrik Rydberg 448c7f3830 Input: MT - add support for balanced slot assignment
Some devices are not fast enough to differentiate between a fast-moving
contact and a new contact. This problem cannot be fully resolved because
information is truly missing, but it is possible to safe-guard against
obvious mistakes by restricting movement with a maximum displacement.

The new problem formulation for dmax > 0 cannot benefit from the speedup
for positive definite matrices, but since the convergence is faster, the
result is about the same. For a handful of contacts, the latency difference
is truly negligible.

Suggested-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Tested-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Henrik Rydberg <rydberg@bitmath.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-02-01 11:50:35 -08:00
Axel Lin 60bcaae15e Input: drv2667 - remove wrong and unneeded drv2667-haptics modalias
This is a I2C driver, so it's wrong to use platform prefix for the
modalias.  We have all needed i2c aliases coming form MODULE_DEVICE_TABLE,
so let's remove the wrong and unneeded drv2667-haptics modalias.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-02-01 11:21:24 -08:00
Axel Lin aa9d2a292a Input: drv260x - remove wrong and unneeded drv260x-haptics modalias
This is a I2C driver, so it's wrong to use platform prefix for the
modalias.  We have all needed i2c aliases coming form MODULE_DEVICE_TABLE,
so let's remove the wrong and unneeded drv260x-haptics modalias.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-02-01 11:21:24 -08:00
Axel Lin e297d7bbf6 Input: cap11xx - remove wrong and unneeded cap11xx modalias
This is a I2C driver, so it's wrong to use platform prefix for the
modalias.  We have all needed i2c aliases coming form MODULE_DEVICE_TABLE,
so let's remove the wrong and unneeded cap11xx modalias.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Daniel Mack <linux@zonque.org>
Reviewed-by: Matt Ranostay <mranostay@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-02-01 11:21:23 -08:00
Chen-Yu Tsai 43c0e22340 Input: sun4i-ts - add support for touchpanel controller on A31
The Allwinner A31 SoC (sun6i) has the same resistive touchpanel controller
as on other sunxi platforms. The only difference between the variants is
the control bits for enabling operations are left-shifted by 1 on the A31.

Also update the comment for the original temperature sensor with
information from Allwinner.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-26 23:58:56 -08:00
Vishnu Patekar e443631d20 Input: serio - add support for Alwinner A10/A20 PS/2 controller
This driver implements support for PS2 controller found on Allwinner A10,
A20 SOCs. It has been tested on A20 Olimex-Lime2 board and also on A10.

Signed-off-by: Vishnu Patekar <vishnupatekar0510@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-26 23:10:13 -08:00
Martin Kepplinger 8d21282036 Input: gtco - use sign_extend32() for sign extension
Signed-off-by: Martin Kepplinger <martink@posteo.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-26 23:07:45 -08:00
Duson Lin bb03bf3f84 Input: elan_i2c - verify firmware signature applying it
To allow for different firmware sizes let's replace the original size check
with with checking the signature in the firmware data.

Signed-off-by: Duson Lin <dusonlin@emc.com.tw>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-23 09:44:21 -08:00
Dmitry Torokhov e719963c4a Input: elantech - remove stale comment from Kconfig
The fixes to the X.org driver have been applied long time ago and
the patch on kernel.org has long since gone so let's remove the
comment.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-22 13:16:14 -08:00
Jochen Hein 1d90d6d552 Input: i8042 - add noloop quirk for Medion Akoya E7225 (MD98857)
Without this the aux port does not get detected, and consequently the touchpad
will not work.

With this patch the touchpad is detected:

$ dmesg | grep -E "(SYN|i8042|serio)"
pnp 00:03: Plug and Play ACPI device, IDs SYN1d22 PNP0f13 (active)
i8042: PNP: PS/2 Controller [PNP0303:PS2K,PNP0f13:PS2M] at 0x60,0x64 irq 1,12
serio: i8042 KBD port at 0x60,0x64 irq 1
serio: i8042 AUX port at 0x60,0x64 irq 12
input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input4
psmouse serio1: synaptics: Touchpad model: 1, fw: 8.1, id: 0x1e2b1, caps: 0xd00123/0x840300/0x126800, board id: 2863, fw id: 1473085
input: SynPS/2 Synaptics TouchPad as /devices/platform/i8042/serio1/input/input6

dmidecode excerpt for this laptop is:

Handle 0x0001, DMI type 1, 27 bytes
System Information
        Manufacturer: Medion
        Product Name: Akoya E7225
        Version: 1.0

Cc: stable@vger.kernel.org
Signed-off-by: Jochen Hein <jochen@jochen.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-22 12:11:07 -08:00
Dan Carpenter b481077375 Input: cyapa - off by one in cyapa_update_fw_store()
If "(count == NAME_MAX)" then we could end up putting the NUL terminator
one space beyond the end of the fw_name[] array.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-22 08:23:15 -08:00
Dudley Du a535a9f16c Input: cyapa - fix variable being dereferenced before check
Fixes the warning regarding variable being dereferenced before check
'gen5_pip->resp_len'.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Dudley Du <dudl@cypress.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-22 08:23:14 -08:00
Dmitry Torokhov 2be7256fe7 Input: cyapa - fix endianness issues in gen5 firmware update support
gen5_bl_metadata_row_params structure has its fields specified with
explicit endianness, so we should not be trying to convert to native CPU
endianness when filling the structure.

Also fix firmware validation checks and misspelled field in
gen5_bl_metadata_row_params.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Reviewed-by: Dudley Du <dudl@cypress.com>
Tested-by: Dudley Du <dudl@cypress.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-22 07:57:36 -08:00
Peter Hutterer 8543cf1c24 Input: synaptics - adjust min/max for Lenovo ThinkPad X1 Carbon 2nd
LEN0037 found in the Lenovo ThinkPad X1 Carbon 2nd (2014 model)

Cc: stable@vger.kernel.org
Reported-and-tested-by: Bjoern Olausson <bjoern@olausson.de>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-19 16:37:32 -08:00
Linus Torvalds 66893885bb Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input subsystem fixes from Dmitry Torokhov.

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: uinput - fix ioctl nr overflow for UI_GET_SYSNAME/VERSION
  Input: I8042 - add Acer Aspire 7738 to the nomux list
  Input: elantech - support new ICs types for version 4
  Input: i8042 - reset keyboard to fix Elantech touchpad detection
  MAINTAINERS: remove Dmitry Torokhov's alternate address
2015-01-19 04:55:23 +12:00
Dudley Du 7b2171d7c4 Input: cyapa - add acpi device id support
Add acpi device tree support.
acpi device id "CYAP0000" is for old gen3 trackpad devices.
acpi device id "CYAP0001" is for new gen5 trackpad devices.

Signed-off-by: Dudley Du <dudl@cypress.com>
Tested-by: Jeremiah Mahler <jmmahler@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-18 00:10:33 -08:00
Dudley Du daceed1e8e Input: cyapa - add gen5 trackpad force re-calibrate function support
Add force re-calibrate function support for gen5 trackpad device, it can be
used through sysfs calibrate interface.

Signed-off-by: Dudley Du <dudl@cypress.com>
Tested-by: Jeremiah Mahler <jmmahler@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-18 00:10:33 -08:00
Dudley Du 6499d390a1 Input: cyapa - add gen5 trackpad read baseline support
Add read baseline function support for gen5 trackpad device, it can be used
through sysfs baseline interface.

Signed-off-by: Dudley Du <dudl@cypress.com>
Tested-by: Jeremiah Mahler <jmmahler@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-18 00:10:32 -08:00
Dudley Du 5812d30672 Input: cyapa - add gen5 trackpad firmware update support
Add firmware image update support for gen5 trackpad device, it can be used
through sysfs update_fw interface.

Signed-off-by: Dudley Du <dudl@cypress.com>
Tested-by: Jeremiah Mahler <jmmahler@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-18 00:10:32 -08:00
Dudley Du e0f79cb799 Input: cyapa - add gen3 trackpad force re-calibrate support
Add force re-calibrate function support for gen3 trackpad device, it can be
used through sysfs calibrate interface.

Signed-off-by: Dudley Du <dudl@cypress.com>
Tested-by: Jeremiah Mahler <jmmahler@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-18 00:10:31 -08:00
Dudley Du f50efd06e0 Input: cyapa - add gen3 trackpad read baseline support
Add read baseline function supported for gen3 trackpad device, it can be
used through sysfs baseline interface.

Signed-off-by: Dudley Du <dudl@cypress.com>
Tested-by: Jeremiah Mahler <jmmahler@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-18 00:10:31 -08:00
Dudley Du 87b26d7288 Input: cyapa - add gen3 trackpad device firmware update support
Add support for firmware image update for gen3 trackpad devices; the
firmware update is initiated by writing to update_fw sysfs attribute.

Signed-off-by: Dudley Du <dudl@cypress.com>
Tested-by: Jeremiah Mahler <jmmahler@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-18 00:10:30 -08:00
Dudley Du c806b0b84d Input: cyapa - add sysfs interfaces support in the cyapa driver
Introduce control interfaces that are commonly used in pre- and after
production, for trackpad device state checking, managing and firmware image
updating.  These interfaces include mode, firmware_version and product_id
interfaces for reading firmware version and trackpad device product id
values, and update_fw interface to command firmware image update process.
There are also baseline and calibrate interfaces for reading and checking
trackpad device's sensors states.

Signed-off-by: Dudley Du <dudl@cypress.com>
Tested-by: Jeremiah Mahler <jmmahler@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-18 00:10:30 -08:00
Dudley Du 672865080a Input: cyapa - add runtime power management support
This change implements runtime PM support in the driver and adds
runtime_suspend_scanrate_ms power management interface in device's power
group, so users or applications can control the runtime power management
strategy of trackpad device according to their requirements.

Signed-off-by: Dudley Du <dudl@cypress.com>
Tested-by: Jeremiah Mahler <jmmahler@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-18 00:10:29 -08:00
Dudley Du 22e7db8111 Input: cyapa - add power management interfaces support for the device
Add suspend_scanrate_ms power management interfaces in device's
power group, so users or applications can control the power management
strategy of trackpad device according to their requirements.

Signed-off-by: Dudley Du <dudl@cypress.com>
Tested-by: Jeremiah Mahler <jmmahler@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-18 00:10:29 -08:00
Dudley Du 6972a85960 Input: cyapa - add gen5 trackpad device basic functions support
This change adds support for Gen5 Cypress trackpads. The driver detects
generation of the device at probe time and automatically selects
appropriate protocol.

Signed-off-by: Dudley Du <dudl@cypress.com>
Tested-by: Jeremiah Mahler <jmmahler@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-18 00:10:28 -08:00
Dudley Du 9f1cd85751 Input: cyapa - re-design driver to support multi-trackpad in one driver
In order to support multiple different chipsets and communication protocols
trackpad devices in one cyapa driver, the new cyapa driver is re-designed
with one cyapa driver core and multiple device specific functions component.
The cyapa driver core is contained in this patch, it supplies basic functions
that working with kernel and input subsystem, and also supplies the interfaces
that the specific devices' component can connect and work together with as
one driver.

Signed-off-by: Dudley Du <dudl@cypress.com>
Tested-by: Jeremiah Mahler <jmmahler@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-18 00:10:28 -08:00
Michael Karcher 9923d858cb Input: atari - enable the 102nd key for German keyboards
Signed-off-by: Michael Karcher <kernel@mkarcher.dialup.fu-berlin.de>
Acked-by: Thorsten Glaser <tg@mirbsd.org>
Tested-by: Stefan Niestegge <beetle@atari.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-18 00:10:28 -08:00
Chen-Yu Tsai 2236971079 Input: sun4i-ts - add thermal zone sensor support
The touchscreen controller has a temperature sensor embedded in the SoC,
which already has hwmon support in the driver.

Add DT thermal zone support so we can use it with cpufreq for thermal
throttling.

This also adds a comment stating that we do not know the actual formula
for calculating the temperature.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-18 00:10:27 -08:00
Dmitry Torokhov 0c49cd295d linux 3.19-rc4
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJUsuDQAAoJEHm+PkMAQRiGnecH/0RO9UKnEduOTRPaZGXAjGI8
 N0FvNia8qn7f+XnvN62pG/YZZqi2uvuy37vwAXMtS6KXEgaDG9Wq4fVrhOaJ5VgL
 QOmPdVGUa+1PuPcMYj/QLIFRfIHvIY/XVZWXrcIyYfQdBAAoJ2q23qx/yFmdyTwf
 +enAv+PV4ZVNMEANyN9KS7xX5gPbSDl36AOhm6lXDvrlem4mbnhRuUtYez9R8KTK
 VNfkKZQRDOgl4/ns0ndzpAUhaDj1JJGoLRgMXKna33XgtzSEL4XijvImdnoIXp5N
 Z98Jc1N5Vg5OcUFeGJC3bRR27m39xoOHQk2ufY43uAIfB3Ez/C7m/r7b50ZVWfs=
 =J7TO
 -----END PGP SIGNATURE-----

Merge tag 'v3.19-rc4' into next

Merge with mainline to bring in the latest thermal and other changes.
2015-01-15 09:46:14 -08:00
Anshul Garg 0c3e99437a Input: evdev - flush pending events on clock type change
When client changes the type of clock used for the time stamps in input
events flush pending events from the client's queue (since client would not
know which events have old time stamps and which ones have new ones) and
and queue SYN_DROPPED event.

Signed-off-by: Anshul Garg <anshul.g@samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-15 09:37:18 -08:00
Pali Rohár 34412ba282 Input: alps - add sanity checks for non DualPoint devices
Make sure that driver does not process bogus packets as trackstick data
when there is no trackstick present and emit warnings in dmesg so potential
issues with trackstick handling will be visible for debugging.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-11 15:57:04 -08:00
Pali Rohár dfba860002 Input: alps - fix name, product and version of dev2 input device
This change fixes name, product and version of dev2 input device based on
format used in function psmouse_switch_protocol() in file psmouse-base.c.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-11 15:57:03 -08:00
Axel Lin 3cb6dcfa44 Input: regulator-haptic - simplify code
All the use cases in this driver has a regulator_haptic_toggle() call after
regulator_haptic_set_voltage(). So make regulator_haptic_set_voltage() call
regulator_haptic_toggle() to simplify the code.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-11 15:52:59 -08:00
Moritz Fischer 846a7fc8f4 Input: add support for NI Ettus Research USRP E3x0 button
Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-10 14:17:10 -08:00
Dmitry Torokhov 9333caeaea Input: I8042 - add Acer Aspire 7738 to the nomux list
When KBC is in active multiplexing mode the touchpad on this laptop does
not work.

Reported-by: Bilal Koc <koc.bilo@googlemail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-08 14:56:17 -08:00
Dmitry Torokhov b388de8830 Input: axp20x-pek - switch over to using attribute group
Instead of registering device attributes individually let's use attribute
groups and also devm_* infrastructure to ease cleanup.

Tested-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-08 13:55:30 -08:00
Carlo Caione 5b6c26a9f6 Input: add driver for AXP20x Power Enable Key
This change adds support for the Power Enable Key found on MFD AXP202
and AXP209. Besides the basic support for the button, the driver adds
two entries in sysfs to configure the time delay for power on/off.

Signed-off-by: Carlo Caione <carlo@caione.org>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
[wens@csie.org: made axp20x_pek_remove() static; removed driver owner
 field; fixed path for sysfs entries]
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-08 13:53:51 -08:00
Anshul Garg 2c50ad340c Input: do not try to filter out events if handler is not a filter
If given input handler is not a filter there is no point is iterating list
of events in a packet to see if some of them need to be filtered out.

Signed-off-by: Anshul Garg <anshul.g@samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-08 13:53:34 -08:00
Anshul Garg 5ab1714570 Input: small tweak to autorepeat handling
If a device does not support autorepeat or does not emit any key events we
should not be scanning all events in a packet to decide if we should start
or stop autorepeat function.

Signed-off-by: Anshul Garg <anshul.g@samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-08 13:53:30 -08:00
Sam hung 810aa0918b Input: elantech - support new ICs types for version 4
This change allows the driver to recognize newer Elantech touchpads.

Cc: stable@vger.kernel.org
Signed-off-by: Yi ju Hong <sam.hung@emc.com.tw>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-08 13:52:26 -08:00
Srihari Vijayaraghavan 148e9a711e Input: i8042 - reset keyboard to fix Elantech touchpad detection
On some laptops, keyboard needs to be reset in order to successfully detect
touchpad (e.g., some Gigabyte laptop models with Elantech touchpads).
Without resettin keyboard touchpad pretends to be completely dead.

Based on the original patch by Mateusz Jończyk this version has been
expanded to include DMI based detection & application of the fix
automatically on the affected models of laptops. This has been confirmed to
fix problem by three users already on three different models of laptops.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=81331
Cc: stable@vger.kernel.org
Signed-off-by: Srihari Vijayaraghavan <linux.bug.reporting@gmail.com>
Acked-by: Mateusz Jończyk <mat.jonczyk@o2.pl>
Tested-by: Srihari Vijayaraghavan <linux.bug.reporting@gmail.com>
Tested by: Zakariya Dehlawi <zdehlawi@gmail.com>
Tested-by: Guillaum Bouchard <guillaum.bouchard@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-07 17:20:44 -08:00
Fabio Estevam 061a5ad7c9 Input: imx_keypad - use the preferred form for passing a size of a struct
According to Documentation/CodingStyle - Chapter 14:

"The preferred form for passing a size of a struct is the following:

        p = kmalloc(sizeof(*p), ...);

The alternative form where struct name is spelled out hurts readability and
introduces an opportunity for a bug when the pointer variable type is changed
but the corresponding sizeof that is passed to a memory allocator is not."

So do it as recommended.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-07 16:02:52 -08:00
Linus Torvalds 7f4054836d Revert "Input: atmel_mxt_ts - use deep sleep mode when stopped"
This reverts commit 9d469d033d.

It breaks the Chromebook Pixel touchpad (and touchscreen).

Reported-by: Dirk Hohndel <dirk@hohndel.org>
Bisected-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Nick Dyer <nick.dyer@itdev.co.uk>
Cc: Benson Leung <bleung@chromium.org>
Cc: Yufeng Shen <miletus@chromium.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: stable@vger.kernel.org  # v3.16+
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-12-31 12:59:34 -08:00
Linus Torvalds bac22980b0 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input layer fixes from Dmitry Torokhov:
 "Fixes for v7 protocol for ALPS devices and few other driver fixes.

  Also users can request input events to be stamped with boot time
  timestamps, in addition to real and monotonic timestamps"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: hil_kbd - fix incorrect use of init_completion
  Input: alps - v7: document the v7 touchpad packet protocol
  Input: alps - v7: fix finger counting for > 2 fingers on clickpads
  Input: alps - v7: sometimes a single touch is reported in mt[1]
  Input: alps - v7: ignore new packets
  Input: evdev - add CLOCK_BOOTTIME support
  Input: psmouse - expose drift duration for IBM trackpoints
  Input: stmpe - bias keypad columns properly
  Input: stmpe - enforce device tree only mode
  mfd: stmpe: add pull up/down register offsets for STMPE
  Input: optimize events_per_packet count calculation
  Input: edt-ft5x06 - fixed a macro coding style issue
  Input: gpio_keys - replace timer and workqueue with delayed workqueue
  Input: gpio_keys - allow separating gpio and irq in device tree
2014-12-30 16:59:59 -08:00
Benjamin Tissoires aa104b1aaa Input: synaptics - remove duplicated code
synaptics_profile_sensor_process() and synaptics_report_mt_data() now
share the exact same code. Remove one implementation and rely on the
other where it was used.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-12-29 14:23:01 -08:00
Benjamin Tissoires e9e8520f22 Input: synaptics - use in-kernel tracking for reporting mt data
The current code tries to consider all states and transitions to properly
detect which finger is attached to which slot. The code is quite huge
and difficult to read.

If the sensor manages to group the touch points but is not reliable in
giving tracking ids, we can simply use the kernel tracking method. Note
that it is already used by Cr-48 Chromebooks.

Incidentaly, this fixes a bug reported by Peter Hutterer:
"""
on the Lenovo T440, run:
evemu-record /dev/input/event4 | grep BTN_

then put one, two, three, two fingers down
when you go from 3 to 2 fingers the driver sends a spurious BTN_TOUCH 0
event:

E: 0.000000 0001 014a 0001      # EV_KEY / BTN_TOUCH            1
E: 0.000000 0001 0145 0001      # EV_KEY / BTN_TOOL_FINGER      1
E: 0.770008 0001 0145 0000      # EV_KEY / BTN_TOOL_FINGER      0
E: 0.770008 0001 014d 0001      # EV_KEY / BTN_TOOL_DOUBLETAP   1
E: 1.924716 0001 014d 0000      # EV_KEY / BTN_TOOL_DOUBLETAP   0
E: 1.924716 0001 014e 0001      # EV_KEY / BTN_TOOL_TRIPLETAP   1

.. changing from 3 to 2 fingers now

E: 3.152641 0001 014a 0000      # EV_KEY / BTN_TOUCH            0
E: 3.152641 0001 014d 0001      # EV_KEY / BTN_TOOL_DOUBLETAP   1
E: 3.152641 0001 014e 0000      # EV_KEY / BTN_TOOL_TRIPLETAP   0
E: 3.176948 0001 014a 0001      # EV_KEY / BTN_TOUCH            1

quick look in the kernel shows it's caused by hw.z going to 0 for a packet,
so probably a firmware bug. either way, it makes it hard to track BTN_TOUCH
as signal that at least one finger is down.
"""

The in-kernel tracking is enough to remove this spurious BTN_TOUCH 0.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-12-29 14:23:00 -08:00
Fabian Frederick f361a2febf Input: elants_i2c - remove unnecessary version.h inclusion
Based on versioncheck.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-12-29 14:08:59 -08:00
Mathias Gottschlag 05be1d079e Input: psmouse - support for the FocalTech PS/2 protocol extensions
Most of the protocol for these touchpads has been reverse engineered. This
commit adds a basic multitouch-capable driver.

A lot of the protocol is still unknown. Especially, we don't know how to
identify the device yet apart from the PNP ID.

The previous workaround for these devices has been left in place in case
the driver is not compiled into the kernel or in case some other device
with the same PNP ID is not recognized by the driver yet still has the same
problems with the device probing code.

Signed-off-by: Mathias Gottschlag <mgottschlag@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-12-29 09:51:37 -08:00
Nicholas Mc Guire cceeb872d6 Input: hil_kbd - fix incorrect use of init_completion
The successive init_completion calls should be reinit_completion calls.

Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
Acked-by: Helge Deller <deller@gmx.de>
Tested-by: Helge Deller <deller@gmx.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-12-27 20:43:35 -08:00
Felipe Balbi 5fafed3e56 Input: add tps65218 power button driver
With this driver, we can report KEY_POWER on AM437x SK. This patch has been
tested with said board.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-12-27 20:43:03 -08:00
Hans de Goede af6a5af8e8 Input: add new sun4i-lradc-keys driver
Allwinnner sunxi SoCs have a low resolution adc (called lradc) which is
specifically designed to have various (tablet) keys (ie home, back, search,
etc). attached to it using a resistor network. This adds a driver for this.

There are 2 channels, currently this driver only supports chan0 since there
are no boards known to use chan1.

This has been tested on an olimex a10s-olinuxino-micro, a13-olinuxino, and
a20-olinuxino-micro.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-12-21 18:59:21 -08:00
Jaewon Kim d64cb71bed Input: add regulator haptic driver
This change adds support for haptic driver controlled by voltage of a
regulator. Userspace can control the device via Force Feedback interface
from input framework.

Signed-off-by: Jaewon Kim <jaewon02.kim@samsung.com>
Signed-off-by: Hyunhee Kim <hyunhee.kim@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Tested-by: Chanwoo Choi <cw00.choi@samsung.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Reviewed-by: Pankaj Dubey <pankaj.dubey@samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-12-21 18:59:20 -08:00
Dmitry Torokhov 6d32af019a Merge branch 'next' into for-linus
Second round of input updates for 3.19.
2014-12-18 10:02:39 -08:00
Hans de Goede 27a560ba1d Input: alps - v7: document the v7 touchpad packet protocol
Add a table documenting where all the bits are in the v7 touchpad packets.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-12-18 10:01:28 -08:00
Hans de Goede d27eb7931c Input: alps - v7: fix finger counting for > 2 fingers on clickpads
Protocol v7 uses the middle / right button bits on clickpads to communicate
"location" information of a 3th touch (and possible 4th) touch on
clickpads.

Specifically when 3 touches are down, if one of the 3 touches is in the
left / right button area, this will get reported in the middle / right
button bits and the touchpad will still send a TWO type packet rather then
a MULTI type packet, so when this happens we must add the finger reported
in the button area to the finger count.

Likewise we must also add fingers reported this way to the finger count
when we get MULTI packets.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=86338
Cc: stable@vger.kernel.org # 3.17
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-12-18 10:01:23 -08:00
Hans de Goede 7091c443dd Input: alps - v7: sometimes a single touch is reported in mt[1]
The v7 proto differentiates between a primary touch (with high precision)
and a secondary touch (with lower precision). Normally when 2 fingers are
down and one is lifted the still present touch becomes the primary touch,
but some traces have shown that this does not happen always.

This commit deals with this by making alps_get_mt_count() not stop at the
first empty mt slot, and if a touch is present in mt[1] and not mt[0]
moving the data to mt[0] (for input_mt_assign_slots).

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=86338
Cc: stable@vger.kernel.org # 3.17
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-12-18 10:01:17 -08:00
Hans de Goede 8b23811535 Input: alps - v7: ignore new packets
NEW packets are send to indicate a discontinuity in the finger coordinate
reporting. Specifically a finger may have moved from slot 0 to 1 or vice
versa.  INPUT_MT_TRACK takes care of this for us.

NEW packets have 3 problems:
1) They do not contain middle / right button info (on non clickpads)
   this can be worked around by preserving the old button state
2) They do not contain an accurate fingercount, and they are
   typically send when the number of fingers changes. We cannot use
   the old finger count as that may mismatch with the amount of
   touch coordinates we've available in the NEW packet
3) Their x data for the second touch is inaccurate leading to
   a possible jump of the x coordinate by 16 units when the first
   non NEW packet comes in

Since problems 2 & 3 cannot be worked around, just ignore them.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=86338
Cc: stable@vger.kernel.org # 3.17
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-12-18 10:00:58 -08:00
Aniroop Mathur aac8bcf1ed Input: evdev - add CLOCK_BOOTTIME support
This patch adds support for CLOCK_BOOTTIME for input event timestamp.
CLOCK_BOOTTIME includes suspend time, so it would allow aplications
to get correct time difference between two events even when system
resumes from suspend state.

Signed-off-by: Aniroop Mathur <a.mathur@samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-12-17 15:46:59 -08:00
haarp 2ba3532047 Input: psmouse - expose drift duration for IBM trackpoints
IBM Trackpoints have a feature to compensate for drift by recalibrating
themselves periodically. By default, if for 0.5 seconds there is no change
in position, it's used as the new zero. This duration is too low. Often,
the calibration happens when the trackpoint is in fact being used.

IBM's Trackpoint Engineering Specifications show a configuration register
that allows changing this duration, rstdft1.

Expose it via sysfs among the other settings.

Signed-off-by: Mike Murdoch <main.haarp@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-12-17 15:46:51 -08:00
Linus Torvalds d797da41b2 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input subsystem updates from Dmitry Torokhov:
 "Two new drivers for Elan hardware (for I2C touchpad and touchscreen
  found in several Chromebooks and other devices), a driver for Goodix
  touch panel, and small fixes to Cypress I2C trackpad and other input
  drivers.

  Also we switched to use __maybe_unused instead of gating suspend/
  resume code with #ifdef guards to get better compile coverage"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (27 commits)
  Input: gpio_keys - fix warning regarding uninitialized 'button' variable
  Input: add support for Elan eKTH I2C touchscreens
  Input: gpio_keys - fix warning regarding uninitialized  'irq' variable
  Input: cyapa - use 'error' for error codes
  Input: cyapa - fix resuming the device
  Input: gpio_keys - add device tree support for interrupt only keys
  Input: amikbd - allocate temporary keymap buffer on the stack
  Input: amikbd - fix build if !CONFIG_HW_CONSOLE
  Input: lm8323 - missing error check in lm8323_set_disable()
  Input: initialize device counter variables with -1
  Input: initialize input_no to -1 to avoid subtraction
  Input: i8042 - do not try to load on Intel NUC D54250WYK
  Input: atkbd - correct MSC_SCAN events for force_release keys
  Input: cyapa - switch to using managed resources
  Input: lifebook - use "static inline" instead of "inline" in lifebook.h
  Input: touchscreen - use __maybe_unused instead of ifdef around suspend/resume
  Input: mouse - use __maybe_unused instead of ifdef around suspend/resume
  Input: misc - use __maybe_unused instead of ifdef around suspend/resume
  Input: cap11xx - support for irq-active-high option
  Input: cap11xx - add support for various cap11xx devices
  ...
2014-12-17 10:06:02 -08:00
Linus Walleij 7c12a5b19e Input: stmpe - bias keypad columns properly
All keypad column pins used as inputs should be pulled up on the STMPE24xx,
but this is not done by the current driver.  Add some logic that will do
this properly. The STMPE1601 also has a keypad controller, but explicitly
does *NOT* require you to set up any pull-ups.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-12-15 22:25:38 -08:00
Linus Walleij a4164863e1 Input: stmpe - enforce device tree only mode
The STMPE keypad controller is only used with device tree configured
systems, so force the configuration to come from device tree only, and now
actually get the rows and cols from the device tree too.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-12-15 21:46:12 -08:00
Anshul Garg baf332c0f1 Input: optimize events_per_packet count calculation
This patch avoids unnecessary operations while estimating events per
packet for an input device when event type is not set.

Signed-off-by: Anshul Garg <anshul.g@samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-12-15 21:45:55 -08:00
Asaf Vertz 189387f9e0 Input: edt-ft5x06 - fixed a macro coding style issue
Fixed a coding style error, macros with complex values should be
enclosed in parentheses.

Signed-off-by: Asaf Vertz <asaf.vertz@tandemg.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-12-15 21:45:54 -08:00
Dmitry Torokhov 8ed9255676 Input: gpio_keys - replace timer and workqueue with delayed workqueue
We do not need to roll our own implementation of delayed work now that we
have proper implementation of mod_delayed_work.

For interrupt-only driven buttons we retain the timer, but we rename
it to release_timer to better reflect its purpose.

Tested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-12-15 21:45:53 -08:00
Dmitry Torokhov 97d86e07b7 Input: gpio_keys - allow separating gpio and irq in device tree
This change allows specify interrupt for buttons separately form gpio,
potentially allowing to form several "clusters" of buttons on
different interrupts.

Button defined without both gpio and irq in device tree is a hared error
instead of a warning now.

Tested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-12-15 21:45:52 -08:00
Dmitry Torokhov f20c86cd75 Merge branch 'next' into for-linus
Prepare input updates for 3.19.
2014-12-15 20:32:42 -08:00
Linus Torvalds e6b5be2be4 Driver core patches for 3.19-rc1
Here's the set of driver core patches for 3.19-rc1.
 
 They are dominated by the removal of the .owner field in platform
 drivers.  They touch a lot of files, but they are "simple" changes, just
 removing a line in a structure.
 
 Other than that, a few minor driver core and debugfs changes.  There are
 some ath9k patches coming in through this tree that have been acked by
 the wireless maintainers as they relied on the debugfs changes.
 
 Everything has been in linux-next for a while.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iEYEABECAAYFAlSOD20ACgkQMUfUDdst+ylLPACg2QrW1oHhdTMT9WI8jihlHVRM
 53kAoLeteByQ3iVwWurwwseRPiWa8+MI
 =OVRS
 -----END PGP SIGNATURE-----

Merge tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core

Pull driver core update from Greg KH:
 "Here's the set of driver core patches for 3.19-rc1.

  They are dominated by the removal of the .owner field in platform
  drivers.  They touch a lot of files, but they are "simple" changes,
  just removing a line in a structure.

  Other than that, a few minor driver core and debugfs changes.  There
  are some ath9k patches coming in through this tree that have been
  acked by the wireless maintainers as they relied on the debugfs
  changes.

  Everything has been in linux-next for a while"

* tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits)
  Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries"
  fs: debugfs: add forward declaration for struct device type
  firmware class: Deletion of an unnecessary check before the function call "vunmap"
  firmware loader: fix hung task warning dump
  devcoredump: provide a one-way disable function
  device: Add dev_<level>_once variants
  ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries
  ath: use seq_file api for ath9k debugfs files
  debugfs: add helper function to create device related seq_file
  drivers/base: cacheinfo: remove noisy error boot message
  Revert "core: platform: add warning if driver has no owner"
  drivers: base: support cpu cache information interface to userspace via sysfs
  drivers: base: add cpu_device_create to support per-cpu devices
  topology: replace custom attribute macros with standard DEVICE_ATTR*
  cpumask: factor out show_cpumap into separate helper function
  driver core: Fix unbalanced device reference in drivers_probe
  driver core: fix race with userland in device_add()
  sysfs/kernfs: make read requests on pre-alloc files use the buffer.
  sysfs/kernfs: allow attributes to request write buffer be pre-allocated.
  fs: sysfs: return EGBIG on write if offset is larger than file size
  ...
2014-12-14 16:10:09 -08:00
Fabio Estevam 1d6a01365f Input: gpio_keys - fix warning regarding uninitialized 'button' variable
Commit af906faabc ("Input: gpio_keys - fix warning regarding uninitialized
'irq' variable") introduced the following build warning:

drivers/input/keyboard/gpio_keys.c:625:16: warning: 'button' may be used uninitialized in this function [-Wmaybe-uninitialized]

Move the 'button' initialization to a proper location to avoid such warning.

Reported-by: Olof's autobuilder <build@lixom.net>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-12-14 11:51:36 -08:00
Rafael J. Wysocki e3d857e1ae Merge branch 'pm-runtime'
* pm-runtime: (25 commits)
  i2c-omap / PM: Drop CONFIG_PM_RUNTIME from i2c-omap.c
  dmaengine / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  drivers: sh / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  e1000e / igb / PM: Eliminate CONFIG_PM_RUNTIME
  MMC / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  MFD / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  misc / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  media / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  input / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  iio / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  hsi / OMAP / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  i2c-hid / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  drm / exynos / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  gpio / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  hwrandom / exynos / PM: Use CONFIG_PM in #ifdef
  block / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  USB / PM: Drop CONFIG_PM_RUNTIME from the USB core
  PM: Merge the SET*_RUNTIME_PM_OPS() macros
  PM / Kconfig: Do not select PM directly from Kconfig files
  PCI / PM: Drop CONFIG_PM_RUNTIME from the PCI core
  ...
2014-12-08 20:00:44 +01:00
Rafael J. Wysocki d3eaf5875e Merge branch 'device-properties'
* device-properties:
  leds: leds-gpio: Fix multiple instances registration without 'label' property
  leds: leds-gpio: Fix legacy GPIO number case
  ACPI / property: Drop size_prop from acpi_dev_get_property_reference()
  leds: leds-gpio: Convert gpio_blink_set() to use GPIO descriptors
  ACPI / GPIO: Document ACPI GPIO mappings API
  net: rfkill: gpio: Add default GPIO driver mappings for ACPI
  ACPI / GPIO: Driver GPIO mappings for ACPI GPIOs
  input: gpio_keys_polled: Make use of device property API
  leds: leds-gpio: Make use of device property API
  gpio: Support for unified device properties interface
  Driver core: Unified interface for firmware node properties
  input: gpio_keys_polled: Add support for GPIO descriptors
  leds: leds-gpio: Add support for GPIO descriptors
  gpio: sch: Consolidate core and resume banks
  gpio / ACPI: Add support for _DSD device properties
  misc: at25: Make use of device property API
  ACPI: Allow drivers to match using Device Tree compatible property
  Driver core: Unified device properties interface for platform firmware
  ACPI: Add support for device specific properties
2014-12-08 19:50:17 +01:00
Scott Liu 66aee90088 Input: add support for Elan eKTH I2C touchscreens
This driver supports Elan eKTH I2C touchscreen controllers. Note that these
are using custom protocol, as opposed to other Elan parts that use
HID-over-I2C and are supported by the standard HID-multitouch driver.

Signed-off-by: Scott Liu <scott.liu@emc.com.tw>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-12-07 23:09:23 -08:00
Dmitry Torokhov af906faabc Input: gpio_keys - fix warning regarding uninitialized 'irq' variable
Commit f2d347ff70 ("Input: gpio_keys - add device tree support for
interrupt only keys") caused the following build warning:

drivers/input/keyboard/gpio_keys.c: In function 'gpio_keys_probe':
drivers/input/keyboard/gpio_keys.c:647:15: warning: 'irq' may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/input/keyboard/gpio_keys.c:622:7: note: 'irq' was declared here

Move button->irq initialization into proper branch and get rid of the
temporary.

Reported-by: Olof's autobuilder <build@lixom.net>
Reported-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-12-07 23:07:07 -08:00
Rafael J. Wysocki dc5686e45d input / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
After commit b2b49ccbdd (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is
selected) PM_RUNTIME is always set if PM is set, so #ifdef blocks
depending on CONFIG_PM_RUNTIME may now be changed to depend on
CONFIG_PM.

The alternative of CONFIG_PM_SLEEP and CONFIG_PM_RUNTIME may be
replaced with CONFIG_PM too.

Make these changes in 2 files under drivers/input/.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Ferruh Yigit <fery@cypress.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-12-05 02:54:17 +01:00
Dudley Du 823a11fdbd Input: cyapa - use 'error' for error codes
Let's use 'error' variable instead of 'ret' when we need to store erro
codes.

Signed-off-by: Dudley Du <dudley.dulixin@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-12-04 09:26:40 -08:00
Dudley Du f68a95cda6 Input: cyapa - fix resuming the device
Chage b1cfa7b438 tried to get away form using
irq in cyapa structure and use client->irq instead, but missed a couple of
spots making the touchpad inoperative after resume.

Reported-by: Jeremiah Mahler <jmmahler@gmail.com>
Signed-off-by: Dudley Du <dudley.dulixin@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-12-03 15:39:14 -08:00
Alexander Stein f2d347ff70 Input: gpio_keys - add device tree support for interrupt only keys
This features already exists for board config setups. Add support for
device tree based systems.

Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-12-03 15:28:39 -08:00
Geert Uytterhoeven e147af492e Input: amikbd - allocate temporary keymap buffer on the stack
Allocate the temporary buffer needed for initialization of the console
keyboard maps (512 bytes, as NR_KEYS = 256) on the stack instead of
statically, to reduce kernel size.

add/remove: 0/1 grow/shrink: 0/0 up/down: 0/-512 (-512)
function                                     old     new   delta
temp_map                                     512       -    -512

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-12-03 15:28:27 -08:00
Geert Uytterhoeven 545e625325 Input: amikbd - fix build if !CONFIG_HW_CONSOLE
If CONFIG_HW_CONSOLE is not set:

drivers/built-in.o: In function `amikbd_probe':
amikbd.c:(.init.text+0x3e4e): undefined reference to `key_maps'
amikbd.c:(.init.text+0x3dd4): undefined reference to `key_maps'

To fix this, extract the initialization of the console keyboard maps
into amikbd_init_console_keymaps(), protected by #ifdef
CONFIG_HW_CONSOLE.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-12-03 15:28:27 -08:00
Dan Carpenter 3b5005e920 Input: lm8323 - missing error check in lm8323_set_disable()
The missing error handling here is not especially harmful but static
checkers complain that "i" can be used uninitialized.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-12-03 15:28:26 -08:00