summaryrefslogtreecommitdiff
path: root/drivers/input
AgeCommit message (Collapse)Author
2017-04-12Input: ar1021_i2c - coding style fixesMartin Kepplinger
Use the common kernel coding style and corrently align parameters with open parenthesis. Signed-off-by: Martin Kepplinger <martin.kepplinger@ginzinger.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-12Input: lpc32xx_ts - check for clk_prepare_enable() errorFabio Estevam
clk_prepare_enable() may fail, so we better check its return value and propagate it in the case of error. Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-12Input: imx6ul_tsc - fix error handlingFabio Estevam
If imx6ul_tsc_init() fails we should not return directly. We should disable the previously acquired clocks in this case. Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-11input: cpcap-pwrbutton: New driverSebastian Reichel
Motorola CPCAP is a PMIC found in multiple smartphones. This driver adds support for the power/on button and has been tested in Droid 4. Acked-by: Rob Herring <robh@kernel.org> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Tested-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sebastian Reichel <sre@kernel.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-04-10Input: omap-keypad - fix error handling codeChristophe JAILLET
According to the previous error handling code, it is likely that 'goto err_free_keymap' is expected here in order to avoid a memory leak in error handling path. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-10Input: xpad - add support for Razer Wildcat gamepadCameron Gutman
Cc: stable@vger.kernel.org Signed-off-by: Cameron Gutman <aicommander@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-10Input: xpad - support some quirky Xbox One padsCameron Gutman
There are several quirky Xbox One pads that depend on initialization packets that the Microsoft pads don't require. To deal with these, I've added a mechanism for issuing device-specific initialization packets using a VID/PID-based quirks list. For the initial set of init quirks, I have added quirk handling from Valve's Steam Link xpad driver[0] and the 360Controller project[1] for macOS to enable some new pads to work properly. This should enable full functionality on the following quirky pads: 0x0e6f:0x0165 - Titanfall 2 gamepad (previously fully non-functional) 0x0f0d:0x0067 - Hori Horipad (analog sticks previously non-functional) 0x24c6:0x541a - PowerA Xbox One pad (previously fully non-functional) 0x24c6:0x542a - PowerA Xbox One pad (previously fully non-functional) 0x24c6:0x543a - PowerA Xbox One pad (previously fully non-functional) [0]: https://github.com/ValveSoftware/steamlink-sdk/blob/master/kernel/drivers/input/joystick/xpad.c [1]: https://github.com/360Controller/360Controller Signed-off-by: Cameron Gutman <aicommander@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-10Input: yealink - define packet offset __be16 instead of u16Martin Kepplinger
sparse says warning: incorrect type in assignment (different base types) expected unsigned short [unsigned] [usertype] offset got restricted __be16 [usertype] <noident> for every usage of cpu_to_be16 in yealink.c. Defining it __be16 in the first place shouldn't hurt. Signed-off-by: Martin Kepplinger <martin.kepplinger@ginzinger.com> Signed-off-by: Henk.Vergonet@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-10Input: turbografx - use setup_timerGeliang Tang
Use setup_timer() instead of init_timer() to simplify the code. Signed-off-by: Geliang Tang <geliangtang@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-10Input: locomokbd - use setup_timerGeliang Tang
Use setup_timer() instead of init_timer() to simplify the code. Signed-off-by: Geliang Tang <geliangtang@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-10Input: gameport - use setup_timerGeliang Tang
Use setup_timer() instead of init_timer() to simplify the code. Signed-off-by: Geliang Tang <geliangtang@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-10Input: db9 - use setup_timerGeliang Tang
Use setup_timer() instead of init_timer() to simplify the code. Signed-off-by: Geliang Tang <geliangtang@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-10Input: soc_button_array - properly map usage 0x07/0xe3 to KEY_LEFTMETAHans de Goede
When submitting the support for the ACPI0011 windows tablet keys device I mapped the "windows" logo homekey to KEY_HOMEPAGE. But this is inconsistent with how it is done on windows tablets using the old PNP0C40 ACPI device and it does not match the HUT spec, which says that usage-page 7 usage 0xe3 is "Keyboard Left GUI". This commit maps usage-page 7 usage 0xe3 to KEY_LEFTMETA fixing this. Fixes: 4c3362f44980 ("Input: soc_button_array - add support for ACPI 6.0...") Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-05Input: pm8xxx-vib - add support for pm8916's vibratorDamien Riegel
Add pm8xxx_regs for this PMIC and the device tree match table entry. Signed-off-by: Damien Riegel <damien.riegel@savoirfairelinux.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-05Input: pm8xxx-vib - handle separate enable registerDamien Riegel
Some PMIC vibrator IPs use a separate enable register to turn the vibrator on and off. To detect if a vibrator uses this feature, rely on the enable_mask being non-zero. Signed-off-by: Damien Riegel <damien.riegel@savoirfairelinux.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-05Input: pm8xxx-vib - parametrize the driverDamien Riegel
In order to prepare this driver to support other vibrators of the same kind, move some hardcoded values to a structure holding register parameters (address, mask, shit of the control register). Signed-off-by: Damien Riegel <damien.riegel@savoirfairelinux.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-05Input: pm8xxx-vib - reorder header alphabeticallyDamien Riegel
Signed-off-by: Damien Riegel <damien.riegel@savoirfairelinux.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-05Input: sur40 - fix bad endianness handling in sur40_pollMartin Kepplinger
sparse says: sur40.c:372:40: warning: restricted __le32 degrades to integer the header's data is __le32 so we need to convert it before comparing. Signed-off-by: Martin Kepplinger <martink@posteo.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-05Input: eeti_ts - switch to gpiod APIDmitry Torokhov
gpiod API allows standard way of specifying GPIO polarity and takes it into account when reading or setting GPIO state. It also allows us to switch to common way of obtaining GPIO descriptor and away form legacy platform data. Reviewed-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-05Input: eeti_ts - expect platform code to set interrupt triggerDmitry Torokhov
Instead of keying interrupt trigger off GPIO polarity, let's rely on platform code to set it up properly for us. Reviewed-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-03Input: eeti_ts - switch to using threaded interruptDmitry Torokhov
Instead of having standard interrupt handler and manually firing work item to perform I2C reads, let's switch to threaded interrupts, which were designed specifically for this purpose. Reviewed-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-03Input: eeti_ts - use gpio_get_value_cansleepDmitry Torokhov
We are reading GPIO state in a non-atomic context (workqueue), so we can use "cansleep" variant, and thus make the driver available on systems where GPIO controllers require sleeping when reading GPIO state. Reviewed-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-03Input: eeti_ts - respect interrupt set in client structureDmitry Torokhov
Instead of expecting that GPIO is always interrupt source, let's use interrupt specified in I2C client. Reviewed-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-03Input: eeti_ts - switch to using managed resourcesDmitry Torokhov
Using devm_* APIs simpifies error handling and device teardown. Reviewed-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-03Input: eeti_ts - use input_set_capability()Dmitry Torokhov
Use input_set_capability() instead of manipulating evbit/keybit masks directly. Reviewed-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-03Input: eeti_ts - use get_unaligned_be16() to retrieve dataDmitry Torokhov
Instead of manually converting big endian data on wire into host endianness, let's use helpers to do that for us. It might save us a few cycles if host endianness matches what's on wire. Reviewed-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-03Input: eeti_ts - use BIT(n)Dmitry Torokhov
Use idiomatic BIT(n) to form single-bit masks. Reviewed-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-03Input: eeti_ts - rename eeti_ts_priv to eeti_tsDmitry Torokhov
Also rename 'priv' variables to eeti. Reviewed-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-03Input: synaptics-rmi4 - when registering sensors do not call them "drivers"Dmitry Torokhov
We are not registering drivers, but transport devices (AKA sensors), so let's call them that. Also let's rename "retval" to "error" in probe() functions as the variables are used to store error codes. Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-03Input: synaptics-rmi4 - cleanup SMbus mapping handlingDmitry Torokhov
There is no reason to copy structures field-by-filed when we can copy elements at once. Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-03Input: synaptics-rmi4 - fix endianness issue in SMBus transportDmitry Torokhov
The mapping table holds address in LE form, so we should convert it to CPU when comparing it. Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-03Input: synaptics-rmi4 - fix handling failures from rmi_enable_sensorDmitry Torokhov
If rmi_enable_sensor() fails in rmi_driver_probe(), we should not return immediately, but disable IRQs and tear down function list. Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-03Input: synaptics - use u8 instead of unsigned charDmitry Torokhov
The rest of the kernel uses u8, u16, etc for data coming form hardware, let's switch ti using u8 here as well. Also turn pkt_type into an enum. Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-03Input: synaptics - do not abuse -1 as return valueDmitry Torokhov
Let's stop using -1 as a universal return value and instead propagate errors from underlying calls up the stack. Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-03Input: synaptics - use BIT() and GENMASK() macrosDmitry Torokhov
Use standard infrastructure, such as BIT and GENMASK, instead of rolling bitmasks by hand. Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-03Input: synaptics - add synaptics_query_int()Dmitry Torokhov
Factor out querying and parsing 3-byte response into an integer value. Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-03Input: psmouse - use i2c_client_type to locate i2c clientsDmitry Torokhov
Now that i2c_client_type structure is exported, we can use it, instead of i2c_adapter_type, when looking for devices that are i2c clients. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-03Merge tag 'v4.11-rc5' into nextDmitry Torokhov
Sync up with mainline to bring in changes to input subsystem merged through other trees.
2017-04-03Input: cros_ec_keyb - add an EC event for sysrqRajat Jain
Some form factors (detachables/tablets) may not have a keyboard and thus user may have to resort to using a defined EC UI to send sysrq(s) to the kernel in order to collect crash info etc. This UI typically is in the form of user pressing volume / power buttons in some specific sequence and for some specific time. Add a new EC event that allows EC to communicate the sysrq to the AP. (We're skipping event number 5 because it has been reserved for something else) Signed-off-by: Rajat Jain <rajatja@google.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-03Input: psmouse - fix cleaning up SMBus companionsDmitry Torokhov
When trying to destroy platform data after destruction of SMbus companion, we need to make sure that we are actually dealing with an SMB companion device, and not some random I2C client device. Fixes: 8eb92e5c9133 ("Input: psmouse - add support for SMBus companions") Reported-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Tested-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-01Input: bma150 - remove support for bma150H. Nikolaus Schaller
This essentially reverts commit baf28d91e7b1 ("Input: bma150 - avoid binding to bma180 if IIO bma180 driver present") and commit ef3714fdbc8d ("Input: bma150 - extend chip detection for bma180") Rationale: initially (2012) the GTA04 device using a bma180 chip simply referenced the bma150 platform driver in its board file [1] which happened to work in all scenarios that were tested. When conversion to DT started (2014), we needed to make the driver be still recognised. Hence we introduced the compatibility to the bma180 chip in Linux 3.15-rc5 [2] without further checks if it is really 100% compatible. This worked flawlessly for years with the GTA04 device. Recently (2016), Hans de Goede pointed out that the chips are not as similar as they appeared and the driver works with the bma180 for the GTA04 only by good luck. He proposed to remove the bma180 support completely [3], but we still did need it until we have a replacement. Thus, a conditional compile was added. We have now developed a generic iio-input-bridge which works with any 2 or 3 axis iio based accelerometer. It has been tested on GTA04 and Pyra and works as expected. Therefore we can remove the bma180 support from this driver completely. User-space API compatibility can be restored by using the iio-input-bridge. Maybe it is time to convert the bma150 driver to iio as well and retire the accelerometer input drivers completely but this is a different story and task. [1]: https://github.com/neilbrown/linux/blob/gta04/3.2.y/arch/arm/mach-omap2/board-omap3gta04.c#L976 [2]: https://patchwork.kernel.org/patch/3961171/ [3]: https://patchwork.kernel.org/patch/9325481/ Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-03-29Input: max11801_ts - add missing of_match_tableJagan Teki
Added missing of_match_table for max11801_ts driver with compatible as "maxim,max11801_ts" Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-03-29Input: matrix_keypad - add option to drive inactive columnsDavid Rivshin
The gpio-matrix-keypad driver normally sets inactive columns as inputs while scanning. This does not work for all hardware, which may require the inactive columns to be actively driven in order to overcome any pull-ups/downs on the columns. Signed-off-by: David Rivshin <drivshin@allworx.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-03-29Input: melfas_mip4 - ensure that device is presentDmitry Torokhov
Try a quick read from the device in mip4_query_device() to make sure that the device is there, as we do not consider failures to retrieve product name or resolution fatal. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-03-27Merge 4.11-rc4 into char-misc-nextGreg Kroah-Hartman
We want the char-misc fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-25Input: ads7846 - avoid pen up/down when reading hwmonDavid Jander
Each time the HWMON devices are read (e.g. battery voltage) while the touchscreen is held pressed, extra pen-up and pen-down events are generated. This is fixed by avoiding the UP event when the touchscreen is stopped. Signed-off-by: David Jander <david@protonic.nl> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-03-25Input: synaptics - add support for Intertouch devicesBenjamin Tissoires
Most of the Synaptics devices are connected through PS/2 and a different bus (SMBus or HID over I2C). The secondary bus capability is indicated by the InterTouch bit in extended capability 0x0C. We only enable the InterTouch device to be created for the laptops registered with the top software button property or those we know that are functional. In the future, we might change the default to always rely on the InterTouch bus. Currently, users can enable/disable the feature with the psmouse parameter synaptics_intertouch. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-03-25Input: synaptics - split device info into a separate structureDmitry Torokhov
In preparation for SMBus/Intertouch device support, move static device information that we query form the touchpad upon initialization into separate structure. This will allow us to query the device without allocating memory first. Also stop using "unsigned long", everything fits into 32 bit chunks. Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-03-25Input: psmouse - add support for SMBus companionsBenjamin Tissoires
This provides glue between PS/2 devices that enumerate the RMI4 devices and Elan touchpads to the RMI4 (or Elan) SMBus driver. The SMBus devices keep their PS/2 connection alive. If the initialization process goes too far (psmouse_activate called), the device disconnects from the I2C bus and stays on the PS/2 bus, that is why we explicitly disable PS/2 device reporting (by calling psmouse_deactivate) before trying to register SMBus companion device. The HID over I2C devices are enumerated through the ACPI DSDT, and their PS/2 device also exports the InterTouch bit in the extended capability 0x0C. However, the firmware keeps its I2C connection open even after going further in the PS/2 initialization. We don't need to take extra precautions with those device, especially because they block their PS/2 communication when HID over I2C is used. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-03-25Input: psmouse - introduce notion of SMBus companionsDmitry Torokhov
Prepare PS/2 mouse drivers to work with devices that are accessible both via PS/2 and SMBus, which provides higher bandwidth, and thus suits better for modern multi-touch devices. We expect that SMBus drivers will take control over the device, so when we detect SMBus "protocol" we forego registering input device, or enabling PS/2 device reports (as it usually makes device unresponsive to access over SMBus). Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>