aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksei Mamlin <mamlinav@gmail.com>2015-03-06 19:43:38 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2015-03-06 20:18:17 -0500
commit771d8f1b178e7e09fcc641fccd48852958dbc329 (patch)
treedde9fadc552a07c0890f362e6939c455713b7ac7
parenta7ac7c95d4682883d141c5d7a7544d2818f0a09f (diff)
Input: goodix - add device tree support
This change adds device tree support and binding information for Goodix GT9xx series touchscreen controller. It also adds support for 5-finger chips, like GT911 and GT912, which can be found on ARM tablets, such as Wexler TAB7200 and MSI Primo73. Datasheets can be found here: https://drive.google.com/folderview?id=0BxCVOQS3ZymGfmJyY2RKbE5XbVlKNlktVTlwV0lxNEdxd2dzeWZER094cmJPVnMxN1F0Yzg&usp=sharing Signed-off-by: Aleksei Mamlin <mamlinav@gmail.com> Reviewed-by: Bastien Nocera <hadess@hadess.net> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r--Documentation/devicetree/bindings/input/touchscreen/goodix.txt29
-rw-r--r--Documentation/devicetree/bindings/vendor-prefixes.txt1
-rw-r--r--drivers/input/touchscreen/Kconfig5
-rw-r--r--drivers/input/touchscreen/goodix.c21
4 files changed, 53 insertions, 3 deletions
diff --git a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
new file mode 100644
index 000000000000..8ba98eec765b
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
@@ -0,0 +1,29 @@
1Device tree bindings for Goodix GT9xx series touchscreen controller
2
3Required properties:
4
5 - compatible : Should be "goodix,gt911"
6 or "goodix,gt9110"
7 or "goodix,gt912"
8 or "goodix,gt927"
9 or "goodix,gt9271"
10 or "goodix,gt928"
11 or "goodix,gt967"
12 - reg : I2C address of the chip. Should be 0x5d or 0x14
13 - interrupt-parent : Interrupt controller to which the chip is connected
14 - interrupts : Interrupt to which the chip is connected
15
16Example:
17
18 i2c@00000000 {
19 /* ... */
20
21 gt928@5d {
22 compatible = "goodix,gt928";
23 reg = <0x5d>;
24 interrupt-parent = <&gpio>;
25 interrupts = <0 0>;
26 };
27
28 /* ... */
29 };
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
index 96a17541391e..943ed01f9fe5 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -65,6 +65,7 @@ gef GE Fanuc Intelligent Platforms Embedded Systems, Inc.
65geniatech Geniatech, Inc. 65geniatech Geniatech, Inc.
66globalscale Globalscale Technologies, Inc. 66globalscale Globalscale Technologies, Inc.
67gmt Global Mixed-mode Technology, Inc. 67gmt Global Mixed-mode Technology, Inc.
68goodix Shenzhen Huiding Technology Co., Ltd.
68google Google, Inc. 69google Google, Inc.
69gumstix Gumstix, Inc. 70gumstix Gumstix, Inc.
70gw Gateworks Corporation 71gw Gateworks Corporation
diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig
index 58917525126e..2adf7244b025 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -297,11 +297,12 @@ config TOUCHSCREEN_FUJITSU
297 297
298config TOUCHSCREEN_GOODIX 298config TOUCHSCREEN_GOODIX
299 tristate "Goodix I2C touchscreen" 299 tristate "Goodix I2C touchscreen"
300 depends on I2C && ACPI 300 depends on I2C
301 help 301 help
302 Say Y here if you have the Goodix touchscreen (such as one 302 Say Y here if you have the Goodix touchscreen (such as one
303 installed in Onda v975w tablets) connected to your 303 installed in Onda v975w tablets) connected to your
304 system. 304 system. It also supports 5-finger chip models, which can be
305 found on ARM tablets, like Wexler TAB7200 and MSI Primo73.
305 306
306 If unsure, say N. 307 If unsure, say N.
307 308
diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c
index 3ab7232ac1af..3af16984d57c 100644
--- a/drivers/input/touchscreen/goodix.c
+++ b/drivers/input/touchscreen/goodix.c
@@ -23,6 +23,8 @@
23#include <linux/irq.h> 23#include <linux/irq.h>
24#include <linux/interrupt.h> 24#include <linux/interrupt.h>
25#include <linux/slab.h> 25#include <linux/slab.h>
26#include <linux/acpi.h>
27#include <linux/of.h>
26#include <asm/unaligned.h> 28#include <asm/unaligned.h>
27 29
28struct goodix_ts_data { 30struct goodix_ts_data {
@@ -375,11 +377,27 @@ static const struct i2c_device_id goodix_ts_id[] = {
375 { } 377 { }
376}; 378};
377 379
380#ifdef CONFIG_ACPI
378static const struct acpi_device_id goodix_acpi_match[] = { 381static const struct acpi_device_id goodix_acpi_match[] = {
379 { "GDIX1001", 0 }, 382 { "GDIX1001", 0 },
380 { } 383 { }
381}; 384};
382MODULE_DEVICE_TABLE(acpi, goodix_acpi_match); 385MODULE_DEVICE_TABLE(acpi, goodix_acpi_match);
386#endif
387
388#ifdef CONFIG_OF
389static const struct of_device_id goodix_of_match[] = {
390 { .compatible = "goodix,gt911" },
391 { .compatible = "goodix,gt9110" },
392 { .compatible = "goodix,gt912" },
393 { .compatible = "goodix,gt927" },
394 { .compatible = "goodix,gt9271" },
395 { .compatible = "goodix,gt928" },
396 { .compatible = "goodix,gt967" },
397 { }
398};
399MODULE_DEVICE_TABLE(of, goodix_of_match);
400#endif
383 401
384static struct i2c_driver goodix_ts_driver = { 402static struct i2c_driver goodix_ts_driver = {
385 .probe = goodix_ts_probe, 403 .probe = goodix_ts_probe,
@@ -387,7 +405,8 @@ static struct i2c_driver goodix_ts_driver = {
387 .driver = { 405 .driver = {
388 .name = "Goodix-TS", 406 .name = "Goodix-TS",
389 .owner = THIS_MODULE, 407 .owner = THIS_MODULE,
390 .acpi_match_table = goodix_acpi_match, 408 .acpi_match_table = ACPI_PTR(goodix_acpi_match),
409 .of_match_table = of_match_ptr(goodix_of_match),
391 }, 410 },
392}; 411};
393module_i2c_driver(goodix_ts_driver); 412module_i2c_driver(goodix_ts_driver);