Lines Matching refs:ts

70 static void ektf2127_report_event(struct ektf2127_ts *ts, const u8 *buf)
78 dev_err(&ts->client->dev,
85 input_mt_assign_slots(ts->input, slots, touches,
89 input_mt_slot(ts->input, slots[i]);
90 input_mt_report_slot_state(ts->input, MT_TOOL_FINGER, true);
91 touchscreen_report_pos(ts->input, &ts->prop,
95 input_mt_sync_frame(ts->input);
96 input_sync(ts->input);
99 static void ektf2127_report2_contact(struct ektf2127_ts *ts, int slot,
102 input_mt_slot(ts->input, slot);
103 input_mt_report_slot_state(ts->input, MT_TOOL_FINGER, active);
109 touchscreen_report_pos(ts->input, &ts->prop, x, y, true);
113 static void ektf2127_report2_event(struct ektf2127_ts *ts, const u8 *buf)
115 ektf2127_report2_contact(ts, 0, &buf[1], !!(buf[7] & 2));
116 ektf2127_report2_contact(ts, 1, &buf[4], !!(buf[7] & 4));
118 input_mt_sync_frame(ts->input);
119 input_sync(ts->input);
124 struct ektf2127_ts *ts = dev_id;
125 struct device *dev = &ts->client->dev;
129 ret = i2c_master_recv(ts->client, buf, EKTF2127_TOUCH_REPORT_SIZE);
137 ektf2127_report_event(ts, buf);
141 ektf2127_report2_event(ts, buf);
164 struct ektf2127_ts *ts = input_get_drvdata(dev);
166 enable_irq(ts->client->irq);
167 gpiod_set_value_cansleep(ts->power_gpios, 1);
174 struct ektf2127_ts *ts = input_get_drvdata(dev);
176 disable_irq(ts->client->irq);
177 gpiod_set_value_cansleep(ts->power_gpios, 0);
182 struct ektf2127_ts *ts = i2c_get_clientdata(to_i2c_client(dev));
184 mutex_lock(&ts->input->mutex);
185 if (input_device_enabled(ts->input))
186 ektf2127_stop(ts->input);
187 mutex_unlock(&ts->input->mutex);
194 struct ektf2127_ts *ts = i2c_get_clientdata(to_i2c_client(dev));
196 mutex_lock(&ts->input->mutex);
197 if (input_device_enabled(ts->input))
198 ektf2127_start(ts->input);
199 mutex_unlock(&ts->input->mutex);
250 struct ektf2127_ts *ts;
261 ts = devm_kzalloc(dev, sizeof(*ts), GFP_KERNEL);
262 if (!ts)
266 ts->power_gpios = devm_gpiod_get(dev, "power", GPIOD_OUT_HIGH);
267 if (IS_ERR(ts->power_gpios))
268 return dev_err_probe(dev, PTR_ERR(ts->power_gpios), "Error getting power gpio\n");
279 ts->client = client;
283 i2c_master_recv(ts->client, buf, sizeof(buf));
296 touchscreen_parse_properties(input, true, &ts->prop);
305 ts->input = input;
306 input_set_drvdata(input, ts);
310 IRQF_ONESHOT, client->name, ts);
317 ektf2127_stop(ts->input);
323 i2c_set_clientdata(client, ts);