ARM64: dts: rockchip: support gt9xx for Rockchip platform
authorXu Jianqun <jay.xu@rock-chips.com>
Mon, 28 Dec 2015 07:34:39 +0000 (15:34 +0800)
committerGerrit Code Review <gerrit@rock-chips.com>
Wed, 6 Jan 2016 10:36:02 +0000 (18:36 +0800)
Add support gt9xx driver for Rockchip platform goodix
touchscreen.

There is a goodix driver on upstream but it not work well, so
use the old driver until someone debug the upstream driver.

Change-Id: Id8711a63150da4bdcd8e78f3b2a82157e1b3de4f
Signed-off-by: Xu Jianqun <jay.xu@rock-chips.com>
arch/arm64/boot/dts/rockchip/rk3368-tb-sheep.dts
arch/arm64/boot/dts/rockchip/rk3368-tb.dtsi
arch/arm64/configs/rockchip_defconfig
drivers/input/touchscreen/Kconfig
drivers/input/touchscreen/Makefile
drivers/input/touchscreen/gt9xx/gt9xx.c

index 27e1bdf3f481f8a18f0f3a6956dfee19edbfe751..b45d2c540f0713882d12b92bfe217771ec1d50a5 100644 (file)
@@ -48,7 +48,7 @@
        compatible = "rockchip,sheep", "rockchip,rk3368";
 };
 
-&gt911 {
+&gt9xx {
        status = "okay";
 };
 
index b78518014256d6b718a7ac1be3b2b762fc078f9f..925ce1a2d8ee351c85440b5aba9a65e2cb25d610 100644 (file)
                interrupts = <12 0>;
                status = "disabled";
        };
+
+       gt9xx: gt9xx@14 {
+               compatible = "goodix,gt9xx";
+               reg = <0x14>;
+               touch-gpio = <&gpio0 12 IRQ_TYPE_LEVEL_LOW>;
+               reset-gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>;
+               max-x = <1200>;
+               max-y = <1900>;
+               tp-size = <911>;
+               status = "disabled";
+       };
 };
 
 &pwm0 {
index b4b326bb4718bb83252c8bf8c59ee5cbbced0a9a..586af125691f37b7ce953ab671c8f48ee03ac3a5 100644 (file)
@@ -259,7 +259,7 @@ CONFIG_TABLET_USB_GTCO=y
 CONFIG_TABLET_USB_HANWANG=y
 CONFIG_TABLET_USB_KBTAB=y
 CONFIG_INPUT_TOUCHSCREEN=y
-CONFIG_TOUCHSCREEN_GOODIX=y
+CONFIG_TOUCHSCREEN_GT9XX=y
 CONFIG_INPUT_MISC=y
 CONFIG_INPUT_UINPUT=y
 # CONFIG_SERIO is not set
index ae33da7ab51ff7f5f84464366be1c4b9f8030527..e705afd4d866c2af8e7a26b929fec61084153a72 100644 (file)
@@ -335,6 +335,15 @@ config TOUCHSCREEN_GOODIX
          To compile this driver as a module, choose M here: the
          module will be called goodix.
 
+config TOUCHSCREEN_GT9XX
+       tristate "Goodix gt9xx support for rockchip platform"
+       depends on I2C && ARCH_ROCKCHIP
+       help
+         Say Y here if you have a touchscreen interface using the gt9xx
+         on Rockchip platform, and your board-specific initialization
+         code includes that in its table of IIC devices.
+         If unsure, say N.
+
 config TOUCHSCREEN_ILI210X
        tristate "Ilitek ILI210X based touchscreen"
        depends on I2C
index cbaa6abb08dae6c58ea1125b0fc0baa335dbc444..922becb12d0ec6d96eda6676c78fadd900fc901d 100644 (file)
@@ -38,6 +38,7 @@ obj-$(CONFIG_TOUCHSCREEN_EGALAX)      += egalax_ts.o
 obj-$(CONFIG_TOUCHSCREEN_FT6236)       += ft6236.o
 obj-$(CONFIG_TOUCHSCREEN_FUJITSU)      += fujitsu_ts.o
 obj-$(CONFIG_TOUCHSCREEN_GOODIX)       += goodix.o
+obj-$(CONFIG_TOUCHSCREEN_GT9XX)                += gt9xx/
 obj-$(CONFIG_TOUCHSCREEN_ILI210X)      += ili210x.o
 obj-$(CONFIG_TOUCHSCREEN_IMX6UL_TSC)   += imx6ul_tsc.o
 obj-$(CONFIG_TOUCHSCREEN_INEXIO)       += inexio.o
index 1bac1f8a53e31e899a921ac5aefefb690db56aef..3cf920246466edea6c3c9a8e393e43c6278ce5f6 100755 (executable)
@@ -158,15 +158,18 @@ s32 gtp_i2c_read(struct i2c_client *client, u8 *buf, s32 len)
     msgs[0].addr  = client->addr;
     msgs[0].len   = GTP_ADDR_LENGTH;
     msgs[0].buf   = &buf[0];
+#ifdef CONFIG_I2C_ROCKCHIP_COMPAT
     msgs[0].scl_rate=200 * 1000;
     //msgs[0].scl_rate = 300 * 1000;    // for Rockchip, etc.
-    
+#endif
     msgs[1].flags = I2C_M_RD;
     msgs[1].addr  = client->addr;
     msgs[1].len   = len - GTP_ADDR_LENGTH;
     msgs[1].buf   = &buf[GTP_ADDR_LENGTH];
+#ifdef CONFIG_I2C_ROCKCHIP_COMPAT
     msgs[1].scl_rate=200 * 1000;
-    //msgs[1].scl_rate = 300 * 1000;
+    //msgs[1].scl_rate = 300 * 1000;    // for Rockchip, etc.
+#endif
 
     while(retries < 5)
     {
@@ -228,9 +231,10 @@ s32 gtp_i2c_write(struct i2c_client *client,u8 *buf,s32 len)
     msg.addr  = client->addr;
     msg.len   = len;
     msg.buf   = buf;
+#ifdef CONFIG_I2C_ROCKCHIP_COMPAT
     msg.scl_rate=200 * 1000;
     //msg.scl_rate = 300 * 1000;    // for Rockchip, etc
-
+#endif
     while(retries < 5)
     {
         ret = i2c_transfer(client->adapter, &msg, 1);
@@ -1676,8 +1680,6 @@ static ssize_t gt91xx_config_write_proc(struct file *filp, const char __user *bu
 {
     s32 ret = 0;
 
-    GTP_DEBUG("write count %d\n", count);
-
     if (count > GTP_CONFIG_MAX_LENGTH)
     {
         GTP_ERROR("size not match [%d:%zu]\n", GTP_CONFIG_MAX_LENGTH, count);
@@ -1943,7 +1945,7 @@ static int goodix_ts_early_suspend(struct tp_device *tp_d)
     //  delay 48 + 10ms to ensure reliability
     msleep(58);
        regulator_tp = regulator_get(NULL,"vcc_tp");
-       if(regulator_tp ==NULL)
+       if(IS_ERR(regulator_tp))
        {
                printk("!!!!%s:%d:get regulator_tp failed\n",__func__,__LINE__);
                return 0;
@@ -1978,7 +1980,7 @@ static int goodix_ts_early_resume(struct tp_device *tp_d)
     GTP_INFO("System resume.");
 
        regulator_tp = regulator_get(NULL, "vcc_tp");
-       if(regulator_tp ==NULL)
+       if(IS_ERR(regulator_tp))
        {
                printk("!!!!%s:%d:get regulator_tp failed\n",__func__,__LINE__);
                return 0;
@@ -2567,14 +2569,13 @@ static int goodix_ts_probe(struct i2c_client *client, const struct i2c_device_id
     struct device_node *np = client->dev.of_node;
     enum of_gpio_flags rst_flags, pwr_flags;
     u32 val;
-       printk("___%s() start____ \n", __func__);
+       printk("%s() start\n", __func__);
 
     
     GTP_DEBUG_FUNC();
     
     //do NOT remove these logs
     GTP_INFO("GTP Driver Version: %s", GTP_DRIVER_VERSION);
-    GTP_INFO("GTP Driver Built@%s, %s", __TIME__, __DATE__);
     GTP_INFO("GTP I2C Address: 0x%02x", client->addr);
 
     i2c_connect_client = client;