type
stringclasses
5 values
content
stringlengths
9
163k
functions
CONFIG_OF if(config_load == false) { type28_selected = kzalloc(sizeof(*type28_selected), GFP_KERNEL); if (type28_selected == NULL) { E("%s: alloc type28_selected fail!\n", __func__); return -1; }
functions
endif if (fw_ver_info_retry > 2) { E("%s: Try to read firmware" " version fail over %d times, stop loading!\n", __func__, fw_ver_info_retry); return -1; }
functions
config if(need_load_default) { himax_loaddefaultSensorConfig(client); //Sense Off i2c_himax_write_command(client, 0x82, normalRetry); hr_msleep(120); //read fw id i2c_himax_read(client, 0x32, data, 2, normalRetry); private_ts->vendor_fw_ver = data[0]; //read sensor id i2c_himax_read(cl...
functions
else if (rc == 0){ if ((private_ts->tw_x_max)&&(private_ts->tw_y_max)) { pdata->abs_x_min = private_ts->tw_x_min; pdata->abs_x_max = private_ts->tw_x_max; pdata->abs_y_min = private_ts->tw_y_min; pdata->abs_y_max = private_ts->tw_y_max; I(" DT-%s:config-panel-coords = %d, %...
functions
HX_LOADIN_CONFIG if (type28_selected) { //Read config id private_ts->vendor_config_ver = type28_selected->c36[1]; //Normal Register c1~c35 i2c_himax_master_write(client, type28_selected->c1,sizeof(type28_selected->c1),normalRetry); i2c_himax_master_write(client, type28_selected->c2,sizeof(type28_selec...
functions
ssize_t himax_register_show(struct device *dev, struct device_attribute *attr, char *buf) { int ret = 0; int base = 0; uint16_t loop_i,loop_j; uint8_t data[128]; uint8_t outData[5]; memset(outData, 0x00, sizeof(outData)); memset(data, 0x00, sizeof(data)); I("Himax multi_register_command = %d \n",multi_registe...
functions
ssize_t himax_register_store(struct device *dev,struct device_attribute *attr, const char *buf, size_t count) { char buf_tmp[6], length = 0; unsigned long result = 0; uint8_t loop_i = 0; uint16_t base = 5; uint8_t write_da[128]; uint8_t outData[5]; memset(buf_tmp, 0x0, sizeof(buf_tmp)); m...
functions
uint8_t getXChannel(void) { return x_channel; }
functions
uint8_t getYChannel(void) { return y_channel; }
functions
uint8_t getDiagCommand(void) { return diag_command; }
functions
void setXChannel(uint8_t x) { x_channel = x; }
functions
void setYChannel(uint8_t y) { y_channel = y; }
functions
void setMutualBuffer(void) { diag_mutual = kzalloc(x_channel * y_channel * sizeof(uint8_t), GFP_KERNEL); }
functions
ssize_t himax_diag_show(struct device *dev,struct device_attribute *attr, char *buf) { size_t count = 0; uint32_t loop_i; uint16_t mutual_num, self_num, width; mutual_num = x_channel * y_channel; self_num = x_channel + y_channel; //don't add KEY_COUNT width = x_channel; count += sprintf(buf + cou...
functions
else if (diag_command > 4) { for (loop_i = 0; loop_i < self_num; loop_i++) { count += sprintf(buf + count, "%4d", diag_self[loop_i]); if (((loop_i - mutual_num) % width) == (width - 1)) count += sprintf(buf + count, "\n"); }
functions
else if (diag_command == 7) { for (loop_i = 0; loop_i < 128 ;loop_i++) { if ((loop_i % 16) == 0) count += sprintf(buf + count, "LineStart:"); count += sprintf(buf + count, "%4d", diag_coor[loop_i]); if ((loop_i % 16) == 15) count += sprintf(buf + count, "\n"); }
functions
ssize_t himax_diag_dump(struct device *dev,struct device_attribute *attr, const char *buf, size_t count) { const uint8_t command_ec_128_raw_flag = 0x01; const uint8_t command_ec_24_normal_flag = 0x00; uint8_t command_ec_128_raw_baseline_flag = 0x02; uint8_t command_ec_128_raw_bank_flag = 0x03; uint8...
functions
Bank if (buf[0] == '1') { if (diag_command == 0) diag_command = 1; else { diag_command --; if (diag_command == 0) diag_command = 3; }
functions
else if (buf[0] == '2') { diag_command ++; if (diag_command > 3) diag_command = 1; }
functions
else if (diag_command == 1) {//IIR command_91h[1] = command_ec_128_raw_flag; //0x01 i2c_himax_write(private_ts->client, command_91h[0] ,&command_91h[1], 1, DEFAULT_RETRY_CNT); I("[Himax]diag_command=0x%x\n",diag_command); }
functions
else if (diag_command == 3) { //BANK if (IC_TYPE != HX_85XX_D_SERIES_PWON) { i2c_himax_write(private_ts->client, command_82h[0] ,&command_82h[0], 0, DEFAULT_RETRY_CNT); hr_msleep(50); i2c_himax_write(private_ts->client, command_80h[0] ,&command_80h[0], 0, DEFAULT_RETRY_CNT); hr_msleep(50); ...
functions
else if (buf[0] == '7') { diag_command = buf[0] - '0'; }
functions
else if (buf[0] == '8') { diag_command = buf[0] - '0'; coordinate_fn = filp_open(DIAG_COORDINATE_FILE,O_CREAT | O_WRONLY | O_APPEND | O_TRUNC,0666); if (IS_ERR(coordinate_fn)) { E("%s: coordinate_dump_file_create error\n", __func__); coordinate_dump_enable = 0; filp_close(coordinate_fn,NULL);...
functions
else if (buf[0] == '9') { coordinate_dump_enable = 0; diag_command = buf[0] - '0'; if (!IS_ERR(coordinate_fn)) { filp_close(coordinate_fn,NULL); }
functions
ssize_t himax_reset_set(struct device *dev,struct device_attribute *attr, const char *buf, size_t count) { if (buf[0] == '1') doHWreset(); return count; }
functions
int fts_ctpm_fw_upgrade_with_sys_fs(unsigned char *fw, int len) { unsigned char* ImageBuffer = fw;//CTPM_FW; int fullFileLength = len;//sizeof(CTPM_FW); //Paul Check int i, j; uint8_t cmd[5], last_byte, prePage; int FileLength; uint8_t checksumResult = 0; //Try 3 Times for (j = 0; j < 3; j++) { i...
functions
ssize_t himax_debug_show(struct device *dev,struct device_attribute *attr, char *buf) { size_t count = 0; int i = 0; if (debug_level_cmd == 't') { if (fw_update_complete) { count += sprintf(buf, "FW Update Complete \n"); }
functions
else if (debug_level_cmd == 'i') { if (irq_enable) { count += sprintf(buf, "IRQ is enable\n"); }
functions
else if (debug_level_cmd == 'h') { if (handshaking_result == 0) { count += sprintf(buf, "Handshaking Result = %d (MCU Running)\n",handshaking_result); }
functions
else if (handshaking_result == 1) { count += sprintf(buf, "Handshaking Result = %d (MCU Stop)\n",handshaking_result); }
functions
else if (handshaking_result == 2) { count += sprintf(buf, "Handshaking Result = %d (I2C Error)\n",handshaking_result); }
functions
else if (debug_level_cmd == 'v') { count += sprintf(buf + count, "FW_VER_MAJ_buff = "); count += sprintf(buf + count, "0x%2.2X \n",FW_VER_MAJ_buff[0]); count += sprintf(buf + count, "FW_VER_MIN_buff = "); count += sprintf(buf + count, "0x%2.2X \n",FW_VER_MIN_buff[0]); count += spr...
functions
else if (debug_level_cmd == 'd') { count += sprintf(buf + count, "Himax Touch IC Information :\n"); if (IC_TYPE == HX_85XX_A_SERIES_PWON) { count += sprintf(buf + count, "IC Type : A\n"); }
functions
else if (IC_TYPE == HX_85XX_B_SERIES_PWON) { count += sprintf(buf + count, "IC Type : B\n"); }
functions
else if (IC_TYPE == HX_85XX_C_SERIES_PWON) { count += sprintf(buf + count, "IC Type : C\n"); }
functions
else if (IC_TYPE == HX_85XX_D_SERIES_PWON) { count += sprintf(buf + count, "IC Type : D\n"); }
functions
else if (IC_CHECKSUM == HX_TP_BIN_CHECKSUM_HW) { count += sprintf(buf + count, "IC Checksum : HW\n"); }
functions
else if (IC_CHECKSUM == HX_TP_BIN_CHECKSUM_CRC) { count += sprintf(buf + count, "IC Checksum : CRC\n"); }
functions
ssize_t himax_debug_dump(struct device *dev,struct device_attribute *attr, const char *buf, size_t count) { struct file* filp = NULL; mm_segment_t oldfs; int result = 0; char fileName[128]; if (buf[0] == 'i') //irq { debug_level_cmd = buf[0]; if (buf[2] == '1') //enable irq { himax_int_enabl...
functions
end if (buf[0] == 't') { debug_level_cmd = buf[0]; fw_update_complete = false; memset(fileName, 0, 128); // parse the file name snprintf(fileName, count-2, "%s", &buf[2]); I("%s: upgrade from file(%s) start!\n", __func__, fileName); // open file filp = filp_open(fileName, O_RDONLY, 0); ...
functions
HX_FW_UPDATE_BY_I_FILE if (buf[0] == 'f') { I("%s: upgrade firmware from kernel image start!\n", __func__); if (i_isTP_Updated == 0) { I("himax touch isTP_Updated: %d\n", i_isTP_Updated); if (1) { himax_int_enable(0); I("himax touch firmware upgrade: %d\n", i_isTP_Updated); ...
functions
uint8_t getFlashCommand(void) { return flash_command; }
functions
uint8_t getFlashDumpProgress(void) { return flash_progress; }
functions
uint8_t getFlashDumpComplete(void) { return flash_dump_complete; }
functions
uint8_t getFlashDumpFail(void) { return flash_dump_fail; }
functions
uint8_t getSysOperation(void) { return sys_operation; }
functions
uint8_t getFlashReadStep(void) { return flash_read_step; }
functions
uint8_t getFlashDumpSector(void) { return flash_dump_sector; }
functions
uint8_t getFlashDumpPage(void) { return flash_dump_page; }
functions
bool getFlashDumpGoing(void) { return flash_dump_going; }
functions
void setFlashBuffer(void) { int i=0; flash_buffer = kzalloc(32768*sizeof(uint8_t), GFP_KERNEL); for(i=0; i<32768; i++) { flash_buffer[i] = 0x00; }
functions
void setSysOperation(uint8_t operation) { sys_operation = operation; }
functions
void setFlashDumpProgress(uint8_t progress) { flash_progress = progress; //I("TPPPP setFlashDumpProgress : progress = %d ,flash_progress = %d \n",progress,flash_progress); }
functions
void setFlashDumpComplete(uint8_t status) { flash_dump_complete = status; }
functions
void setFlashDumpFail(uint8_t fail) { flash_dump_fail = fail; }
functions
void setFlashCommand(uint8_t command) { flash_command = command; }
functions
void setFlashReadStep(uint8_t step) { flash_read_step = step; }
functions
void setFlashDumpSector(uint8_t sector) { flash_dump_sector = sector; }
functions
void setFlashDumpPage(uint8_t page) { flash_dump_page = page; }
functions
void setFlashDumpGoing(bool going) { flash_dump_going = going; }
functions
ssize_t himax_flash_show(struct device *dev,struct device_attribute *attr, char *buf) { int ret = 0; int loop_i; uint8_t local_flash_read_step=0; uint8_t local_flash_complete = 0; uint8_t local_flash_progress = 0; uint8_t local_flash_command = 0; uint8_t local_flash_fail = 0; local_flash_complete = ge...
functions
ssize_t himax_flash_store(struct device *dev,struct device_attribute *attr, const char *buf, size_t count) { char buf_tmp[6]; unsigned long result = 0; uint8_t loop_i = 0; int base = 0; memset(buf_tmp, 0x0, sizeof(buf_tmp)); I("%s: buf[0] = %s\n", __func__, buf); if (getSysOperation() == 1) { E("...
functions
else if (buf[0] == '1') { setSysOperation(1); setFlashCommand(1); setFlashDumpProgress(0); setFlashDumpComplete(0); setFlashDumpFail(0); queue_work(private_ts->flash_wq, &private_ts->flash_work); }
functions
else if (buf[0] == '2') { setSysOperation(1); setFlashCommand(2); setFlashDumpProgress(0); setFlashDumpComplete(0); setFlashDumpFail(0); queue_work(private_ts->flash_wq, &private_ts->flash_work); }
functions
else if (buf[0] == '3') { setSysOperation(1); setFlashCommand(3); setFlashDumpProgress(0); setFlashDumpComplete(0); setFlashDumpFail(0); memcpy(buf_tmp, buf + 3, 2); if (!strict_strtoul(buf_tmp, 16, &result)) { setFlashDumpSector(result); }
functions
else if (buf[0] == '4') { I("%s: command 4 enter.\n", __func__); setSysOperation(1); setFlashCommand(4); setFlashDumpProgress(0); setFlashDumpComplete(0); setFlashDumpFail(0); memcpy(buf_tmp, buf + 3, 2); if (!strict_strtoul(buf_tmp, 16, &result)) { setFlashDumpSector(result); }
functions
void himax_ts_flash_work_func(struct work_struct *work) { struct himax_ts_data *ts = container_of(work, struct himax_ts_data, flash_work); uint8_t page_tmp[128]; uint8_t x59_tmp[4] = {0,0,0,0}
functions
start for(k=0; k<128; k++) { page_tmp[k] = 0x00; }
functions
end for(k=0; k<128; k++) { flash_buffer[buffer_ptr++] = page_tmp[k]; if (page_tmp[k] == 0xFF) { flash_end_count ++; if (flash_end_count == 32) { flash_end_count = 0; buffer_ptr = buffer_ptr -32; goto FLASH_END; }
functions
else if (local_flash_command == 3) { x43_command[1] = 0x01; if ( i2c_himax_write(ts->client, x43_command[0],&x43_command[1], 1, DEFAULT_RETRY_CNT) < 0 ) { E("%s i2c write 43 fail.\n",__func__); goto Flash_Dump_i2c_transfer_error; }
functions
end for(i=0; i<128; i++) { flash_buffer[buffer_ptr++] = page_tmp[i]; }
functions
else if (local_flash_command == 4) { //page write flow. //I("%s: local_flash_command = 4, enter.\n", __func__); //----------------------------------------------------------------------------------------------- // unlock flash //--------------------------------------------------------------------------...
functions
ssize_t himax_chip_self_test_function(struct device *dev, struct device_attribute *attr, char *buf) { int val=0x00; val = himax_chip_self_test(); if (val == 0x00) { return sprintf(buf, "Self_Test Pass\n"); }
functions
int himax_chip_self_test(void) { uint8_t cmdbuf[11]; int ret = 0; uint8_t valuebuf[16]; int i=0, pf_value=0x00; memset(valuebuf, 0x00, sizeof(valuebuf)); //----[HX_RST_PIN_FUNC]-----------------------------------------------------------------------------start // #ifdef HX_RST_PIN_FUNC // himax_HW_res...
functions
mode if (ret < 0) { E("[Himax]:write sernsor to self-test mode failed line: %d \n",__LINE__); }
functions
on if (ret < 0) { E("[Himax]:write HX_CMD_TSSON failed line: %d \n",__LINE__); }
functions
mode if (ret < 0) { E("[Himax]:write sensor to normal mode failed line: %d \n",__LINE__); }
functions
on if (ret < 0) { E("[Himax]:write HX_CMD_TSSON failed line: %d \n",__LINE__); }
functions
else if (IC_TYPE == HX_85XX_D_SERIES_PWON) {//For HTC cmdbuf[0] = 0x06; i2c_himax_write(private_ts->client, 0x91,&cmdbuf[0], 1, DEFAULT_RETRY_CNT); hr_msleep(120); cmdbuf[0] = 0x00; i2c_himax_write(private_ts->client, 0xD7,&cmdbuf[0], 1, DEFAULT_RETRY_CNT); hr_msleep(120); i2c_himax_write(private...
functions
ssize_t touch_vendor_show(struct device *dev, struct device_attribute *attr, char *buf) { ssize_t ret = 0; struct himax_ts_data *ts_data; ts_data = private_ts; ret += sprintf(buf, "%s_FW:%#x_CFG:%#x_SensorId:%#x\n", HIMAX8528_NAME, ts_data->vendor_fw_ver, ts_data->vendor_config_ver, ts_data->vendor_sensor_id)...
functions
ssize_t touch_attn_show(struct device *dev, struct device_attribute *attr, char *buf) { ssize_t ret = 0; struct himax_ts_data *ts_data; ts_data = private_ts; sprintf(buf, "attn = %x\n", gpio_get_value(ts_data->irq)); ret = strlen(buf) + 1; return ret; }
functions
ssize_t himax_int_status_show(struct device *dev, struct device_attribute *attr, char *buf) { struct himax_ts_data *ts = private_ts; size_t count = 0; count += sprintf(buf + count, "%d ", ts->irq_enabled); count += sprintf(buf + count, "\n"); return count; }
functions
ssize_t himax_int_status_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct himax_ts_data *ts = private_ts; int value, ret=0; if (sysfs_streq(buf, "0")) value = false; else if (sysfs_streq(buf, "1")) value = true; else return -EINVAL; if (value) { ret = re...
functions
int himax_input_register(struct himax_ts_data *ts) { int ret; ts->input_dev = input_allocate_device(); if (ts->input_dev == NULL) { ret = -ENOMEM; E("%s: Failed to allocate input device\n", __func__); return ret; }
functions
ssize_t himax_layout_show(struct device *dev, struct device_attribute *attr, char *buf) { struct himax_ts_data *ts = private_ts; size_t count = 0; count += sprintf(buf + count, "%d ", ts->pdata->abs_x_min); count += sprintf(buf + count, "%d ", ts->pdata->abs_x_max); count += sprintf(buf + count, "%d ", ts->pdat...
functions
ssize_t himax_layout_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct himax_ts_data *ts = private_ts; char buf_tmp[5]; int i = 0, j = 0, k = 0, ret; unsigned long value; int layout[4] = {0}
functions
ssize_t himax_debug_level_show(struct device *dev, struct device_attribute *attr, char *buf) { struct himax_ts_data *ts_data; size_t count = 0; ts_data = private_ts; count += sprintf(buf, "%d\n", ts_data->debug_log_level); return count; }
functions
ssize_t himax_debug_level_dump(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct himax_ts_data *ts; char buf_tmp[11]; int i; ts = private_ts; memset(buf_tmp, 0x0, sizeof(buf_tmp)); memcpy(buf_tmp, buf, count); ts->debug_log_level = 0; for(i=0; i<count-1; i++) { if(...
functions
ssize_t himax_set_event_htc(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct himax_ts_data *ts_data; unsigned long result = 0; ts_data = private_ts; if (!strict_strtoul(buf, 10, &result)) { ts_data->event_htc_enable_type = result; I("htc event enable = %d\n", ts_d...
functions
ssize_t himax_show_event_htc(struct device *dev, struct device_attribute *attr, char *buf) { struct himax_ts_data *ts_data; ts_data = private_ts; return sprintf(buf, "htc event enable = %d\n", ts_data->event_htc_enable_type); }
functions
void doHWreset(void) { struct himax_ts_data *ts = private_ts; int ret = 0; if (ts->rst_gpio) { if (ts->use_irq) himax_int_enable(0); else { hrtimer_cancel(&ts->timer); ret = cancel_work_sync(&ts->work); }
functions
hrtimer_restart himax_ts_timer_fake_event_func(struct hrtimer *timer) { struct himax_ts_data *ts = container_of(timer, struct himax_ts_data, timer); static int i; static int X_tmp; static int Y_tmp; if (!i) { X_tmp = X_fake_S; Y_tmp = Y_fake_S; i++; }
functions
else if (ts->protocol_type == PROTOCOL_TYPE_B) { input_mt_slot(ts->input_dev, 0); input_mt_report_slot_state(ts->input_dev, MT_TOOL_FINGER, 1); input_report_abs(ts->input_dev, ABS_MT_TOUCH_MAJOR, 10); input_report_abs(ts->input_dev, ABS_MT_WIDTH_MAJOR, 10); input_report_abs(ts->input_dev, ABS_MT_PRESSURE...
functions
else if (ts->protocol_type == PROTOCOL_TYPE_B) { input_mt_slot(ts->input_dev, 0); input_mt_report_slot_state(ts->input_dev, MT_TOOL_FINGER, 0); }
functions
ssize_t himax_fake_event_show(struct device *dev, struct device_attribute *attr, char *buf) { struct himax_ts_data *ts = private_ts; static uint8_t i; size_t count = 0; int Xres = 0, Yres = 0, Fx = 0, Fy = 0; if (!i) { hrtimer_init(&ts->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); ts->timer.function = himax_t...
functions
ssize_t himax_fake_event_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct himax_ts_data *ts_data; long value; char buf_tmp[5]; int i = 0, j = 0, k = 0, ret; ts_data = private_ts; while (1) { if (buf[i] == ',' || buf[i] == '\n') { memset(buf_tmp, 0x0, sizeof(...
functions
int register_sr_touch_device(void) { struct himax_ts_data *ts = private_ts; int ret = 0; ts->sr_input_dev = input_allocate_device(); if (ts->sr_input_dev == NULL) { E("[SR]%s: Failed to allocate SR input device\n", __func__); return ALLOCATE_DEV_FAIL; }
functions
ssize_t himax_set_en_sr(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct himax_ts_data *ts_data; ts_data = private_ts; if (buf[0]) { if (ts_data->sr_input_dev) I("[SR]%s: SR device already exist!\n", __func__); else I("[SR]%s: SR touch device enable result:%X\n",...
functions
void doFirmwareUpdate(void *unused, async_cookie_t cookie) { struct himax_ts_data *ts = private_ts; int FileLength = ts->fw_size; int ret; uint8_t buf[2] = {0}
functions
on if (ret < 0) { E("[himax] %s: I2C access failed addr = 0x%x\n", __func__, ts->client->addr); }