我的tp驱动gsl3675在android4.4.2上已经工作正常,现在需要把它迁移到android4.4.3上,andorid4.4.3内核用的设备树框架,主要的修改如下:
diff --git a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
index bf81f2d..3f12cf3 100755
--- a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
@@ -279,6 +279,9 @@
lvds0-5vpow-en = <&gpio5 5 0>;
lvds0-bl-pwm-en = <&gpio4 25 0>;
lvds0-cab-en = <&gpio5 12 0>;
+
+ /*tp*/
+ tp-pow-en = <&gpio4 29 0>;
};
};
@@ -463,6 +466,14 @@
interrupts = <8 2>;
wakeup-gpios = <&gpio6 8 0>;
};
+ gsl3675_ts@0x40 {
+ compatible = "fcar,gsl3675_ts";
+ reg = <0x40>;
+ interrupt-parent = <&gpio7>;
+ interrupts = <19 2>;
+ int-gpios = <&gpio7 0 0>; // TP_DEV_EN
+ wakeup-gpios = <&gpio7 1 0>; //TP_INT_TO
+ };
};
&i2c3 {
@@ -507,7 +518,7 @@
vdd-supply = <®_sensor>;
interrupt-parent = <&gpio3>;
interrupts = <9 2>;
- };
+ };
};
&iomuxc {
@@ -556,6 +567,11 @@
MX6QDL_PAD_DISP0_DAT5__GPIO4_IO26 0x80000000//145 lvds0-pow-en
MX6QDL_PAD_DISP0_DAT11__GPIO5_IO05 0x80000000//135 lvds0-5vpow-en
MX6QDL_PAD_DISP0_DAT18__GPIO5_IO12 0x80000000//131 lvds0-cab-en
+
+ /*tp*/
+ MX6QDL_PAD_SD3_DAT5__GPIO7_IO00 0x80000000//43 TP_INT_TO
+ MX6QDL_PAD_SD3_DAT4__GPIO7_IO01 0x80000000//42 TP_DEV_EN
+ MX6QDL_PAD_DISP0_DAT8__GPIO4_IO29 0x80000000//134 TP_POW_EN
//huangkc_fcar end
>;
};
diff --git a/drivers/input/touchscreen/gsl3675.c b/drivers/input/touchscreen/gsl3675.c
index f903e38..96f10de 100755
--- a/drivers/input/touchscreen/gsl3675.c
+++ b/drivers/input/touchscreen/gsl3675.c
@@ -20,7 +20,7 @@
#include <linux/io.h>
#include <linux/platform_device.h>
#include <linux/async.h>
-#include <mach/gpio.h>
+//#include <mach/gpio.h>
#include <linux/irq.h>
//#include <mach/board.h>
#include <linux/workqueue.h>
@@ -28,6 +28,8 @@
#include <linux/input/mt.h>
#include <linux/gpio.h>
+#include <linux/slab.h>
+#include <linux/of_gpio.h>
#include "GSL3675.h"
@@ -44,8 +46,10 @@
#define GSLX680_I2C_NAME "gslX680"
#define GSLX680_I2C_ADDR 0x40
-#define IRQ_PORT IMX_GPIO_NR(6,8)
-#define WAKE_PORT IMX_GPIO_NR(4,22)//RESET TP
+//#define IRQ_PORT IMX_GPIO_NR(6,8)
+//#define WAKE_PORT IMX_GPIO_NR(4,22)//RESET TP
+static int IRQ_PORT = 0;
+static char WAKE_PORT = 0;
#define SCREEN_MAX_X 1280
#define SCREEN_MAX_Y 800
@@ -1035,6 +1039,24 @@ static int __devinit gsl_ts_probe(struct i2c_client *client,
printk("GSLX680 Enter %s\n", __func__);
+ //huangkc_fcar begin
+ struct device_node *np = client->dev.of_node;
+
+ if (!np)
+ {
+ printk("#####huangkc_fcar failed to of_find_node_by_name gsl3675_ts : fun is %s line is %d \n file is %s\n",__FUNCTION__,__LINE__,__FILE__);
+ return ;
+ }
+
+ WAKE_PORT = of_get_named_gpio(np, "wakeup-gpios", 0);
+ if (!gpio_is_valid(WAKE_PORT))
+ printk("#####huangkc_fcar gpio WAKE_PORT is not valid : fun is %s line is %d \n file is %s\n",__FUNCTION__,__LINE__,__FILE__);
+
+ IRQ_PORT = of_get_named_gpio(np, "int-gpios", 0);
+ if (!gpio_is_valid(IRQ_PORT))
+ printk("#####huangkc_fcar gpio IRQ_PORT is not valid : fun is %s line is %d \n file is %s\n",__FUNCTION__,__LINE__,__FILE__);
+ //huangk_fcar end
+
if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
dev_err(&client->dev, "I2C functionality not supported\n");
return -ENODEV;
@@ -1145,10 +1167,16 @@ static const struct i2c_device_id gsl_ts_id[] = {
};
MODULE_DEVICE_TABLE(i2c, gsl_ts_id);
+static struct of_device_id gsl3675_ts_dt_ids[] = {
+ { .compatible = "fcar,gsl3675_ts" },
+ { /* sentinel */ }
+};
+
static struct i2c_driver gsl_ts_driver = {
.driver = {
.name = GSLX680_I2C_NAME,
.owner = THIS_MODULE,
+ .of_match_table = of_match_ptr(gsl3675_ts_dt_ids),
},
#ifndef CONFIG_HAS_EARLYSUSPEND
.suspend = gsl_ts_suspend,
另外,the touch IC gsl3675's power pin TP_POW_EN and reset pin TP_DEV_EN has been pull up by measuring.触摸ic gsl3675的电源脚TP_POW_EN 和复位脚TP_DEV_EN通过用万用表测量可知道已经被拉高,但是非常奇怪的是,i2c 通讯还是会失败,出错信息如下:
==gsl_ts_init==
GSLX680 Enter gsl_ts_probe
==kzalloc success=
[GSLX680] Enter gslX680_ts_init
input: gslX680 as /devices/soc0/soc.0/2100000.aips-bus/21a4000.i2c/i2c-0/0-0040/input/input0
gsl_ts_read set data address fail!
gsl_ts_read set data address fail!
------gslX680 test_i2c error------
gsl_ts_read set data address fail!
#########check mem read 0xb0 = 0 0 0 0 #########
gsl_ts_read set data address fail!
gsl_ts_read set data address fail!
------gslX680 test_i2c error------
[GSLX680] End gsl_ts_probe
我也有从其他平台拿已经证明可以正常工作的驱动移植到现在板子上的的尝试,比如rockchip瑞芯微,但是报的错是一样的。
有移植过这个驱动的朋友,或者有android4.4.3开发过im6q产品的朋友,请帮忙看下这个问题
@FSL_TICS_Rita |