Lines Matching refs:tsdata
51 static void pixcir_ts_parse(struct pixcir_i2c_ts_data *tsdata, in pixcir_ts_parse() argument
60 const struct pixcir_i2c_chip_data *chip = tsdata->chip; in pixcir_ts_parse()
65 readsize = 2 + tsdata->max_fingers * (4 + i); in pixcir_ts_parse()
69 ret = i2c_master_send(tsdata->client, wrbuf, sizeof(wrbuf)); in pixcir_ts_parse()
71 dev_err(&tsdata->client->dev, in pixcir_ts_parse()
77 ret = i2c_master_recv(tsdata->client, rdbuf, readsize); in pixcir_ts_parse()
79 dev_err(&tsdata->client->dev, in pixcir_ts_parse()
86 if (touch > tsdata->max_fingers) in pixcir_ts_parse()
87 touch = tsdata->max_fingers; in pixcir_ts_parse()
93 touchscreen_set_mt_pos(&report->pos[i], &tsdata->prop, in pixcir_ts_parse()
151 struct pixcir_i2c_ts_data *tsdata = dev_id; in pixcir_ts_isr() local
154 while (tsdata->running) { in pixcir_ts_isr()
156 pixcir_ts_parse(tsdata, &report); in pixcir_ts_isr()
159 pixcir_ts_report(tsdata, &report); in pixcir_ts_isr()
161 if (gpiod_get_value_cansleep(tsdata->gpio_attb)) { in pixcir_ts_isr()
167 input_mt_sync_frame(tsdata->input); in pixcir_ts_isr()
168 input_sync(tsdata->input); in pixcir_ts_isr()
179 static void pixcir_reset(struct pixcir_i2c_ts_data *tsdata) in pixcir_reset() argument
181 if (!IS_ERR_OR_NULL(tsdata->gpio_reset)) { in pixcir_reset()
182 gpiod_set_value_cansleep(tsdata->gpio_reset, 1); in pixcir_reset()
184 gpiod_set_value_cansleep(tsdata->gpio_reset, 0); in pixcir_reset()
427 struct pixcir_i2c_ts_data *tsdata) in pixcir_parse_dt() argument
429 tsdata->chip = of_device_get_match_data(dev); in pixcir_parse_dt()
430 if (!tsdata->chip) in pixcir_parse_dt()
437 struct pixcir_i2c_ts_data *tsdata) in pixcir_parse_dt() argument
449 struct pixcir_i2c_ts_data *tsdata; in pixcir_i2c_ts_probe() local
453 tsdata = devm_kzalloc(dev, sizeof(*tsdata), GFP_KERNEL); in pixcir_i2c_ts_probe()
454 if (!tsdata) in pixcir_i2c_ts_probe()
458 tsdata->chip = &pdata->chip; in pixcir_i2c_ts_probe()
460 error = pixcir_parse_dt(dev, tsdata); in pixcir_i2c_ts_probe()
468 if (!tsdata->chip->max_fingers) { in pixcir_i2c_ts_probe()
479 tsdata->client = client; in pixcir_i2c_ts_probe()
480 tsdata->input = input; in pixcir_i2c_ts_probe()
494 touchscreen_parse_properties(input, true, &tsdata->prop); in pixcir_i2c_ts_probe()
502 tsdata->max_fingers = tsdata->chip->max_fingers; in pixcir_i2c_ts_probe()
503 if (tsdata->max_fingers > PIXCIR_MAX_SLOTS) { in pixcir_i2c_ts_probe()
504 tsdata->max_fingers = PIXCIR_MAX_SLOTS; in pixcir_i2c_ts_probe()
506 tsdata->max_fingers); in pixcir_i2c_ts_probe()
509 error = input_mt_init_slots(input, tsdata->max_fingers, in pixcir_i2c_ts_probe()
516 input_set_drvdata(input, tsdata); in pixcir_i2c_ts_probe()
518 tsdata->gpio_attb = devm_gpiod_get(dev, "attb", GPIOD_IN); in pixcir_i2c_ts_probe()
519 if (IS_ERR(tsdata->gpio_attb)) { in pixcir_i2c_ts_probe()
520 error = PTR_ERR(tsdata->gpio_attb); in pixcir_i2c_ts_probe()
525 tsdata->gpio_reset = devm_gpiod_get_optional(dev, "reset", in pixcir_i2c_ts_probe()
527 if (IS_ERR(tsdata->gpio_reset)) { in pixcir_i2c_ts_probe()
528 error = PTR_ERR(tsdata->gpio_reset); in pixcir_i2c_ts_probe()
533 tsdata->gpio_wake = devm_gpiod_get_optional(dev, "wake", in pixcir_i2c_ts_probe()
535 if (IS_ERR(tsdata->gpio_wake)) { in pixcir_i2c_ts_probe()
536 error = PTR_ERR(tsdata->gpio_wake); in pixcir_i2c_ts_probe()
542 tsdata->gpio_enable = devm_gpiod_get_optional(dev, "enable", in pixcir_i2c_ts_probe()
544 if (IS_ERR(tsdata->gpio_enable)) { in pixcir_i2c_ts_probe()
545 error = PTR_ERR(tsdata->gpio_enable); in pixcir_i2c_ts_probe()
551 if (tsdata->gpio_enable) in pixcir_i2c_ts_probe()
556 client->name, tsdata); in pixcir_i2c_ts_probe()
562 pixcir_reset(tsdata); in pixcir_i2c_ts_probe()
565 error = pixcir_set_power_mode(tsdata, PIXCIR_POWER_IDLE); in pixcir_i2c_ts_probe()
572 error = pixcir_stop(tsdata); in pixcir_i2c_ts_probe()
580 i2c_set_clientdata(client, tsdata); in pixcir_i2c_ts_probe()