Skip to contentSkip to conversation

Add device tree support for Goodix GT9xx series touchscreen controller

PATCH New Aleksei Mamlin 3 participants 5 messages Jan 18, 2015 – Jan 19, 2015 2 messages not in the archive

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v2 cover Add device tree support for Goodix GT9xx series touchscreen controller

This patch set adds device tree support and binding information for Goodix GT9xx series touchscreen controller. Support was tested on Wexler Tab 7200 tablet pc and also should work on other devices.

Changes since v1:
Added Kconfig entry, which enable CONFIG_OF

Aleksei Mamlin (3):
input: goodix: Add device tree support
dt-bindings: Add vendor-prefix for Goodix
input: goodix: Add bindings documentation

 .../bindings/input/touchscreen/gt9xx.txt           | 23 ++++++++++++++++++++++
 .../devicetree/bindings/vendor-prefixes.txt        |  1 +
 drivers/input/touchscreen/Kconfig                  |  2 +-
 drivers/input/touchscreen/goodix.c                 | 10 ++++++++++
 4 files changed, 35 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/input/touchscreen/gt9xx.txt
Signature · 1 line
2.0.5
#2 lore raw

PATCH v2 1/3 input: goodix: Add device tree support

In reply to a message not in the archive
---
 drivers/input/touchscreen/Kconfig  |  2 +-
 drivers/input/touchscreen/goodix.c | 10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)
drivers/input/touchscreen/Kconfig +1 -1
index 5891752..c4a79b7 100644
@@ -297,7 +297,7 @@ config TOUCHSCREEN_FUJITSU
 
 config TOUCHSCREEN_GOODIX
 	tristate "Goodix I2C touchscreen"
-	depends on I2C && ACPI
+	depends on I2C && (ACPI || OF)
 	help
 	  Say Y here if you have the Goodix touchscreen (such as one
 	  installed in Onda v975w tablets) connected to your
drivers/input/touchscreen/goodix.c +10 -0
index ca19668..603d2ae 100644
@@ -23,6 +23,7 @@
 #include <linux/irq.h>
 #include <linux/interrupt.h>
 #include <linux/slab.h>
+#include <linux/of.h>
 #include <asm/unaligned.h>
 
 struct goodix_ts_data {
@@ -378,6 +379,14 @@ static const struct acpi_device_id goodix_acpi_match[] = {
 };
 MODULE_DEVICE_TABLE(acpi, goodix_acpi_match);
 
+#ifdef CONFIG_OF
+static struct of_device_id goodix_of_match[] = {
+	{ .compatible = "goodix,gt9xx" },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, goodix_of_match);
+#endif
+
 static struct i2c_driver goodix_ts_driver = {
 	.probe = goodix_ts_probe,
 	.id_table = goodix_ts_id,
@@ -385,6 +394,7 @@ static struct i2c_driver goodix_ts_driver = {
 		.name = "Goodix-TS",
 		.owner = THIS_MODULE,
 		.acpi_match_table = goodix_acpi_match,
+		.of_match_table = of_match_ptr(goodix_of_match),
 	},
 };
 module_i2c_driver(goodix_ts_driver);
Signature · 6 lines
2.0.5

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#5 lore raw

PATCH v2 2/3 dt-bindings: Add vendor-prefix for Goodix

In reply to Aleksei Mamlin
---
 Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/vendor-prefixes.txt +1 -0
index b1df0ad..72136f1 100644
@@ -64,6 +64,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
Signature · 1 line
2.0.5
#6 lore raw

PATCH v2 3/3 input: goodix: Add bindings documentation

In reply to Aleksei Mamlin
---
 .../bindings/input/touchscreen/gt9xx.txt           | 23 ++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/touchscreen/gt9xx.txt
Documentation/devicetree/bindings/input/touchscreen/gt9xx.txt new file +23 -0
new file mode 100644
index 0000000..96c17f0
@@ -0,0 +1,23 @@
+Device tree bindings for Goodix GT9xx series touchscreen controller
+
+Required properties:
+
+ - compatible		: Should be "goodix,gt9xx"
+ - reg			: I2C address of the chip
+ - interrupt-parent 	: Interrupt controller to which the chip is connected
+ - interrupts		: Interrupt to which the chip is connected
+
+Example:
+
+	i2c@00000000 {
+		/* ... */
+
+		gt9xx@5d {
+			compatible = "goodix,gt9xx";
+			reg = <0x5d>;
+			interrupt-parent = <&gpio>;
+			interrupts = <0 2>;
+		};
+
+		/* ... */
+	};
Signature · 1 line
2.0.5
#4 lore raw

Re: [PATCH v2 1/3] input: goodix: Add device tree support

In reply to a message not in the archive
Quoted 11 lines · Aleksei Mamlin
---
 drivers/input/touchscreen/Kconfig  |  2 +-
 drivers/input/touchscreen/goodix.c | 10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)
drivers/input/touchscreen/Kconfig +0 -0
index 5891752..c4a79b7 100644

drivers/input/touchscreen/Kconfig config TOUCHSCREEN_FUJITSU · line 300

Quoted 5 lines
drivers/input/touchscreen/Kconfig +1 -1
@@ -297,7 +297,7 @@ config TOUCHSCREEN_FUJITSU
 
 config TOUCHSCREEN_GOODIX
 	tristate "Goodix I2C touchscreen"
-	depends on I2C && ACPI
+	depends on I2C && (ACPI || OF)

This can't be ACPI or OF. If ACPI is disabled, the goodix_acpi_match structure is still defined, not ifdef'ed like the OF code you're adding.

Quoted 31 lines
drivers/input/touchscreen/Kconfig +0 -0
 	help
 	  Say Y here if you have the Goodix touchscreen (such as one
 	  installed in Onda v975w tablets) connected to your
drivers/input/touchscreen/goodix.c +9 -0
index ca19668..603d2ae 100644
@@ -23,6 +23,7 @@
 #include <linux/irq.h>
 #include <linux/interrupt.h>
 #include <linux/slab.h>
+#include <linux/of.h>
 #include <asm/unaligned.h>
 
 struct goodix_ts_data {
@@ -378,6 +379,14 @@ static const struct acpi_device_id goodix_acpi_match[] = {
 };
 MODULE_DEVICE_TABLE(acpi, goodix_acpi_match);
 
+#ifdef CONFIG_OF
+static struct of_device_id goodix_of_match[] = {
+	{ .compatible = "goodix,gt9xx" },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, goodix_of_match);
+#endif
+
 static struct i2c_driver goodix_ts_driver = {
 	.probe = goodix_ts_probe,
 	.id_table = goodix_ts_id,

drivers/input/touchscreen/goodix.c static struct i2c_driver goodix_ts_driver = { · line 400

Quoted 7 lines
drivers/input/touchscreen/goodix.c +1 -0
@@ -385,6 +394,7 @@ static struct i2c_driver goodix_ts_driver = {
 		.name = "Goodix-TS",
 		.owner = THIS_MODULE,
 		.acpi_match_table = goodix_acpi_match,
+		.of_match_table = of_match_ptr(goodix_of_match),
 	},
 };
 module_i2c_driver(goodix_ts_driver);

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html