本文整理汇总了C++中GTP_INFO函数的典型用法代码示例。如果您正苦于以下问题:C++ GTP_INFO函数的具体用法?C++ GTP_INFO怎么用?C++ GTP_INFO使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GTP_INFO函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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, >1x_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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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, >_tool_fops) == NULL) {
GTP_ERROR("create_proc_entry %s failed", procname);
return -1;
}
#endif
return SUCCESS;
}
示例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!");
}
}
示例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;
}
示例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, >1x_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;
}
示例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;
}
示例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!");
}
}
示例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]]);
}
示例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;
}
示例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!");
}
示例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;
}