Lines Matching refs:ts

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