Lines Matching refs:ts

37 	struct zet6223_ts *ts = input_get_drvdata(dev);  in zet6223_start()  local
39 enable_irq(ts->client->irq); in zet6223_start()
46 struct zet6223_ts *ts = input_get_drvdata(dev); in zet6223_stop() local
48 disable_irq(ts->client->irq); in zet6223_stop()
53 struct zet6223_ts *ts = dev_id; in zet6223_irq() local
60 u8 bufsize = 3 + 4 * ts->fingernum; in zet6223_irq()
66 ret = i2c_master_recv(ts->client, buf, bufsize); in zet6223_irq()
69 dev_err_ratelimited(&ts->client->dev, in zet6223_irq()
78 for (i = 0; i < ts->fingernum; i++) { in zet6223_irq()
82 input_mt_slot(ts->input, i); in zet6223_irq()
83 input_mt_report_slot_state(ts->input, MT_TOOL_FINGER, true); in zet6223_irq()
84 input_event(ts->input, EV_ABS, ABS_MT_POSITION_X, in zet6223_irq()
86 input_event(ts->input, EV_ABS, ABS_MT_POSITION_Y, in zet6223_irq()
90 input_mt_sync_frame(ts->input); in zet6223_irq()
91 input_sync(ts->input); in zet6223_irq()
98 struct zet6223_ts *ts = _ts; in zet6223_power_off() local
100 regulator_bulk_disable(ARRAY_SIZE(ts->supplies), ts->supplies); in zet6223_power_off()
103 static int zet6223_power_on(struct zet6223_ts *ts) in zet6223_power_on() argument
105 struct device *dev = &ts->client->dev; in zet6223_power_on()
108 ts->supplies[0].supply = "vio"; in zet6223_power_on()
109 ts->supplies[1].supply = "vcc"; in zet6223_power_on()
111 error = devm_regulator_bulk_get(dev, ARRAY_SIZE(ts->supplies), in zet6223_power_on()
112 ts->supplies); in zet6223_power_on()
116 error = regulator_bulk_enable(ARRAY_SIZE(ts->supplies), ts->supplies); in zet6223_power_on()
122 error = devm_add_action_or_reset(dev, zet6223_power_off, ts); in zet6223_power_on()
131 static int zet6223_query_device(struct zet6223_ts *ts) in zet6223_query_device() argument
138 ret = i2c_master_send(ts->client, &cmd, sizeof(cmd)); in zet6223_query_device()
141 dev_err(&ts->client->dev, in zet6223_query_device()
146 ret = i2c_master_recv(ts->client, buf, sizeof(buf)); in zet6223_query_device()
149 dev_err(&ts->client->dev, in zet6223_query_device()
154 ts->fingernum = buf[15] & 0x7F; in zet6223_query_device()
155 if (ts->fingernum > ZET6223_MAX_FINGERS) { in zet6223_query_device()
156 dev_warn(&ts->client->dev, in zet6223_query_device()
158 ts->fingernum, ZET6223_MAX_FINGERS); in zet6223_query_device()
159 ts->fingernum = ZET6223_MAX_FINGERS; in zet6223_query_device()
162 ts->max_x = get_unaligned_le16(&buf[8]); in zet6223_query_device()
163 ts->max_y = get_unaligned_le16(&buf[10]); in zet6223_query_device()
171 struct zet6223_ts *ts; in zet6223_probe() local
180 ts = devm_kzalloc(dev, sizeof(*ts), GFP_KERNEL); in zet6223_probe()
181 if (!ts) in zet6223_probe()
184 ts->client = client; in zet6223_probe()
186 error = zet6223_power_on(ts); in zet6223_probe()
190 error = zet6223_query_device(ts); in zet6223_probe()
194 ts->input = input = devm_input_allocate_device(dev); in zet6223_probe()
198 input_set_drvdata(input, ts); in zet6223_probe()
205 input_set_abs_params(input, ABS_MT_POSITION_X, 0, ts->max_x, 0, 0); in zet6223_probe()
206 input_set_abs_params(input, ABS_MT_POSITION_Y, 0, ts->max_y, 0, 0); in zet6223_probe()
208 touchscreen_parse_properties(input, true, &ts->prop); in zet6223_probe()
210 error = input_mt_init_slots(input, ts->fingernum, in zet6223_probe()
216 IRQF_ONESHOT, client->name, ts); in zet6223_probe()