rk3128 android7.1 gt928触摸调试

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;  //GTP_CHANGE_X2Y  1
+ bool mGtpChange_X2Y = FALSE;  //GTP_CHANGE_X2Y  1 TRUE
bool mGtp_X_Reverse = FALSE;  //GTP_X_REVERSE_ENABLE
bool mGtp_Y_Reverse = TRUE;  //GTP_Y_REVERSE_ENABLE
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;
    //struct regulator *regulator_tp = NULL;
    //int reg = 0;

    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.");
    }
    // to avoid waking up while not sleeping
    //  delay 48 + 10ms to ensure reliability
    
+ /*    msleep(58);
+ 
	regulator_tp = regulator_get(NULL,"vcc_tp");
	if(regulator_tp ==NULL)
	{
		printk("!!!!%s:%d:get regulator_tp failed\n",__func__,__LINE__);
		return 0;
	}
	while(regulator_is_enabled(regulator_tp))
	{
		reg = regulator_disable(regulator_tp);
		msleep(10);
	}
	regulator_put(regulator_tp);  
+	msleep(20);*/
+	
	return 0;
}

/*******************************************************
Function:
    Late resume function.
Input:
    h: early_suspend struct.
Output:
    None.
*******************************************************/
static int goodix_ts_early_resume(struct tp_device *tp_d)
{
    struct goodix_ts_data *ts;
    s8 ret = -1;
   // struct regulator *regulator_tp = NULL;
   // int reg = 0;
    ts = container_of(tp_d, struct goodix_ts_data, tp);
    GTP_DEBUG_FUNC();

    GTP_INFO("System resume.");

+ /*	regulator_tp = regulator_get(NULL, "vcc_tp");
	if(regulator_tp ==NULL)
	{
		printk("!!!!%s:%d:get regulator_tp failed\n",__func__,__LINE__);
		return 0;
	}
	while(!(regulator_is_enabled(regulator_tp)))
	{
		reg = regulator_enable(regulator_tp);
		msleep(10);
	}
+ 	regulator_put(regulator_tp); */
+ 
	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)
    {
        // do nothing
    }
    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; //pwr_flags;
    u32 val;
  
    ...............
    
    if (!np) {
    	dev_err(&client->dev, "no device tree\n");
    	return -EINVAL;
    }
+ /*    if (of_property_read_u32(np, "tp-size", &val)) {
    	dev_err(&client->dev, "no max-x defined\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);
+   //ts->pwr_pin = of_get_named_gpio_flags(np, "power-gpio", 0, &pwr_flags);
    //ts->tp_select_pin = of_get_named_gpio_flags(np, "tp-select-gpio", 0, &tp_select_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>;
	};
};

根据自己的实际情况进行配置
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

YY2065

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值