Commit graph

618888 commits

Author SHA1 Message Date
Guenter Roeck
8e1b4d83cf Input: touchscreen - drop unnecessary calls to device_init_wakeup
Calling device_init_wakeup in the remove function is unnecessary since the
device is going away, and thus won't be able to cause any wakeups under any
circumstances. Besides, the driver cleanup code already handles the
necessary cleanup.

Similarly, disabling wakeup in the probe error path is unnecessary, as is
disabling wakeup in the probe function in the first place.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-21 23:53:30 -08:00
Guenter Roeck
56580c2cb7 Input: misc - drop unnecessary calls to device_init_wakeup
Calling device_init_wakeup in the remove function is unnecessary since the
device is going away, and thus won't be able to cause any wakeups under any
circumstances. Besides, the driver cleanup code already handles the
necessary cleanup.

Similarly, disabling wakeup in the probe error path is unnecessary, as is
disabling wakeup in the probe function in the first place.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-21 23:53:21 -08:00
Guenter Roeck
de3a00ef21 Input: keyboard - drop unnecessary calls to device_init_wakeup
Calling device_init_wakeup in the remove function is unnecessary since the
device is going away, and thus won't be able to cause any wakeups under any
circumstances. Besides, the driver cleanup code already handles the
necessary cleanup.

Similarly, disabling wakeup in the probe error path is unnecessary, as is
disabling wakeup in the probe function in the first place.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-21 23:53:19 -08:00
Guenter Roeck
d7ddf15414 Input: touchscreen - use local variables consistently
If a function declares a variable to access a structure element,
use it consistently.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-21 23:53:17 -08:00
Guenter Roeck
ad56814fcc Input: mouse - use local variables consistently
If a function declares a variable to access a structure element,
use it consistently.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-21 23:52:22 -08:00
Guenter Roeck
a0d86ecd23 Input: misc - use local variables consistently
If a function declares a variable to access a structure element,
use it consistently.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-21 23:51:56 -08:00
Guenter Roeck
b4e66e7d19 Input: keyboard - use local variables consistently
If a function declares a variable to access a structure element,
use it consistently.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-21 23:51:54 -08:00
Guenter Roeck
8300445cc7 Input: touchscreen - drop calls to platform_set_drvdata and i2c_set_clientdata
There is no call to i2c_get_clientdata(), platform_get_drvdata(),
or dev_get_drvdata() in any of the drivers in this patch.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-21 23:51:53 -08:00
Guenter Roeck
4cd216cbe7 Input: misc - drop calls to platform_set_drvdata and i2c_set_clientdata
There is no call to i2c_get_clientdata(), platform_get_drvdata(),
or dev_get_drvdata() in any of the drivers in this patch.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-21 23:51:51 -08:00
Guenter Roeck
666c0b8366 Input: keyboard - drop calls to platform_set_drvdata and i2c_set_clientdata
There is no call to i2c_get_clientdata(), platform_get_drvdata(),
or dev_get_drvdata() in any of the drivers in this patch.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-21 23:51:49 -08:00
Hans de Goede
83e4947a56 Input: gpio-keys - add support for setkeycode
gpio-keys input devices created by the soc_button_array driver are
configured with key-codes based on ACPI provided information.

Unfortunately on some tablets this info is wrong, and we need to have
a quirk to fix things up.

Add support for input_setkeycode to the gpio-keys driver, so that
the existing udev hwdb mechanism can be used to fix things up on these
tablets.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-21 11:46:53 -08:00
Hans de Goede
5c4fa2a6da Input: soc_button_array - debounce the buttons
The soc_button_array driver was initializing (kzalloc) the
debounce_interval value to 0, leading to no debouncing at all,
while the buttons are simple mechanical switches.

This commit sets debounce_interval to 50ms to avoid spurious button
press reports both on press and release of the button. Note 50ms may
seem like a lot but soc_button_array is typically used with cheap
tablets, with not so great buttons. I tried 10ms on my tablet and it
is not enough, where as 50ms works well.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-21 11:46:52 -08:00
Jaechul Lee
72d1f2346d Input: tm2-touchkey - add touchkey driver support for TM2
This patch adds support for the TM2 touch key and led functionality.

The driver interfaces with userspace through an input device and reports
KEY_PHONE and KEY_BACK event types. LED brightness can be controlled by
"/sys/class/leds/tm2-touchkey/brightness".

Signed-off-by: Beomho Seo <beomho.seo@samsung.com>
Signed-off-by: Jaechul Lee <jcsing.lee@samsung.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Reviewed-by: Andi Shyti <andi.shyti@samsung.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Tested-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-18 14:50:23 -08:00
Guenter Roeck
aa6f922221 Input: sis_i2c - drop unnecessary call to i2c_set_clientdata
There is no call to i2c_get_clientdata() or dev_get_drvdata().
Drop the unnecessary call to i2c_set_clientdata().

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-18 14:29:57 -08:00
Guenter Roeck
8beb7172b4 Input: bcm-keypad - drop unnecessary call to platform_set_drvdata
There is no call to platform_get_drvdata() or dev_get_drvdata().
Drop the unnecessary call to platform_set_drvdata().

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-18 11:49:22 -08:00
Guenter Roeck
e634d08dec Input: twl4030_keypad - drop unnecessary call to platform_set_drvdata
There is no call to platform_get_drvdata() or dev_get_drvdata().
Drop the unnecessary call to platform_set_drvdata().

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-18 11:49:20 -08:00
Guenter Roeck
b8f6a6ad77 Input: ab8500-ponkey - drop unnecessary call to platform_set_drvdata
There is no call to platform_get_drvdata() or dev_get_drvdata().
Drop the unnecessary call to platform_set_drvdata().

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-18 11:49:19 -08:00
Guenter Roeck
8ace98df9a Input: tps65218-pwrbutton - drop unnecessary call to platform_set_drvdata
There is no call to platform_get_drvdata() or dev_get_drvdata().
Drop the unnecessary call to platform_set_drvdata().

Also use existing variable 'dev' instead of dereferencing it several times.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-18 11:49:17 -08:00
Guenter Roeck
aa45590ae8 Input: soc_button_array - use 'dev' instead of dereferencing it
Use local variable 'dev' instead of dereferencing it several times.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-18 11:49:16 -08:00
Guenter Roeck
9e85aa6956 Input: mma8450 - drop unnecessary call to i2c_set_clientdata
There is no call to i2c_get_clientdata() or dev_get_drvdata().
Drop the unnecessary call to i2c_set_clientdata().

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-18 11:49:14 -08:00
Guenter Roeck
a196b2c9f5 Input: gpio_decoder - drop unnecessary call to platform_set_drvdata
There is no call to platform_get_drvdata() or dev_get_drvdata().
Drop the unnecessary call to platform_set_drvdata().

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-18 11:49:13 -08:00
Guenter Roeck
0265c324b8 Input: bfin_rotary - switch to using devm_add_action_or_reset()
Use local variable 'dev' instead of dereferencing it several times and
replace devm_add_action() and manual error handling with
devm_add_action_or_reset().

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-18 11:49:11 -08:00
Guenter Roeck
ad03ae44ba Input: eeti_ts - drop goto to return statement
Replace 'goto l; ... l: return e;' with 'return e;'

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-18 11:33:10 -08:00
Guenter Roeck
5d20b927fa Input: atmel-wm97xx - drop unnecessary error messages
Error messages after memory allocation failures are unnecessary and
can be dropped, especially give that they were emitted as dev_dbg() so
noone except person actively debugging the driver would see them.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-18 11:33:08 -08:00
Guenter Roeck
a8e90be161 Input: ar1021_i2c - drop unnecessary call to i2c_set_clientdata
There is no call to i2c_get_clientdata() or dev_get_drvdata().
Drop the unnecessary call to i2c_set_clientdata().

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-18 11:33:05 -08:00
Guenter Roeck
32237677fb Input: xilinx_ps2 - use 'dev' instead of dereferencing it
Use local variable 'dev' instead of dereferencing it several times.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-18 11:33:03 -08:00
Guenter Roeck
009af5fdb4 Input: at32psif - drop unnecessary error messages and other changes
Error messages after memory allocation failures are unnecessary and
can be dropped, given that they are emitted as dev_dbg() so nobody except
person actively debugging the driver would see them.

Also replace jump to return 'goto l; ... l: return e;' with 'return e;'

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-18 11:33:02 -08:00
Guenter Roeck
2057e15945 Input: cros_ec_keyb - drop unnecessary call to dev_set_drvdata and other changes
There is no call to platform_get_drvdata() or dev_get_drvdata().
Drop the unnecessary call to dev_set_drvdata().
Other relevant changes:
  Use existing variable 'dev' instead of dereferencing it several times

This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Drop dev_set_drvdata()
- Use local variable 'struct device *dev' consistently

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-18 11:33:00 -08:00
Maxime Ripard
259b77ef85 Input: tca8418 - use the interrupt trigger from the device tree
The TCA8418 might be used using different interrupt triggers on various
boards. This is not working so far because the current code forces a
falling edge trigger.

The device tree already provides a trigger type, so let's use whatever it
sets up, and since we can be loaded without DT, keep the old behaviour for
the non-DT case.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-17 14:17:39 -08:00
Nicholas Mc Guire
13e360ac97 Input: cyapa - use msleep() for long delay
ulseep_range() uses hrtimers and provides no advantage over msleep()
for larger delays. Fix up the 50ms delays here to use msleep() and
reduce the load on the hrtimer subsystem.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-15 15:40:23 -08:00
Nicholas Mc Guire
cd4c1b412d Input: cyapa - use time based retry loop
Using counter based retry loops for peripherals results in the delay
being significantly overrun during high-load situations where delay
functions tend to be vary imprecise and overrun there timeouts. So
condition the termination on the actual condition of 2s for the
re-calibration to have been successful.

As this is a very long delay there is no advantage in using
high-resolution timers thus switching this to msleep().

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-15 15:40:11 -08:00
Akinobu Mita
de901cc31d Input: mpr121 - switch to device tree probe
This driver currently only supports legacy platform data probe.  This
change adds device tree support and gets rid of platform data probe code
since no one is actually using mpr121 platform data in the mainline.

The device tree property parsing code is based on the work of
atmel_captouch driver.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-15 15:08:46 -08:00
Akinobu Mita
08fea55e37 Input: mpr121 - handle multiple bits change of status register
This driver reports input events on their interrupts which are triggered
by the sensor's status register changes.  But only single bit change is
reported in the interrupt handler.  So if there are multiple bits are
changed at almost the same time, other press or release events are ignored.

This fixes it by detecting all changed bits in the status register.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-15 15:08:44 -08:00
Akinobu Mita
9723ddc8fe Input: mpr121 - set missing event capability
This driver reports misc scan input events on the sensor's status
register changes.  But the event capability for them was not set in the
device initialization, so these events were ignored.

This change adds the missing event capability.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-15 15:08:43 -08:00
Akinobu Mita
a4b1aeb726 Input: mpr121 - remove unused field in struct mpr121_touchkey
Remove unused key_val field in struct mpr121_touchkey.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-15 15:08:42 -08:00
Akinobu Mita
890fa16762 Input: mpr121 - annotate PM methods as __maybe_unused
Instead of using #ifdef, let's mark suspend and resume methods as
__maybe_unused to provide better compile coverage.

Suggested-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-15 15:08:40 -08:00
Andy Shevchenko
aa142ed770 Input: intel-mid-touch - remove driver
The Moorestown support was removed by commit 1a8359e411 ("x86/mid: Remove
Intel Moorestown").

Remove this leftover.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-06 10:31:52 -08:00
Aniroop Mathur
0eeecf6039 Input: edt_ft5x06 - change msleep to usleep_range for small msecs
msleep(1~20) may not do what the caller intends, and will often sleep
longer (~20 ms actual sleep for any value given in the 1~20ms range).  This
is not the desired behaviour for many cases like device resume time, device
suspend time, device enable time, retry logic, etc.  Thus, change msleep to
usleep_range for precise wakeups.

Signed-off-by: Aniroop Mathur <a.mathur@samsung.com>
Acked-by: Simon Budig <simon.budig@kernelconcepts.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-06 10:31:52 -08:00
Cameron Gutman
c01b5e7464 Input: xpad - don't depend on endpoint order
The order of endpoints is well defined on official Xbox pads, but
we have found at least one 3rd-party pad that doesn't follow the
standard ("Titanfall 2 Xbox One controller" 0e6f:0165).

Fortunately, we get lucky with this specific pad because it uses
endpoint addresses that differ only by direction. We know that
there are other pads out where this is not true, so let's go
ahead and fix this.

Signed-off-by: Cameron Gutman <aicommander@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-06 10:31:51 -08:00
Pavel Rojtberg
a8c34e27fb Input: xpad - simplify error condition in init_output
Replace first goto with simple returns as we really are just returning
one error code.

Signed-off-by: Pavel Rojtberg <rojtberg@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-06 10:31:51 -08:00
Daniel Tobias
4f88476c75 Input: xpad - move reporting xbox one home button to common function
xbox one was the only device that has a *_process_buttons routine.

Signed-off-by: Pavel Rojtberg <rojtberg@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-06 10:31:50 -08:00
Daniel Tobias
c02fc1d9e5 Input: xpad - correctly sort vendor id's
Signed-off-by: Daniel Tobias <dan.g.tob@gmail.com>
Signed-off-by: Pavel Rojtberg <rojtberg@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-06 10:31:49 -08:00
Aniroop Mathur
f63bb4f442 Input: bma150 - switch to using usleep_range instead of msleep
msleep (1~20) may not do what the caller intends, and will often sleep
longer.  (~20 ms actual sleep for any value given in the 1~20ms range) This
is not the desired behaviour for many cases like device resume time, device
suspend time, device enable time, etc.  Thus, change msleep to usleep_range
for precise wakeups.

Signed-off-by: Aniroop Mathur <a.mathur@samsung.com>
Acked by: Albert Zhang <xu.zhang@bosch-sensortec.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2016-12-27 13:36:50 -08:00
Dmitry Torokhov
1a9027770f Input: i8042 - force synchronous probing of PNP drivers
We rely on the result of scanning PNP bus for keyboard and mouse devices to
decide whether we should continue initialization of i8042 driver or not, so
the probes can not be asynchronous.

Also, it is not a good idea to unbind either of the PNP devices while i8042
is running, so let's disable bind/unbind for the PNP drivers through sysfs
and rely on i8042 cleaning after itself properly. User can still unbind and
rebind entire i8042 and that will take care of PNP drivers as well.

Reviewed-by: Luis R. Rodriguez <mgrof@kernel.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2016-12-18 15:56:44 -08:00
Dmitry Torokhov
ebfb0184ef Merge branch 'synaptics-rmi4' into next
Merge updated Synaptics RMI4 support, including support for SMBus
controllers and flashing firmware.
2016-12-15 21:36:09 -08:00
Guy Shapiro
f43d3ec3a8 Input: imx6ul_tsc - generalize the averaging property
Make the avarage-samples property a general touchscreen property
rather than imx6ul device specific.

Signed-off-by: Guy Shapiro <guy.shapiro@mobi-wize.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2016-12-15 21:34:35 -08:00
Jingkui Wang
34888602eb Input: drv260x - use generic device properties
Update driver drv260x to use generic device properties so that it can be
used on non-DT systems. We also remove platform data as generic device
properties work on static board code as well.

Signed-off-by: Jingkui Wang <jkwang@google.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2016-12-12 14:20:32 -08:00
Dmitry Torokhov
ba4cf37838 Input: drv260x - use temporary for &client->dev
Let's introduce a temporary for "client->dev" is probe() as we use
it quite a few times and "dev" is shorter.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2016-12-12 14:20:31 -08:00
Jingkui Wang
5a8a6b89c1 Input: drv260x - fix input device's parent assignment
We were assigning I2C bus controller instead of client as parent device.
Besides being logically wrong, it messed up with devm handling of input
device. As a result we were leaving input device and event node behind
after rmmod-ing the driver, which lead to a kernel oops if one were to
access the event node later.

Let's remove the assignment and rely on devm_input_allocate_device() to
set it up properly for us.

Signed-off-by: Jingkui Wang <jkwang@google.com>
Fixes: 7132fe4f56 ("Input: drv260x - add TI drv260x haptics driver")
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2016-12-12 14:20:30 -08:00
Nick Dyer
5191d88acc Input: synaptics-rmi4 - add support for F34 V7 bootloader
Port firmware update code from Samsung Galaxy S7 driver into
mainline framework.

This patch has been tested on Synaptics S7813.

Signed-off-by: Nick Dyer <nick@shmanahar.org>
Tested-by: Chris Healy <cphealy@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2016-12-12 11:26:47 -08:00