Lines Matching refs:ts

111 static void pixcir_ts_report(struct pixcir_i2c_ts_data *ts,  in pixcir_ts_report()  argument
118 struct device *dev = &ts->client->dev; in pixcir_ts_report()
119 const struct pixcir_i2c_chip_data *chip = ts->chip; in pixcir_ts_report()
125 if (!ts->chip->has_hw_ids) { in pixcir_ts_report()
132 input_mt_assign_slots(ts->input, slots, pos, n, 0); in pixcir_ts_report()
139 slot = input_mt_get_slot_by_key(ts->input, touch->id); in pixcir_ts_report()
149 input_mt_slot(ts->input, slot); in pixcir_ts_report()
150 input_mt_report_slot_state(ts->input, in pixcir_ts_report()
153 input_event(ts->input, EV_ABS, ABS_MT_POSITION_X, touch->x); in pixcir_ts_report()
154 input_event(ts->input, EV_ABS, ABS_MT_POSITION_Y, touch->y); in pixcir_ts_report()
160 input_mt_sync_frame(ts->input); in pixcir_ts_report()
161 input_sync(ts->input); in pixcir_ts_report()
205 static int pixcir_set_power_mode(struct pixcir_i2c_ts_data *ts, in pixcir_set_power_mode() argument
208 struct device *dev = &ts->client->dev; in pixcir_set_power_mode()
211 ret = i2c_smbus_read_byte_data(ts->client, PIXCIR_REG_POWER_MODE); in pixcir_set_power_mode()
224 ret = i2c_smbus_write_byte_data(ts->client, PIXCIR_REG_POWER_MODE, ret); in pixcir_set_power_mode()
239 static int pixcir_set_int_mode(struct pixcir_i2c_ts_data *ts, in pixcir_set_int_mode() argument
242 struct device *dev = &ts->client->dev; in pixcir_set_int_mode()
245 ret = i2c_smbus_read_byte_data(ts->client, PIXCIR_REG_INT_MODE); in pixcir_set_int_mode()
260 ret = i2c_smbus_write_byte_data(ts->client, PIXCIR_REG_INT_MODE, ret); in pixcir_set_int_mode()
273 static int pixcir_int_enable(struct pixcir_i2c_ts_data *ts, bool enable) in pixcir_int_enable() argument
275 struct device *dev = &ts->client->dev; in pixcir_int_enable()
278 ret = i2c_smbus_read_byte_data(ts->client, PIXCIR_REG_INT_MODE); in pixcir_int_enable()
290 ret = i2c_smbus_write_byte_data(ts->client, PIXCIR_REG_INT_MODE, ret); in pixcir_int_enable()
300 static int pixcir_start(struct pixcir_i2c_ts_data *ts) in pixcir_start() argument
302 struct device *dev = &ts->client->dev; in pixcir_start()
306 error = pixcir_set_int_mode(ts, PIXCIR_INT_LEVEL_TOUCH, 0); in pixcir_start()
312 ts->running = true; in pixcir_start()
316 error = pixcir_int_enable(ts, true); in pixcir_start()
326 static int pixcir_stop(struct pixcir_i2c_ts_data *ts) in pixcir_stop() argument
331 error = pixcir_int_enable(ts, false); in pixcir_stop()
333 dev_err(&ts->client->dev, in pixcir_stop()
340 ts->running = false; in pixcir_stop()
344 synchronize_irq(ts->client->irq); in pixcir_stop()
351 struct pixcir_i2c_ts_data *ts = input_get_drvdata(dev); in pixcir_input_open() local
353 return pixcir_start(ts); in pixcir_input_open()
358 struct pixcir_i2c_ts_data *ts = input_get_drvdata(dev); in pixcir_input_close() local
360 pixcir_stop(ts); in pixcir_input_close()
366 struct pixcir_i2c_ts_data *ts = i2c_get_clientdata(client); in pixcir_i2c_ts_suspend() local
367 struct input_dev *input = ts->input; in pixcir_i2c_ts_suspend()
374 ret = pixcir_start(ts); in pixcir_i2c_ts_suspend()
381 ret = pixcir_stop(ts); in pixcir_i2c_ts_suspend()
393 struct pixcir_i2c_ts_data *ts = i2c_get_clientdata(client); in pixcir_i2c_ts_resume() local
394 struct input_dev *input = ts->input; in pixcir_i2c_ts_resume()
402 ret = pixcir_stop(ts); in pixcir_i2c_ts_resume()
409 ret = pixcir_start(ts); in pixcir_i2c_ts_resume()