summaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen/atmel_mxt_ts.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'input-for-v6.8-rc0' of ↵Linus Torvalds2024-01-181-12/+9
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input updates from Dmitry Torokhov: - a new driver for Adafruit Seesaw gamepad device - Zforce touchscreen will handle standard device properties for axis swap/inversion - handling of advanced sensitivity settings in Microchip CAP11xx capacitive sensor driver - more drivers have been converted to use newer gpiod API - support for dedicated wakeup IRQs in gpio-keys dirver - support for slider gestures and OTP variants in iqs269a driver - atkbd will report keyboard version as 0xab83 in cases when GET ID command was skipped (to deal with problematic firmware on newer laptops), restoring the previous behavior - other assorted cleanups and changes * tag 'input-for-v6.8-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (44 commits) Input: atkbd - use ab83 as id when skipping the getid command Input: driver for Adafruit Seesaw Gamepad dt-bindings: input: bindings for Adafruit Seesaw Gamepad Input: da9063_onkey - avoid explicitly setting input's parent Input: da9063_onkey - avoid using OF-specific APIs Input: iqs269a - add support for OTP variants dt-bindings: input: iqs269a: Add bindings for OTP variants Input: iqs269a - add support for slider gestures dt-bindings: input: iqs269a: Add bindings for slider gestures Input: gpio-keys - filter gpio_keys -EPROBE_DEFER error messages Input: zforce_ts - accept standard touchscreen properties dt-bindings: touchscreen: neonode,zforce: Use standard properties dt-bindings: touchscreen: convert neonode,zforce to json-schema dt-bindings: input: convert drv266x to json-schema Input: da9063 - use dev_err_probe() Input: da9063 - drop redundant prints in probe() Input: da9063 - simplify obtaining OF match data Input: as5011 - convert to GPIO descriptor Input: omap-keypad - drop optional GPIO support Input: tca6416-keypad - drop unused include ...
| * Input: touchscreen - use sysfs_emit[_at]() instead of scnprintf()ye xingchen2023-12-131-12/+9
| | | | | | | | | | | | | | | | | | | | | | Follow the advice of the Documentation/filesystems/sysfs.rst and show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Oliver Graute <oliver.graute@kococonnector.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* | media: videobuf2: core: Rename min_buffers_needed field in vb2_queueBenjamin Gaignard2023-12-131-1/+1
|/ | | | | | | | | | | | Rename min_buffers_needed into min_queued_buffers and update the documentation about it. Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [hverkuil: Drop the change where min_queued_buffers + 1 buffers would be] [hverkuil: allocated. Now this patch only renames this field instead of making] [hverkuil: a functional change as well.] [hverkuil: Renamed 3 remaining min_buffers_needed occurrences.]
* Input: Switch i2c drivers back to use .probe()Uwe Kleine-König2023-05-171-1/+1
| | | | | | | | | | | | After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20230517164645.162294-1-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: atmel_mxt_ts - support capacitive keysAndré Apitzsch2023-05-011-0/+85
| | | | | | | | | | | Add support for touch keys found in some Atmel touch controller configurations. Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: André Apitzsch <git@apitzsch.eu> Link: https://lore.kernel.org/r/20230407-atmel_keys-v2-2-92446a4343cb@apitzsch.eu Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: atmel_mxt_ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()Jonathan Cameron2023-01-091-4/+4
| | | | | | | | | | | | | | | | | SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Nicolas Ferre <nicolas.ferre@microchip.com> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com> Cc: Claudiu Beznea <claudiu.beznea@microchip.com> Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20230102181842.718010-34-jic23@kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: atmel_mxt_ts - Convert to i2c's .probe_new()Uwe Kleine-König2022-12-021-2/+2
| | | | | | | | | The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20221118224540.619276-228-uwe@kleine-koenig.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: move from strlcpy with unused retval to strscpyWolfram Sang2022-08-181-4/+4
| | | | | | | | | | Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Link: https://lore.kernel.org/r/20220818210022.6865-1-wsa+renesas@sang-engineering.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* i2c: Make remove callback return voidUwe Kleine-König2022-08-161-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The value returned by an i2c driver's remove function is mostly ignored. (Only an error message is printed if the value is non-zero that the error is ignored.) So change the prototype of the remove function to return no value. This way driver authors are not tempted to assume that passing an error to the upper layer is a good idea. All drivers are adapted accordingly. There is no intended change of behaviour, all callbacks were prepared to return 0 before. Reviewed-by: Peter Senna Tschudin <peter.senna@gmail.com> Reviewed-by: Jeremy Kerr <jk@codeconstruct.com.au> Reviewed-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Reviewed-by: Crt Mori <cmo@melexis.com> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Marek Behún <kabel@kernel.org> # for leds-turris-omnia Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Petr Machata <petrm@nvidia.com> # for mlxsw Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com> # for surface3_power Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> # for bmc150-accel-i2c + kxcjk-1013 Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> # for media/* + staging/media/* Acked-by: Miguel Ojeda <ojeda@kernel.org> # for auxdisplay/ht16k33 + auxdisplay/lcd2s Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com> # for versaclock5 Reviewed-by: Ajay Gupta <ajayg@nvidia.com> # for ucsi_ccg Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> # for iio Acked-by: Peter Rosin <peda@axentia.se> # for i2c-mux-*, max9860 Acked-by: Adrien Grassein <adrien.grassein@gmail.com> # for lontium-lt8912b Reviewed-by: Jean Delvare <jdelvare@suse.de> # for hwmon, i2c-core and i2c/muxes Acked-by: Corey Minyard <cminyard@mvista.com> # for IPMI Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com> # for drivers/power Acked-by: Krzysztof Hałasa <khalasa@piap.pl> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Wolfram Sang <wsa@kernel.org>
* Input: atmel_mxt_ts - fix double free in mxt_read_info_blockJosé Expósito2021-12-121-1/+1
| | | | | | | | | | | | | | The "id_buf" buffer is stored in "data->raw_info_block" and freed by "mxt_free_object_table" in case of error. Return instead of jumping to avoid a double free. Addresses-Coverity-ID: 1474582 ("Double free") Fixes: 068bdb67ef74 ("Input: atmel_mxt_ts - fix the firmware update") Signed-off-by: José Expósito <jose.exposito89@gmail.com> Link: https://lore.kernel.org/r/20211212194257.68879-1-jose.exposito89@gmail.com Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: move to use request_irq by IRQF_NO_AUTOEN flagBarry Song2021-03-251-3/+2
| | | | | | | | | | | | | | | | disable_irq() after request_irq() still has a time gap in which interrupts can come. request_irq() with IRQF_NO_AUTOEN flag will disable IRQ auto-enable because of requesting. On the other hand, request_irq() after setting IRQ_NOAUTOEN as below irq_set_status_flags(irq, IRQ_NOAUTOEN); request_irq(dev, irq...); can also be replaced by request_irq() with IRQF_NO_AUTOEN flag. Signed-off-by: Barry Song <song.bao.hua@hisilicon.com> Link: https://lore.kernel.org/r/20210302224916.13980-3-song.bao.hua@hisilicon.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: atmel_mxt_ts - support wakeup methodsDmitry Osipenko2021-03-201-0/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | According to datasheets, chips like mXT1386 have a WAKE line, it is used to wake the chip up from deep sleep mode before communicating with it via the I2C-compatible interface. If the WAKE line is connected to a GPIO line, the line must be asserted 25 ms before the host attempts to communicate with the controller. If the WAKE line is connected to the SCL pin, the controller will send a NACK on the first attempt to address it, the host must then retry 25 ms later. Implement the wake-up methods in the driver. Touchscreen now works properly on devices like Acer A500 tablet, fixing problems like this: atmel_mxt_ts 0-004c: __mxt_read_reg: i2c transfer failed (-121) atmel_mxt_ts 0-004c: mxt_bootloader_read: i2c recv failed (-121) atmel_mxt_ts 0-004c: Trying alternate bootloader address atmel_mxt_ts 0-004c: mxt_bootloader_read: i2c recv failed (-121) atmel_mxt_ts: probe of 0-004c failed with error -121 Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jiada Wang <jiada_wang@mentor.com> Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Link: https://lore.kernel.org/r/20210302102158.10533-3-digetx@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Merge branch 'next' into for-linusDmitry Torokhov2020-12-141-12/+44
|\ | | | | | | Prepare input updates for 5.11 merge window.
| * Input: atmel_mxt_ts - simplify the return expression of ↵Zheng Yongjun2020-12-101-6/+1
| | | | | | | | | | | | | | | | | | mxt_send_bootloader_cmd() Simplify the return expression. Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com> Link: https://lore.kernel.org/r/20201210135943.1612-1-zhengyongjun3@huawei.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
| * Input: use input_device_enabled()Andrzej Pietrasiewicz2020-12-021-2/+2
| | | | | | | | | | | | | | | | Use the newly added helper in relevant input drivers. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com> Link: https://lore.kernel.org/r/20200608112211.12125-3-andrzej.p@collabora.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
| * Input: atmel_mxt_ts - support regulator suppliesLinus Walleij2020-11-171-1/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the code for the Atmel touchscreens such as mXT224 to obtain power regulators for the supply voltages AVDD and VDD. On mobile phones such as Samsung GT-I8190 (Golden) this is needed to explicitly bring power online. We just enable the regulators at probe() and disable them at remove() or in the error path for now. As regulators are naturally stubbed if not available, this should have no impact on existing systems. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20201104153032.1387747-3-linus.walleij@linaro.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
| * Input: atmel_mxt_ts - fix up inverted RESET handlerLinus Walleij2020-11-171-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This driver uses GPIO descriptors to drive the touchscreen RESET line. In the existing device trees this has in conflict with intution been flagged as GPIO_ACTIVE_HIGH and the driver then applies the reverse action by driving the line low (setting to 0) to enter reset state and driving the line high (setting to 1) to get out of reset state. The correct way to handle active low GPIO lines is to provide the GPIO_ACTIVE_LOW in the device tree (thus properly describing the hardware) and letting the GPIO framework invert the assertion (driving high) to a low level and vice versa. This is considered a bug since the device trees are incorrectly mis-specifying the line as active high. Fix the driver and all device trees specifying a reset line. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Philippe Schenker <philippe.schenker@toradex.com> Acked-by: Krzysztof Kozlowski <krzk@kernel.org> Link: https://lore.kernel.org/r/20201104153032.1387747-1-linus.walleij@linaro.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
| * treewide: Use fallthrough pseudo-keywordGustavo A. R. Silva2020-08-231-1/+1
| | | | | | | | | | | | | | | | | | | | Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary fall-through markings when it is the case. [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
* | Input: atmel_mxt_ts - fix lost interruptsLinus Walleij2020-12-011-2/+2
|/ | | | | | | | | | | | | | | | | | | | | | After commit 74d905d2d38a devices requiring the workaround for edge triggered interrupts stopped working. The hardware needs the quirk to be used before even proceeding to check if the quirk is needed because mxt_acquire_irq() is called before mxt_check_retrigen() is called and at this point pending IRQs need to be checked, and if the workaround is not active, all interrupts will be lost from this point. Solve this by switching the calls around. Reported-by: Andre Müller <andre.muller@web.de> Tested-by: Andre Müller <andre.muller@web.de> Suggested-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Fixes: 74d905d2d38a ("Input: atmel_mxt_ts - only read messages in mxt_acquire_irq() when necessary") Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20201201123026.1416743-1-linus.walleij@linaro.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: atmel_mxt_ts - only read messages in mxt_acquire_irq() when necessaryNick Dyer2020-07-281-3/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The workaround of reading all messages until an invalid is received is a way of forcing the CHG line high, which means that when using edge-triggered interrupts the interrupt can be acquired. With level-triggered interrupts the workaround is unnecessary. Also, most recent maXTouch chips have a feature called RETRIGEN which, when enabled, reasserts the interrupt line every cycle if there are messages waiting. This also makes the workaround unnecessary. Note: the RETRIGEN feature is only in some firmware versions/chips, it's not valid simply to enable the bit. Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk> Acked-by: Benson Leung <bleung@chromium.org> Acked-by: Yufeng Shen <miletus@chromium.org> (cherry picked from ndyer/linux/for-upstream commit 1ae4e8281e491b22442cd5acdfca1862555f8ecb) [gdavis: Fix conflicts due to v4.6-rc7 commit eb43335c4095 ("Input: atmel_mxt_ts - use mxt_acquire_irq in mxt_soft_reset").] Signed-off-by: George G. Davis <george_davis@mentor.com> [jiada: reset use_retrigen_workaround at beginning of mxt_check_retrigen() call mxt_check_retrigen() after mxt_acquire_irq() in mxt_initialize() replace white-spaces with tab for MXT_COMMS_RETRIGEN Changed to check if IRQ is level type] Signed-off-by: Jiada Wang <jiada_wang@mentor.com> Link: https://lore.kernel.org/r/20200727151637.23810-1-jiada_wang@mentor.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: introduce input_mt_report_slot_inactive()Jiada Wang2020-05-121-4/+3
| | | | | | | | | | | input_mt_report_slot_state() ignores "tool" argument when the slot is closed, which has caused a bit of confusion. Let's introduce input_mt_report_slot_inactive() to report inactive slot state. Suggested-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Jiada Wang <jiada_wang@mentor.com> Link: https://lore.kernel.org/r/20200508055656.96389-2-jiada_wang@mentor.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: atmel_mxt_ts - disable IRQ across suspendEvan Green2019-10-021-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>
* Input: atmel_mxt_ts - switch to use device_property_count_u32()Andy Shevchenko2019-08-121-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>
* Merge branch 'for-linus' of ↵Linus Torvalds2019-07-131-11/+12
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input updates from Dmitry Torokhov: - an update to Elan touchpad SMBus driver to fetch device parameters (size, resolution) while it is still in PS/2 mode, before switching over to SMBus, as in that mode some devices return garbage dimensions - update to iforce joystick driver - miscellaneous driver fixes * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (48 commits) Input: gpio_keys_polled - allow specifying name of input device Input: edt-ft5x06 - simplify event reporting code Input: max77650-onkey - add MODULE_ALIAS() Input: atmel_mxt_ts - fix leak in mxt_update_cfg() Input: synaptics - enable SMBUS on T480 thinkpad trackpad Input: atmel_mxt_ts - fix -Wunused-const-variable Input: joydev - extend absolute mouse detection HID: quirks: Refactor ELAN 400 and 401 handling Input: elan_i2c - export the device id whitelist Input: edt-ft5x06 - use get_unaligned_be16() Input: iforce - add the Saitek R440 Force Wheel Input: iforce - use unaligned accessors, where appropriate Input: iforce - drop couple of temps from transport code Input: iforce - drop bus type from iforce structure Input: iforce - use DMA-safe buffores for USB transfers Input: iforce - allow callers supply data buffer when fetching device IDs Input: iforce - only call iforce_process_packet() if initialized Input: iforce - signal command completion from transport code Input: iforce - do not combine arguments for iforce_process_packet() Input: iforce - factor out hat handling when parsing packets ...
| * Merge branch 'next' into for-linusDmitry Torokhov2019-07-101-10/+10
| |\ | | | | | | | | | Prepare input updates for 5.3 merge window.
| | * Input: atmel_mxt_ts - fix -Wunused-const-variableNathan Huckleberry2019-07-011-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clang produces the following warning drivers/input/touchscreen/atmel_mxt_ts.c:259:42: warning: unused variable 'mxt_video_fops' [-Wunused-const-variable] static const struct v4l2_file_operations mxt_video_fops = { Since mxt_video_fops is only used inside an ifdef. It should be moved inside the ifdef. Link: https://github.com/ClangBuiltLinux/linux/issues/527 Signed-off-by: Nathan Huckleberry <nhuck@google.com> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
| * | Input: atmel_mxt_ts - fix leak in mxt_update_cfg()Ian Ray2019-07-051-1/+2
| |/ | | | | | | | | | | | | | | Fix leak (whose magnitude is the configuration file size) when the CRCs match in mxt_update_cfg(). Signed-off-by: Ian Ray <ian.ray@ge.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* / treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152Thomas Gleixner2019-05-301-6/+1
|/ | | | | | | | | | | | | | | | | | | | | Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 3029 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Input: atmel_mxt_ts - don't try to free unallocated kernel memorySanjeev Chugh2018-12-281-2/+2
| | | | | | | | | | | | If the user attempts to update Atmel device with an invalid configuration cfg file, error handling code is trying to free cfg file memory which is not allocated yet hence results into kernel crash. This patch fixes the order of memory free operations. Signed-off-by: Sanjeev Chugh <sanjeev_chugh@mentor.com> Fixes: a4891f105837 ("Input: atmel_mxt_ts - zero terminate config firmware file") Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: atmel_mxt_ts - mark expected switch fall-throughGustavo A. R. Silva2018-10-151-1/+1
| | | | | | | In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: atmel_mxt_ts - fix multiple <linux/property.h> includesGeorge G. Davis2018-09-281-1/+0
| | | | | | | | | Both v4.16-rc7 commit 93afb1d6e72a ("Input: atmel_mxt_ts - switch from OF to generic device properties") and v4.16-rc7 commit 96a938aa214e ("Input: atmel_mxt_ts - remove platform data support") added includes of "<linux/property.h>". Remove one of the duplicate includes to fix this. Signed-off-by: George G. Davis <george_davis@mentor.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: atmel_mxt_ts - move completion to after config crc is updatedNick Dyer2018-07-271-2/+2
| | | | Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: atmel_mxt_ts - don't report zero pressure from T9Nick Dyer2018-07-271-0/+4
| | | | | | | If T9.CTRL DISAMP is set, then pressure is reported as zero. This means some app layers (eg tslib) will ignore the contact. Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: atmel_mxt_ts - zero terminate config firmware fileNick Dyer2018-07-271-10/+24
| | | | | | | | We use sscanf to parse the configuration file, so it's necessary to zero terminate the configuration otherwise a truncated file can cause the parser to run off into uninitialised memory. Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: atmel_mxt_ts - refactor config update code to add context structNick Dyer2018-07-271-52/+56
| | | | Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: atmel_mxt_ts - config CRC may start at T71Nick Dyer2018-07-271-12/+22
| | | | | | | On devices with the T71 object, the config CRC will start there, rather than at T7. Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: atmel_mxt_ts - remove unnecessary debug on ENOMEMNick Dyer2018-07-271-6/+2
| | | | Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: atmel_mxt_ts - remove duplicate setup of ABS_MT_PRESSURENick Dyer2018-07-271-6/+0
| | | | Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: atmel_mxt_ts - use BIT() macro everywhereNick Dyer2018-07-271-18/+18
| | | | Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: atmel_mxt_ts - only use first T9 instanceNick Dyer2018-07-271-3/+4
| | | | | | | | | | | | | | | | | | | The driver only registers one input device, which uses the screen parameters from the first T9 instance. The first T63 instance also uses those parameters. It is incorrect to send input reports from the second instances of these objects if they are enabled: the input scaling will be wrong and the positions will be mashed together. This also causes problems on Android if the number of slots exceeds 32. In the future, this could be handled by looking for enabled touch object instances and creating an input device for each one. Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk> Acked-by: Benson Leung <bleung@chromium.org> Acked-by: Yufeng Shen <miletus@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: atmel_mxt_ts - fix reset-gpio for level based irqsSebastian Reichel2018-05-241-11/+7
| | | | | | | | | | | | | | | | | | | | | The current reset-gpio support triggers an interrupt storm on platforms using the maxtouch with level based interrupt. The Motorola Droid 4, which I used for some of the tests is not affected, since it uses a edge based interrupt. This change avoids the interrupt storm by enabling the device while its interrupt is disabled. Afterwards we wait 100ms. This is important for two reasons: The device is unresponsive for some time (~22ms for mxt224E) and the CHG (interrupt) line is not working properly for 100ms. We don't need to wait for any following interrupts, since the following mxt_initialize() checks for bootloader mode anyways. This fixes a boot issue on GE PPD (watchdog kills device due to interrupt storm) and does not cause regression on Motorola Droid 4. Fixes: f657b00df22e ("Input: atmel_mxt_ts - add support for reset line") Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk> Reviewed-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: atmel_mxt_ts - require device properties present when probingDmitry Torokhov2018-05-241-140/+12
| | | | | | | | | | | | | | | | | The driver needs help determining whether it is dealing with a touchscreen or a touchpad, and with button mapping. Previously we supported passing this data via device properties, and also had DMI lists for Chromebooks that specified Atmel devices in ACPI, but did not provide enough data there. Now that chromeos_laptop driver is adjusted to supply necessary device properties even for ACPI devices, we can drop the DMI tables and refuse to probe if device properties are not attached to the device. We use presence of "compatible" property to determine if device properties are attached to the device or not and rely on chromeos_laptop to re-probe the device after attaching missing device properties to it. Reviewed-by: Benson Leung <bleung@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Merge branch 'for-linus' of ↵Linus Torvalds2018-05-021-76/+124
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input updates from Dmitry Torokhov: "Just a few driver fixes" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: atmel_mxt_ts - add missing compatible strings to OF device table Input: atmel_mxt_ts - fix the firmware update Input: atmel_mxt_ts - add touchpad button mapping for Samsung Chromebook Pro MAINTAINERS: Rakesh Iyer can't be reached anymore Input: hideep_ts - fix a typo in Kconfig Input: alps - fix reporting pressure of v3 trackstick Input: leds - fix out of bound access Input: synaptics-rmi4 - fix an unchecked out of memory error path
| * Input: atmel_mxt_ts - add missing compatible strings to OF device tableJavier Martinez Canillas2018-05-011-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit af503716ac14 ("i2c: core: report OF style module alias for devices registered via OF") fixed how the I2C core reports the module alias when devices are registered via OF. But the atmel_mxt_ts driver only has an "atmel,maxtouch" compatible in its OF device ID table, so if a Device Tree is using a different one, autoload won't be working for the module (the matching works because the I2C device ID table is used as a fallback). So add compatible strings for each of the entries in the I2C device table. Fixes: af503716ac14 ("i2c: core: report OF style module alias for devices registered via OF") Reported-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> Tested-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Reviewed-by: Rob Herring <robh@kernel.org> [dtor: document which compatibles are deprecated and should not be used] Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
| * Input: atmel_mxt_ts - fix the firmware updateNick Dyer2018-05-011-76/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The automatic update mechanism will trigger an update if the info block CRCs are different between maxtouch configuration file (maxtouch.cfg) and chip. The driver compared the CRCs without retrieving the chip CRC, resulting always in a failure and firmware flashing action triggered. Fix this issue by retrieving the chip info block CRC before the check. Note that this solution has the benefit that by reading the information block and the object table into a contiguous region of memory, we can verify the checksum at probe time. This means we make sure that we are indeed talking to a chip that supports object protocol correctly. Using this patch on a kevin chromebook, the touchscreen and touchpad drivers are able to match the CRC: atmel_mxt_ts 3-004b: Family: 164 Variant: 14 Firmware V2.3.AA Objects: 40 atmel_mxt_ts 5-004a: Family: 164 Variant: 17 Firmware V2.0.AA Objects: 31 atmel_mxt_ts 3-004b: Resetting device atmel_mxt_ts 5-004a: Resetting device atmel_mxt_ts 3-004b: Config CRC 0x573E89: OK atmel_mxt_ts 3-004b: Touchscreen size X4095Y2729 input: Atmel maXTouch Touchscreen as /devices/platform/ff130000.i2c/i2c-3/3-004b/input/input5 atmel_mxt_ts 5-004a: Config CRC 0x0AF6BA: OK atmel_mxt_ts 5-004a: Touchscreen size X1920Y1080 input: Atmel maXTouch Touchpad as /devices/platform/ff140000.i2c/i2c-5/5-004a/input/input6 Signed-off-by: Nick Dyer <nick.dyer@shmanahar.org> Acked-by: Benson Leung <bleung@chromium.org> [Ezequiel: minor patch massage] Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Tested-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
| * Input: atmel_mxt_ts - add touchpad button mapping for Samsung Chromebook ProVittorio Gambaletta (VittGam)2018-05-011-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the correct platform data information for the Caroline Chromebook, so that the mouse button does not get stuck in pressed state after the first click. The Samus button keymap and platform data definition are the correct ones for Caroline, so they have been reused here. Signed-off-by: Vittorio Gambaletta <linuxbugs@vittgam.net> Signed-off-by: Salvatore Bellizzi <lkml@seppia.net> Tested-by: Guenter Roeck <groeck@chromium.org> Cc: stable@vger.kernel.org [dtor: adjusted vendor spelling to match shipping firmware] Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* | Input: atmel_mxt_ts - remove platform data supportDmitry Torokhov2018-04-091-75/+55
| | | | | | | | | | | | | | | | | | | | Now that there are no users of custom Atmel platform data, and everyone has switched to the generic device properties, we can remove support for the platform data. Acked-by: Nick Dyer <nick@shmanahar.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Benson Leung <bleung@chromium.org>
* | Input: atmel_mxt_ts - switch ChromeOS ACPI devices to generic propsDmitry Torokhov2018-04-091-23/+40
| | | | | | | | | | | | | | | | | | | | | | | | Move older ChromeOS devices describing Atmel controllers in ACPI, but not providing enough details to configure the controllers properly, from platform data over to generic device properties. This will allow us remove support for platform data later on, leaving only generic device properties in place. Acked-by: Nick Dyer <nick@shmanahar.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Benson Leung <bleung@chromium.org>
* | Input: atmel_mxt_ts - switch from OF to generic device propertiesDmitry Torokhov2018-04-091-29/+30
| | | | | | | | | | | | | | | | | | | | | | Instead of using OF-specific APIs to fecth device properties, let's switch to generic device properties API. This will allow us to use device properties on legacy ChromeOS devices and get rid of platform data down the road. Acked-by: Nick Dyer <nick@shmanahar.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Benson Leung <bleung@chromium.org>
* | Input: atmel_mxt_ts - do not pass suspend mode in platform dataDmitry Torokhov2018-04-091-5/+22
|/ | | | | | | | | | | | | | | | The way we are supposed to put controller to sleep and wake it up does not depend on the platform, but rather on controller itself, so we want to get rid of suspend mode in platform data (and eventually get rid of platform data completely). Unfortunately some early chromebooks (the original Pixel, Acer C720) were shipped with config that requires manually re-enabling touch reporting in T9. We will sort it out, but in the meantime let's switch to a simple DMI quirk. We'll keep pdata->suspend_mode for now and remove it when we rework chromeos-laptop driver. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Benson Leung <bleung@chromium.org>