Input: goodix - add device tree support
authorAleksei Mamlin <mamlinav@gmail.com>
Sat, 7 Mar 2015 00:43:38 +0000 (16:43 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Sat, 7 Mar 2015 01:18:17 +0000 (17:18 -0800)
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>
Documentation/devicetree/bindings/input/touchscreen/goodix.txt [new file with mode: 0644]
Documentation/devicetree/bindings/vendor-prefixes.txt
drivers/input/touchscreen/Kconfig
drivers/input/touchscreen/goodix.c

diff --git a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
new file mode 100644 (file)
index 0000000..8ba98ee
--- /dev/null
@@ -0,0 +1,29 @@
+Device tree bindings for Goodix GT9xx series touchscreen controller
+
+Required properties:
+
+ - compatible          : Should be "goodix,gt911"
+                                or "goodix,gt9110"
+                                or "goodix,gt912"
+                                or "goodix,gt927"
+                                or "goodix,gt9271"
+                                or "goodix,gt928"
+                                or "goodix,gt967"
+ - reg                 : I2C address of the chip. Should be 0x5d or 0x14
+ - interrupt-parent    : Interrupt controller to which the chip is connected
+ - interrupts          : Interrupt to which the chip is connected
+
+Example:
+
+       i2c@00000000 {
+               /* ... */
+
+               gt928@5d {
+                       compatible = "goodix,gt928";
+                       reg = <0x5d>;
+                       interrupt-parent = <&gpio>;
+                       interrupts = <0 0>;
+               };
+
+               /* ... */
+       };
index 96a1754..943ed01 100644 (file)
@@ -65,6 +65,7 @@ gef   GE Fanuc Intelligent Platforms Embedded Systems, Inc.
 geniatech      Geniatech, Inc.
 globalscale    Globalscale Technologies, Inc.
 gmt    Global Mixed-mode Technology, Inc.
+goodix Shenzhen Huiding Technology Co., Ltd.
 google Google, Inc.
 gumstix        Gumstix, Inc.
 gw     Gateworks Corporation
index 5891752..2adf724 100644 (file)
@@ -297,11 +297,12 @@ config TOUCHSCREEN_FUJITSU
 
 config TOUCHSCREEN_GOODIX
        tristate "Goodix I2C touchscreen"
-       depends on I2C && ACPI
+       depends on I2C
        help
          Say Y here if you have the Goodix touchscreen (such as one
          installed in Onda v975w tablets) connected to your
-         system.
+         system. It also supports 5-finger chip models, which can be
+         found on ARM tablets, like Wexler TAB7200 and MSI Primo73.
 
          If unsure, say N.
 
index 3ab7232..3af1698 100644 (file)
@@ -23,6 +23,8 @@
 #include <linux/irq.h>
 #include <linux/interrupt.h>
 #include <linux/slab.h>
+#include <linux/acpi.h>
+#include <linux/of.h>
 #include <asm/unaligned.h>
 
 struct goodix_ts_data {
@@ -375,11 +377,27 @@ static const struct i2c_device_id goodix_ts_id[] = {
        { }
 };
 
+#ifdef CONFIG_ACPI
 static const struct acpi_device_id goodix_acpi_match[] = {
        { "GDIX1001", 0 },
        { }
 };
 MODULE_DEVICE_TABLE(acpi, goodix_acpi_match);
+#endif
+
+#ifdef CONFIG_OF
+static const struct of_device_id goodix_of_match[] = {
+       { .compatible = "goodix,gt911" },
+       { .compatible = "goodix,gt9110" },
+       { .compatible = "goodix,gt912" },
+       { .compatible = "goodix,gt927" },
+       { .compatible = "goodix,gt9271" },
+       { .compatible = "goodix,gt928" },
+       { .compatible = "goodix,gt967" },
+       { }
+};
+MODULE_DEVICE_TABLE(of, goodix_of_match);
+#endif
 
 static struct i2c_driver goodix_ts_driver = {
        .probe = goodix_ts_probe,
@@ -387,7 +405,8 @@ static struct i2c_driver goodix_ts_driver = {
        .driver = {
                .name = "Goodix-TS",
                .owner = THIS_MODULE,
-               .acpi_match_table = goodix_acpi_match,
+               .acpi_match_table = ACPI_PTR(goodix_acpi_match),
+               .of_match_table = of_match_ptr(goodix_of_match),
        },
 };
 module_i2c_driver(goodix_ts_driver);