Lines Matching full:ts

26 #define ST1232_TS_NAME	"st1232-ts"
27 #define ST1633_TS_NAME "st1633-ts"
51 static int st1232_ts_read_data(struct st1232_ts_data *ts) in st1232_ts_read_data() argument
53 struct i2c_client *client = ts->client; in st1232_ts_read_data()
54 u8 start_reg = ts->chip_info->start_reg; in st1232_ts_read_data()
64 .len = ts->read_buf_len, in st1232_ts_read_data()
65 .buf = ts->read_buf, in st1232_ts_read_data()
77 static int st1232_ts_parse_and_report(struct st1232_ts_data *ts) in st1232_ts_parse_and_report() argument
79 struct input_dev *input = ts->input_dev; in st1232_ts_parse_and_report()
86 for (i = 0; i < ts->chip_info->max_fingers; i++) { in st1232_ts_parse_and_report()
87 u8 *buf = &ts->read_buf[i * 4]; in st1232_ts_parse_and_report()
94 &ts->prop, x, y); in st1232_ts_parse_and_report()
97 if (ts->chip_info->have_z) in st1232_ts_parse_and_report()
98 z[n_contacts] = ts->read_buf[i + 6]; in st1232_ts_parse_and_report()
110 if (ts->chip_info->have_z) in st1232_ts_parse_and_report()
122 struct st1232_ts_data *ts = dev_id; in st1232_ts_irq_handler() local
126 error = st1232_ts_read_data(ts); in st1232_ts_irq_handler()
130 count = st1232_ts_parse_and_report(ts); in st1232_ts_irq_handler()
132 if (ts->low_latency_req.dev) { in st1232_ts_irq_handler()
133 dev_pm_qos_remove_request(&ts->low_latency_req); in st1232_ts_irq_handler()
134 ts->low_latency_req.dev = NULL; in st1232_ts_irq_handler()
136 } else if (!ts->low_latency_req.dev) { in st1232_ts_irq_handler()
138 dev_pm_qos_add_ancestor_request(&ts->client->dev, in st1232_ts_irq_handler()
139 &ts->low_latency_req, in st1232_ts_irq_handler()
147 static void st1232_ts_power(struct st1232_ts_data *ts, bool poweron) in st1232_ts_power() argument
149 if (ts->reset_gpio) in st1232_ts_power()
150 gpiod_set_value_cansleep(ts->reset_gpio, !poweron); in st1232_ts_power()
180 struct st1232_ts_data *ts; in st1232_ts_probe() local
202 ts = devm_kzalloc(&client->dev, sizeof(*ts), GFP_KERNEL); in st1232_ts_probe()
203 if (!ts) in st1232_ts_probe()
206 ts->chip_info = match; in st1232_ts_probe()
209 ts->read_buf_len = ts->chip_info->max_fingers * 4; in st1232_ts_probe()
210 ts->read_buf = devm_kzalloc(&client->dev, ts->read_buf_len, GFP_KERNEL); in st1232_ts_probe()
211 if (!ts->read_buf) in st1232_ts_probe()
218 ts->client = client; in st1232_ts_probe()
219 ts->input_dev = input_dev; in st1232_ts_probe()
221 ts->reset_gpio = devm_gpiod_get_optional(&client->dev, NULL, in st1232_ts_probe()
223 if (IS_ERR(ts->reset_gpio)) { in st1232_ts_probe()
224 error = PTR_ERR(ts->reset_gpio); in st1232_ts_probe()
230 st1232_ts_power(ts, true); in st1232_ts_probe()
232 error = devm_add_action_or_reset(&client->dev, st1232_ts_power_off, ts); in st1232_ts_probe()
242 if (ts->chip_info->have_z) in st1232_ts_probe()
244 ts->chip_info->max_area, 0, 0); in st1232_ts_probe()
247 0, ts->chip_info->max_x, 0, 0); in st1232_ts_probe()
249 0, ts->chip_info->max_y, 0, 0); in st1232_ts_probe()
251 touchscreen_parse_properties(input_dev, true, &ts->prop); in st1232_ts_probe()
253 error = input_mt_init_slots(input_dev, ts->chip_info->max_fingers, in st1232_ts_probe()
264 client->name, ts); in st1232_ts_probe()
270 error = input_register_device(ts->input_dev); in st1232_ts_probe()
277 i2c_set_clientdata(client, ts); in st1232_ts_probe()
285 struct st1232_ts_data *ts = i2c_get_clientdata(client); in st1232_ts_suspend() local
290 st1232_ts_power(ts, false); in st1232_ts_suspend()
298 struct st1232_ts_data *ts = i2c_get_clientdata(client); in st1232_ts_resume() local
301 st1232_ts_power(ts, true); in st1232_ts_resume()