Lines Matching defs:tsdata

93 static void pixcir_ts_parse(struct pixcir_i2c_ts_data *tsdata,
102 const struct pixcir_i2c_chip_data *chip = tsdata->chip;
107 readsize = 2 + tsdata->chip->max_fingers * (4 + i);
111 ret = i2c_master_send(tsdata->client, wrbuf, sizeof(wrbuf));
113 dev_err(&tsdata->client->dev,
119 ret = i2c_master_recv(tsdata->client, rdbuf, readsize);
121 dev_err(&tsdata->client->dev,
128 if (touch > tsdata->chip->max_fingers)
129 touch = tsdata->chip->max_fingers;
135 touchscreen_set_mt_pos(&report->pos[i], &tsdata->prop,
193 struct pixcir_i2c_ts_data *tsdata = dev_id;
196 while (tsdata->running) {
198 pixcir_ts_parse(tsdata, &report);
201 pixcir_ts_report(tsdata, &report);
203 if (gpiod_get_value_cansleep(tsdata->gpio_attb)) {
209 input_mt_sync_frame(tsdata->input);
210 input_sync(tsdata->input);
221 static void pixcir_reset(struct pixcir_i2c_ts_data *tsdata)
223 if (!IS_ERR_OR_NULL(tsdata->gpio_reset)) {
224 gpiod_set_value_cansleep(tsdata->gpio_reset, 1);
226 gpiod_set_value_cansleep(tsdata->gpio_reset, 0);
469 struct pixcir_i2c_ts_data *tsdata;
473 tsdata = devm_kzalloc(dev, sizeof(*tsdata), GFP_KERNEL);
474 if (!tsdata)
477 tsdata->chip = device_get_match_data(dev);
478 if (!tsdata->chip && id)
479 tsdata->chip = (const void *)id->driver_data;
480 if (!tsdata->chip) {
491 tsdata->client = client;
492 tsdata->input = input;
501 touchscreen_parse_properties(input, true, &tsdata->prop);
508 error = input_mt_init_slots(input, tsdata->chip->max_fingers,
515 input_set_drvdata(input, tsdata);
517 tsdata->gpio_attb = devm_gpiod_get(dev, "attb", GPIOD_IN);
518 if (IS_ERR(tsdata->gpio_attb)) {
519 error = PTR_ERR(tsdata->gpio_attb);
526 tsdata->gpio_reset = devm_gpiod_get_optional(dev, "reset",
528 if (IS_ERR(tsdata->gpio_reset)) {
529 error = PTR_ERR(tsdata->gpio_reset);
536 tsdata->gpio_wake = devm_gpiod_get_optional(dev, "wake",
538 if (IS_ERR(tsdata->gpio_wake)) {
539 error = PTR_ERR(tsdata->gpio_wake);
545 tsdata->gpio_enable = devm_gpiod_get_optional(dev, "enable",
547 if (IS_ERR(tsdata->gpio_enable)) {
548 error = PTR_ERR(tsdata->gpio_enable);
554 if (tsdata->gpio_enable)
559 client->name, tsdata);
565 pixcir_reset(tsdata);
568 error = pixcir_set_power_mode(tsdata, PIXCIR_POWER_IDLE);
575 error = pixcir_stop(tsdata);
583 i2c_set_clientdata(client, tsdata);