Lines Matching full:ts

27 #define ST1232_TS_NAME	"st1232-ts"
28 #define ST1633_TS_NAME "st1633-ts"
66 static int st1232_ts_read_data(struct st1232_ts_data *ts, u8 reg, in st1232_ts_read_data() argument
69 struct i2c_client *client = ts->client; in st1232_ts_read_data()
80 .buf = ts->read_buf, in st1232_ts_read_data()
92 static int st1232_ts_wait_ready(struct st1232_ts_data *ts) in st1232_ts_wait_ready() argument
98 error = st1232_ts_read_data(ts, REG_STATUS, 1); in st1232_ts_wait_ready()
100 switch (ts->read_buf[0]) { in st1232_ts_wait_ready()
113 static int st1232_ts_read_resolution(struct st1232_ts_data *ts, u16 *max_x, in st1232_ts_read_resolution() argument
120 error = st1232_ts_read_data(ts, REG_XY_RESOLUTION, 3); in st1232_ts_read_resolution()
124 buf = ts->read_buf; in st1232_ts_read_resolution()
132 static int st1232_ts_parse_and_report(struct st1232_ts_data *ts) in st1232_ts_parse_and_report() argument
134 struct input_dev *input = ts->input_dev; in st1232_ts_parse_and_report()
141 for (i = 0; i < ts->chip_info->max_fingers; i++) { in st1232_ts_parse_and_report()
142 u8 *buf = &ts->read_buf[i * 4]; in st1232_ts_parse_and_report()
149 &ts->prop, x, y); in st1232_ts_parse_and_report()
152 if (ts->chip_info->have_z) in st1232_ts_parse_and_report()
153 z[n_contacts] = ts->read_buf[i + 6]; in st1232_ts_parse_and_report()
161 if (touch_overlay_process_contact(&ts->touch_overlay_list, in st1232_ts_parse_and_report()
169 if (ts->chip_info->have_z) in st1232_ts_parse_and_report()
173 touch_overlay_sync_frame(&ts->touch_overlay_list, input); in st1232_ts_parse_and_report()
182 struct st1232_ts_data *ts = dev_id; in st1232_ts_irq_handler() local
186 error = st1232_ts_read_data(ts, REG_XY_COORDINATES, ts->read_buf_len); in st1232_ts_irq_handler()
190 count = st1232_ts_parse_and_report(ts); in st1232_ts_irq_handler()
192 if (ts->low_latency_req.dev) { in st1232_ts_irq_handler()
193 dev_pm_qos_remove_request(&ts->low_latency_req); in st1232_ts_irq_handler()
194 ts->low_latency_req.dev = NULL; in st1232_ts_irq_handler()
196 } else if (!ts->low_latency_req.dev) { in st1232_ts_irq_handler()
198 dev_pm_qos_add_ancestor_request(&ts->client->dev, in st1232_ts_irq_handler()
199 &ts->low_latency_req, in st1232_ts_irq_handler()
207 static void st1232_ts_power(struct st1232_ts_data *ts, bool poweron) in st1232_ts_power() argument
209 if (ts->reset_gpio) in st1232_ts_power()
210 gpiod_set_value_cansleep(ts->reset_gpio, !poweron); in st1232_ts_power()
234 struct st1232_ts_data *ts; in st1232_ts_probe() local
257 ts = devm_kzalloc(&client->dev, sizeof(*ts), GFP_KERNEL); in st1232_ts_probe()
258 if (!ts) in st1232_ts_probe()
261 ts->chip_info = match; in st1232_ts_probe()
264 ts->read_buf_len = ts->chip_info->max_fingers * 4; in st1232_ts_probe()
265 ts->read_buf = devm_kzalloc(&client->dev, ts->read_buf_len, GFP_KERNEL); in st1232_ts_probe()
266 if (!ts->read_buf) in st1232_ts_probe()
273 ts->client = client; in st1232_ts_probe()
274 ts->input_dev = input_dev; in st1232_ts_probe()
276 ts->reset_gpio = devm_gpiod_get_optional(&client->dev, NULL, in st1232_ts_probe()
278 if (IS_ERR(ts->reset_gpio)) { in st1232_ts_probe()
279 error = PTR_ERR(ts->reset_gpio); in st1232_ts_probe()
285 st1232_ts_power(ts, true); in st1232_ts_probe()
287 error = devm_add_action_or_reset(&client->dev, st1232_ts_power_off, ts); in st1232_ts_probe()
298 error = st1232_ts_wait_ready(ts); in st1232_ts_probe()
302 if (ts->chip_info->have_z) in st1232_ts_probe()
304 ts->chip_info->max_area, 0, 0); in st1232_ts_probe()
307 INIT_LIST_HEAD(&ts->touch_overlay_list); in st1232_ts_probe()
308 error = touch_overlay_map(&ts->touch_overlay_list, input_dev); in st1232_ts_probe()
312 if (touch_overlay_mapped_touchscreen(&ts->touch_overlay_list)) { in st1232_ts_probe()
314 touch_overlay_get_touchscreen_abs(&ts->touch_overlay_list, in st1232_ts_probe()
318 error = st1232_ts_read_resolution(ts, &max_x, &max_y); in st1232_ts_probe()
331 touchscreen_parse_properties(input_dev, true, &ts->prop); in st1232_ts_probe()
333 error = input_mt_init_slots(input_dev, ts->chip_info->max_fingers, in st1232_ts_probe()
344 client->name, ts); in st1232_ts_probe()
350 error = input_register_device(ts->input_dev); in st1232_ts_probe()
357 i2c_set_clientdata(client, ts); in st1232_ts_probe()
365 struct st1232_ts_data *ts = i2c_get_clientdata(client); in st1232_ts_suspend() local
370 st1232_ts_power(ts, false); in st1232_ts_suspend()
378 struct st1232_ts_data *ts = i2c_get_clientdata(client); in st1232_ts_resume() local
381 st1232_ts_power(ts, true); in st1232_ts_resume()