Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Aleksei Mamlin and committed by
Dmitry Torokhov
771d8f1b a7ac7c95

+53 -3
+29
Documentation/devicetree/bindings/input/touchscreen/goodix.txt
··· 1 + Device tree bindings for Goodix GT9xx series touchscreen controller 2 + 3 + Required 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 + 16 + Example: 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 + };
+1
Documentation/devicetree/bindings/vendor-prefixes.txt
··· 65 65 geniatech Geniatech, Inc. 66 66 globalscale Globalscale Technologies, Inc. 67 67 gmt Global Mixed-mode Technology, Inc. 68 + goodix Shenzhen Huiding Technology Co., Ltd. 68 69 google Google, Inc. 69 70 gumstix Gumstix, Inc. 70 71 gw Gateworks Corporation
+3 -2
drivers/input/touchscreen/Kconfig
··· 297 297 298 298 config TOUCHSCREEN_GOODIX 299 299 tristate "Goodix I2C touchscreen" 300 - depends on I2C && ACPI 300 + depends on I2C 301 301 help 302 302 Say Y here if you have the Goodix touchscreen (such as one 303 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 307 If unsure, say N. 307 308
+20 -1
drivers/input/touchscreen/goodix.c
··· 23 23 #include <linux/irq.h> 24 24 #include <linux/interrupt.h> 25 25 #include <linux/slab.h> 26 + #include <linux/acpi.h> 27 + #include <linux/of.h> 26 28 #include <asm/unaligned.h> 27 29 28 30 struct goodix_ts_data { ··· 377 375 { } 378 376 }; 379 377 378 + #ifdef CONFIG_ACPI 380 379 static const struct acpi_device_id goodix_acpi_match[] = { 381 380 { "GDIX1001", 0 }, 382 381 { } 383 382 }; 384 383 MODULE_DEVICE_TABLE(acpi, goodix_acpi_match); 384 + #endif 385 + 386 + #ifdef CONFIG_OF 387 + static const struct of_device_id goodix_of_match[] = { 388 + { .compatible = "goodix,gt911" }, 389 + { .compatible = "goodix,gt9110" }, 390 + { .compatible = "goodix,gt912" }, 391 + { .compatible = "goodix,gt927" }, 392 + { .compatible = "goodix,gt9271" }, 393 + { .compatible = "goodix,gt928" }, 394 + { .compatible = "goodix,gt967" }, 395 + { } 396 + }; 397 + MODULE_DEVICE_TABLE(of, goodix_of_match); 398 + #endif 385 399 386 400 static struct i2c_driver goodix_ts_driver = { 387 401 .probe = goodix_ts_probe, ··· 405 387 .driver = { 406 388 .name = "Goodix-TS", 407 389 .owner = THIS_MODULE, 408 - .acpi_match_table = goodix_acpi_match, 390 + .acpi_match_table = ACPI_PTR(goodix_acpi_match), 391 + .of_match_table = of_match_ptr(goodix_of_match), 409 392 }, 410 393 }; 411 394 module_i2c_driver(goodix_ts_driver);