Lines Matching refs:tsdata

43 static void pixcir_ts_parse(struct pixcir_i2c_ts_data *tsdata,  in pixcir_ts_parse()  argument
52 const struct pixcir_i2c_chip_data *chip = tsdata->chip; in pixcir_ts_parse()
57 readsize = 2 + tsdata->max_fingers * (4 + i); in pixcir_ts_parse()
61 ret = i2c_master_send(tsdata->client, wrbuf, sizeof(wrbuf)); in pixcir_ts_parse()
63 dev_err(&tsdata->client->dev, in pixcir_ts_parse()
69 ret = i2c_master_recv(tsdata->client, rdbuf, readsize); in pixcir_ts_parse()
71 dev_err(&tsdata->client->dev, in pixcir_ts_parse()
78 if (touch > tsdata->max_fingers) in pixcir_ts_parse()
79 touch = tsdata->max_fingers; in pixcir_ts_parse()
85 touchscreen_set_mt_pos(&report->pos[i], &tsdata->prop, in pixcir_ts_parse()
143 struct pixcir_i2c_ts_data *tsdata = dev_id; in pixcir_ts_isr() local
146 while (tsdata->running) { in pixcir_ts_isr()
148 pixcir_ts_parse(tsdata, &report); in pixcir_ts_isr()
151 pixcir_ts_report(tsdata, &report); in pixcir_ts_isr()
153 if (gpiod_get_value_cansleep(tsdata->gpio_attb)) { in pixcir_ts_isr()
159 input_mt_sync_frame(tsdata->input); in pixcir_ts_isr()
160 input_sync(tsdata->input); in pixcir_ts_isr()
171 static void pixcir_reset(struct pixcir_i2c_ts_data *tsdata) in pixcir_reset() argument
173 if (!IS_ERR_OR_NULL(tsdata->gpio_reset)) { in pixcir_reset()
174 gpiod_set_value_cansleep(tsdata->gpio_reset, 1); in pixcir_reset()
176 gpiod_set_value_cansleep(tsdata->gpio_reset, 0); in pixcir_reset()
419 struct pixcir_i2c_ts_data *tsdata) in pixcir_parse_dt() argument
421 tsdata->chip = of_device_get_match_data(dev); in pixcir_parse_dt()
422 if (!tsdata->chip) in pixcir_parse_dt()
429 struct pixcir_i2c_ts_data *tsdata) in pixcir_parse_dt() argument
441 struct pixcir_i2c_ts_data *tsdata; in pixcir_i2c_ts_probe() local
445 tsdata = devm_kzalloc(dev, sizeof(*tsdata), GFP_KERNEL); in pixcir_i2c_ts_probe()
446 if (!tsdata) in pixcir_i2c_ts_probe()
450 tsdata->chip = &pdata->chip; in pixcir_i2c_ts_probe()
452 error = pixcir_parse_dt(dev, tsdata); in pixcir_i2c_ts_probe()
460 if (!tsdata->chip->max_fingers) { in pixcir_i2c_ts_probe()
471 tsdata->client = client; in pixcir_i2c_ts_probe()
472 tsdata->input = input; in pixcir_i2c_ts_probe()
486 touchscreen_parse_properties(input, true, &tsdata->prop); in pixcir_i2c_ts_probe()
494 tsdata->max_fingers = tsdata->chip->max_fingers; in pixcir_i2c_ts_probe()
495 if (tsdata->max_fingers > PIXCIR_MAX_SLOTS) { in pixcir_i2c_ts_probe()
496 tsdata->max_fingers = PIXCIR_MAX_SLOTS; in pixcir_i2c_ts_probe()
498 tsdata->max_fingers); in pixcir_i2c_ts_probe()
501 error = input_mt_init_slots(input, tsdata->max_fingers, in pixcir_i2c_ts_probe()
508 input_set_drvdata(input, tsdata); in pixcir_i2c_ts_probe()
510 tsdata->gpio_attb = devm_gpiod_get(dev, "attb", GPIOD_IN); in pixcir_i2c_ts_probe()
511 if (IS_ERR(tsdata->gpio_attb)) { in pixcir_i2c_ts_probe()
512 error = PTR_ERR(tsdata->gpio_attb); in pixcir_i2c_ts_probe()
517 tsdata->gpio_reset = devm_gpiod_get_optional(dev, "reset", in pixcir_i2c_ts_probe()
519 if (IS_ERR(tsdata->gpio_reset)) { in pixcir_i2c_ts_probe()
520 error = PTR_ERR(tsdata->gpio_reset); in pixcir_i2c_ts_probe()
525 tsdata->gpio_wake = devm_gpiod_get_optional(dev, "wake", in pixcir_i2c_ts_probe()
527 if (IS_ERR(tsdata->gpio_wake)) { in pixcir_i2c_ts_probe()
528 error = PTR_ERR(tsdata->gpio_wake); in pixcir_i2c_ts_probe()
534 tsdata->gpio_enable = devm_gpiod_get_optional(dev, "enable", in pixcir_i2c_ts_probe()
536 if (IS_ERR(tsdata->gpio_enable)) { in pixcir_i2c_ts_probe()
537 error = PTR_ERR(tsdata->gpio_enable); in pixcir_i2c_ts_probe()
543 if (tsdata->gpio_enable) in pixcir_i2c_ts_probe()
548 client->name, tsdata); in pixcir_i2c_ts_probe()
554 pixcir_reset(tsdata); in pixcir_i2c_ts_probe()
557 error = pixcir_set_power_mode(tsdata, PIXCIR_POWER_IDLE); in pixcir_i2c_ts_probe()
564 error = pixcir_stop(tsdata); in pixcir_i2c_ts_probe()
572 i2c_set_clientdata(client, tsdata); in pixcir_i2c_ts_probe()