Lines Matching refs:tsdata
93 static void pixcir_ts_parse(struct pixcir_i2c_ts_data *tsdata, in pixcir_ts_parse() argument
102 const struct pixcir_i2c_chip_data *chip = tsdata->chip; in pixcir_ts_parse()
107 readsize = 2 + tsdata->chip->max_fingers * (4 + i); in pixcir_ts_parse()
111 ret = i2c_master_send(tsdata->client, wrbuf, sizeof(wrbuf)); in pixcir_ts_parse()
113 dev_err(&tsdata->client->dev, in pixcir_ts_parse()
119 ret = i2c_master_recv(tsdata->client, rdbuf, readsize); in pixcir_ts_parse()
121 dev_err(&tsdata->client->dev, in pixcir_ts_parse()
128 if (touch > tsdata->chip->max_fingers) in pixcir_ts_parse()
129 touch = tsdata->chip->max_fingers; in pixcir_ts_parse()
135 touchscreen_set_mt_pos(&report->pos[i], &tsdata->prop, in pixcir_ts_parse()
193 struct pixcir_i2c_ts_data *tsdata = dev_id; in pixcir_ts_isr() local
196 while (tsdata->running) { in pixcir_ts_isr()
198 pixcir_ts_parse(tsdata, &report); in pixcir_ts_isr()
201 pixcir_ts_report(tsdata, &report); in pixcir_ts_isr()
203 if (gpiod_get_value_cansleep(tsdata->gpio_attb)) { in pixcir_ts_isr()
209 input_mt_sync_frame(tsdata->input); in pixcir_ts_isr()
210 input_sync(tsdata->input); in pixcir_ts_isr()
221 static void pixcir_reset(struct pixcir_i2c_ts_data *tsdata) in pixcir_reset() argument
223 if (!IS_ERR_OR_NULL(tsdata->gpio_reset)) { in pixcir_reset()
224 gpiod_set_value_cansleep(tsdata->gpio_reset, 1); in pixcir_reset()
226 gpiod_set_value_cansleep(tsdata->gpio_reset, 0); in pixcir_reset()
469 struct pixcir_i2c_ts_data *tsdata; in pixcir_i2c_ts_probe() local
473 tsdata = devm_kzalloc(dev, sizeof(*tsdata), GFP_KERNEL); in pixcir_i2c_ts_probe()
474 if (!tsdata) in pixcir_i2c_ts_probe()
477 tsdata->chip = device_get_match_data(dev); in pixcir_i2c_ts_probe()
478 if (!tsdata->chip && id) in pixcir_i2c_ts_probe()
479 tsdata->chip = (const void *)id->driver_data; in pixcir_i2c_ts_probe()
480 if (!tsdata->chip) { in pixcir_i2c_ts_probe()
491 tsdata->client = client; in pixcir_i2c_ts_probe()
492 tsdata->input = input; in pixcir_i2c_ts_probe()
501 touchscreen_parse_properties(input, true, &tsdata->prop); in pixcir_i2c_ts_probe()
508 error = input_mt_init_slots(input, tsdata->chip->max_fingers, in pixcir_i2c_ts_probe()
515 input_set_drvdata(input, tsdata); in pixcir_i2c_ts_probe()
517 tsdata->gpio_attb = devm_gpiod_get(dev, "attb", GPIOD_IN); in pixcir_i2c_ts_probe()
518 if (IS_ERR(tsdata->gpio_attb)) in pixcir_i2c_ts_probe()
519 return dev_err_probe(dev, PTR_ERR(tsdata->gpio_attb), in pixcir_i2c_ts_probe()
522 tsdata->gpio_reset = devm_gpiod_get_optional(dev, "reset", in pixcir_i2c_ts_probe()
524 if (IS_ERR(tsdata->gpio_reset)) in pixcir_i2c_ts_probe()
525 return dev_err_probe(dev, PTR_ERR(tsdata->gpio_reset), in pixcir_i2c_ts_probe()
528 tsdata->gpio_wake = devm_gpiod_get_optional(dev, "wake", in pixcir_i2c_ts_probe()
530 if (IS_ERR(tsdata->gpio_wake)) in pixcir_i2c_ts_probe()
531 return dev_err_probe(dev, 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 return dev_err_probe(dev, PTR_ERR(tsdata->gpio_enable), in pixcir_i2c_ts_probe()
540 if (tsdata->gpio_enable) in pixcir_i2c_ts_probe()
545 client->name, tsdata); in pixcir_i2c_ts_probe()
551 pixcir_reset(tsdata); in pixcir_i2c_ts_probe()
554 error = pixcir_set_power_mode(tsdata, PIXCIR_POWER_IDLE); in pixcir_i2c_ts_probe()
561 error = pixcir_stop(tsdata); in pixcir_i2c_ts_probe()
569 i2c_set_clientdata(client, tsdata); in pixcir_i2c_ts_probe()