Lines Matching refs:data

102 	struct exc3000_data *data = from_timer(data, t, timer);
104 input_mt_sync_frame(data->input);
105 input_sync(data->input);
108 static int exc3000_read_frame(struct exc3000_data *data, u8 *buf)
110 struct i2c_client *client = data->client;
114 if (data->info->max_xy == SZ_16K - 1)
140 static int exc3000_read_data(struct exc3000_data *data,
145 error = exc3000_read_frame(data, buf);
155 error = exc3000_read_frame(data, buf + EXC3000_LEN_FRAME);
167 static int exc3000_query_interrupt(struct exc3000_data *data)
169 u8 *buf = data->buf;
172 error = i2c_master_recv(data->client, buf, EXC3000_LEN_FRAME);
180 strlcpy(data->model, buf + 5, sizeof(data->model));
182 strlcpy(data->fw_version, buf + 5, sizeof(data->fw_version));
191 struct exc3000_data *data = dev_id;
192 struct input_dev *input = data->input;
193 u8 *buf = data->buf;
197 if (mutex_is_locked(&data->query_lock)) {
198 data->query_result = exc3000_query_interrupt(data);
199 complete(&data->wait_event);
203 error = exc3000_read_data(data, buf, &total_slots);
206 mod_timer(&data->timer,
214 del_timer_sync(&data->timer);
218 exc3000_report_slots(input, &data->prop, buf + 4, slots);
234 struct exc3000_data *data = i2c_get_clientdata(client);
240 mutex_lock(&data->query_lock);
242 data->query_result = -ETIMEDOUT;
243 reinit_completion(&data->wait_event);
247 mutex_unlock(&data->query_lock);
251 wait_for_completion_interruptible_timeout(&data->wait_event, 1 * HZ);
252 mutex_unlock(&data->query_lock);
254 if (data->query_result < 0)
255 return data->query_result;
257 return sprintf(buf, "%s\n", data->fw_version);
261 static ssize_t exc3000_get_model(struct exc3000_data *data)
266 struct i2c_client *client = data->client;
269 mutex_lock(&data->query_lock);
270 data->query_result = -ETIMEDOUT;
271 reinit_completion(&data->wait_event);
275 mutex_unlock(&data->query_lock);
279 wait_for_completion_interruptible_timeout(&data->wait_event, 1 * HZ);
280 mutex_unlock(&data->query_lock);
282 return data->query_result;
289 struct exc3000_data *data = i2c_get_clientdata(client);
292 error = exc3000_get_model(data);
296 return sprintf(buf, "%s\n", data->model);
312 struct exc3000_data *data;
316 data = devm_kzalloc(&client->dev, sizeof(*data), GFP_KERNEL);
317 if (!data)
320 data->client = client;
321 data->info = device_get_match_data(&client->dev);
322 if (!data->info) {
325 data->info = &exc3000_info[eeti_dev_id];
327 timer_setup(&data->timer, exc3000_timer, 0);
328 init_completion(&data->wait_event);
329 mutex_init(&data->query_lock);
331 data->reset = devm_gpiod_get_optional(&client->dev, "reset",
333 if (IS_ERR(data->reset))
334 return PTR_ERR(data->reset);
336 if (data->reset) {
338 gpiod_set_value_cansleep(data->reset, 0);
346 data->input = input;
347 input_set_drvdata(input, data);
349 input->name = data->info->name;
352 max_xy = data->info->max_xy;
356 touchscreen_parse_properties(input, true, &data->prop);
369 client->name, data);
382 error = exc3000_get_model(data);
392 dev_dbg(&client->dev, "TS Model: %s", data->model);
394 i2c_set_clientdata(client, data);
413 { .compatible = "eeti,exc3000", .data = &exc3000_info[EETI_EXC3000] },
414 { .compatible = "eeti,exc80h60", .data = &exc3000_info[EETI_EXC80H60] },
415 { .compatible = "eeti,exc80h84", .data = &exc3000_info[EETI_EXC80H84] },