Mark Brown [Mon, 4 Mar 2013 04:21:30 +0000 (20:21 -0800)]
Input: mms114 - Fix regulator enable and disable paths
When it uses regulators the mms114 driver checks to see if it managed to
acquire regulators and ignores errors. This is not the intended usage and
not great style in general.
Since the driver already refuses to probe if it fails to allocate the
regulators simply make the enable and disable calls unconditional and
add appropriate error handling, including adding cleanup of the
regulators if setup_reg() fails.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Rabin Vincent [Sun, 10 Mar 2013 00:17:20 +0000 (16:17 -0800)]
Input: tc3589x-keypad - fix keymap size
The keymap size used by tc3589x is too low, leading to the driver
overwriting other people's memory. Fix this by making the driver
use the automatically allocated keymap provided by
matrix_keypad_build_keymap() instead of allocating one on its own.
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
dave turvene [Sun, 24 Feb 2013 04:06:34 +0000 (20:06 -0800)]
Input: ALPS - update documentation for recent touchpad driver mods
Updated documentation for the new ALPS touchpad support submitted in two
patchsets by Kevin Cernekee. My understanding is the most recent
patchset '"Dolphin V2" touchpad support' may still need some work but
Future work on the ALPS driver should not impact these documentation changes.
See https://bugs.launchpad.net/ubuntu/+source/linux/+bug/606238
Signed-off-by: David Turvene <dturvene@dahetral.com> Acked-by: Kevin Cernekee <cernekee@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Dave Turvene [Fri, 22 Feb 2013 06:58:28 +0000 (22:58 -0800)]
Input: ALPS - add "Dolphin V1" touchpad support
These touchpads use a different protocol; they have been seen on Dell
N5110, Dell 17R SE, and others.
The official ALPS driver identifies them by looking for an exact match
on the E7 report: 73 03 50. Dolphin V1 returns an EC report of
73 01 xx (02 and 0d have been seen); Dolphin V2 returns an EC report of
73 02 xx (02 has been seen).
Dolphin V2 probably needs a different initialization sequence and/or
report parser, so it is left for a future commit.
Signed-off-by: Dave Turvene <dturvene@dahetral.com> Signed-off-by: Kevin Cernekee <cernekee@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Kevin Cernekee [Fri, 22 Feb 2013 06:58:20 +0000 (22:58 -0800)]
Input: ALPS - remove unused argument to alps_enter_command_mode()
Now that alps_identify() explicitly issues an EC report using
alps_rpt_cmd(), we no longer need to look at the magic numbers returned
by alps_enter_command_mode().
Signed-off-by: Kevin Cernekee <cernekee@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Stephen Warren [Sat, 16 Feb 2013 01:04:12 +0000 (17:04 -0800)]
Input: tegra-kbc - require CONFIG_OF, remove platform data
Tegra only supports, and always enables, device tree. Remove all ifdefs
and runtime checks for DT support from the driver. Platform data is
therefore no longer required. Delete the header that defines it, and
rework the driver to parse the device tree directly into struct
tegra_kbc.
Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To properly setup event parameters for emulated events, pass
the appropriate flag to the slot initialization function. Also,
all MT-related events should be setup before initialization.
Incidentally, this solves the issue of doubly filtered pointer
events.
Reported-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Input: bma150 - make some defines public and fix some comments
Make the constants referring to range and bandwidth public so they can
be used when initializing the platform data fields in the platform code.
Fix also some comments regarding the unit of measurement to use for the
range and bandwidth fields, the values are not actually expected to be
in G or HZ, the code in bma150.c just uses the BMA150_RANGE_xxx and
BMA150_BW_xxx constants like they are with no translation from actual
values in G or HZ.
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> Signed-off-by: Antonio Ospite <ao2@amarulasolutions.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Input: bma150 - fix checking pm_runtime_get_sync() return value
When PM_RUNTIME is not defined, pm_runtime_get_sync() returns 1, see
include/linux/pm_runtime.c::__pm_runtime_resume(), and the check of the
return value was overlooking this, in this case bma150_open() would
return 1 which is not expected by upper layers.
Maybe the check for != -ENOSYS (Function not implemented) was meant to
cover this, but pm_runtime_get_sync() does not return this value.
For now fix the issue locally by checking explicitly for negative return
values.
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> Signed-off-by: Antonio Ospite <ao2@amarulasolutions.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Kevin Cernekee [Thu, 14 Feb 2013 06:26:11 +0000 (22:26 -0800)]
Input: ALPS - make the V3 packet field decoder "pluggable"
A number of different ALPS touchpad protocols can reuse
alps_process_touchpad_packet_v3() with small tweaks to the bitfield
decoding. Create a new priv->decode_fields() callback that handles the
per-model differences.
Signed-off-by: Kevin Cernekee <cernekee@gmail.com> Tested-by: Dave Turvene <dturvene@dahetral.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Kevin Cernekee [Thu, 14 Feb 2013 06:24:22 +0000 (22:24 -0800)]
Input: ALPS - fix command mode check
Pinnacle class devices should return "88 07 xx" or "88 08 xx" when
entering command mode. If either the first byte or the second byte is
invalid, return an error.
Signed-off-by: Kevin Cernekee <cernekee@gmail.com> Tested-by: Dave Turvene <dturvene@dahetral.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Kevin Cernekee [Thu, 14 Feb 2013 06:23:34 +0000 (22:23 -0800)]
Input: ALPS - rework detection of Pinnacle AGx touchpads
The official ALPS driver uses the EC report, not the E7 report, to detect
these devices. Also, they check for a range of values; the original
table-based code only checked for two specific ones.
Signed-off-by: Kevin Cernekee <cernekee@gmail.com> Tested-by: Dave Turvene <dturvene@dahetral.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Kevin Cernekee [Thu, 14 Feb 2013 06:22:08 +0000 (22:22 -0800)]
Input: ALPS - use function pointers for different protocol handlers
In anticipation of adding more ALPS protocols and more per-device quirks,
use function pointers instead of switch statements to call functions that
differ from one device to the next.
Signed-off-by: Kevin Cernekee <cernekee@gmail.com> Tested-by: Dave Turvene <dturvene@dahetral.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Kevin Cernekee [Thu, 14 Feb 2013 06:19:01 +0000 (22:19 -0800)]
Input: ALPS - introduce helper function for repeated commands
Several ALPS driver init sequences repeat a command three times, then
issue PSMOUSE_CMD_GETINFO to read the result. Move this into a helper
function to simplify the code.
Signed-off-by: Kevin Cernekee <cernekee@gmail.com> Tested-by: Dave Turvene <dturvene@dahetral.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Kevin Cernekee [Thu, 14 Feb 2013 04:56:33 +0000 (20:56 -0800)]
Input: ALPS - copy "model" info into alps_data struct
Not every type of ALPS touchpad is well-suited to table-based detection.
Start moving the various alps_model_data attributes into the alps_data
struct so that we don't need a unique table entry for every possible
permutation of protocol version, flags, byte0/mask0, etc.
Signed-off-by: Kevin Cernekee <cernekee@gmail.com> Tested-by: Dave Turvene <dturvene@dahetral.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Benson Leung [Wed, 13 Feb 2013 21:56:03 +0000 (13:56 -0800)]
Input: cyapa - add support for smbus protocol
This patch adds support for the Cypress APA Smbus Trackpad type,
which uses a modified register map that fits within the
limitations of the smbus protocol.
Devices that use this protocol include:
CYTRA-116001-00 - Samsung Series 5 550 Chromebook trackpad
CYTRA-103002-00 - Acer C7 Chromebook trackpad
CYTRA-101003-00 - HP Pavilion 14 Chromebook trackpad
Signed-off-by: Dudley Du <dudl@cypress.com> Signed-off-by: Benson Leung <bleung@chromium.org> Reviewed-by: Daniel Kurtz <djkurtz@chromium.org> Reviewed-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Investigating the following gesture highlighted two slight implementation
errors with choosing which slots to report in which slot when multiple
contacts are present:
In step 4, slot 1 was not being cleared first, which means the same
tracking ID was being used for reporting both the old contact 1 and the
new contact 3. This could result in "drumroll", where the old contact 1
would appear to suddenly jump to new finger 3 position.
Similarly, if contacts 2 & 3 are not detected at the same sample, step 4
is split into two:
In this case, there was also a bug. In step 4, when contact 1 moves from
SGM to AGM and contact 2 is first reported in SGM, slot 0 was actually
empty. So slot 0 can be used to report the new SGM (contact 0),
immediately. Since it was empty, contact 2 in slot 0 will get a new
tracking ID.
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Heiko Carstens [Wed, 13 Feb 2013 21:29:01 +0000 (13:29 -0800)]
Input: add couple of missing GENERIC_HARDIRQS dependencies
When removing the !S390 dependency from drivers/input/Kconfig
a couple of drivers don't compile because they have a dependency
on GENERIC_HARDIRQS. So add the missing dependencies.
Fixes e.g. this one:
drivers/input/keyboard/lm8323.c: In function ‘lm8323_suspend’:
drivers/input/keyboard/lm8323.c:801:2: error: implicit declaration of function ‘irq_set_irq_wake’
[-Werror=implicit-function-declaration]
Brian Swetland [Thu, 24 Jan 2013 03:45:00 +0000 (19:45 -0800)]
Input: goldfish - virtual input event driver
This device is a direct pipe from "hardware" to the input event subsystem,
allowing us to avoid having to route "keypad" style events through an
AT keyboard driver (gross!).
As with the other submissions this driver is cross architecture.
Signed-off-by: Mike A. Chan <mikechan@google.com>
[Tided up to work on x86] Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com> Signed-off-by: Xiaohui Xin <xiaohui.xin@intel.com> Signed-off-by: Jun Nakajima <jun.nakajima@intel.com> Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
[Ported to 3.4] Signed-off-by: Tom Keel <thomas.keel@intel.com>
[Cleaned up for 3.7 and submission] Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Chris Bagwell [Thu, 24 Jan 2013 03:37:34 +0000 (19:37 -0800)]
Input: wacom - fix wacom_set_report retry logic
Logic sets a value and then reads it back to make sure it worked
and retries write on failures. Since read and write share a buffer,
it needs to be set back up before writing though.
Issue is not seen a lot because 1) it doesn't need to retry for
a lot of tablets and 2) a lot of failures that need a retry are
from an -ETIMEDOUT and hopefully buffer is not touched in this case.
At least one user has shown logs with buffer being modified during
-ETIMEDOUT case with linux 3.7 kernel.
Signed-off-by: Chris Bagwell <chris@cnpbagwell.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Dmitry Torokhov [Sat, 15 Dec 2012 07:13:24 +0000 (23:13 -0800)]
Input: walkera0701 - set up input device's parent
This will place the joystick's input device into propoer place in sysfs
hierarchy as long as th port has device assigned to it (i.e. it is not
legacy port).
Input: atkbd - fix multi-byte scancode handling on reconnect
On resume from suspend there is a possibility for multi-byte scancodes
to be handled incorrectly. atkbd_reconnect disables the processing of
scancodes in software by calling atkbd_disable, but the keyboard may
still be active because no disconnect command was sent. Later, software
handling is re-enabled. If a multi-byte scancode sent from the keyboard
straddles the re-enable, only the latter byte(s) will be handled.
In practice, this leads to cases where multi-byte break codes (ex. "e0
4d" - break code for right-arrow) are misread as make codes ("4d" - make
code for numeric 6), leading to one or more unwanted, untyped characters
being interpreted.
The solution implemented here involves sending command f5 (reset
disable) to the keyboard prior to disabling software handling of codes.
Later, the command to re-enable the keyboard is sent only after we are
prepared to handle scancodes.
Laxman Dewangan [Mon, 7 Jan 2013 02:34:48 +0000 (18:34 -0800)]
Input: tegra-kbc - remove default keymap
Tegra KBC driver have the default key mapping for 16x8 configuration.
The key mapping can be provided through platform data or through DT
and the mapping varies from platform to platform, hence this default
mapping is not so useful. Remove the default mapping to reduce the code
lines of the driver.
Laxman Dewangan [Mon, 7 Jan 2013 02:32:22 +0000 (18:32 -0800)]
Input: tegra-kbc - add support for rows/columns configuration from dt
The NVIDIA's Tegra KBC has maximum 24 pins to make matrix keypad.
Any pin can be configured as row or column. The maximum column pin
can be 8 and maximum row pin can be 16.
Remove the assumption that all first 16 pins will be used as row
and remaining as columns and Add the property for configuring pins
to either row or column from DT. Update the devicetree binding
document accordingly.
This patch adds keyreset functionality to the sysrq driver. It allows
certain button/key combinations to be used in order to trigger emergency
reboots.
Redefining the '__weak platform_sysrq_reset_seq' variable is required
to trigger the feature. Alternatively keys can be passed to the driver
via a module parameter.
This functionality comes from the keyreset driver submitted by
Arve Hjønnevåg in the Android kernel.
Dmitry Torokhov [Tue, 8 Jan 2013 17:10:31 +0000 (09:10 -0800)]
Input: document that unregistering managed devices is not necessary
Apparently some users of managed input devices are confused whether
input_unregister_device() is needed when working with them. Clarify
this in the kernel doc for devm_input_allocate_device(): in most cases
there is no need to call neither input_unregister_device() nor
input_free_device() when working with managed devices.
Ping Cheng [Sat, 5 Jan 2013 07:53:52 +0000 (23:53 -0800)]
Input: wacom - prepare for syncing with input-mt changes
Henrik added new MT routines in release 3.7. This patch is to prepare
for the use of new MT routines.
In the newly added wacom_abs_set_axis() function, the first
if-statement assigns ABS_X/Y for number of contacts less or equal
to 2. So, it is single and 2 finger touch devices. Two finger touch
devices are processed here since they will not use the updated
input_mt_init_slots(), which does not offer benefit to those devices.
input_mt_init_slots() will take care of ABS_X/Y assignment when flags
are not zero. All touch devices with more than two contacts will use
input_mt_init_slots() with non-zero flags.
The second if-statement is for all MT devices, which include two
finger touch devices.
Dmitry Torokhov [Mon, 24 Dec 2012 17:32:46 +0000 (09:32 -0800)]
Input: gpio_keys - defer probing if GPIO probing is deferred
If of_get_gpio_flags() returns an error (as in case when GPIO probe is
deferred) the driver would attempt to claim invalid GPIO. It should
propagate the error code up the stack instead so that the probe either
fails or will be retried later (in case of -EPROBE_DEFER).
Input: sentelic - only report position of first finger as ST coordinates
Report only the position of the first finger as absolute non-MT coordinates,
instead of reporting both fingers alternatively. Actual MT events are
unaffected.
This fixes horizontal and improves vertical scrolling with the touchpad.
Florian Fainelli [Mon, 10 Dec 2012 20:18:20 +0000 (12:18 -0800)]
Input: matrix-keymap - provide a proper module license
The matrix-keymap module is currently lacking a proper module license,
add one so we don't have this module tainting the entire kernel. This
issue has been present since commit 1932811f (Input: matrix-keymap -
uninline and prepare for device tree support)
Dmitry Torokhov [Wed, 14 Nov 2012 16:20:21 +0000 (08:20 -0800)]
Input: tca8418_keypad - increase severity of failures in probe()
Failures to build a keymap, request an IRQ, or register input device are
fatal for the driver, therefore the messages should have "error" severity
instead of "debug".
Reviewed-by: Alban Bedel <alban.bedel@avionic-design.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Lee Jones [Fri, 28 Sep 2012 13:35:43 +0000 (14:35 +0100)]
Input: bu21013_ts - add support for Device Tree booting
Now we can register the BU21013_ts touch screen when booting with Device
Tree enabled. Here we parse all the necessary components previously
expected to be passed from platform data.
Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Lee Jones [Thu, 22 Nov 2012 03:11:46 +0000 (19:11 -0800)]
Input: bu21013_ts - request regulator that actually exists
Currently the BU21013 Touch Screen driver requests a regulator by the
name of 'V-TOUCH', which doesn't exist anywhere in the kernel. The
correct name, as referenced in platform regulator code is 'avdd'. Here,
when we request a regulator, we use the correct name instead.
Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Lee Jones [Thu, 27 Sep 2012 10:47:43 +0000 (11:47 +0100)]
ARM: ux500: Strip out duplicate touch screen platform information
We're currently carrying two 'struct bu21013_platform_device's which
are identical for no apparent reason. Here we remove the extra burden
and apply the same information to the two different instances of the
bu21012_tp driver registration.
[Dmitry Torokhov: picked it up to (hopefully) reduce merge conflict with
bu21013_ts update that follows.]
Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Jonas Aaberg [Sat, 24 Nov 2012 08:10:29 +0000 (00:10 -0800)]
Input: gpio_keys - disable hardware on suspend
Disable hardware if active when suspending if the hw can not
wake the system from suspend.
[Dmitry Torokhov: use input_dev->users instead of a separate flag]
Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com> Signed-off-by: Philippe Langlais <philippe.langlais@linaro.org> Reviewed-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Input: spear-keyboard - add clk_{un}prepare() support
clk_{un}prepare is mandatory for platforms using common clock framework.
Because for SPEAr we don't do anything in clk_{un}prepare() calls, just
call them once in probe/remove.
Andreas Pretzsch [Sun, 25 Nov 2012 07:31:38 +0000 (23:31 -0800)]
Input: imx_keypad - only set enabled columns to open-drain
In imx_keypad_inhibit(), all 8 columns were set to open-drain, in
contrast to the rest of the driver, where only the enabled columns
are modified/used.
Contrary to the normal expectation, this also affects column I/Os not
even mapped via IOMUX to the KPP hardware module but used as a GPIO.
Therefore only init enabled columns to open-drain and leave all others
with their default reset value of 0, i.e. totem-pole.
Signed-off-by: Andreas Pretzsch <apr@cn-eng.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Peter Ujfalusi [Wed, 14 Nov 2012 18:10:49 +0000 (10:10 -0800)]
Input: twl4030-pwrbutton - switch to using TWL_MODULE_PM_MASTER define
To facilitate upcoming cleanup in twl stack switch from using
TWL4030_MODULE_PM_MASTER define to usingTWL_MODULE_PM_MASTER.
There are no functional changes.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Dmitry Torokhov [Wed, 14 Nov 2012 16:55:21 +0000 (08:55 -0800)]
Input: stmpe-keypad - add support for Device Tree bindings
This patch allows the STMPE driver to be successfully probed and
initialised when Device Tree support is enabled. Besides the usual
platform data changes, we also separate the process of filling in
the 'in use' pin bitmap, as we have to extract the information from
Device Tree in the DT boot case.
Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Bill Pemberton [Sat, 24 Nov 2012 05:50:47 +0000 (21:50 -0800)]
Input: remove use of __devexit
CONFIG_HOTPLUG is going away as an option so __devexit is no
longer needed.
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>