summaryrefslogtreecommitdiff
path: root/drivers/input/touchscreen/cyttsp_core.c
AgeCommit message (Collapse)AuthorFilesLines
2023-01-28Input: cyttsp - use EXPORT_GPL_SIMPLE_DEV_PM_OPS()Jonathan Cameron1-4/+3
SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and EXPORT_GPL_SIMPLE_DEV_PMU_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. It also rolls in the EXPORT_SYMBOL() so that we only export it if CONFIG_PM_SLEEP. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Javier Martinez Canillas <javier@dowhile0.org> Cc: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20230114171620.42891-12-jic23@kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-06-02Input: cyttsp - remove public headerDmitry Torokhov1-1/+8
There is nothing in include/linux/input/cyttsp.h that might be of interes to the kernel at large, so let's move this information into the driver code and remove the header. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20210531052307.1433979-2-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-05-31Input: cyttsp - do not force interrupt triggerDmitry Torokhov1-2/+1
Instead of forcing interrupt trigger to be "falling edge" let's rely on the platform to set it up according to how it is set up on a given board based on data in device tree or ACPI tables. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/YK7iO96g+7yIC0l1@google.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-05-27Input: cyttsp - obtain regulatorsLinus Walleij1-0/+35
The CYTTSP TMA340 chips have two supplies: VCPIN and VDD for analog and digital voltage respectively. Add some minimal code to obtain and enable these regulators if need be. Reviewed-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20210526230352.1433537-3-linus.walleij@linaro.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-04-10Input: cyttsp - flag the device properlyLinus Walleij1-1/+1
This device is certainly a very simple touchscreen so we set INPUT_MT_DIRECT. Reviewed-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20210408131153.3446138-9-linus.walleij@linaro.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-04-10Input: cyttsp - set abs params for ABS_MT_TOUCH_MAJORLinus Walleij1-0/+3
The driver is certainly reporting pressure in cyttsp_report_tchdata() with input_report_abs(input, ABS_MT_TOUCH_MAJOR, tch->z); so we should also advertise this capability. Reviewed-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20210408131153.3446138-8-linus.walleij@linaro.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-04-10Input: cyttsp - drop the phys pathLinus Walleij1-2/+0
When I test to use the CY8CTMA340 with PostmarketOS I don't have any problem whatsoever in dropping this phys path, it finds and uses the touchscreen just as well. I suppose it is because userspace is using modern input libraries. I challenge the maintainers to point out a valid and still used userspace that actually need this. I say we drop it. Reviewed-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20210408131153.3446138-7-linus.walleij@linaro.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-04-10Input: cyttsp - reduce reset pulse timingsLinus Walleij1-2/+8
The data sheet for CY8CTMA340 specifies that the reset pulse shall be at least 1 ms. Specify 1-2 ms with usleep_range() to cut some slack for the scheduler. Curiously the datasheet does not specify how long we have to wait after a hard reset until the chip is up, but I have found a vendor tree (Samsung GT-S7710) that has code for this touch screen and there this is set to 5 ms so I use this with the same 1 ms fuzz. Reviewed-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20210408131153.3446138-6-linus.walleij@linaro.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-04-10Input: cyttsp - error message on boot mode exit errorLinus Walleij1-1/+3
Provide a proper error message when attempting to exit boot loader mode and failing, which is something that happened to me. Reviewed-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20210408131153.3446138-5-linus.walleij@linaro.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-03-26Input: move to use request_irq by IRQF_NO_AUTOEN flagBarry Song1-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>
2021-03-25Input: cyttsp - verbose error on soft resetLinus Walleij1-5/+8
The first thing the Cypress driver does when starting up is to try a soft reset. This is the first point where the driver SPI/I2C communication can fail, so put out some nice debug text: cyttsp-spi spi2.0: failed to send soft reset Instead of just: cyttsp-spi: probe of spi2.0 failed with error -5 This is more helpful. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20210322221349.1116666-1-linus.walleij@linaro.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-12-03Input: use input_device_enabled()Andrzej Pietrasiewicz1-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>
2020-05-12Input: introduce input_mt_report_slot_inactive()Jiada Wang1-1/+1
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>
2019-06-05treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 267Thomas Gleixner1-15/+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 version 2 and only version 2 as published by the free software foundation this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not write to the free software foundation inc 51 franklin street fifth floor boston ma 02110 1301 usa extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 94 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Richard Fontana <rfontana@redhat.com> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190529141334.043630402@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-07-16Input: of_touchscreen - add support for inverted / swapped axesHans de Goede1-1/+1
Extend touchscreen_parse_properties() with support for the touchscreen-inverted-x/y and touchscreen-swapped-x-y properties and add touchscreen_set_mt_pos() and touchscreen_report_pos() helper functions for storing coordinates into a input_mt_pos struct, or directly reporting them, taking these properties into account. This commit also modifies the existing callers of touchscreen_parse_properties() to pass in NULL for the new third argument, keeping the existing behavior. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2016-01-28Input: cyttsp - perform hard reset of the chip during probeOreste Salerno1-0/+12
Since we removed support for calling an init() callback from the platform data, introduce a function which initializes the chip by performing a hard reset, using the reset gpio defined in the device properties. Signed-off-by: Oreste Salerno <oreste.salerno@tomtom.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2016-01-28Input: cyttsp - switch to using device propertiesOreste Salerno1-42/+94
Drop support for platform data passed via a C-structure and switch to device properties instead, which should make the driver compatible with all platforms: OF, ACPI and static boards. Static boards should use property sets to communicate device parameters to the driver. Signed-off-by: Oreste Salerno <oreste.salerno@tomtom.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2016-01-28Input: cyttsp - check return value of input_mt_init_slotsOreste Salerno1-1/+5
Signed-off-by: Oreste Salerno <oreste.salerno@tomtom.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2016-01-28Input: cyttsp - use devres managed resource allocationsOreste Salerno1-38/+30
Use devm_() functions for allocating memory, input device and IRQ. Signed-off-by: Oreste Salerno <oreste.salerno@tomtom.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-11-02Input: touchscreen - use __maybe_unused instead of ifdef around suspend/resumeJingoo Han1-5/+2
Use __maybe_unused instead of ifdef guards around suspend/resume functions, in order to increase build coverage and fix build warnings. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2013-12-16Merge tag 'v3.13-rc4' into nextDmitry Torokhov1-1/+1
Synchronize with mainline to bring in the new keycode definitions and new hwmon API.
2013-12-06Input: use dev_get_platdata()Jingoo Han1-2/+2
Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. This is a cosmetic change to make the code simpler and enhance the readability. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Fugang Duan <B38611@freescale.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2013-11-15tree-wide: use reinit_completion instead of INIT_COMPLETIONWolfram Sang1-1/+1
Use this new function to make code more comprehensible, since we are reinitialzing the completion, not initializing. [akpm@linux-foundation.org: linux-next resyncs] Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Acked-by: Linus Walleij <linus.walleij@linaro.org> (personally at LCE13) Cc: Ingo Molnar <mingo@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-07-02Merge branch 'next' into for-linusDmitry Torokhov1-2/+4
Prepare first set of updates for 3.11 merge window.
2013-07-01Input: cyttsp - I2C driver split into two modulesFerruh Yigit1-2/+4
Existing I2C code is for TrueTouch Gen3 devices TrueTouch Gen4 device is using same protocol, will split driver into two pieces to use common code with both drivers. Read/Write functions parameter list modified, since shared code will be used by two separate drivers and these drivers are not sharing same structs, parameters updated to use common structures. Signed-off-by: Ferruh Yigit <fery@cypress.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2013-06-06Input: cyttsp - add missing handshakeFerruh Yigit1-6/+20
For the devices that has blocking with timeout communication, these extra handshakes will prevent one timeout delay in startup sequence Tested-by: Ferruh Yigit <fery@cypress.com> on TMA300-DVK Signed-off-by: Ferruh Yigit <fery@cypress.com> Acked-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2013-06-06Input: cyttsp - fix memcpy size paramFerruh Yigit1-1/+1
memcpy param is wrong because of offset in bl_cmd, this may corrupt the stack which may cause a crash. Tested-by: Ferruh Yigit <fery@cypress.com> on TMA300-DVK Signed-off-by: Ferruh Yigit <fery@cypress.com> Acked-by: Javier Martinez Canillas <javier@dowhile0.org> Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-09-19Input: MT - Add flags to input_mt_init_slots()Henrik Rydberg1-1/+1
Preparing to move more repeated code into the mt core, add a flags argument to the input_mt_slots_init() function. Reviewed-and-tested-by: Benjamin Tissoires <benjamin.tissoires@enac.fr> Tested-by: Ping Cheng <pingc@wacom.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
2012-03-04Input: cyttsp - remove useless checks in cyttsp_probe()Dmitry Torokhov1-1/+1
This fixes reference-before-check problem; there is no reason to check if caller passed NULL dev or bus_ops as it is done only by bus-specific drivers which already do the right thing. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-01-31Input: add Cypress TTSP capacitive multi-touch screen supportJavier Martinez Canillas1-0/+625
Cypress TrueTouch(tm) Standard Product controllers are found in a wide range of embedded devices. This driver add support for a variety of TTSP controllers. Since the hardware is capable of tracking identifiable contacts, multi-touch protocol type B (stateful) is used to report contact information. The driver is composed of a core driver that process the data sent by the contacts and a set of bus specific interface modules. This patch adds the base core TTSP driver. Signed-off-by: Javier Martinez Canillas <javier@dowhile0.org> Reviewed-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>