input: touchscreen: Add generic driver for Silead touchscreens
Subsystems (4)
v4 cover input: touchscreen: Add generic driver for Silead touchscreens
Hi all,
We’re hereby submitting a driver for gsl1680 based touchscreens for merging into the upstream kernel.
The gsl1680 family of touchscreen controllers is very popular in cheap tablets, as such there have been multiple attempts to write a driver for it. This submission is based on Robert Dolca's work on this:
https://lkml.org/lkml/2015/8/25/738
This driver has been picked up and improved by Sigurd Bøe:
https://github.com/sigboe/gslX68X
And since seen minor improvements from: Gregor Riepl, Hans de Goede and ourselves.
The driver as submitted today has been tested on a wide variety of ARM based tablet using devicetree for instantiation. It has been tested with the gsl1680, gsl3670 and gsl3675 variants of the gsl1680 controller.
Please review en merge,
Robert Wessel Blokzijl and Daniel Jansen
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v4 1/1 input: touchscreen: Add generic driver for Silead touchscreens
From: Robert Dolca <[email protected]>
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.
---
Changes since v3
- Check for the hw reporting more touches than expected
- Fix input_mt_assign_slots usage
- Remove unnecessary defines.
- Shorten lines to be under 80 characters.
- Move closing block comment to new line.
- Add device tree bindings document for silead_gsl1680.
- Use dev->driver->acpi_match_table instead of silead_ts_acpi_match
- Replaced sprintf in default firmware file name generator with snprintf
- Add missing input_mt_sync_frame() call
- Fix device tree support
Changes since v2
- removed device properties requirements
- max x and y default to 4095
- max fingers default to 10
- firmware name uses the HID / device name
- power named GPIO optional with fallback to indexed GPIO (without it there is no pm support in the driver)
- finger tracking in the kernel using slot assignment
- add device property for x/y inverting and xy swapping
Changes since v1
- changed device tree properties names
- removed cast for void *id
- removed ifdef from suspend and resume and use __maybe_unused
- remove ifdef from ACPI_PTR
- renamed ret to error
- removed input_set_capability for EV_ABS
- fixed endianess issues
- added mask for y in order to use only 12 bits
- using the 4 MSb for touch ID instead of LSb (bug)
- using the 4 LSB for X instead of MSb (bug)
--- .../bindings/input/touchscreen/silead_gsl1680.txt | 39 ++ drivers/input/touchscreen/Kconfig | 13 + drivers/input/touchscreen/Makefile | 1 + drivers/input/touchscreen/silead.c | 652 +++++++++++++++++++++ 4 files changed, 705 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/touchscreen/silead_gsl1680.txt create mode 100644 drivers/input/touchscreen/silead.c
Documentation/devicetree/bindings/input/touchscreen/silead_gsl1680.txt new file +39 -0
@@ -0,0 +1,39 @@ +* GSL 1680 touchscreen controller + +Required properties: +- compatible : "silead,gsl1680" +- reg : I2C slave address of the chip (0x40) +- interrupt-parent : a phandle pointing to the interrupt controller + serving the interrupt for this chip +- interrupts : interrupt specification for the gsl1680 interrupt +- wake-gpios : GPIO specification for the WAKE input +- touchscreen-size-x : horizontal resolution of touchscreen (in pixels) +- touchscreen-size-y : vertical resolution of touchscreen (in pixels) +- touchscreen-max-fingers : maximal input values given to inputsystem + +Optional properties: +- touchscreen-inverted-x : X axis is inverted (boolean) +- touchscreen-inverted-y : Y axis is inverted (boolean) +- touchscreen-swapped-x-y : X and Y axis are swapped (boolean) + Swapping is done after inverting the axis + +Example: + +i2c@00000000 { + + gsl1680: touchscreen@40 { + compatible = "silead,gsl1680"; + reg = <0x40>; + interrupt-parent = <&pio>; + interrupts = <6 11 IRQ_TYPE_EDGE_FALLING>; + power-gpios = <&pio 1 3 GPIO_ACTIVE_HIGH>; + touchscreen-size-x = <480>; + touchscreen-size-y = <800>; + touchscreen-max-fingers = <5>; + touchscreen-inverted-x; + touchscreen-swapped-x-y; + }; + + /* ... */ +}; +
drivers/input/touchscreen/Kconfig +13 -0
@@ -1155,4 +1155,17 @@ config TOUCHSCREEN_ROHM_BU21023 To compile this driver as a module, choose M here: the module will be called bu21023_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. + + endif
drivers/input/touchscreen/Makefile +1 -0
@@ -95,3 +95,4 @@ obj-$(CONFIG_TOUCHSCREEN_TPS6507X) += tps6507x-ts.o obj-$(CONFIG_TOUCHSCREEN_ZFORCE) += zforce_ts.o obj-$(CONFIG_TOUCHSCREEN_COLIBRI_VF50) += colibri-vf50-ts.o obj-$(CONFIG_TOUCHSCREEN_ROHM_BU21023) += rohm_bu21023.o +obj-$(CONFIG_TOUCHSCREEN_SILEAD) += silead.o
drivers/input/touchscreen/silead.c new file +652 -0
652 lines not on this page · raw message
Signature · 1 line
2.5.5
Rob Herring
maintainerQuoted 61 lines · Daniel Jansen
From: Robert Dolca <[email protected]>
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 <[email protected]>Signed-off-by Daniel Jansen <[email protected]>Signed-off-by Hans de Goede <[email protected]>---
Changes since v3
- Check for the hw reporting more touches than expected
- Fixinput_mt_assign_slotsusage
- Remove unnecessary defines.
- Shorten lines to be under 80 characters.
- Move closing block comment to new line.
- Add device tree bindings document forsilead_gsl1680.
- Usedev->driver->acpi_match_tableinstead ofsilead_ts_acpi_match
- Replaced sprintf in default firmware file name generator with snprintf
- Add missinginput_mt_sync_frame()call
- Fix device tree supportChanges since v2
- removed device properties requirements
- max x and y default to 4095
- max fingers default to 10
- firmware name uses the HID / device name
- power named GPIO optional with fallback to indexed GPIO (without it there is no pm support in the driver)
- finger tracking in the kernel using slot assignment
- add device property for x/y inverting and xy swappingChanges since v1
- changed device tree properties names
- removed cast forvoid *id
- removed ifdef from suspend and resume and use__maybe_unused
- remove ifdef fromACPI_PTR
- renamed ret to error
- removedinput_set_capabilityforEV_ABS
- fixed endianess issues
- added mask for y in order to use only 12 bits
- using the 4 MSb for touch ID instead of LSb (bug)
- using the 4 LSB for X instead of MSb (bug)--- .../bindings/input/touchscreen/silead_gsl1680.txt | 39 ++ drivers/input/touchscreen/Kconfig | 13 + drivers/input/touchscreen/Makefile | 1 + drivers/input/touchscreen/silead.c | 652 +++++++++++++++++++++ 4 files changed, 705 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/touchscreen/silead_gsl1680.txt create mode 100644 drivers/input/touchscreen/silead.cDocumentation/devicetree/bindings/input/touchscreen/silead_gsl1680.txt new file +0
-0
Documentation/devicetree/bindings/input/touchscreen/silead_gsl1680.txt line 9
Quoted 9 lines
Documentation/devicetree/bindings/input/touchscreen/silead_gsl1680.txt new file +9
-0@@ -0,0 +1,39 @@ +* GSL 1680 touchscreen controller + +Required properties: +- compatible : "silead,gsl1680" +- reg : I2C slave address of the chip (0x40) +- interrupt-parent : a phandle pointing to the interrupt controller + serving the interrupt for this chip +- interrupts : interrupt specification for the gsl1680 interrupt +- wake-gpios : GPIO specification for the WAKE input
What direction is this?
Quoted 30 lines
Documentation/devicetree/bindings/input/touchscreen/silead_gsl1680.txt new file +30
-0+- touchscreen-size-x : horizontal resolution of touchscreen (in pixels) +- touchscreen-size-y : vertical resolution of touchscreen (in pixels) +- touchscreen-max-fingers : maximal input values given to inputsystem + +Optional properties: +- touchscreen-inverted-x : X axis is inverted (boolean) +- touchscreen-inverted-y : Y axis is inverted (boolean) +- touchscreen-swapped-x-y : X and Y axis are swapped (boolean) + Swapping is done after inverting the axis + +Example: + +i2c@00000000 { + + gsl1680: touchscreen@40 { + compatible = "silead,gsl1680"; + reg = <0x40>; + interrupt-parent = <&pio>; + interrupts = <6 11 IRQ_TYPE_EDGE_FALLING>; + power-gpios = <&pio 1 3 GPIO_ACTIVE_HIGH>; + touchscreen-size-x = <480>; + touchscreen-size-y = <800>; + touchscreen-max-fingers = <5>; + touchscreen-inverted-x; + touchscreen-swapped-x-y; + }; + + /* ... */ +}; +
Hi,
Quoted 65 lines · Rob Herring
Quoted 64 lines · Daniel Jansen
From: Robert Dolca <[email protected]>
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 <[email protected]>Signed-off-by Daniel Jansen <[email protected]>Signed-off-by Hans de Goede <[email protected]>---
Changes since v3
- Check for the hw reporting more touches than expected
- Fixinput_mt_assign_slotsusage
- Remove unnecessary defines.
- Shorten lines to be under 80 characters.
- Move closing block comment to new line.
- Add device tree bindings document forsilead_gsl1680.
- Usedev->driver->acpi_match_tableinstead ofsilead_ts_acpi_match
- Replaced sprintf in default firmware file name generator with snprintf
- Add missinginput_mt_sync_frame()call
- Fix device tree supportChanges since v2
- removed device properties requirements
- max x and y default to 4095
- max fingers default to 10
- firmware name uses the HID / device name
- power named GPIO optional with fallback to indexed GPIO (without it there is no pm support in the driver)
- finger tracking in the kernel using slot assignment
- add device property for x/y inverting and xy swappingChanges since v1
- changed device tree properties names
- removed cast forvoid *id
- removed ifdef from suspend and resume and use__maybe_unused
- remove ifdef fromACPI_PTR
- renamed ret to error
- removedinput_set_capabilityforEV_ABS
- fixed endianess issues
- added mask for y in order to use only 12 bits
- using the 4 MSb for touch ID instead of LSb (bug)
- using the 4 LSB for X instead of MSb (bug)--- .../bindings/input/touchscreen/silead_gsl1680.txt | 39 ++ drivers/input/touchscreen/Kconfig | 13 + drivers/input/touchscreen/Makefile | 1 + drivers/input/touchscreen/silead.c | 652 +++++++++++++++++++++ 4 files changed, 705 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/touchscreen/silead_gsl1680.txt create mode 100644 drivers/input/touchscreen/silead.cDocumentation/devicetree/bindings/input/touchscreen/silead_gsl1680.txt new file +3
-0@@ -0,0 +1,39 @@ +* GSL 1680 touchscreen controller + +Required properties:
Quoted 8 lines
Documentation/devicetree/bindings/input/touchscreen/silead_gsl1680.txt line 9
Quoted 6 lines
Documentation/devicetree/bindings/input/touchscreen/silead_gsl1680.txt new file +6
-0+- compatible : "silead,gsl1680" +- reg : I2C slave address of the chip (0x40) +- interrupt-parent : a phandle pointing to the interrupt controller + serving the interrupt for this chip +- interrupts : interrupt specification for the gsl1680 interrupt +- wake-gpios : GPIO specification for the WAKE inputWhat direction is this?
This is an input to the touchscreen controller, it needs to be driven high to take the touchscreen controller out of its low power state.
Regards,
Hans
Quoted 30 lines
Quoted 30 lines
Documentation/devicetree/bindings/input/touchscreen/silead_gsl1680.txt new file +30
-0+- touchscreen-size-x : horizontal resolution of touchscreen (in pixels) +- touchscreen-size-y : vertical resolution of touchscreen (in pixels) +- touchscreen-max-fingers : maximal input values given to inputsystem + +Optional properties: +- touchscreen-inverted-x : X axis is inverted (boolean) +- touchscreen-inverted-y : Y axis is inverted (boolean) +- touchscreen-swapped-x-y : X and Y axis are swapped (boolean) + Swapping is done after inverting the axis + +Example: + +i2c@00000000 { + + gsl1680: touchscreen@40 { + compatible = "silead,gsl1680"; + reg = <0x40>; + interrupt-parent = <&pio>; + interrupts = <6 11 IRQ_TYPE_EDGE_FALLING>; + power-gpios = <&pio 1 3 GPIO_ACTIVE_HIGH>; + touchscreen-size-x = <480>; + touchscreen-size-y = <800>; + touchscreen-max-fingers = <5>; + touchscreen-inverted-x; + touchscreen-swapped-x-y; + }; + + /* ... */ +}; +
Rob Herring
maintainerQuoted 15 lines · Hans de Goede
Hi,
Quoted 11 lines · Rob Herring
Quoted 9 lines · Daniel Jansen
From: Robert Dolca <[email protected]>
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.
[...]
Quoted 18 lines
Quoted 8 lines
Quoted 8 lines
b/Documentation/devicetree/bindings/input/touchscreen/silead_gsl1680.txtDocumentation/devicetree/bindings/input/touchscreen/silead_gsl1680.txt new file +6
-0@@ -0,0 +1,39 @@ +* GSL 1680 touchscreen controller + +Required properties: +- compatible : "silead,gsl1680" +- reg : I2C slave address of the chip (0x40) +- interrupt-parent : a phandle pointing to the interruptQuoted 8 lines
Quoted 5 lines
controller
+ serving the interrupt for this chip
+- interrupts : interrupt specification for the gsl1680
interrupt
+- wake-gpios : GPIO specification for the WAKE inputWhat direction is this?
Quoted 2 lines
This is an input to the touchscreen controller, it needs to be driven high to take the touchscreen controller out of its low power state.
Okay, please clarify that in the description. The gpio flags should also indicate it is active high.
Rob