Android7.1 内核版本: Linux version 3.10.104
make menuconfig

1.\drivers\input\touchscreen\gt9xx\gt9xx.h
bool m89or101 = TRUE;
bool bgt911 = FALSE;
- bool mGtpChange_X2Y = TRUE;
+ bool mGtpChange_X2Y = FALSE;
bool mGtp_X_Reverse = FALSE;
bool mGtp_Y_Reverse = TRUE;
2. \drivers\input\touchscreen\gt9xx\gt9xx.c
static int goodix_ts_early_suspend(struct tp_device *tp_d)
{
struct goodix_ts_data *ts;
s8 ret = -1;
ts = container_of(tp_d, struct goodix_ts_data, tp);
GTP_DEBUG_FUNC();
GTP_INFO("System suspend.");
ts->gtp_is_suspend = 1;
#if GTP_ESD_PROTECT
gtp_esd_switch(ts->client, SWITCH_OFF);
#endif
#if GTP_GESTURE_WAKEUP
ret = gtp_enter_doze(ts);
#else
if (ts->use_irq)
{
gtp_irq_disable(ts);
}
else
{
hrtimer_cancel(&ts->timer);
}
ret = gtp_enter_sleep(ts);
#endif
if (ret < 0)
{
printk("GTP early suspend failed.");
}
+
+
return 0;
}
static int goodix_ts_early_resume(struct tp_device *tp_d)
{
struct goodix_ts_data *ts;
s8 ret = -1;
ts = container_of(tp_d, struct goodix_ts_data, tp);
GTP_DEBUG_FUNC();
GTP_INFO("System resume.");
+
+
msleep(10);
ret = gtp_wakeup_sleep(ts);
#if GTP_GESTURE_WAKEUP
doze_status = DOZE_DISABLED;
#endif
if (ret < 0)
{
GTP_ERROR("GTP later resume failed.");
}
#if (GTP_COMPATIBLE_MODE)
if (CHIP_TYPE_GT9F == ts->chip_type)
{
}
else
#endif
{
gtp_send_cfg(ts->client);
}
if (ts->use_irq)
{
gtp_irq_enable(ts);
}
else
{
hrtimer_start(&ts->timer, ktime_set(1, 0), HRTIMER_MODE_REL);
}
ts->gtp_is_suspend = 0;
#if GTP_ESD_PROTECT
gtp_esd_switch(ts->client, SWITCH_ON);
#endif
return 0;
}
..........
static int goodix_ts_probe(struct i2c_client *client, const struct i2c_device_id *id)
{
s32 ret = -1;
struct goodix_ts_data *ts;
u16 version_info;
struct device_node *np = client->dev.of_node;
- enum of_gpio_flags rst_flags,pwr_flags;
+ enum of_gpio_flags rst_flags;
u32 val;
...............
if (!np) {
dev_err(&client->dev, "no device tree\n");
return -EINVAL;
}
+
+
...............
ts->irq_pin = of_get_named_gpio_flags(np, "touch-gpio", 0, (enum of_gpio_flags *)(&ts->irq_flags));
ts->rst_pin = of_get_named_gpio_flags(np, "reset-gpio", 0, &rst_flags);
+
if (of_property_read_u32(np, "max-x", &val)) {
dev_err(&client->dev, "no max-x defined\n");
return -EINVAL;
}
..................
return ret;
}
3、dts
&i2c0 {
status = "okay";
ts@5d {
compatible = "goodix,gt9xx";
reg = <0x5d>;
touch-gpio = <&gpio3 GPIO_C6 IRQ_TYPE_LEVEL_LOW>;
reset-gpio = <&gpio1 GPIO_A7 GPIO_ACTIVE_LOW>;
max-x = <800>;
max-y = <1280>;
};
};
根据自己的实际情况进行配置