Skip to contentSkip to conversation

Input: Add driver for GOODiX GTx5 series touchsereen

PATCH Superseded Wang Yafei 1 participant 1 message Jun 21, 2017

Subsystems (2)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Wang Yafei

author
#0 lore raw

PATCH v3 1/1 Input: Add driver for GOODiX GTx5 series touchsereen

This driver is for GOODiX GTx5 series touchscreen controllers such as GT8589, GT7589. This driver designed with hierarchial structure, for that can be modified to support subsequent controllers easily. Some zones of the touchscreen can be set to buttons(according to the hardware). That is why it handles button and multitouch events.

A brief description of driver structure
- Core Layer: This layer responsible for basic input events report, GPIO pinctrl, Interrupt, Power resources manager and submodules manager.
- Hardware Layer: This layer responsible for controllers initialization, irq handle as well as bus read/write.
- External Module Layer: This layer used for support more features such as firmware update, debug tools and gesture wakeup.

---
Goodix driver that the kernel already have, is for our gt9xx series touchscreen controllers. This new driver is for out new generation touchscreen controllers, consider this two generations are very different with each other. We wrote a new driver instead of make a patch on the old driver.

Since v1:
- replace touchscreen properties according to the description in Documentation/devicetree/bindings/input/touchscreen/touchscreen.txt
- Droped all compat stuff for older kernels
- Removed Android stuff (EARLY_SUSPEND, CONFIG_FB)
- Use device_property_read_* get device properties
- use get-unaligned_*() API
- Use dev_err() dev_dbg() for logging
- remove pinctrl functions
- remove some unused functions
- Modify Kconfig

---
 drivers/input/touchscreen/Kconfig                  |    1 +
 drivers/input/touchscreen/Makefile                 |    1 +
 .../input/touchscreen/goodix-ts-sunrise/Kconfig    |   38 +
 .../input/touchscreen/goodix-ts-sunrise/Makefile   |    6 +
 .../goodix-ts-sunrise/goodix_gtx5_i2c.c            |  877 ++++++++++++
 .../goodix-ts-sunrise/goodix_gtx5_update.c         | 1464 ++++++++++++++++++++
 .../touchscreen/goodix-ts-sunrise/goodix_ts_core.c | 1368 ++++++++++++++++++
 .../touchscreen/goodix-ts-sunrise/goodix_ts_core.h |  554 ++++++++
 .../goodix-ts-sunrise/goodix_ts_tools.c            |  540 ++++++++
 9 files changed, 4849 insertions(+)
 create mode 100644 drivers/input/touchscreen/goodix-ts-sunrise/Kconfig
 create mode 100644 drivers/input/touchscreen/goodix-ts-sunrise/Makefile
 create mode 100644 drivers/input/touchscreen/goodix-ts-sunrise/goodix_gtx5_i2c.c
 create mode 100644 drivers/input/touchscreen/goodix-ts-sunrise/goodix_gtx5_update.c
 create mode 100644 drivers/input/touchscreen/goodix-ts-sunrise/goodix_ts_core.c
 create mode 100644 drivers/input/touchscreen/goodix-ts-sunrise/goodix_ts_core.h
 create mode 100644 drivers/input/touchscreen/goodix-ts-sunrise/goodix_ts_tools.c
drivers/input/touchscreen/Kconfig +1 -0
index cf26ca4..f3642bb 100644
@@ -15,6 +15,7 @@ config TOUCHSCREEN_PROPERTIES
 	def_tristate INPUT
 	depends on INPUT
 
+source "drivers/input/touchscreen/goodix-ts-sunrise/Kconfig"
 config TOUCHSCREEN_88PM860X
 	tristate "Marvell 88PM860x touchscreen"
 	depends on MFD_88PM860X
drivers/input/touchscreen/Makefile +1 -0
index 18e4769..d9408c0 100644
@@ -6,6 +6,7 @@
 
 wm97xx-ts-y := wm97xx-core.o
 
+obj-$(CONFIG_TOUCHSCREEN_GOODIX_GTX5)	+= goodix-ts-sunrise/
 obj-$(CONFIG_TOUCHSCREEN_PROPERTIES)	+= of_touchscreen.o
 obj-$(CONFIG_TOUCHSCREEN_88PM860X)	+= 88pm860x-ts.o
 obj-$(CONFIG_TOUCHSCREEN_AD7877)	+= ad7877.o
drivers/input/touchscreen/goodix-ts-sunrise/Kconfig new file +38 -0
new file mode 100644
index 0000000..5169005
@@ -0,0 +1,38 @@
+#
+# Goodix touchscreen driver configuration
+#
+menuconfig TOUCHSCREEN_GOODIX_GTX5
+	tristate "Goodix GTx5 touchscreen"
+	depends on I2C && OF
+	depends on GPIOLIB
+	help
+	  Say Y here if you have a Goodix GTx5xx touchscreen connected
+	  to your system.
+
+	  If unsure, say N.
+
+if TOUCHSCREEN_GOODIX_GTX5
+
+config TOUCHSCREEN_GOODIX_GTX5_UPDATE
+	tristate "Goodix GTx5xx firmware update module"
+	help
+	  Say Y here to enable support for doing firmware update.
+
+	  If unsure, say N.
+
+	  If you want support firmware update function say yes,
+	  this module will create some sysfs node for firmware
+	  update.
+
+config TOUCHSCREEN_GOODIX_GTX5_TOOLS
+	tristate "Goodix touch tools support"
+	help
+	  Say Y here to enable debug tools.
+
+	  If unsure, say N.
+
+	  Say yes here if you want to support controller debug
+	  and any other extended functionality. In most condition
+	  you may not need this feature.
+
+endif
drivers/input/touchscreen/goodix-ts-sunrise/Makefile new file +6 -0
new file mode 100644
index 0000000..690f256
@@ -0,0 +1,6 @@
+# Goodix Touchscreen Makefile
+
+obj-$(CONFIG_TOUCHSCREEN_GOODIX_GTX5)           += goodix_gtx5_i2c.o
+obj-$(CONFIG_TOUCHSCREEN_GOODIX_GTX5)           += goodix_ts_core.o
+obj-$(CONFIG_TOUCHSCREEN_GOODIX_GTX5_TOOLS)    += goodix_ts_tools.o
+obj-$(CONFIG_TOUCHSCREEN_GOODIX_GTX5_UPDATE)    += goodix_gtx5_update.o
drivers/input/touchscreen/goodix-ts-sunrise/goodix_gtx5_i2c.c new file +877 -0

877 lines not on this page · raw message

drivers/input/touchscreen/goodix-ts-sunrise/goodix_gtx5_update.c new file +1464 -0

1,464 lines not on this page · raw message

drivers/input/touchscreen/goodix-ts-sunrise/goodix_ts_core.c new file +1368 -0

601 lines not on this page · raw message

drivers/input/touchscreen/goodix-ts-sunrise/goodix_ts_core.h new file +554 -0

554 lines not on this page · raw message

drivers/input/touchscreen/goodix-ts-sunrise/goodix_ts_tools.c new file +540 -0

540 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.7.4

Part of the diff is not shown here. View the raw message.