Lines Matching refs:tsdata

161 static bool edt_ft5x06_ts_check_crc(struct edt_ft5x06_ts_data *tsdata,  in edt_ft5x06_ts_check_crc()  argument
171 tsdata->crc_errors++; in edt_ft5x06_ts_check_crc()
172 dev_err_ratelimited(&tsdata->client->dev, in edt_ft5x06_ts_check_crc()
186 struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(i2c); in edt_M06_i2c_read() local
209 wbuf[0] = M06_REG_CMD(tsdata->factory_mode); in edt_M06_i2c_read()
210 wbuf[1] = M06_REG_ADDR(tsdata->factory_mode, addr); in edt_M06_i2c_read()
211 wbuf[1] |= tsdata->factory_mode ? 0x80 : 0x40; in edt_M06_i2c_read()
237 tsdata->header_errors++; in edt_M06_i2c_read()
244 if (!edt_ft5x06_ts_check_crc(tsdata, val_buf, val_size)) in edt_M06_i2c_read()
249 if (!edt_ft5x06_ts_check_crc(tsdata, wbuf, 4)) in edt_M06_i2c_read()
262 struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(i2c); in edt_M06_i2c_write() local
271 wbuf[0] = M06_REG_CMD(tsdata->factory_mode); in edt_M06_i2c_write()
272 wbuf[1] = M06_REG_ADDR(tsdata->factory_mode, addr); in edt_M06_i2c_write()
301 struct edt_ft5x06_ts_data *tsdata = dev_id; in edt_ft5x06_ts_isr() local
302 struct device *dev = &tsdata->client->dev; in edt_ft5x06_ts_isr()
308 error = regmap_bulk_read(tsdata->regmap, tsdata->tdata_cmd, rdbuf, in edt_ft5x06_ts_isr()
309 tsdata->tdata_len); in edt_ft5x06_ts_isr()
316 for (i = 0; i < tsdata->max_support_points; i++) { in edt_ft5x06_ts_isr()
317 u8 *buf = &rdbuf[i * tsdata->point_len + tsdata->tdata_offset]; in edt_ft5x06_ts_isr()
325 if (tsdata->version == EDT_M06 && type == TOUCH_EVENT_DOWN) in edt_ft5x06_ts_isr()
331 if (tsdata->version == EV_FT) in edt_ft5x06_ts_isr()
336 input_mt_slot(tsdata->input, id); in edt_ft5x06_ts_isr()
337 if (input_mt_report_slot_state(tsdata->input, MT_TOOL_FINGER, in edt_ft5x06_ts_isr()
339 touchscreen_report_pos(tsdata->input, &tsdata->prop, in edt_ft5x06_ts_isr()
343 input_mt_report_pointer_emulation(tsdata->input, true); in edt_ft5x06_ts_isr()
344 input_sync(tsdata->input); in edt_ft5x06_ts_isr()
379 struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client); in edt_ft5x06_setting_show() local
382 u8 *field = (u8 *)tsdata + attr->field_offset; in edt_ft5x06_setting_show()
388 mutex_lock(&tsdata->mutex); in edt_ft5x06_setting_show()
390 if (tsdata->factory_mode) { in edt_ft5x06_setting_show()
395 switch (tsdata->version) { in edt_ft5x06_setting_show()
416 error = regmap_read(tsdata->regmap, addr, &val); in edt_ft5x06_setting_show()
418 dev_err(&tsdata->client->dev, in edt_ft5x06_setting_show()
428 dev_warn(&tsdata->client->dev, in edt_ft5x06_setting_show()
436 mutex_unlock(&tsdata->mutex); in edt_ft5x06_setting_show()
445 struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client); in edt_ft5x06_setting_store() local
448 u8 *field = (u8 *)tsdata + attr->field_offset; in edt_ft5x06_setting_store()
453 mutex_lock(&tsdata->mutex); in edt_ft5x06_setting_store()
455 if (tsdata->factory_mode) { in edt_ft5x06_setting_store()
469 switch (tsdata->version) { in edt_ft5x06_setting_store()
490 error = regmap_write(tsdata->regmap, addr, val); in edt_ft5x06_setting_store()
492 dev_err(&tsdata->client->dev, in edt_ft5x06_setting_store()
501 mutex_unlock(&tsdata->mutex); in edt_ft5x06_setting_store()
528 struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client); in model_show() local
530 return sysfs_emit(buf, "%s\n", tsdata->name); in model_show()
539 struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client); in fw_version_show() local
541 return sysfs_emit(buf, "%s\n", tsdata->fw_version); in fw_version_show()
551 struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client); in header_errors_show() local
553 return sysfs_emit(buf, "%d\n", tsdata->header_errors); in header_errors_show()
563 struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client); in crc_errors_show() local
565 return sysfs_emit(buf, "%d\n", tsdata->crc_errors); in crc_errors_show()
585 static void edt_ft5x06_restore_reg_parameters(struct edt_ft5x06_ts_data *tsdata) in edt_ft5x06_restore_reg_parameters() argument
587 struct edt_reg_addr *reg_addr = &tsdata->reg_addr; in edt_ft5x06_restore_reg_parameters()
588 struct regmap *regmap = tsdata->regmap; in edt_ft5x06_restore_reg_parameters()
590 regmap_write(regmap, reg_addr->reg_threshold, tsdata->threshold); in edt_ft5x06_restore_reg_parameters()
591 regmap_write(regmap, reg_addr->reg_gain, tsdata->gain); in edt_ft5x06_restore_reg_parameters()
593 regmap_write(regmap, reg_addr->reg_offset, tsdata->offset); in edt_ft5x06_restore_reg_parameters()
595 regmap_write(regmap, reg_addr->reg_offset_x, tsdata->offset_x); in edt_ft5x06_restore_reg_parameters()
597 regmap_write(regmap, reg_addr->reg_offset_y, tsdata->offset_y); in edt_ft5x06_restore_reg_parameters()
600 tsdata->report_rate); in edt_ft5x06_restore_reg_parameters()
604 static int edt_ft5x06_factory_mode(struct edt_ft5x06_ts_data *tsdata) in edt_ft5x06_factory_mode() argument
606 struct i2c_client *client = tsdata->client; in edt_ft5x06_factory_mode()
611 if (tsdata->version != EDT_M06) { in edt_ft5x06_factory_mode()
619 if (!tsdata->raw_buffer) { in edt_ft5x06_factory_mode()
620 tsdata->raw_bufsize = tsdata->num_x * tsdata->num_y * in edt_ft5x06_factory_mode()
622 tsdata->raw_buffer = kzalloc(tsdata->raw_bufsize, GFP_KERNEL); in edt_ft5x06_factory_mode()
623 if (!tsdata->raw_buffer) { in edt_ft5x06_factory_mode()
630 error = regmap_write(tsdata->regmap, WORK_REGISTER_OPMODE, 0x03); in edt_ft5x06_factory_mode()
637 tsdata->factory_mode = true; in edt_ft5x06_factory_mode()
641 error = regmap_read(tsdata->regmap, FACTORY_REGISTER_OPMODE, in edt_ft5x06_factory_mode()
657 kfree(tsdata->raw_buffer); in edt_ft5x06_factory_mode()
658 tsdata->raw_buffer = NULL; in edt_ft5x06_factory_mode()
659 tsdata->factory_mode = false; in edt_ft5x06_factory_mode()
665 static int edt_ft5x06_work_mode(struct edt_ft5x06_ts_data *tsdata) in edt_ft5x06_work_mode() argument
667 struct i2c_client *client = tsdata->client; in edt_ft5x06_work_mode()
673 error = regmap_write(tsdata->regmap, FACTORY_REGISTER_OPMODE, 0x1); in edt_ft5x06_work_mode()
680 tsdata->factory_mode = false; in edt_ft5x06_work_mode()
685 error = regmap_read(tsdata->regmap, WORK_REGISTER_OPMODE, &val); in edt_ft5x06_work_mode()
693 tsdata->factory_mode = true; in edt_ft5x06_work_mode()
697 kfree(tsdata->raw_buffer); in edt_ft5x06_work_mode()
698 tsdata->raw_buffer = NULL; in edt_ft5x06_work_mode()
700 edt_ft5x06_restore_reg_parameters(tsdata); in edt_ft5x06_work_mode()
708 struct edt_ft5x06_ts_data *tsdata = data; in edt_ft5x06_debugfs_mode_get() local
710 *mode = tsdata->factory_mode; in edt_ft5x06_debugfs_mode_get()
717 struct edt_ft5x06_ts_data *tsdata = data; in edt_ft5x06_debugfs_mode_set() local
723 mutex_lock(&tsdata->mutex); in edt_ft5x06_debugfs_mode_set()
725 if (mode != tsdata->factory_mode) { in edt_ft5x06_debugfs_mode_set()
726 retval = mode ? edt_ft5x06_factory_mode(tsdata) : in edt_ft5x06_debugfs_mode_set()
727 edt_ft5x06_work_mode(tsdata); in edt_ft5x06_debugfs_mode_set()
730 mutex_unlock(&tsdata->mutex); in edt_ft5x06_debugfs_mode_set()
742 struct edt_ft5x06_ts_data *tsdata = file->private_data; in edt_ft5x06_debugfs_raw_data_read() local
743 struct i2c_client *client = tsdata->client; in edt_ft5x06_debugfs_raw_data_read()
751 if (*off < 0 || *off >= tsdata->raw_bufsize) in edt_ft5x06_debugfs_raw_data_read()
754 mutex_lock(&tsdata->mutex); in edt_ft5x06_debugfs_raw_data_read()
756 if (!tsdata->factory_mode || !tsdata->raw_buffer) { in edt_ft5x06_debugfs_raw_data_read()
761 error = regmap_write(tsdata->regmap, 0x08, 0x01); in edt_ft5x06_debugfs_raw_data_read()
770 error = regmap_read(tsdata->regmap, 0x08, &val); in edt_ft5x06_debugfs_raw_data_read()
789 rdbuf = tsdata->raw_buffer; in edt_ft5x06_debugfs_raw_data_read()
790 colbytes = tsdata->num_y * sizeof(u16); in edt_ft5x06_debugfs_raw_data_read()
792 for (i = 0; i < tsdata->num_x; i++) { in edt_ft5x06_debugfs_raw_data_read()
794 error = regmap_bulk_read(tsdata->regmap, 0xf5, rdbuf, colbytes); in edt_ft5x06_debugfs_raw_data_read()
801 read = min_t(size_t, count, tsdata->raw_bufsize - *off); in edt_ft5x06_debugfs_raw_data_read()
802 if (copy_to_user(buf, tsdata->raw_buffer + *off, read)) { in edt_ft5x06_debugfs_raw_data_read()
809 mutex_unlock(&tsdata->mutex); in edt_ft5x06_debugfs_raw_data_read()
818 static void edt_ft5x06_ts_prepare_debugfs(struct edt_ft5x06_ts_data *tsdata, in edt_ft5x06_ts_prepare_debugfs() argument
821 tsdata->debug_dir = debugfs_create_dir(debugfs_name, NULL); in edt_ft5x06_ts_prepare_debugfs()
823 debugfs_create_u16("num_x", S_IRUSR, tsdata->debug_dir, &tsdata->num_x); in edt_ft5x06_ts_prepare_debugfs()
824 debugfs_create_u16("num_y", S_IRUSR, tsdata->debug_dir, &tsdata->num_y); in edt_ft5x06_ts_prepare_debugfs()
827 tsdata->debug_dir, tsdata, &debugfs_mode_fops); in edt_ft5x06_ts_prepare_debugfs()
829 tsdata->debug_dir, tsdata, &debugfs_raw_data_fops); in edt_ft5x06_ts_prepare_debugfs()
832 static void edt_ft5x06_ts_teardown_debugfs(struct edt_ft5x06_ts_data *tsdata) in edt_ft5x06_ts_teardown_debugfs() argument
834 debugfs_remove_recursive(tsdata->debug_dir); in edt_ft5x06_ts_teardown_debugfs()
835 kfree(tsdata->raw_buffer); in edt_ft5x06_ts_teardown_debugfs()
840 static int edt_ft5x06_factory_mode(struct edt_ft5x06_ts_data *tsdata) in edt_ft5x06_factory_mode() argument
845 static void edt_ft5x06_ts_prepare_debugfs(struct edt_ft5x06_ts_data *tsdata, in edt_ft5x06_ts_prepare_debugfs() argument
850 static void edt_ft5x06_ts_teardown_debugfs(struct edt_ft5x06_ts_data *tsdata) in edt_ft5x06_ts_teardown_debugfs() argument
857 struct edt_ft5x06_ts_data *tsdata) in edt_ft5x06_ts_identify() argument
862 char *model_name = tsdata->name; in edt_ft5x06_ts_identify()
863 char *fw_version = tsdata->fw_version; in edt_ft5x06_ts_identify()
870 error = regmap_bulk_read(tsdata->regmap, 0xBB, rdbuf, EDT_NAME_LEN - 1); in edt_ft5x06_ts_identify()
879 tsdata->version = EDT_M06; in edt_ft5x06_ts_identify()
893 regmap_exit(tsdata->regmap); in edt_ft5x06_ts_identify()
894 tsdata->regmap = regmap_init_i2c(client, in edt_ft5x06_ts_identify()
896 if (IS_ERR(tsdata->regmap)) { in edt_ft5x06_ts_identify()
898 return PTR_ERR(tsdata->regmap); in edt_ft5x06_ts_identify()
901 tsdata->version = EDT_M12; in edt_ft5x06_ts_identify()
924 tsdata->version = GENERIC_FT; in edt_ft5x06_ts_identify()
926 error = regmap_bulk_read(tsdata->regmap, 0xA6, rdbuf, 2); in edt_ft5x06_ts_identify()
932 error = regmap_bulk_read(tsdata->regmap, 0xA8, rdbuf, 1); in edt_ft5x06_ts_identify()
947 tsdata->version = EDT_M09; in edt_ft5x06_ts_identify()
952 tsdata->version = EDT_M09; in edt_ft5x06_ts_identify()
960 tsdata->version = EV_FT; in edt_ft5x06_ts_identify()
961 error = regmap_bulk_read(tsdata->regmap, 0x53, rdbuf, 1); in edt_ft5x06_ts_identify()
980 struct edt_ft5x06_ts_data *tsdata) in edt_ft5x06_ts_get_defaults() argument
982 struct edt_reg_addr *reg_addr = &tsdata->reg_addr; in edt_ft5x06_ts_get_defaults()
983 struct regmap *regmap = tsdata->regmap; in edt_ft5x06_ts_get_defaults()
990 tsdata->threshold = val; in edt_ft5x06_ts_get_defaults()
996 tsdata->gain = val; in edt_ft5x06_ts_get_defaults()
1003 tsdata->offset = val; in edt_ft5x06_ts_get_defaults()
1010 tsdata->offset_x = val; in edt_ft5x06_ts_get_defaults()
1017 tsdata->offset_y = val; in edt_ft5x06_ts_get_defaults()
1021 static void edt_ft5x06_ts_get_parameters(struct edt_ft5x06_ts_data *tsdata) in edt_ft5x06_ts_get_parameters() argument
1023 struct edt_reg_addr *reg_addr = &tsdata->reg_addr; in edt_ft5x06_ts_get_parameters()
1024 struct regmap *regmap = tsdata->regmap; in edt_ft5x06_ts_get_parameters()
1027 regmap_read(regmap, reg_addr->reg_threshold, &tsdata->threshold); in edt_ft5x06_ts_get_parameters()
1028 regmap_read(regmap, reg_addr->reg_gain, &tsdata->gain); in edt_ft5x06_ts_get_parameters()
1030 regmap_read(regmap, reg_addr->reg_offset, &tsdata->offset); in edt_ft5x06_ts_get_parameters()
1032 regmap_read(regmap, reg_addr->reg_offset_x, &tsdata->offset_x); in edt_ft5x06_ts_get_parameters()
1034 regmap_read(regmap, reg_addr->reg_offset_y, &tsdata->offset_y); in edt_ft5x06_ts_get_parameters()
1037 &tsdata->report_rate); in edt_ft5x06_ts_get_parameters()
1038 tsdata->num_x = EDT_DEFAULT_NUM_X; in edt_ft5x06_ts_get_parameters()
1041 tsdata->num_x = val; in edt_ft5x06_ts_get_parameters()
1043 tsdata->num_y = EDT_DEFAULT_NUM_Y; in edt_ft5x06_ts_get_parameters()
1046 tsdata->num_y = val; in edt_ft5x06_ts_get_parameters()
1050 static void edt_ft5x06_ts_set_tdata_parameters(struct edt_ft5x06_ts_data *tsdata) in edt_ft5x06_ts_set_tdata_parameters() argument
1054 if (tsdata->version == EDT_M06) { in edt_ft5x06_ts_set_tdata_parameters()
1055 tsdata->tdata_cmd = 0xf9; in edt_ft5x06_ts_set_tdata_parameters()
1056 tsdata->tdata_offset = 5; in edt_ft5x06_ts_set_tdata_parameters()
1057 tsdata->point_len = 4; in edt_ft5x06_ts_set_tdata_parameters()
1060 tsdata->tdata_cmd = 0x0; in edt_ft5x06_ts_set_tdata_parameters()
1061 tsdata->tdata_offset = 3; in edt_ft5x06_ts_set_tdata_parameters()
1062 tsdata->point_len = 6; in edt_ft5x06_ts_set_tdata_parameters()
1066 tsdata->tdata_len = tsdata->point_len * tsdata->max_support_points + in edt_ft5x06_ts_set_tdata_parameters()
1067 tsdata->tdata_offset + crclen; in edt_ft5x06_ts_set_tdata_parameters()
1070 static void edt_ft5x06_ts_set_regs(struct edt_ft5x06_ts_data *tsdata) in edt_ft5x06_ts_set_regs() argument
1072 struct edt_reg_addr *reg_addr = &tsdata->reg_addr; in edt_ft5x06_ts_set_regs()
1074 switch (tsdata->version) { in edt_ft5x06_ts_set_regs()
1089 reg_addr->reg_report_rate = tsdata->version == EDT_M12 ? in edt_ft5x06_ts_set_regs()
1144 struct edt_ft5x06_ts_data *tsdata; in edt_ft5x06_ts_probe() local
1153 tsdata = devm_kzalloc(&client->dev, sizeof(*tsdata), GFP_KERNEL); in edt_ft5x06_ts_probe()
1154 if (!tsdata) { in edt_ft5x06_ts_probe()
1159 tsdata->regmap = regmap_init_i2c(client, &edt_ft5x06_i2c_regmap_config); in edt_ft5x06_ts_probe()
1160 if (IS_ERR(tsdata->regmap)) { in edt_ft5x06_ts_probe()
1162 return PTR_ERR(tsdata->regmap); in edt_ft5x06_ts_probe()
1171 tsdata); in edt_ft5x06_ts_probe()
1183 tsdata->max_support_points = chip_data->max_support_points; in edt_ft5x06_ts_probe()
1185 tsdata->vcc = devm_regulator_get(&client->dev, "vcc"); in edt_ft5x06_ts_probe()
1186 if (IS_ERR(tsdata->vcc)) in edt_ft5x06_ts_probe()
1187 return dev_err_probe(&client->dev, PTR_ERR(tsdata->vcc), in edt_ft5x06_ts_probe()
1190 tsdata->iovcc = devm_regulator_get(&client->dev, "iovcc"); in edt_ft5x06_ts_probe()
1191 if (IS_ERR(tsdata->iovcc)) { in edt_ft5x06_ts_probe()
1192 error = PTR_ERR(tsdata->iovcc); in edt_ft5x06_ts_probe()
1199 error = regulator_enable(tsdata->iovcc); in edt_ft5x06_ts_probe()
1208 error = regulator_enable(tsdata->vcc); in edt_ft5x06_ts_probe()
1211 regulator_disable(tsdata->iovcc); in edt_ft5x06_ts_probe()
1217 tsdata); in edt_ft5x06_ts_probe()
1221 tsdata->reset_gpio = devm_gpiod_get_optional(&client->dev, in edt_ft5x06_ts_probe()
1223 if (IS_ERR(tsdata->reset_gpio)) { in edt_ft5x06_ts_probe()
1224 error = PTR_ERR(tsdata->reset_gpio); in edt_ft5x06_ts_probe()
1230 tsdata->wake_gpio = devm_gpiod_get_optional(&client->dev, in edt_ft5x06_ts_probe()
1232 if (IS_ERR(tsdata->wake_gpio)) { in edt_ft5x06_ts_probe()
1233 error = PTR_ERR(tsdata->wake_gpio); in edt_ft5x06_ts_probe()
1245 if (tsdata->reset_gpio) in edt_ft5x06_ts_probe()
1246 tsdata->suspend_mode = EDT_PMODE_POWEROFF; in edt_ft5x06_ts_probe()
1247 else if (tsdata->wake_gpio) in edt_ft5x06_ts_probe()
1248 tsdata->suspend_mode = EDT_PMODE_HIBERNATE; in edt_ft5x06_ts_probe()
1250 tsdata->suspend_mode = EDT_PMODE_NOT_SUPPORTED; in edt_ft5x06_ts_probe()
1252 if (tsdata->wake_gpio) { in edt_ft5x06_ts_probe()
1254 gpiod_set_value_cansleep(tsdata->wake_gpio, 1); in edt_ft5x06_ts_probe()
1258 if (tsdata->reset_gpio) { in edt_ft5x06_ts_probe()
1260 gpiod_set_value_cansleep(tsdata->reset_gpio, 0); in edt_ft5x06_ts_probe()
1270 mutex_init(&tsdata->mutex); in edt_ft5x06_ts_probe()
1271 tsdata->client = client; in edt_ft5x06_ts_probe()
1272 tsdata->input = input; in edt_ft5x06_ts_probe()
1273 tsdata->factory_mode = false; in edt_ft5x06_ts_probe()
1274 i2c_set_clientdata(client, tsdata); in edt_ft5x06_ts_probe()
1276 error = edt_ft5x06_ts_identify(client, tsdata); in edt_ft5x06_ts_probe()
1286 regmap_read(tsdata->regmap, 0x00, &val); in edt_ft5x06_ts_probe()
1288 edt_ft5x06_ts_set_tdata_parameters(tsdata); in edt_ft5x06_ts_probe()
1289 edt_ft5x06_ts_set_regs(tsdata); in edt_ft5x06_ts_probe()
1290 edt_ft5x06_ts_get_defaults(&client->dev, tsdata); in edt_ft5x06_ts_probe()
1291 edt_ft5x06_ts_get_parameters(tsdata); in edt_ft5x06_ts_probe()
1293 if (tsdata->reg_addr.reg_report_rate != NO_REGISTER && in edt_ft5x06_ts_probe()
1296 if (tsdata->version == EDT_M06) in edt_ft5x06_ts_probe()
1297 tsdata->report_rate = clamp_val(report_rate, 30, 140); in edt_ft5x06_ts_probe()
1299 tsdata->report_rate = clamp_val(report_rate, 1, 255); in edt_ft5x06_ts_probe()
1301 if (report_rate != tsdata->report_rate) in edt_ft5x06_ts_probe()
1304 report_rate, tsdata->report_rate); in edt_ft5x06_ts_probe()
1306 if (tsdata->version == EDT_M06) in edt_ft5x06_ts_probe()
1307 tsdata->report_rate /= 10; in edt_ft5x06_ts_probe()
1309 regmap_write(tsdata->regmap, tsdata->reg_addr.reg_report_rate, in edt_ft5x06_ts_probe()
1310 tsdata->report_rate); in edt_ft5x06_ts_probe()
1315 tsdata->name, tsdata->fw_version, tsdata->num_x, tsdata->num_y); in edt_ft5x06_ts_probe()
1317 input->name = tsdata->name; in edt_ft5x06_ts_probe()
1322 0, tsdata->num_x * 64 - 1, 0, 0); in edt_ft5x06_ts_probe()
1324 0, tsdata->num_y * 64 - 1, 0, 0); in edt_ft5x06_ts_probe()
1326 touchscreen_parse_properties(input, true, &tsdata->prop); in edt_ft5x06_ts_probe()
1328 error = input_mt_init_slots(input, tsdata->max_support_points, in edt_ft5x06_ts_probe()
1342 client->name, tsdata); in edt_ft5x06_ts_probe()
1352 edt_ft5x06_ts_prepare_debugfs(tsdata, dev_driver_string(&client->dev)); in edt_ft5x06_ts_probe()
1357 tsdata->wake_gpio ? desc_to_gpio(tsdata->wake_gpio) : -1, in edt_ft5x06_ts_probe()
1358 tsdata->reset_gpio ? desc_to_gpio(tsdata->reset_gpio) : -1); in edt_ft5x06_ts_probe()
1365 struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client); in edt_ft5x06_ts_remove() local
1367 edt_ft5x06_ts_teardown_debugfs(tsdata); in edt_ft5x06_ts_remove()
1373 struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client); in edt_ft5x06_ts_suspend() local
1374 struct gpio_desc *reset_gpio = tsdata->reset_gpio; in edt_ft5x06_ts_suspend()
1380 if (tsdata->suspend_mode == EDT_PMODE_NOT_SUPPORTED) in edt_ft5x06_ts_suspend()
1384 ret = regmap_write(tsdata->regmap, PMOD_REGISTER_OPMODE, in edt_ft5x06_ts_suspend()
1389 if (tsdata->suspend_mode == EDT_PMODE_HIBERNATE) in edt_ft5x06_ts_suspend()
1398 disable_irq(tsdata->client->irq); in edt_ft5x06_ts_suspend()
1403 ret = regulator_disable(tsdata->vcc); in edt_ft5x06_ts_suspend()
1406 ret = regulator_disable(tsdata->iovcc); in edt_ft5x06_ts_suspend()
1416 struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client); in edt_ft5x06_ts_resume() local
1422 if (tsdata->suspend_mode == EDT_PMODE_NOT_SUPPORTED) in edt_ft5x06_ts_resume()
1425 if (tsdata->suspend_mode == EDT_PMODE_POWEROFF) { in edt_ft5x06_ts_resume()
1426 struct gpio_desc *reset_gpio = tsdata->reset_gpio; in edt_ft5x06_ts_resume()
1439 ret = regulator_enable(tsdata->iovcc); in edt_ft5x06_ts_resume()
1448 ret = regulator_enable(tsdata->vcc); in edt_ft5x06_ts_resume()
1451 regulator_disable(tsdata->iovcc); in edt_ft5x06_ts_resume()
1459 edt_ft5x06_restore_reg_parameters(tsdata); in edt_ft5x06_ts_resume()
1460 enable_irq(tsdata->client->irq); in edt_ft5x06_ts_resume()
1462 if (tsdata->factory_mode) in edt_ft5x06_ts_resume()
1463 ret = edt_ft5x06_factory_mode(tsdata); in edt_ft5x06_ts_resume()
1465 struct gpio_desc *wake_gpio = tsdata->wake_gpio; in edt_ft5x06_ts_resume()