Lines Matching refs:data

103 	struct exc3000_data *data = from_timer(data, t, timer);
105 input_mt_sync_frame(data->input);
106 input_sync(data->input);
109 static inline void exc3000_schedule_timer(struct exc3000_data *data)
111 mod_timer(&data->timer, jiffies + msecs_to_jiffies(EXC3000_TIMEOUT_MS));
119 static int exc3000_read_frame(struct exc3000_data *data, u8 *buf)
121 struct i2c_client *client = data->client;
144 static int exc3000_handle_mt_event(struct exc3000_data *data)
146 struct input_dev *input = data->input;
148 u8 *buf = data->buf;
158 ret = exc3000_read_frame(data, buf + EXC3000_LEN_FRAME);
172 del_timer_sync(&data->timer);
177 exc3000_report_slots(input, &data->prop, buf + 4, slots);
189 exc3000_schedule_timer(data);
196 struct exc3000_data *data = dev_id;
197 u8 *buf = data->buf;
200 ret = exc3000_read_frame(data, buf);
203 exc3000_schedule_timer(data);
209 complete(&data->wait_event);
214 exc3000_handle_mt_event(data);
225 static int exc3000_vendor_data_request(struct exc3000_data *data, u8 *request,
232 mutex_lock(&data->query_lock);
234 reinit_completion(&data->wait_event);
239 ret = i2c_master_send(data->client, buf, EXC3000_LEN_VENDOR_REQUEST);
244 time_left = wait_for_completion_timeout(&data->wait_event,
251 if (data->buf[3] >= EXC3000_LEN_FRAME) {
256 memcpy(response, &data->buf[4], data->buf[3]);
257 ret = data->buf[3];
261 mutex_unlock(&data->query_lock);
270 struct exc3000_data *data = i2c_get_clientdata(client);
275 ret = exc3000_vendor_data_request(data,
288 ret = exc3000_vendor_data_request(data, (u8[]){'D'}, 1, response, 1);
300 struct exc3000_data *data = i2c_get_clientdata(client);
304 ret = exc3000_vendor_data_request(data, (u8[]){'E'}, 1, response, 1);
316 struct exc3000_data *data = i2c_get_clientdata(client);
320 ret = exc3000_vendor_data_request(data, (u8[]){'F'}, 1, response, 1);
341 struct exc3000_data *data;
345 data = devm_kzalloc(&client->dev, sizeof(*data), GFP_KERNEL);
346 if (!data)
349 data->client = client;
350 data->info = device_get_match_data(&client->dev);
351 if (!data->info) {
354 data->info = &exc3000_info[eeti_dev_id];
356 timer_setup(&data->timer, exc3000_timer, 0);
357 init_completion(&data->wait_event);
358 mutex_init(&data->query_lock);
360 data->reset = devm_gpiod_get_optional(&client->dev, "reset",
362 if (IS_ERR(data->reset))
363 return PTR_ERR(data->reset);
371 if (data->reset) {
373 gpiod_set_value_cansleep(data->reset, 0);
381 data->input = input;
382 input_set_drvdata(input, data);
384 input->name = data->info->name;
387 max_xy = data->info->max_xy;
391 touchscreen_parse_properties(input, true, &data->prop);
403 &data->timer);
409 client->name, data);
424 error = exc3000_vendor_data_request(data, (u8[]){'E'}, 1,
438 i2c_set_clientdata(client, data);
457 { .compatible = "eeti,exc3000", .data = &exc3000_info[EETI_EXC3000] },
458 { .compatible = "eeti,exc80h60", .data = &exc3000_info[EETI_EXC80H60] },
459 { .compatible = "eeti,exc80h84", .data = &exc3000_info[EETI_EXC80H84] },