Lines Matching refs:ts

147 static void pixcir_ts_report(struct pixcir_i2c_ts_data *ts,  in pixcir_ts_report()  argument
152 struct device *dev = &ts->client->dev; in pixcir_ts_report()
153 const struct pixcir_i2c_chip_data *chip = ts->chip; in pixcir_ts_report()
159 if (!ts->chip->has_hw_ids) in pixcir_ts_report()
160 input_mt_assign_slots(ts->input, slots, report->pos, n, 0); in pixcir_ts_report()
164 slot = input_mt_get_slot_by_key(ts->input, in pixcir_ts_report()
175 input_mt_slot(ts->input, slot); in pixcir_ts_report()
176 input_mt_report_slot_state(ts->input, MT_TOOL_FINGER, true); in pixcir_ts_report()
178 input_report_abs(ts->input, ABS_MT_POSITION_X, in pixcir_ts_report()
180 input_report_abs(ts->input, ABS_MT_POSITION_Y, in pixcir_ts_report()
187 input_mt_sync_frame(ts->input); in pixcir_ts_report()
188 input_sync(ts->input); in pixcir_ts_report()
232 static int pixcir_set_power_mode(struct pixcir_i2c_ts_data *ts, in pixcir_set_power_mode() argument
235 struct device *dev = &ts->client->dev; in pixcir_set_power_mode()
239 if (ts->gpio_wake) in pixcir_set_power_mode()
240 gpiod_set_value_cansleep(ts->gpio_wake, 1); in pixcir_set_power_mode()
243 ret = i2c_smbus_read_byte_data(ts->client, PIXCIR_REG_POWER_MODE); in pixcir_set_power_mode()
256 ret = i2c_smbus_write_byte_data(ts->client, PIXCIR_REG_POWER_MODE, ret); in pixcir_set_power_mode()
264 if (ts->gpio_wake) in pixcir_set_power_mode()
265 gpiod_set_value_cansleep(ts->gpio_wake, 0); in pixcir_set_power_mode()
276 static int pixcir_set_int_mode(struct pixcir_i2c_ts_data *ts, in pixcir_set_int_mode() argument
279 struct device *dev = &ts->client->dev; in pixcir_set_int_mode()
282 ret = i2c_smbus_read_byte_data(ts->client, PIXCIR_REG_INT_MODE); in pixcir_set_int_mode()
297 ret = i2c_smbus_write_byte_data(ts->client, PIXCIR_REG_INT_MODE, ret); in pixcir_set_int_mode()
310 static int pixcir_int_enable(struct pixcir_i2c_ts_data *ts, bool enable) in pixcir_int_enable() argument
312 struct device *dev = &ts->client->dev; in pixcir_int_enable()
315 ret = i2c_smbus_read_byte_data(ts->client, PIXCIR_REG_INT_MODE); in pixcir_int_enable()
327 ret = i2c_smbus_write_byte_data(ts->client, PIXCIR_REG_INT_MODE, ret); in pixcir_int_enable()
337 static int pixcir_start(struct pixcir_i2c_ts_data *ts) in pixcir_start() argument
339 struct device *dev = &ts->client->dev; in pixcir_start()
342 if (ts->gpio_enable) { in pixcir_start()
343 gpiod_set_value_cansleep(ts->gpio_enable, 1); in pixcir_start()
348 error = pixcir_set_int_mode(ts, PIXCIR_INT_LEVEL_TOUCH, 0); in pixcir_start()
354 ts->running = true; in pixcir_start()
358 error = pixcir_int_enable(ts, true); in pixcir_start()
368 static int pixcir_stop(struct pixcir_i2c_ts_data *ts) in pixcir_stop() argument
373 error = pixcir_int_enable(ts, false); in pixcir_stop()
375 dev_err(&ts->client->dev, in pixcir_stop()
382 ts->running = false; in pixcir_stop()
386 synchronize_irq(ts->client->irq); in pixcir_stop()
388 if (ts->gpio_enable) in pixcir_stop()
389 gpiod_set_value_cansleep(ts->gpio_enable, 0); in pixcir_stop()
396 struct pixcir_i2c_ts_data *ts = input_get_drvdata(dev); in pixcir_input_open() local
398 return pixcir_start(ts); in pixcir_input_open()
403 struct pixcir_i2c_ts_data *ts = input_get_drvdata(dev); in pixcir_input_close() local
405 pixcir_stop(ts); in pixcir_input_close()
411 struct pixcir_i2c_ts_data *ts = i2c_get_clientdata(client); in pixcir_i2c_ts_suspend() local
412 struct input_dev *input = ts->input; in pixcir_i2c_ts_suspend()
419 ret = pixcir_start(ts); in pixcir_i2c_ts_suspend()
426 ret = pixcir_stop(ts); in pixcir_i2c_ts_suspend()
438 struct pixcir_i2c_ts_data *ts = i2c_get_clientdata(client); in pixcir_i2c_ts_resume() local
439 struct input_dev *input = ts->input; in pixcir_i2c_ts_resume()
446 ret = pixcir_stop(ts); in pixcir_i2c_ts_resume()
453 ret = pixcir_start(ts); in pixcir_i2c_ts_resume()