aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-10-09Input: pixcir_i2c_ts - remove platform dataDmitry Torokhov1-75/+25
Previous change moved platform data definition into the driver, making it unusable for users. Given that we want to move away from custom platform data structures, and always use device properties (DT, ACPI or static) to configure devices, let's complete the removal. Tested-by: Fabio Estevam <festevam@gmail.com> Tested-by: Michal Vokáč <michal.vokac@ysoft.com> Reviewed-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-10-09Input: pixcir_i2c_ts - do not print error on defer probeFabio Estevam1-2/+6
In the case of defer probe we should not print an error message. This also aligns with how defer probe is handled in the other GPIOs used by this driver. Signed-off-by: Fabio Estevam <festevam@gmail.com> Reviewed-by: Roger Quadros <rogerq@ti.com> Tested-by: Michal Vokáč <michal.vokac@ysoft.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-10-09Input: pixcir_i2c_ts - print register address in decimalFabio Estevam1-6/+6
The pixcir datasheet lists the registers addresses in decimal and so are PIXCIR_REG_POWER_MODE and PIXCIR_REG_INT_MODE defined in decimal. Change the error messages to print the register addresses in decimal instead of hexadecimal for better readability. Signed-off-by: Fabio Estevam <festevam@gmail.com> Reviewed-by: Roger Quadros <rogerq@ti.com> Tested-by: Michal Vokáč <michal.vokac@ysoft.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-10-09Input: pixcir_i2c_ts - keep header files sortedFabio Estevam1-5/+5
Keep the header files in alphabetical order to keep it more organized. Signed-off-by: Fabio Estevam <festevam@gmail.com> Reviewed-by: Roger Quadros <rogerq@ti.com> Tested-by: Michal Vokáč <michal.vokac@ysoft.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-10-09Input: pixcir_i2c_ts - move definitions into a single fileFabio Estevam1-1/+59
All the defined symbols from linux/platform_data/pixcir_i2c_ts.h are only used by the pixcir_i2c_ts driver, so move all the definitions locally and get rid of the pixcir_i2c_ts.h file. Signed-off-by: Fabio Estevam <festevam@gmail.com> Reviewed-by: Roger Quadros <rogerq@ti.com> Tested-by: Michal Vokáč <michal.vokac@ysoft.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-10-09Input: pixcir_i2c_ts - remove unneeded gpio.h header fileFabio Estevam1-1/+0
The touchscreen device is a GPIO consumer, not a GPIO controller, so there is no need to include <linux/gpio.h>. Remove the unneeded header file. Signed-off-by: Fabio Estevam <festevam@gmail.com> Reviewed-by: Roger Quadros <rogerq@ti.com> Tested-by: Michal Vokáč <michal.vokac@ysoft.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-10-04Input: gpio_mouse - switch to using input device polling modeDmitry Torokhov2-26/+20
Now that instances of input_dev support polling mode natively, we no longer need to create input_polled_dev instance. Acked-by: Hans-Christian Noren Egtvedt <egtvedt@samfundet.no> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-10-04Input: add input_get_poll_interval()Dmitry Torokhov1-0/+9
Some drivers need to be able to know the current polling interval for devices working in polling mode, let's allow them fetching it. Acked-By: Benjamin Tissoires <benjamin.tissoires@redhat.com> Tested-by: Michal Vokáč <michal.vokac@ysoft.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-10-02Input: atmel_mxt_ts - disable IRQ across suspendEvan Green1-0/+4
Across suspend and resume, we are seeing error messages like the following: atmel_mxt_ts i2c-PRP0001:00: __mxt_read_reg: i2c transfer failed (-121) atmel_mxt_ts i2c-PRP0001:00: Failed to read T44 and T5 (-121) This occurs because the driver leaves its IRQ enabled. Upon resume, there is an IRQ pending, but the interrupt is serviced before both the driver and the underlying I2C bus have been resumed. This causes EREMOTEIO errors. Disable the IRQ in suspend, and re-enable it on resume. If there are cases where the driver enters suspend with interrupts disabled, that's a bug we should fix separately. Signed-off-by: Evan Green <evgreen@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-09-05Input: sidewinder - make array seq static const, makes object smallerColin Ian King1-1/+1
Don't populate the array seq on the stack but instead make it static const. Makes the object code smaller by 30 bytes. Before: text data bss dec hex filename 22284 3184 0 25468 637c drivers/input/joystick/sidewinder.o After: text data bss dec hex filename 22158 3280 0 25438 635e drivers/input/joystick/sidewinder.o (gcc version 9.2.1, amd64) Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-09-05Input: reset device timestamp on syncDmitry Torokhov1-0/+7
We need to reset input device's timestamp on input_sync(), otherwise drivers not using input_set_timestamp() will end up with a stale timestamp after their clients consume first input event. Fixes: 3b51c44bd693 ("Input: allow drivers specify timestamp for input events") Reported-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-09-02Input: bu21013_ts - switch to using standard touchscreen propertiesDmitry Torokhov1-21/+33
This switches the driver over to the standard touchscreen properties for coordinate transformation, while keeping old bindings working as well. Tested-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-09-02Input: bu21013_ts - switch to using MT-B (slotted) protocolDmitry Torokhov1-37/+43
MT-B protocol is more efficient and everyone expects it. We use in-kernel tracking to identify contacts. Tested-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-09-02Input: bu21013_ts - fix suspend when wake sourceDmitry Torokhov1-24/+24
If the touchscreen is configured as wakeup source we should not be cutting off power to it. Also, now that the driver relies on I2C client to supply IRQ, we do not need to explicitly enable and disable IRQ for wakeup: if device is created as wakeup source, I2C core will mark interrupt as wakeup one. Tested-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-09-02Input: bu21013_ts - use interrupt from I2C clientDmitry Torokhov1-16/+19
Instead of trying to map INT GPIO to interrupt, let's use one supplied by I2C client. If there is none - bail. This will also allow us to treat INT GPIO as optional, as per the binding. Tested-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-09-02Input: bu21013_ts - remove support for platform dataDmitry Torokhov1-72/+37
There are no current users of the platform data in the tree, and any new users should either use device tree, or static device properties to describe the device. This change drop the platform data definition and handling and moves the driver over to generic device properties API. We also drop support for the external clock. If it is needed we will have to extend the bindings to supply the clock reference and handle it properly in the driver. Also, wakeup setting should be coming from I2C client. Tested-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-09-02Input: bu21013_ts - convert to using managed resourcesDmitry Torokhov1-98/+84
This allows trimming error unwinding and device removal handling. Tested-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-09-02Input: bu21013_ts - remove useless commentsDmitry Torokhov1-59/+2
The comments for individual functions in the driver do not provide any additional information beyond what function names indicate. Tested-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-09-02Input: bu21013_ts - annotate supend/resume methods as __maybe_unusedDmitry Torokhov1-10/+3
Instead if #ifdef-ing out suspend and resume methods, let's mark them as __maybe_unused to get better compile time coverage. Tested-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-09-02Input: bu21013_ts - rename some variablesDmitry Torokhov1-186/+190
"bu21013_data" and "struct bu21013_ts_data" are a tad long, let's call them "ts" and "struct bu21013_ts". Also rename retval to error in bu21013_init_chip() and adjust formatting; i2c_smbus_write_byte_data() returns negative on error and 0 on success, so we simply test if whether erro is 0 or not. Tested-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-09-02Input: bu21013_ts - convert to use GPIO descriptorsLinus Walleij1-48/+38
This driver can use GPIO descriptors rather than GPIO numbers without any problems, convert it. Name the field variables after the actual pins on the chip rather than the "reset" and "touch" names from the devicetree bindings that are vaguely inaccurate. No in-tree users pass GPIO numbers in platform data so drop this. Descriptor tables can be used to get these GPIOs from a board file if need be. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-08-29Input: i8042 - enable wakeup on a stable struct deviceStephen Boyd1-11/+14
We don't know when the device will be added with device_add() in serio_add_port() because serio_add_port() is called from a workqueue that this driver schedules by calling serio_register_port(). The best we can know is that the device will definitely not have been added yet when the start callback is called on the serio device. While it hasn't been shown to be a problem, proactively move the wakeup enabling calls to the start hook so that we don't race with the workqueue calling device_add(). This will avoid racy situations where code tries to add wakeup sysfs attributes for this device from dpm_sysfs_add() but the path in device_set_wakeup_capable() has already done so. Signed-off-by: Stephen Boyd <swboyd@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-08-20Input: soc_button_array - use platform_device_register_resndata()Enrico Weigelt1-14/+8
The registration of gpio-keys device can be written much shorter by using the platform_device_register_resndata() helper. Signed-off-by: Enrico Weigelt <info@metux.net> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-08-20Input: psmouse - drop all unneeded functions from mouse headersHui Wang11-114/+8
Recently we had a building error if we enable the MOUSE_PS2_ALPS while disable the MOUSE_PS2_TRACKPOINT, and was fixed by 49e6979e7e92 ("Input: psmouse - fix build error of multiple definition"). We could improve that fix by dropping all unneeded functions and CONFIG_MOUSE_ guards from the header, it is safe to do that since those functions are not directly called by psmouse-base.c anymore. Signed-off-by: Hui Wang <hui.wang@canonical.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-08-20Input: add support for polling to input devicesDmitry Torokhov4-8/+261
Separating "normal" and "polled" input devices was a mistake, as often we want to allow the very same device work on both interrupt-driven and polled mode, depending on the board on which the device is used. This introduces new APIs: - input_setup_polling - input_set_poll_interval - input_set_min_poll_interval - input_set_max_poll_interval These new APIs allow switching an input device into polled mode with sysfs attributes matching drivers using input_polled_dev APIs that will be eventually removed. Tested-by: Michal Vokáč <michal.vokac@ysoft.com> Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-08-20Input: wacom_w8001 - allocate additional space for 'phys'Jason Gerecke1-1/+3
GCC warns that the output of our call to 'snprintf' in 'w8001_connect' may be truncated since both 'serio->phys' and 'w8001->phys' are 32 bytes in length. Increase the amount of space allocated for the latter to compensate. Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-08-16Input: cros_ec_keyb - add back missing mask for event_typeFei Shao1-2/+4
In the previous patch we didn't mask out event_type in case statement, so switches are always picked instead of buttons, which results in ChromeOS devices misbehaving when power button is pressed. This patch adds back the missing mask. Fixes: d096aa3eb604 ("Input: cros_ec_keyb: mask out extra flags in event_type") Signed-off-by: Fei Shao <fshao@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-08-14Input: remove dev_err() usage after platform_get_irq()Stephen Boyd37-142/+44
We don't need dev_err() messages when platform_get_irq() fails now that platform_get_irq() prints an error message itself when something goes wrong. Let's remove these prints with a simple semantic patch. // <smpl> @@ expression ret; struct platform_device *E; @@ ret = ( platform_get_irq(E, ...) | platform_get_irq_byname(E, ...) ); if ( \( ret < 0 \| ret <= 0 \) ) { ( -if (ret != -EPROBE_DEFER) -{ ... -dev_err(...); -... } | ... -dev_err(...); ) ... } // </smpl> While we're here, remove braces on if statements that only have one statement (manually). Signed-off-by: Stephen Boyd <swboyd@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-08-12Input: applespi - no need to check return value of debugfs_create functionsGreg Kroah-Hartman1-24/+6
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-08-12Input: edt-ft5x06 - no need to check return value of debugfs_create functionsGreg Kroah-Hartman1-2/+0
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-08-12Input: matrix-keymap - switch to use device_property_count_u32()Andy Shevchenko1-1/+1
Use use device_property_count_u32() directly, that makes code neater. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-08-12Input: atmel_mxt_ts - switch to use device_property_count_u32()Andy Shevchenko1-2/+1
Use use device_property_count_u32() directly, that makes code neater. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-08-12Input: hideep - switch to use device_property_count_u32()Andy Shevchenko1-2/+1
Use use device_property_count_u32() directly, that makes code neater. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-08-12Input: mpr121 - switch to use device_property_count_u32()Andy Shevchenko1-2/+1
Use use device_property_count_u32() directly, that makes code neater. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-08-12Input: axp20x-pek - convert driver to use dev_groupsGreg Kroah-Hartman1-12/+3
Drivers now have the option to have the driver core create and remove any needed sysfs attribute files. So take advantage of that and do not register "by hand" a sysfs group of attributes. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-08-12Input: gpio_keys - convert driver to use dev_groupsGreg Kroah-Hartman1-11/+2
Drivers now have the option to have the driver core create and remove any needed sysfs attribute files. So take advantage of that and do not register "by hand" a bunch of sysfs files. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-08-11Merge tag 'v5.3-rc4' into nextDmitry Torokhov13-53/+65
Sync up with mainline to bring in device_property_count_u32 andother newer APIs.
2019-08-09Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/inputLinus Torvalds7-44/+56
Pull input updates from Dmitry Torokhov: - newer systems with Elan touchpads will be switched over to SMBus - HP Spectre X360 will be using SMbus/RMI4 - checks for invalid USB descriptors in kbtab and iforce - build fixes for applespi driver (misconfigs) * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: iforce - add sanity checks Input: applespi - use struct_size() helper Input: kbtab - sanity check for endpoint type Input: usbtouchscreen - initialize PM mutex before using it Input: applespi - add dependency on LEDS_CLASS Input: synaptics - enable RMI mode for HP Spectre X360 Input: elantech - annotate fall-through case in elantech_use_host_notify() Input: elantech - enable SMBus on new (2018+) systems Input: applespi - fix trivial typo in struct description Input: applespi - select CRC16 module Input: applespi - fix warnings detected by sparse
2019-08-09Input: remove w90x900 touchscreen driverArnd Bergmann3-341/+0
The ARM w90x900 platform is getting removed, so this driver is obsolete. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-08-09Input: remove w90x900 keyboard driverArnd Bergmann3-276/+0
The ARM w90x900 platform is getting removed, so this driver is obsolete. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-08-09Input: synaptics - fix a typoChristophe JAILLET1-1/+1
This should be 'synaptics', not 'synpatics' Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-08-09Input: ads7846 - add support for general touchscreen bindingsMarco Felsch1-8/+30
A few vendor specific bindings are now covered by common bindings. Let the driver parse the common bindings to make use of common inverting and swapping mechnism. Aslo make use of touchscreen_report_pos() to ensure the correct inverting-swapping order. The vendor specific properties are used as default (backward compatibility) and gets overwritten by common bindings. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-08-06Input: iforce - add sanity checksOliver Neukum1-0/+5
The endpoint type should also be checked before a device is accepted. Reported-by: syzbot+5efc10c005014d061a74@syzkaller.appspotmail.com Signed-off-by: Oliver Neukum <oneukum@suse.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-08-06Input: applespi - use struct_size() helperGustavo A. R. Silva1-2/+1
One of the more common cases of allocation size calculations is finding the size of a structure that has a zero-sized array at the end, along with memory for some number of elements for that array. For example: struct touchpad_protocol { ... struct tp_finger fingers[0]; }; Make use of the struct_size() helper instead of an open-coded version in order to avoid any potential type mistakes. So, replace the following form: sizeof(*tp) + tp->number_of_fingers * sizeof(tp->fingers[0]); with: struct_size(tp, fingers, tp->number_of_fingers) This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-08-01Input: kbtab - sanity check for endpoint typeOliver Neukum1-2/+4
The driver should check whether the endpoint it uses has the correct type. Reported-by: syzbot+c7df50363aaff50aa363@syzkaller.appspotmail.com Signed-off-by: Oliver Neukum <oneukum@suse.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-08-01Input: usbtouchscreen - initialize PM mutex before using itOliver Neukum1-0/+2
Mutexes shall be initialized before they are used. Fixes: 12e510dbc57b2 ("Input: usbtouchscreen - fix deadlock in autosuspend") Reported-by: syzbot+199ea16c7f26418b4365@syzkaller.appspotmail.com Signed-off-by: Oliver Neukum <oneukum@suse.com> Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-07-31Input: applespi - add dependency on LEDS_CLASSYueHaibing1-0/+1
If applespi is enabled, but LEDs class support is not, the build fails: drivers/input/keyboard/applespi.o: In function `applespi_probe': applespi.c:(.text+0x1fcd): undefined reference to `devm_led_classdev_register_ext' Add "depends on LEDS_CLASS" to the Konfig Reported-by: Hulk Robot <hulkci@huawei.com> Fixes: 038b1a05eae6 ("Input: add Apple SPI keyboard and trackpad driver") Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-07-28Input: soc_button_array - add support for newer surface devicesMaximilian Luz2-15/+96
Power and volume button support for 5th and 6th generation Microsoft Surface devices via soc_button_array. Note that these devices use the same MSHW0040 device as on the Surface Pro 4, however the implementation is different (GPIOs vs. ACPI notifications). Thus some checking is required to ensure we only load this driver on the correct devices. Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-07-25Input: synaptics - enable RMI mode for HP Spectre X360Dmitry Torokhov1-0/+1
The 2016 kabylake HP Spectre X360 (model number 13-w013dx) works much better with psmouse.synaptics_intertouch=1 kernel parameter, so let's enable RMI4 mode automatically. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204115 Reported-by: Nate Graham <pointedstick@zoho.com> Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-07-25Input: allow drivers specify timestamp for input eventsAtif Niyaz2-27/+48
Currently, evdev stamps events with timestamps acquired in evdev_events() However, this timestamping may not be accurate in terms of measuring when the actual event happened. Let's allow individual drivers specify timestamp in order to provide a more accurate sense of time for the event. It is expected that drivers will set the timestamp in their hard interrupt routine. Signed-off-by: Atif Niyaz <atifniyaz@google.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>