From 26d0248b3d9f22c0145d1776470f4ae7edca2c28 Mon Sep 17 00:00:00 2001 From: Robert Dolca Date: Thu, 28 Jul 2016 14:28:46 -0700 Subject: Input: add driver for Silead touchscreens This driver adds support for Silead touchscreens. It has been tested with GSL1680 and GSL3680 touch panels. It supports ACPI and device tree enumeration. Screen resolution, the maximum number of fingers supported and firmware name are configurable. Signed-off-by: Robert Dolca Signed-off-by: Daniel Jansen Signed-off-by: Hans de Goede Signed-off-by: Dmitry Torokhov Input: silead - remove some dead code buf[0] is an unsigned char. touch_nr is an int. The test for negative here doesn't make sense so I have removed it. Signed-off-by: Dan Carpenter Signed-off-by: Dmitry Torokhov Input: silead - use devm_gpiod_get The silead code is using devm_foo for everything (and does not free any resources). Except that it is using gpiod_get instead of devm_gpiod_get (but is not freeing the gpio_desc), change this to use devm_gpiod_get so that the gpio will be properly released. Signed-off-by: Hans de Goede Signed-off-by: Dmitry Torokhov Input: silead_gsl1680 - document firmware-name, fix implementation The driver has supported touchscreen-fw-name to specify the firmware to load since it has been merged, but this was omitted from the dt-binding documentation. During review of adding touchscreen-fw-name to the binding documentation it was brought up that there is a standard property name called "firmware-name" for this, which should be used. Since there are no users of touchscreen-fw-name yet, this commit adds documentation of "firmware-name" to the dt-binding documentation and switches the driver over to use this. This commit also makes the driver add a "silead/" prefix to the firmware name from dt before calling request_firmware. That the firmware files are stored under /lib/firmware/silead under Linux is an implementation detail and does not belong in devicetree. Signed-off-by: Hans de Goede Acked-by: Rob Herring Signed-off-by: Dmitry Torokhov Input: silead_gsl1680 - use "silead/" prefix for firmware loading The silead touch-controller ICs use a different firmware per digitizer / tablet model. So there are going to be quite a few of then and they really should be under a separate subdir. This commit prefixes the default firmware names with "silead/" just like we are already doing for devicetree specified firmware names. Signed-off-by: Hans de Goede Signed-off-by: Dmitry Torokhov Input: silead - add OF device ID table The driver doesn't have a struct of_device_id table but supported devices are registered via Device Trees. This is working on the assumption that a I2C device registered via OF will always match a legacy I2C device ID and that the MODALIAS reported will always be of the form i2c:. But this could change in the future so the correct approach is to have an OF device ID table if the devices are registered via OF. As pointed by Hans de Goede, there's no mssl1680 and this is just used in some ACPI systems to identify the gsl1680 chip. So isn't included in the OF device ID table since a DT should use the proper device name instead. Signed-off-by: Javier Martinez Canillas Signed-off-by: Dmitry Torokhov Input: back-port silead.c: pos[i] handling/assignment Signed-off-by: Philipp Tomsich Input: back-port silead.c: invert_x/y & swap_xy Signed-off-by: Philipp Tomsich Input: silead: retry firmware load If we get ENOENT when trying to load the firmware, this can just mean that the rootfs is not mounted yet. Return EPROBE_DEFER so the probe is retried later. To prevent an infinite probe loop when the firmware does not exist at all, the retries are capped to 10. Signed-off-by: Jakob Unterwurzacher --- drivers/input/touchscreen/Kconfig | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'drivers/input/touchscreen/Kconfig') diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig index 4f569b311042..5540b1990b98 100644 --- a/drivers/input/touchscreen/Kconfig +++ b/drivers/input/touchscreen/Kconfig @@ -1046,6 +1046,18 @@ config TOUCHSCREEN_PCAP To compile this driver as a module, choose M here: the module will be called pcap_ts. +config TOUCHSCREEN_SILEAD + tristate "Silead I2C touchscreen" + depends on I2C + help + Say Y here if you have the Silead touchscreen connected to + your system. + + If unsure, say N. + + To compile this driver as a module, choose M here: the + module will be called silead. + config TOUCHSCREEN_ST1232 tristate "Sitronix ST1232 touchscreen controllers" depends on I2C -- cgit v1.2.3