• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GTP_INFO函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GTP_INFO函数的典型用法代码示例。如果您正苦于以下问题:C++ GTP_INFO函数的具体用法?C++ GTP_INFO怎么用?C++ GTP_INFO使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GTP_INFO函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: gt1x_init_node

s32 gt1x_init_node(void)
{
#if GTP_GESTURE_WAKEUP
	struct proc_dir_entry *proc_entry = NULL;
	mutex_init(&gesture_data_mutex);
	memset(gestures_flag, 0, sizeof(gestures_flag));
	memset((u8 *) & gesture_data, 0, sizeof(st_gesture_data));

	proc_entry = proc_create(GESTURE_NODE, 0666, NULL, &gt1x_fops);
	if (proc_entry == NULL) {
		GTP_ERROR("Couldn't create proc entry[GESTURE_NODE]!");
		return -1;
	} else {
		GTP_INFO("Create proc entry[GESTURE_NODE] success!");
	}
#endif

#if GTP_HOTKNOT
	if (misc_register(&hotknot_misc_device)) {
		GTP_ERROR("Couldn't create [HOTKNOT_NODE] device!");
		return -1;
	} else {
		GTP_INFO("Create [HOTKNOT_NODE] device success!");
	}
#endif
	return 0;
}
开发者ID:AudioGod,项目名称:MediaTek-HelioX10-Kernel,代码行数:27,代码来源:gt1x_extents.c


示例2: tpd_enable_ps

static s32 tpd_enable_ps(s32 enable)
{
    u8  state;
    s32 ret = -1;
   // u8 buffer[3] = {0x80,0x42};
    	mutex_lock(&i2c_access);
    if (enable)
    {
//        buffer[2] = 1;
        state = 1;
        tpd_proximity_flag = 1;
        GTP_INFO("TPD proximity function to be on.");
    }
    else
    {
//        buffer[2] = 0;
        state = 0;
        //tpd_proximity_detect = 1;
        tpd_proximity_flag = 0;
        GTP_INFO("TPD proximity function to be off.");
    }

    ret = i2c_write_bytes(i2c_client_point, TPD_PROXIMITY_ENABLE_REG, &state, 1);
    //ret = gtp_i2c_write(i2c_client_point, buffer, sizeof(buffer));
    	mutex_unlock(&i2c_access);
    if (ret < 0)
    {
        GTP_ERROR("TPD %s proximity cmd failed.", state ? "enable" : "disable");
        //GTP_ERROR("TPD %s proximity cmd failed.", buffer[2] ? "enable" : "disable");
        return ret;
    }
    GTP_INFO("TPD proximity function %s success.", state ? "enable" : "disable");
    //GTP_INFO("TPD proximity function %s success.", buffer[2] ? "enable" : "disable");
    return 0;
}
开发者ID:rictec,项目名称:mtk-android3.18-yaris,代码行数:35,代码来源:gt9xx_driver.c


示例3: gtp_send_cfg

/*******************************************************
Function:
    Send config.
Input:
    client: i2c device.
Output:
    result of i2c write operation.
        1: succeed, otherwise: failed
*********************************************************/
s32 gtp_send_cfg(struct i2c_client *client)
{
    s32 ret = 2;

#if GTP_DRIVER_SEND_CFG
    s32 retry = 0;
    struct goodix_ts_data *ts = i2c_get_clientdata(client);

    if (ts->fixed_cfg)
    {
        GTP_INFO("Ic fixed config, no config sent!");
        return 2;
    }
    GTP_INFO("driver send config");
    for (retry = 0; retry < 5; retry++)
    {
        ret = gtp_i2c_write(client, config , GTP_CONFIG_MAX_LENGTH + GTP_ADDR_LENGTH);
        if (ret > 0)
        {
            break;
        }
    }
#endif

    return ret;
}
开发者ID:saydulk,项目名称:rk3188-kernel,代码行数:35,代码来源:gt9xx.c


示例4: tpd_enable_ps

static s32 tpd_enable_ps(s32 enable)
{
    u8  state;
    s32 ret = -1;

    if (enable)
    {
        state = 1;
        tpd_proximity_flag = 1;
        GTP_INFO("TPD proximity function to be on.");
    }
    else
    {
        state = 0;
        tpd_proximity_flag = 0;
        GTP_INFO("TPD proximity function to be off.");
    }

    ret = i2c_write_bytes(i2c_client_point, TPD_PROXIMITY_ENABLE_REG, &state, 1);

    if (ret < 0)
    {
        GTP_ERROR("TPD %s proximity cmd failed.", state ? "enable" : "disable");
        return ret;
    }

    GTP_INFO("TPD proximity function %s success.", state ? "enable" : "disable");
    return 0;
}
开发者ID:Lesozav25,项目名称:mtk_6572,代码行数:29,代码来源:gt9xx_driver.c


示例5: init_wr_node

s32 init_wr_node(struct i2c_client *client)
{
    s32 i;

    gt_client = i2c_client_point;
    GTP_INFO("client %d.%d", (int)gt_client, (int)client);

    memset(&cmd_head, 0, sizeof(cmd_head));
    cmd_head.data = NULL;

    i = 5;

    while ((!cmd_head.data) && i)
    {
        cmd_head.data = kzalloc(i * DATA_LENGTH_UINT, GFP_KERNEL);

        if (NULL != cmd_head.data)
        {
            break;
        }

        i--;
    }

    if (i)
    {
        DATA_LENGTH = i * DATA_LENGTH_UINT + GTP_ADDR_LENGTH;
        GTP_INFO("Applied memory size:%d.", DATA_LENGTH);
    }
    else
    {
        GTP_ERROR("Apply for memory failed.");
        return FAIL;
    }

    cmd_head.addr_len = 2;
    cmd_head.retry = 5;

    register_i2c_func();

    goodix_proc_entry = create_proc_entry(GOODIX_ENTRY_NAME, 0664, NULL);

    if (goodix_proc_entry == NULL)
    {
        GTP_ERROR("Couldn't create proc entry!");
        return FAIL;
    }
    else
    {
        GTP_INFO("Create proc entry success!");
        goodix_proc_entry->write_proc = goodix_tool_write;
        goodix_proc_entry->read_proc = goodix_tool_read;
    }

    return SUCCESS;
}
开发者ID:mradermaxlol,项目名称:HWY600-kernel,代码行数:56,代码来源:goodix_tool.c


示例6: init_wr_node

s32 init_wr_node(struct i2c_client *client)
{
	s32 i;

	gt_client = i2c_client_point;

	memset(&cmd_head, 0, sizeof(cmd_head));
	cmd_head.data = NULL;

	i = 5;

	while ((!cmd_head.data) && i) {
		cmd_head.data = kzalloc(i * DATA_LENGTH_UINT, GFP_KERNEL);

		if (NULL != cmd_head.data) {
			break;
		}

		i--;
	}

	if (i) {
		DATA_LENGTH = i * DATA_LENGTH_UINT + GTP_ADDR_LENGTH;
		GTP_INFO("Applied memory size:%d.", DATA_LENGTH);
	} else {
		GTP_ERROR("Apply for memory failed.");
		return FAIL;
	}

	cmd_head.addr_len = 2;
	cmd_head.retry = 5;

	register_i2c_func();

	tool_set_proc_name(procname);
#if 0				/* fix 3.10 */
	goodix_proc_entry = create_proc_entry(gtp_tool_entry, 0664, NULL);

	if (goodix_proc_entry == NULL) {
		GTP_ERROR("Couldn't create proc entry!");
		return FAIL;
	} else {
		GTP_INFO("Create proc entry success!");
		goodix_proc_entry->write_proc = goodix_tool_write;
		goodix_proc_entry->read_proc = goodix_tool_read;
	}
#else
	if (proc_create(procname, 0660, NULL, &gt_tool_fops) == NULL) {
		GTP_ERROR("create_proc_entry %s failed", procname);
		return -1;
	}
#endif
	return SUCCESS;
}
开发者ID:Swapnil133609,项目名称:Zeus_exp,代码行数:54,代码来源:goodix_tool.c


示例7: register_i2c_func

static void register_i2c_func(void)
{
	if (strncmp(IC_TYPE, "GTxxx", 5)) {
		tool_i2c_read = tool_i2c_read_with_extra;
		tool_i2c_write = tool_i2c_write_with_extra;
		GTP_INFO("I2C function: register with pre and end cmd!");
	} else {
		tool_i2c_read = tool_i2c_read_no_extra;
		tool_i2c_write = tool_i2c_write_no_extra;
		GTP_INFO("I2C function: register without pre and end cmd!");
	}
}
开发者ID:C457,项目名称:android_kernel_samsung_t110,代码行数:12,代码来源:goodix_tool.c


示例8: hotknot_load_authentication_subsystem

static s32 hotknot_load_authentication_subsystem(void)
{
	s32 ret = 0;
	u8 buffer[5] = { 0 };

	ret = gt1x_hold_ss51_dsp_no_reset();
	if (ret < 0) {
		GTP_ERROR("Hold ss51 fail!");
		return ERROR;
	}

	if (gt1x_chip_type == CHIP_TYPE_GT1X) {
		GTP_INFO("hotknot load jump code.");
		ret = gt1x_load_patch(gt1x_patch_jump_fw, 4096, 0, 1024 * 8);
		if (ret < 0) {
			GTP_ERROR("Load jump code fail!");
			return ret;
		}
		GTP_INFO("hotknot load auth code.");
		ret = gt1x_load_patch(hotknot_auth_fw, 4096, 4096, 1024 * 8);
		if (ret < 0) {
			GTP_ERROR("Load auth system fail!");
			return ret;
		}
	} else {
		GTP_INFO("hotknot load auth code.");
		ret = gt1x_load_patch(hotknot_auth_fw, 4096, 0, 1024 * 6);
		if (ret < 0) {
			GTP_ERROR("load auth system fail!");
			return ret;
		}
	}

	ret = gt1x_startup_patch();
	if (ret < 0) {
		GTP_ERROR("Startup auth system fail!");
		return ret;
	}
	ret = gt1x_i2c_read(GTP_REG_VERSION, buffer, 4);
	if (ret < 0) {
		GTP_ERROR("i2c read error!");
		return ERROR_IIC;
	}
	buffer[4] = 0;
	GTP_INFO("Current System version: %s", buffer);
	return 0;
}
开发者ID:P-D-A,项目名称:android_kernel_lge_mt6753,代码行数:47,代码来源:gt1x_extents.c


示例9: gt1x_init_tool_node

int gt1x_init_tool_node(void)
{
    memset(&cmd_head, 0, sizeof(cmd_head));
    cmd_head.wr = 1;	//if the first operation is read, will return fail.
    cmd_head.data = kzalloc(DATA_LENGTH_UINT, GFP_KERNEL);
    if (NULL == cmd_head.data) {
        GTP_ERROR("Apply for memory failed.");
        return -1;
    }
    GTP_INFO("Applied memory size:%d.", DATA_LENGTH_UINT);
    DATA_LENGTH = DATA_LENGTH_UINT - GTP_ADDR_LENGTH;

    set_tool_node_name(procname);

    gt1x_tool_proc_entry = proc_create(procname, 0666, NULL, &gt1x_tool_fops);
    if (gt1x_tool_proc_entry == NULL) {
        GTP_ERROR("Couldn't create proc entry!");
        return -1;
    } else {
        GTP_INFO("Create proc entry success!");
    }
    return 0;
}
开发者ID:Niisp,项目名称:MT6795.kernel,代码行数:23,代码来源:gt1x_tools.c


示例10: init_wr_node

int init_wr_node(struct i2c_client *client)
{
	int i;

	gt_client = client;
	memset(&cmd_head, 0, sizeof(cmd_head));
	cmd_head.data = NULL;

	i = 5;
	while ((!cmd_head.data) && i) {
		cmd_head.data = kzalloc(i * DATA_LENGTH_UINT, GFP_KERNEL);
		if (NULL != cmd_head.data)
			break;
		i--;
	}
	if (i) {
		DATA_LENGTH = i * DATA_LENGTH_UINT + GTP_ADDR_LENGTH;
		GTP_INFO("Applied memory size:%d.", DATA_LENGTH);
	} else {
		GTP_ERROR("Apply for memory failed.");
		return -1;
	}

	cmd_head.addr_len = 2;
	cmd_head.retry = 5;

	register_i2c_func();

	tool_set_proc_name(procname);
	fops.read = NULL;
	fops.write = NULL;
	goodix_proc_entry =
		proc_create_data(procname, 0666, NULL, &fops, NULL);
	if (goodix_proc_entry == NULL) {
		GTP_ERROR("Couldn't create proc entry!");
		return -1;
	}
	/* else {
	   GTP_INFO("Create proc entry success!");
	   goodix_proc_entry->write_proc = goodix_tool_write;
	   goodix_proc_entry->read_proc = goodix_tool_read;
	   }
	 */

	return 0;
}
开发者ID:Druboo666,项目名称:android_kernel_asus_moorefield,代码行数:46,代码来源:goodix_tool.c


示例11: register_i2c_func

static void register_i2c_func(void)
{
/* if (!strncmp(IC_TYPE, "GT818", 5) || !strncmp(IC_TYPE, "GT816", 5) */
/* || !strncmp(IC_TYPE, "GT811", 5) || !strncmp(IC_TYPE, "GT818F", 6) */
/* || !strncmp(IC_TYPE, "GT827", 5) || !strncmp(IC_TYPE,"GT828", 5) */
/* || !strncmp(IC_TYPE, "GT813", 5)) */
	if (strncmp(IC_TYPE, "GT8110", 6) && strncmp(IC_TYPE, "GT8105", 6)
	    && strncmp(IC_TYPE, "GT801", 5) && strncmp(IC_TYPE, "GT800", 5)
	    && strncmp(IC_TYPE, "GT801PLUS", 9) && strncmp(IC_TYPE, "GT811", 5)
	    && strncmp(IC_TYPE, "GTxxx", 5) && strncmp(IC_TYPE, "GT9XX", 5)) {
		tool_i2c_read = tool_i2c_read_with_extra;
		tool_i2c_write = tool_i2c_write_with_extra;
		GTP_DEBUG("I2C function: with pre and end cmd!");
	} else {
		tool_i2c_read = tool_i2c_read_no_extra;
		tool_i2c_write = tool_i2c_write_no_extra;
		GTP_INFO("I2C function: without pre and end cmd!");
	}
}
开发者ID:Swapnil133609,项目名称:Zeus_exp,代码行数:19,代码来源:goodix_tool.c


示例12: show_tpd_vendor_name

static ssize_t show_tpd_vendor_name(struct device *dev,struct device_attribute *attr, char *buf)
{
	u8 rd_vendor_buf[16];
        s32 ret = -1;
        rd_vendor_buf[0] = GTP_REG_SENSOR_ID >> 8;
        rd_vendor_buf[1] = GTP_REG_SENSOR_ID & 0xff;
        ret = gtp_i2c_read(i2c_client_point, rd_vendor_buf, 3);

        if (ret < 0)
        {
            GTP_ERROR("gt9xx Read SENSOR ID failed");
            rd_vendor_buf[GTP_ADDR_LENGTH] = 3;
            return sprintf(buf, "%s", tpd_manufacturer_name[rd_vendor_buf[GTP_ADDR_LENGTH]]);
        }

        GTP_INFO("gt9xx vendor ID:%d", rd_vendor_buf[GTP_ADDR_LENGTH]);
        rd_vendor_buf[GTP_ADDR_LENGTH] &= 0x03;
    	
    	return sprintf(buf, "%s", tpd_manufacturer_name[rd_vendor_buf[GTP_ADDR_LENGTH]]);
}
开发者ID:Lesozav25,项目名称:mtk_6572,代码行数:20,代码来源:gt9xx_driver.c


示例13: show_read_reg

static ssize_t show_read_reg(struct device *dev,struct device_attribute *attr, char *buf)
{
	int ret, cnt, i;
	
	u8 i2c_buf[GTP_ADDR_LENGTH+100] = {g_attr_read_reg>>8, g_attr_read_reg& 0xff};

	if (g_attr_read_reg == 0xFFFF || g_attr_read_nbytes == 0)
	{
		return sprintf(buf, "0x%x,%d??\n"ATTR_READ_REAG_HINT, g_attr_read_reg, g_attr_read_nbytes);
	}

	ret = gtp_i2c_read(i2c_client_point, i2c_buf, g_attr_read_nbytes+GTP_ADDR_LENGTH);
	if (ret < 0) 
	{
		return sprintf(buf, "read failed\n"ATTR_READ_REAG_HINT);
	}

	cnt = sprintf(buf, "BASE:0x%x, bytes=%d\n", (i2c_buf[0]<<8 | i2c_buf[1]), g_attr_read_nbytes);
	for (i = 0; i< g_attr_read_nbytes; i++)
	{
		cnt += sprintf(buf+cnt, "0x%02x,", i2c_buf[GTP_ADDR_LENGTH+i]);
		if ((i+1)%10 == 0)	cnt += sprintf(buf+cnt, "\n");
	}
	cnt += sprintf(buf+cnt, "\n");

	g_attr_read_reg = 0xFFFF;
	g_attr_read_nbytes = 0;

	return cnt;
}

static ssize_t store_read_reg(struct device *dev,struct device_attribute *attr, const char *buf, size_t size)
{
	char *p;
	
	g_attr_read_reg = (u16)simple_strtol(buf, &p, 16);
	g_attr_read_nbytes = simple_strtol(p+1, NULL, 10);

	GTP_INFO("0x%x, %d", g_attr_read_reg, g_attr_read_nbytes);
	return size;
}
开发者ID:Lesozav25,项目名称:mtk_6572,代码行数:41,代码来源:gt9xx_driver.c


示例14: unregister_i2c_func

static void unregister_i2c_func(void)
{
    tool_i2c_read = NULL;
    tool_i2c_write = NULL;
    GTP_INFO("I2C function: unregister i2c transfer function!");
}
开发者ID:mradermaxlol,项目名称:HWY600-kernel,代码行数:6,代码来源:goodix_tool.c


示例15: init_wr_node

s32 init_wr_node(struct i2c_client *client)
{
    s32 i;

    gt_client = i2c_client_point;

    memset(&cmd_head, 0, sizeof(cmd_head));
    cmd_head.data = NULL;

    i = 5;

    while ((!cmd_head.data) && i)
    {
        cmd_head.data = kzalloc(i * DATA_LENGTH_UINT, GFP_KERNEL);

        if (NULL != cmd_head.data)
        {
            break;
        }

        i--;
    }

    if (i)
    {
        DATA_LENGTH = i * DATA_LENGTH_UINT + GTP_ADDR_LENGTH;
        GTP_INFO("Applied memory size:%d.", DATA_LENGTH);
    }
    else
    {
        GTP_ERROR("Apply for memory failed.");
        return FAIL;
    }

    cmd_head.addr_len = 2;
    cmd_head.retry = 5;

	memset(&cmd_head2, 0, sizeof(cmd_head2));
    cmd_head2.data = NULL;

    i = 5;

    while ((!cmd_head2.data) && i)
    {
        cmd_head2.data = kzalloc(i * DATA_LENGTH_UINT, GFP_KERNEL);

        if (NULL != cmd_head2.data)
        {
            break;
        }

        i--;
    }

    if (i)
    {
        DATA_LENGTH = i * DATA_LENGTH_UINT + GTP_ADDR_LENGTH;
        GTP_INFO("Applied memory size:%d.", DATA_LENGTH);
    }
    else
    {
        GTP_ERROR("Apply for memory failed.");
        return FAIL;
    }

    cmd_head2.addr_len = 2;
    cmd_head2.retry = 5;
	
    register_i2c_func();

    tool_set_proc_name(procname);
    goodix_proc_entry = proc_create(procname, 0660, 	NULL, &tool_ops);

    if (misc_register(&hotknot_misc_device))
    {
        printk("mtk_tpd: hotknot_device register failed\n");
        return FAIL;
    }
   
    if (goodix_proc_entry == NULL)
    {
        GTP_ERROR("Couldn't create proc entry!");
        return FAIL;
    }
    else
    {
        GTP_INFO("Create proc entry success!");
    }

    return SUCCESS;
}
开发者ID:rock12,项目名称:ALPS.L1.MP6.V2.19_CENON6580_WE_1_L_KERNEL,代码行数:91,代码来源:goodix_tool.c


示例16: ctp_detect

/**
 * ctp_detect - Device detection callback for automatic device creation
 * return value:  
 *                    = 0; success;
 *                    < 0; err
 */
static int ctp_detect(struct i2c_client *client, struct i2c_board_info *info)
{
	struct i2c_adapter *adapter = client->adapter;
    int ret;  
    u8 buf[8] = {GTP_REG_VERSION >> 8, GTP_REG_VERSION & 0xff};
        if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)){
        	pr_err("i2c_check_functionality err\n======return=====\n");
                return -ENODEV;
        }


        if(twi_id == adapter->nr){
                pr_debug("%s: addr= %x\n",__func__,client->addr);
                msleep(50);
    			ret = gtp_i2c_read(client, buf, 6);
    			gtp_i2c_end_cmd(client);
				if(buf[3] != 0x18)
				{
					pr_debug("%s:IC is not gt818\n",__func__);
					return -ENODEV;
				}
    			GTP_INFO("IC VERSION:%02x%02x_%02x%02x", buf[3], buf[2], buf[5], buf[4]);
            	strlcpy(info->type, CTP_NAME, I2C_NAME_SIZE);
        	//printk("%s:I2C connection might be something wrong ! \n",__func__);
        	return 0;
	}else{
	        return -ENODEV;
	}
}

/**
 * ctp_print_info - sysconfig print function
 * return value:
 *
 */
static void ctp_print_info(struct ctp_config_info info,int debug_level)
{
	if(debug_level == DEBUG_INIT)
	{
		dprintk(DEBUG_INIT,"info.ctp_used:%d\n",info.ctp_used);
		dprintk(DEBUG_INIT,"info.twi_id:%d\n",info.twi_id);
		dprintk(DEBUG_INIT,"info.screen_max_x:%d\n",info.screen_max_x);
		dprintk(DEBUG_INIT,"info.screen_max_y:%d\n",info.screen_max_y);
		dprintk(DEBUG_INIT,"info.revert_x_flag:%d\n",info.revert_x_flag);
		dprintk(DEBUG_INIT,"info.revert_y_flag:%d\n",info.revert_y_flag);
		dprintk(DEBUG_INIT,"info.exchange_x_y_flag:%d\n",info.exchange_x_y_flag);
		dprintk(DEBUG_INIT,"info.irq_gpio_number:%d\n",info.irq_gpio.gpio);
		dprintk(DEBUG_INIT,"info.wakeup_gpio_number:%d\n",info.wakeup_gpio.gpio);
	}
}

/**
 * ctp_wakeup - function
 *
 */
static int ctp_wakeup(int status,int ms)
{
	dprintk(DEBUG_INIT,"***CTP*** %s:status:%d,ms = %d\n",__func__,status,ms);

	if (status == 0) {

		if(ms == 0) {
			__gpio_set_value(config_info.wakeup_gpio.gpio, 0);
		}else {
			__gpio_set_value(config_info.wakeup_gpio.gpio, 0);
			msleep(ms);
			__gpio_set_value(config_info.wakeup_gpio.gpio, 1);
		}
	}
	if (status == 1) {
		if(ms == 0) {
			__gpio_set_value(config_info.wakeup_gpio.gpio, 1);
		}else {
			__gpio_set_value(config_info.wakeup_gpio.gpio, 1);
			msleep(ms);
			__gpio_set_value(config_info.wakeup_gpio.gpio, 0);
		}
	}
	msleep(5);

	return 0;
}
开发者ID:GREYFOXRGR,项目名称:BPI-M3-bsp,代码行数:88,代码来源:gt818.c


示例17: goodix_tool_write


//.........这里部分代码省略.........
            }
        }
        else if (2 == cmd_head.flag)
        {
            //Need interrupt!
        }
        if (tool_i2c_write(&cmd_head.data[GTP_ADDR_LENGTH - cmd_head.addr_len],
                           cmd_head.data_len + cmd_head.addr_len) <= 0)
        {
            GTP_ERROR("[WRITE]Write data failed!");
            return -EPERM;
        }

        GTP_DEBUG_ARRAY(&cmd_head.data[GTP_ADDR_LENGTH - cmd_head.addr_len],cmd_head.data_len + cmd_head.addr_len);
        if (cmd_head.delay)
        {
            msleep(cmd_head.delay);
        }
    }
    else if (3 == cmd_head.wr)  //Write ic type
    {
        ret = copy_from_user(&cmd_head.data[0], &buff[CMD_HEAD_LENGTH], cmd_head.data_len);
        if(ret)
        {
            GTP_ERROR("copy_from_user failed.");
            return -EPERM;
        }
        memcpy(IC_TYPE, cmd_head.data, cmd_head.data_len);

        register_i2c_func();
    }
    else if (5 == cmd_head.wr)
    {
        //memcpy(IC_TYPE, cmd_head.data, cmd_head.data_len);
    }
    else if (7 == cmd_head.wr)//disable irq!
    {
        gtp_irq_disable(i2c_get_clientdata(gt_client));

#if GTP_ESD_PROTECT
        gtp_esd_switch(gt_client, SWITCH_OFF);
#endif
    }
    else if (9 == cmd_head.wr) //enable irq!
    {
        gtp_irq_enable(i2c_get_clientdata(gt_client));

#if GTP_ESD_PROTECT
        gtp_esd_switch(gt_client, SWITCH_ON);
#endif
    }
    else if(17 == cmd_head.wr)
    {
        struct goodix_ts_data *ts = i2c_get_clientdata(gt_client);
        ret = copy_from_user(&cmd_head.data[GTP_ADDR_LENGTH], &buff[CMD_HEAD_LENGTH], cmd_head.data_len);
        if(ret)
        {
            GTP_DEBUG("copy_from_user failed.");
            return -EPERM;
        }
        if(cmd_head.data[GTP_ADDR_LENGTH])
        {
            GTP_INFO("gtp enter rawdiff.");
            ts->gtp_rawdiff_mode = true;
        }
        else
        {
            ts->gtp_rawdiff_mode = false;
            GTP_INFO("gtp leave rawdiff.");
        }
    }
#ifdef UPDATE_FUNCTIONS
    else if (11 == cmd_head.wr)//Enter update mode!
    {
        if (FAIL == gup_enter_update_mode(gt_client))
        {
            return -EPERM;
        }
    }
    else if (13 == cmd_head.wr)//Leave update mode!
    {
        gup_leave_update_mode();
    }
    else if (15 == cmd_head.wr) //Update firmware!
    {
        show_len = 0;
        total_len = 0;
        memset(cmd_head.data, 0, cmd_head.data_len + 1);
        memcpy(cmd_head.data, &buff[CMD_HEAD_LENGTH], cmd_head.data_len);

        if (FAIL == gup_update_proc((void*)cmd_head.data))
        {
            return -EPERM;
        }
    }

#endif

    return len;
}
开发者ID:sndnvaps,项目名称:G718c_kernel,代码行数:101,代码来源:goodix_tool.c


示例18: init_wr_node

s32 init_wr_node(struct i2c_client *client)
{
    s32 i;
    const s8 entry_prefix[] = "GMNode_";
    s8 gtp_tool_entry[30];

    gt_client = i2c_client_point;
    GTP_INFO("client %d.%d", (int)gt_client, (int)client);

    memset(&cmd_head, 0, sizeof(cmd_head));
    cmd_head.data = NULL;

    i = 5;

    while ((!cmd_head.data) && i)
    {
        cmd_head.data = kzalloc(i * DATA_LENGTH_UINT, GFP_KERNEL);

        if (NULL != cmd_head.data)
        {
            break;
        }

        i--;
    }

    if (i)
    {
        DATA_LENGTH = i * DATA_LENGTH_UINT + GTP_ADDR_LENGTH;
        GTP_INFO("Applied memory size:%d.", DATA_LENGTH);
    }
    else
    {
        GTP_ERROR("Apply for memory failed.");
        return FAIL;
    }

    cmd_head.addr_len = 2;
    cmd_head.retry = 5;

    register_i2c_func();

 //   goodix_proc_entry = create_proc_entry(GOODIX_ENTRY_NAME, 0664, NULL);
 
    memset(gtp_tool_entry, 0, sizeof(gtp_tool_entry));
    i = sizeof(entry_prefix)/sizeof(s8);
    memcpy(gtp_tool_entry, entry_prefix, i-1);
    memcpy(&gtp_tool_entry[i-1], __DATE__, sizeof(__DATE__)/sizeof(s8));
#if 0 // fix 3.10
    goodix_proc_entry = create_proc_entry(gtp_tool_entry, 0664, NULL);

    if (goodix_proc_entry == NULL)
    {
        GTP_ERROR("Couldn't create proc entry!");
        return FAIL;
    }
    else
    {
        GTP_INFO("Create proc entry success!");
        goodix_proc_entry->write_proc = goodix_tool_write;
        goodix_proc_entry->read_proc = goodix_tool_read;
    }
#else
    if(proc_create(GOODIX_ENTRY_NAME, 0660, NULL, &gt_tool_fops)== NULL)
	{
        GTP_ERROR("create_proc_entry %s failed", gtp_tool_entry);
		return -1;
    }	
#endif
    return SUCCESS;
}
开发者ID:luckasfb,项目名称:bindu-kernel-mediatek,代码行数:71,代码来源:goodix_tool.c


示例19: gt1x_ioctl

//@return, 0:operate successfully
//         > 0: the length of memory size ioctl has accessed,
//         error otherwise.
static long gt1x_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
	u32 value = 0;
	s32 ret = 0;		//the initial value must be 0
	u8 *data = NULL;

	GTP_DEBUG("IOCTL CMD:%x", cmd);
	GTP_DEBUG("command:%d, length:%d, rw:%s", _IOC_NR(cmd), _IOC_SIZE(cmd), (_IOC_DIR(cmd) & _IOC_READ) ? "read" : (_IOC_DIR(cmd) & _IOC_WRITE) ? "write" : "-");

	if (_IOC_DIR(cmd)) {
		s32 err = -1;
		s32 data_length = _IOC_SIZE(cmd);
		data = (u8 *) kzalloc(data_length, GFP_KERNEL);
		memset(data, 0, data_length);

		if (_IOC_DIR(cmd) & _IOC_WRITE) {
			err = copy_from_user(data, (void __user *)arg, data_length);
			if (err) {
				GTP_DEBUG("Can't access the memory.");
				kfree(data);
				return -1;
			}
		}
	} else {
		value = (u32) arg;
	}

	switch (cmd & NEGLECT_SIZE_MASK) {
	case IO_GET_VERISON:
		if ((u8 __user *) arg) {
			ret = copy_to_user(((u8 __user *) arg), IO_VERSION, sizeof(IO_VERSION));
			if (!ret) {
				ret = sizeof(IO_VERSION);
			}
			GTP_INFO("%s", IO_VERSION);
		}
		break;
	case IO_IIC_READ:
		ret = io_iic_read(data, (void __user *)arg);
		break;

	case IO_IIC_WRITE:
		ret = io_iic_write(data);
		break;

	case IO_RESET_GUITAR:
		gt1x_reset_guitar();
		break;

	case IO_DISABLE_IRQ:
		gt1x_irq_disable();
#if GTP_ESD_PROTECT
		gt1x_esd_switch(SWITCH_OFF);
#endif
		break;

	case IO_ENABLE_IRQ:
		gt1x_irq_enable();
#if GTP_ESD_PROTECT
		gt1x_esd_switch(SWITCH_ON);
#endif
		break;

		//print a string to syc log messages between application and kernel.
	case IO_PRINT:
		if (data)
			GTP_INFO("%s", (char *)data);
		break;

#if GTP_GESTURE_WAKEUP
	case GESTURE_ENABLE_TOTALLY:
		GTP_DEBUG("ENABLE_GESTURE_TOTALLY");
		gesture_enabled = (is_all_dead(gestures_flag, sizeof(gestures_flag)) ? 0 : 1);
		break;

	case GESTURE_DISABLE_TOTALLY:
		GTP_DEBUG("DISABLE_GESTURE_TOTALLY");
		gesture_enabled = 0;
		break;

	case GESTURE_ENABLE_PARTLY:
		SETBIT(gestures_flag, (u8) value);
		gesture_enabled = 1;
		GTP_DEBUG("ENABLE_GESTURE_PARTLY, gesture = 0x%02X, gesture_enabled = %d", value, gesture_enabled);
		break;

	case GESTURE_DISABLE_PARTLY:
		ret = QUERYBIT(gestures_flag, (u8) value);
		if (!ret) {
			break;
		}
		CLEARBIT(gestures_flag, (u8) value);
		if (is_all_dead(gestures_flag, sizeof(gestures_flag))) {
			gesture_enabled = 0;
		}
		GTP_DEBUG("DISABLE_GESTURE_PARTLY, gesture = 0x%02X, gesture_enabled = %d", value, gesture_enabled);
		break;
//.........这里部分代码省略.........
开发者ID:AudioGod,项目名称:MediaTek-HelioX10-Kernel,代码行数:101,代码来源:gt1x_extents.c


示例20: gesture_event_handler

s32 gesture_event_handler(struct input_dev * dev)
{
	u8 doze_buf[4] = { 0 };
	s32 ret = -1;
	int len, extra_len;

	if (DOZE_ENABLED == gesture_doze_status) {
		ret = gt1x_i2c_read(GTP_REG_WAKEUP_GESTURE, doze_buf, 4);
		GTP_DEBUG("0x%x = 0x%02X,0x%02X,0x%02X,0x%02X", GTP_REG_WAKEUP_GESTURE, doze_buf[0], doze_buf[1], doze_buf[2], doze_buf[3]);
		if (ret == 0 && doze_buf[0] != 0) {
			if (!QUERYBIT(gestures_flag, doze_buf[0])) {
				GTP_INFO("Sorry, this gesture has been disabled.");
				doze_buf[0] = 0x00;
				gt1x_i2c_write(GTP_REG_WAKEUP_GESTURE, doze_buf, 1);
				return 0;
			}

			mutex_lock(&gesture_data_mutex);
			len = doze_buf[1];
			if (len > GESTURE_MAX_POINT_COUNT) {
				GTP_ERROR("Gesture contain too many points!(%d)", len);
				len = GESTURE_MAX_POINT_COUNT;
			}
			if (len > 0) {
				ret = gt1x_i2c_read(GTP_REG_WAKEUP_GESTURE_DETAIL, &gesture_data.data[4], len * 4);
				if (ret < 0) {
					GTP_DEBUG("Read gesture data failed.");
					mutex_unlock(&gesture_data_mutex);
					return 0;
				}
			}
			extra_len = doze_buf[3];
			if (extra_len > 80) {
				GTP_ERROR("Gesture contain too many extra data!(%d)", extra_len);
				extra_len = 80;
			}
			if (extra_len > 0) {
				ret = gt1x_i2c_read(GTP_REG_WAKEUP_GESTURE + 4, &gesture_data.data[4 + len * 4], extra_len);
				if (ret < 0) {
					GTP_DEBUG("Read extra gesture data failed.");
					mutex_unlock(&gesture_data_mutex);
					return 0;
				}
			}

			gesture_data.data[0] = doze_buf[0];	// gesture type
			gesture_data.data[1] = len;	// gesture points number
			gesture_data.data[2] = doze_buf[2];
			gesture_data.data[3] = extra_len;
			mutex_unlock(&gesture_data_mutex);

			GTP_DEBUG("Gesture: 0x%02X, points: %d", doze_buf[0], doze_buf[1]);

			doze_buf[0] = 0;
			gt1x_i2c_write(GTP_REG_WAKEUP_GESTURE, doze_buf, 1);

			input_report_key(dev, KEY_GESTURE, 1);
			input_sync(dev);
			input_report_key(dev, KEY_GESTURE, 0);
			input_sync(dev);
			return 1;
		}
		return 0;
	}
	return -1;
}
开发者ID:AudioGod,项目名称:MediaTek-HelioX10-Kernel,代码行数:66,代码来源:gt1x_extents.c



注:本文中的GTP_INFO函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GTS_OBJECT函数代码示例发布时间:2022-05-30
下一篇:
C++ GTP_ERROR函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap