Lines Matching refs:tsdata

57 static void pixcir_ts_parse(struct pixcir_i2c_ts_data *tsdata,  in pixcir_ts_parse()  argument
66 const struct pixcir_i2c_chip_data *chip = tsdata->chip; in pixcir_ts_parse()
71 readsize = 2 + tsdata->max_fingers * (4 + i); in pixcir_ts_parse()
75 ret = i2c_master_send(tsdata->client, wrbuf, sizeof(wrbuf)); in pixcir_ts_parse()
77 dev_err(&tsdata->client->dev, in pixcir_ts_parse()
83 ret = i2c_master_recv(tsdata->client, rdbuf, readsize); in pixcir_ts_parse()
85 dev_err(&tsdata->client->dev, in pixcir_ts_parse()
92 if (touch > tsdata->max_fingers) in pixcir_ts_parse()
93 touch = tsdata->max_fingers; in pixcir_ts_parse()
166 struct pixcir_i2c_ts_data *tsdata = dev_id; in pixcir_ts_isr() local
169 while (tsdata->running) { in pixcir_ts_isr()
171 pixcir_ts_parse(tsdata, &report); in pixcir_ts_isr()
174 pixcir_ts_report(tsdata, &report); in pixcir_ts_isr()
176 if (gpiod_get_value_cansleep(tsdata->gpio_attb)) { in pixcir_ts_isr()
182 input_mt_sync_frame(tsdata->input); in pixcir_ts_isr()
183 input_sync(tsdata->input); in pixcir_ts_isr()
194 static void pixcir_reset(struct pixcir_i2c_ts_data *tsdata) in pixcir_reset() argument
196 if (!IS_ERR_OR_NULL(tsdata->gpio_reset)) { in pixcir_reset()
197 gpiod_set_value_cansleep(tsdata->gpio_reset, 1); in pixcir_reset()
199 gpiod_set_value_cansleep(tsdata->gpio_reset, 0); in pixcir_reset()
425 struct pixcir_i2c_ts_data *tsdata) in pixcir_parse_dt() argument
433 tsdata->chip = (const struct pixcir_i2c_chip_data *)match->data; in pixcir_parse_dt()
434 if (!tsdata->chip) in pixcir_parse_dt()
441 struct pixcir_i2c_ts_data *tsdata) in pixcir_parse_dt() argument
453 struct pixcir_i2c_ts_data *tsdata; in pixcir_i2c_ts_probe() local
457 tsdata = devm_kzalloc(dev, sizeof(*tsdata), GFP_KERNEL); in pixcir_i2c_ts_probe()
458 if (!tsdata) in pixcir_i2c_ts_probe()
462 tsdata->chip = &pdata->chip; in pixcir_i2c_ts_probe()
464 error = pixcir_parse_dt(dev, tsdata); in pixcir_i2c_ts_probe()
472 if (!tsdata->chip->max_fingers) { in pixcir_i2c_ts_probe()
483 tsdata->client = client; in pixcir_i2c_ts_probe()
484 tsdata->input = input; in pixcir_i2c_ts_probe()
506 tsdata->max_fingers = tsdata->chip->max_fingers; in pixcir_i2c_ts_probe()
507 if (tsdata->max_fingers > PIXCIR_MAX_SLOTS) { in pixcir_i2c_ts_probe()
508 tsdata->max_fingers = PIXCIR_MAX_SLOTS; in pixcir_i2c_ts_probe()
510 tsdata->max_fingers); in pixcir_i2c_ts_probe()
513 error = input_mt_init_slots(input, tsdata->max_fingers, in pixcir_i2c_ts_probe()
520 input_set_drvdata(input, tsdata); in pixcir_i2c_ts_probe()
522 tsdata->gpio_attb = devm_gpiod_get(dev, "attb", GPIOD_IN); in pixcir_i2c_ts_probe()
523 if (IS_ERR(tsdata->gpio_attb)) { in pixcir_i2c_ts_probe()
524 error = PTR_ERR(tsdata->gpio_attb); in pixcir_i2c_ts_probe()
529 tsdata->gpio_reset = devm_gpiod_get_optional(dev, "reset", in pixcir_i2c_ts_probe()
531 if (IS_ERR(tsdata->gpio_reset)) { in pixcir_i2c_ts_probe()
532 error = PTR_ERR(tsdata->gpio_reset); in pixcir_i2c_ts_probe()
539 client->name, tsdata); in pixcir_i2c_ts_probe()
545 pixcir_reset(tsdata); in pixcir_i2c_ts_probe()
548 error = pixcir_set_power_mode(tsdata, PIXCIR_POWER_IDLE); in pixcir_i2c_ts_probe()
555 error = pixcir_stop(tsdata); in pixcir_i2c_ts_probe()
563 i2c_set_clientdata(client, tsdata); in pixcir_i2c_ts_probe()