Lines Matching refs:ts

39 	struct zet6223_ts *ts = input_get_drvdata(dev);  in zet6223_start()  local
41 enable_irq(ts->client->irq); in zet6223_start()
48 struct zet6223_ts *ts = input_get_drvdata(dev); in zet6223_stop() local
50 disable_irq(ts->client->irq); in zet6223_stop()
55 struct zet6223_ts *ts = dev_id; in zet6223_irq() local
62 u8 bufsize = 3 + 4 * ts->fingernum; in zet6223_irq()
68 ret = i2c_master_recv(ts->client, buf, bufsize); in zet6223_irq()
71 dev_err_ratelimited(&ts->client->dev, in zet6223_irq()
80 for (i = 0; i < ts->fingernum; i++) { in zet6223_irq()
84 input_mt_slot(ts->input, i); in zet6223_irq()
85 input_mt_report_slot_state(ts->input, MT_TOOL_FINGER, true); in zet6223_irq()
86 input_event(ts->input, EV_ABS, ABS_MT_POSITION_X, in zet6223_irq()
88 input_event(ts->input, EV_ABS, ABS_MT_POSITION_Y, in zet6223_irq()
92 input_mt_sync_frame(ts->input); in zet6223_irq()
93 input_sync(ts->input); in zet6223_irq()
100 struct zet6223_ts *ts = _ts; in zet6223_power_off() local
102 regulator_bulk_disable(ARRAY_SIZE(ts->supplies), ts->supplies); in zet6223_power_off()
105 static int zet6223_power_on(struct zet6223_ts *ts) in zet6223_power_on() argument
107 struct device *dev = &ts->client->dev; in zet6223_power_on()
110 ts->supplies[0].supply = "vio"; in zet6223_power_on()
111 ts->supplies[1].supply = "vcc"; in zet6223_power_on()
113 error = devm_regulator_bulk_get(dev, ARRAY_SIZE(ts->supplies), in zet6223_power_on()
114 ts->supplies); in zet6223_power_on()
118 error = regulator_bulk_enable(ARRAY_SIZE(ts->supplies), ts->supplies); in zet6223_power_on()
124 error = devm_add_action_or_reset(dev, zet6223_power_off, ts); in zet6223_power_on()
133 static int zet6223_query_device(struct zet6223_ts *ts) in zet6223_query_device() argument
140 ret = i2c_master_send(ts->client, &cmd, sizeof(cmd)); in zet6223_query_device()
143 dev_err(&ts->client->dev, in zet6223_query_device()
148 ret = i2c_master_recv(ts->client, buf, sizeof(buf)); in zet6223_query_device()
151 dev_err(&ts->client->dev, in zet6223_query_device()
156 ts->fingernum = buf[15] & 0x7F; in zet6223_query_device()
157 if (ts->fingernum > ZET6223_MAX_FINGERS) { in zet6223_query_device()
158 dev_warn(&ts->client->dev, in zet6223_query_device()
160 ts->fingernum, ZET6223_MAX_FINGERS); in zet6223_query_device()
161 ts->fingernum = ZET6223_MAX_FINGERS; in zet6223_query_device()
164 ts->max_x = get_unaligned_le16(&buf[8]); in zet6223_query_device()
165 ts->max_y = get_unaligned_le16(&buf[10]); in zet6223_query_device()
174 struct zet6223_ts *ts; in zet6223_probe() local
183 ts = devm_kzalloc(dev, sizeof(*ts), GFP_KERNEL); in zet6223_probe()
184 if (!ts) in zet6223_probe()
187 ts->client = client; in zet6223_probe()
189 error = zet6223_power_on(ts); in zet6223_probe()
193 error = zet6223_query_device(ts); in zet6223_probe()
197 ts->input = input = devm_input_allocate_device(dev); in zet6223_probe()
201 input_set_drvdata(input, ts); in zet6223_probe()
208 input_set_abs_params(input, ABS_MT_POSITION_X, 0, ts->max_x, 0, 0); in zet6223_probe()
209 input_set_abs_params(input, ABS_MT_POSITION_Y, 0, ts->max_y, 0, 0); in zet6223_probe()
211 touchscreen_parse_properties(input, true, &ts->prop); in zet6223_probe()
213 error = input_mt_init_slots(input, ts->fingernum, in zet6223_probe()
219 IRQF_ONESHOT, client->name, ts); in zet6223_probe()