Lines Matching refs:ts
48 struct zet6223_ts *ts = input_get_drvdata(dev); in zet6223_start() local
50 enable_irq(ts->client->irq); in zet6223_start()
57 struct zet6223_ts *ts = input_get_drvdata(dev); in zet6223_stop() local
59 disable_irq(ts->client->irq); in zet6223_stop()
64 struct zet6223_ts *ts = dev_id; in zet6223_irq() local
71 u8 bufsize = 3 + 4 * ts->fingernum; in zet6223_irq()
77 ret = i2c_master_recv(ts->client, buf, bufsize); in zet6223_irq()
80 dev_err_ratelimited(&ts->client->dev, in zet6223_irq()
89 for (i = 0; i < ts->fingernum; i++) { in zet6223_irq()
93 input_mt_slot(ts->input, i); in zet6223_irq()
94 input_mt_report_slot_state(ts->input, MT_TOOL_FINGER, true); in zet6223_irq()
95 input_event(ts->input, EV_ABS, ABS_MT_POSITION_X, in zet6223_irq()
97 input_event(ts->input, EV_ABS, ABS_MT_POSITION_Y, in zet6223_irq()
101 input_mt_sync_frame(ts->input); in zet6223_irq()
102 input_sync(ts->input); in zet6223_irq()
109 struct zet6223_ts *ts = _ts; in zet6223_power_off() local
111 regulator_bulk_disable(ARRAY_SIZE(ts->supplies), ts->supplies); in zet6223_power_off()
114 static int zet6223_power_on(struct zet6223_ts *ts) in zet6223_power_on() argument
116 struct device *dev = &ts->client->dev; in zet6223_power_on()
119 ts->supplies[0].supply = "vio"; in zet6223_power_on()
120 ts->supplies[1].supply = "vcc"; in zet6223_power_on()
122 error = devm_regulator_bulk_get(dev, ARRAY_SIZE(ts->supplies), in zet6223_power_on()
123 ts->supplies); in zet6223_power_on()
127 error = regulator_bulk_enable(ARRAY_SIZE(ts->supplies), ts->supplies); in zet6223_power_on()
133 error = devm_add_action_or_reset(dev, zet6223_power_off, ts); in zet6223_power_on()
142 static int zet6223_query_device(struct zet6223_ts *ts) in zet6223_query_device() argument
149 ret = i2c_master_send(ts->client, &cmd, sizeof(cmd)); in zet6223_query_device()
152 dev_err(&ts->client->dev, in zet6223_query_device()
157 ret = i2c_master_recv(ts->client, buf, sizeof(buf)); in zet6223_query_device()
160 dev_err(&ts->client->dev, in zet6223_query_device()
165 ts->fingernum = buf[15] & 0x7F; in zet6223_query_device()
166 if (ts->fingernum > ZET6223_MAX_FINGERS) { in zet6223_query_device()
167 dev_warn(&ts->client->dev, in zet6223_query_device()
169 ts->fingernum, ZET6223_MAX_FINGERS); in zet6223_query_device()
170 ts->fingernum = ZET6223_MAX_FINGERS; in zet6223_query_device()
173 ts->max_x = get_unaligned_le16(&buf[8]); in zet6223_query_device()
174 ts->max_y = get_unaligned_le16(&buf[10]); in zet6223_query_device()
183 struct zet6223_ts *ts; in zet6223_probe() local
192 ts = devm_kzalloc(dev, sizeof(*ts), GFP_KERNEL); in zet6223_probe()
193 if (!ts) in zet6223_probe()
196 ts->client = client; in zet6223_probe()
198 error = zet6223_power_on(ts); in zet6223_probe()
202 error = zet6223_query_device(ts); in zet6223_probe()
206 ts->input = input = devm_input_allocate_device(dev); in zet6223_probe()
210 input_set_drvdata(input, ts); in zet6223_probe()
217 input_set_abs_params(input, ABS_MT_POSITION_X, 0, ts->max_x, 0, 0); in zet6223_probe()
218 input_set_abs_params(input, ABS_MT_POSITION_Y, 0, ts->max_y, 0, 0); in zet6223_probe()
220 touchscreen_parse_properties(input, true, &ts->prop); in zet6223_probe()
222 error = input_mt_init_slots(input, ts->fingernum, in zet6223_probe()
228 IRQF_ONESHOT, client->name, ts); in zet6223_probe()