|
发表于 2022-10-22 17:20:30
967 浏览 0 回复
T618(UMS512) Android11 TP 功耗配置
问题:
展锐T618 基线触摸屏 无休眠唤醒功能;
解决方案:
主要是创建节点: /sys/class/touchscreen_suspend/device/suspend_tp,展锐自行设计,系统层通过对suspend_tp节点进行写0和1后,TP 进行睡眠和唤醒;
修改代码如下(代码路径:bsp/modules/kernel4.14/input/touchscreen/focaltech_8006/focaltech.c):
- static int ft5x0x_i2c_txdata(char *txdata, int length)
- @@ -1560,6 +1601,81 @@ static const struct attribute_group ft5x0x_attr_group = {
- extern char TP_NAME[20];
- extern unsigned char TP_FW_VER;
- #endif
- +static int ft_suspend()
- +{
- + //int ret = -1;
- + printk("==%s==\n", __FUNCTION__);
- +
- + //ret = ft5x0x_write_reg(FT5X0X_REG_PMODE, PMODE_HIBERNATE);
- + //if(ret){
- + // printk("==ft5x0x_ts_suspend== ft5x0x_write_reg fail\n");
- + //}
- + ///
- + ft5x0x_irq_disable(g_ft5x0x_ts);
- + ft5x0x_clear_report_data(g_ft5x0x_ts);
- +
- + return 0;
- +}
- +
- +//static void ft5x0x_resume(void)
- +static int ft_resume()
- +{
- + //ret = ft5x0x_write_reg(FT5X0X_REG_PMODE, PMODE_HIBERNATE);
- +
- + //ft5x0x_ts_reset();
- +
- + ft5x0x_irq_enable(g_ft5x0x_ts);
- + msleep(2);
- + ft5x0x_clear_report_data(g_ft5x0x_ts);
- +
- +
- + return 0;
- +}
- +
- +static ssize_t suspend_tp_show(struct device *dev,struct device_attribute *attr, char *buf)
- +{
- +
- + return sprintf(buf, "ts_suspend_show %d\n", ft_suspend_flag);
- +
- +
- +}
- +
- +static ssize_t suspend_tp_store(struct device *dev,struct device_attribute *attr, const char *buf, size_t count)
- +{
- + //struct goodix_ts_data *pdata = i2c_get_clientdata(i2c_connect_client);
- +
- + //printk("ts_suspend_store 11 \n");
- + //if(ft_suspend_flag == 0) {
- + // ft_suspend_flag = 1;
- + // return count;
- + //}
- +
- + printk("%s %d \n",__func__,__LINE__);
- +
- + if ((buf[0] == '1'))
- + {
- + ft_suspend();
- + ft_suspend_flag = 1;
- + }
- + else if ((buf[0] == '0'))
- + {
- + ft_resume();
- + ft_suspend_flag = 0;
- + }
- +
- + return count;
- +}
- +
- +static DEVICE_ATTR(suspend_tp,0664,suspend_tp_show,suspend_tp_store);
- +
-
- static int ft5x0x_ts_probe(struct i2c_client *client, const struct i2c_device_id *id)
- {
- @@ -1568,6 +1684,10 @@ static int ft5x0x_ts_probe(struct i2c_client *client, const struct i2c_device_id
- struct ft5x0x_ts_platform_data *pdata = client->dev.platform_data;
- int err = 0;
- unsigned char uc_reg_value;
- + struct class *touchsreen_suspend_class;
- + struct device *touchsreen_suspend_dev;
- +
- +
- #ifdef __WW6_CDC_COM__
- u8 i;
- #endif
- @@ -1840,6 +1960,21 @@ focaltech_get_upgrade_array(client);
- #ifdef SYSFS_DEBUG
- fts_create_sysfs_ww(client);
- #endif
- + printk("[GTP] %s %d\n",__func__,__LINE__);
- + touchsreen_suspend_class = class_create(THIS_MODULE,"touchscreen_suspend");
- + if(IS_ERR(touchsreen_suspend_class))
- + printk("Failed to create class!\n");
- +
- + touchsreen_suspend_dev = device_create(touchsreen_suspend_class, NULL, 0, NULL, "device");
- + if(IS_ERR(touchsreen_suspend_dev))
- + printk("Failed to create device!\n");
- +
- + if(device_create_file(touchsreen_suspend_dev, &dev_attr_suspend_tp) < 0) // /sys/class/touchscreen_suspend/device/suspend_tp
- + printk("Failed to create device file(%s)!\n", dev_attr_suspend_tp.attr.name);
- +
- + printk("[GTP] %s %d\n",__func__,__LINE__);
- +
- + ft_suspend_flag = 0;
-
复制代码
参考资料:
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|
手机微信同号:13682654092
|
|
|
|
|
登录或注册
|