Lines Matching refs:ts

41 static int imagis_i2c_read_reg(struct imagis_ts *ts,  in imagis_i2c_read_reg()  argument
48 .addr = ts->client->addr, in imagis_i2c_read_reg()
53 .addr = ts->client->addr, in imagis_i2c_read_reg()
64 ret = i2c_transfer(ts->client->adapter, msg, ARRAY_SIZE(msg)); in imagis_i2c_read_reg()
71 dev_err(&ts->client->dev, in imagis_i2c_read_reg()
81 struct imagis_ts *ts = dev_id; in imagis_interrupt() local
87 error = imagis_i2c_read_reg(ts, IST3038C_REG_INTR_MESSAGE, in imagis_interrupt()
90 dev_err(&ts->client->dev, in imagis_interrupt()
98 dev_err(&ts->client->dev, in imagis_interrupt()
107 error = imagis_i2c_read_reg(ts, in imagis_interrupt()
111 dev_err(&ts->client->dev, in imagis_interrupt()
117 input_mt_slot(ts->input_dev, i); in imagis_interrupt()
118 input_mt_report_slot_state(ts->input_dev, MT_TOOL_FINGER, in imagis_interrupt()
120 touchscreen_report_pos(ts->input_dev, &ts->prop, in imagis_interrupt()
124 input_report_abs(ts->input_dev, ABS_MT_TOUCH_MAJOR, in imagis_interrupt()
129 input_mt_sync_frame(ts->input_dev); in imagis_interrupt()
130 input_sync(ts->input_dev); in imagis_interrupt()
138 struct imagis_ts *ts = _ts; in imagis_power_off() local
140 regulator_bulk_disable(ARRAY_SIZE(ts->supplies), ts->supplies); in imagis_power_off()
143 static int imagis_power_on(struct imagis_ts *ts) in imagis_power_on() argument
147 error = regulator_bulk_enable(ARRAY_SIZE(ts->supplies), ts->supplies); in imagis_power_on()
156 static int imagis_start(struct imagis_ts *ts) in imagis_start() argument
160 error = imagis_power_on(ts); in imagis_start()
164 enable_irq(ts->client->irq); in imagis_start()
169 static int imagis_stop(struct imagis_ts *ts) in imagis_stop() argument
171 disable_irq(ts->client->irq); in imagis_stop()
173 imagis_power_off(ts); in imagis_stop()
180 struct imagis_ts *ts = input_get_drvdata(dev); in imagis_input_open() local
182 return imagis_start(ts); in imagis_input_open()
187 struct imagis_ts *ts = input_get_drvdata(dev); in imagis_input_close() local
189 imagis_stop(ts); in imagis_input_close()
192 static int imagis_init_input_dev(struct imagis_ts *ts) in imagis_init_input_dev() argument
197 input_dev = devm_input_allocate_device(&ts->client->dev); in imagis_init_input_dev()
201 ts->input_dev = input_dev; in imagis_init_input_dev()
209 input_set_drvdata(input_dev, ts); in imagis_init_input_dev()
215 touchscreen_parse_properties(input_dev, true, &ts->prop); in imagis_init_input_dev()
216 if (!ts->prop.max_x || !ts->prop.max_y) { in imagis_init_input_dev()
217 dev_err(&ts->client->dev, in imagis_init_input_dev()
226 dev_err(&ts->client->dev, in imagis_init_input_dev()
233 dev_err(&ts->client->dev, in imagis_init_input_dev()
241 static int imagis_init_regulators(struct imagis_ts *ts) in imagis_init_regulators() argument
243 struct i2c_client *client = ts->client; in imagis_init_regulators()
245 ts->supplies[0].supply = "vdd"; in imagis_init_regulators()
246 ts->supplies[1].supply = "vddio"; in imagis_init_regulators()
248 ARRAY_SIZE(ts->supplies), in imagis_init_regulators()
249 ts->supplies); in imagis_init_regulators()
255 struct imagis_ts *ts; in imagis_probe() local
258 ts = devm_kzalloc(dev, sizeof(*ts), GFP_KERNEL); in imagis_probe()
259 if (!ts) in imagis_probe()
262 ts->client = i2c; in imagis_probe()
264 error = imagis_init_regulators(ts); in imagis_probe()
270 error = imagis_power_on(ts); in imagis_probe()
276 error = devm_add_action_or_reset(dev, imagis_power_off, ts); in imagis_probe()
282 error = imagis_i2c_read_reg(ts, in imagis_probe()
298 "imagis-touchscreen", ts); in imagis_probe()
305 error = imagis_init_input_dev(ts); in imagis_probe()
315 struct imagis_ts *ts = i2c_get_clientdata(client); in imagis_suspend() local
318 mutex_lock(&ts->input_dev->mutex); in imagis_suspend()
320 if (input_device_enabled(ts->input_dev)) in imagis_suspend()
321 retval = imagis_stop(ts); in imagis_suspend()
323 mutex_unlock(&ts->input_dev->mutex); in imagis_suspend()
331 struct imagis_ts *ts = i2c_get_clientdata(client); in imagis_resume() local
334 mutex_lock(&ts->input_dev->mutex); in imagis_resume()
336 if (input_device_enabled(ts->input_dev)) in imagis_resume()
337 retval = imagis_start(ts); in imagis_resume()
339 mutex_unlock(&ts->input_dev->mutex); in imagis_resume()