Lines Matching refs:ts

55 static void cy8ctma140_report(struct cy8ctma140 *ts, u8 *data, int n_fingers)  in cy8ctma140_report()  argument
74 slot = input_mt_get_slot_by_key(ts->input, id); in cy8ctma140_report()
82 dev_dbg(ts->dev, "finger %d: ID %02x (%d, %d) w: %d\n", in cy8ctma140_report()
85 input_mt_slot(ts->input, slot); in cy8ctma140_report()
86 input_mt_report_slot_state(ts->input, MT_TOOL_FINGER, true); in cy8ctma140_report()
87 touchscreen_report_pos(ts->input, &ts->props, x, y, true); in cy8ctma140_report()
88 input_report_abs(ts->input, ABS_MT_TOUCH_MAJOR, w); in cy8ctma140_report()
91 input_mt_sync_frame(ts->input); in cy8ctma140_report()
92 input_sync(ts->input); in cy8ctma140_report()
97 struct cy8ctma140 *ts = d; in cy8ctma140_irq_thread() local
102 .addr = ts->client->addr, in cy8ctma140_irq_thread()
107 .addr = ts->client->addr, in cy8ctma140_irq_thread()
116 ret = i2c_transfer(ts->client->adapter, msg, ARRAY_SIZE(msg)); in cy8ctma140_irq_thread()
119 dev_err(ts->dev, "error reading message: %d\n", ret); in cy8ctma140_irq_thread()
121 dev_err(ts->dev, "wrong number of messages\n"); in cy8ctma140_irq_thread()
126 dev_dbg(ts->dev, "invalid event\n"); in cy8ctma140_irq_thread()
132 dev_err(ts->dev, "unexpected number of fingers: %d\n", in cy8ctma140_irq_thread()
137 cy8ctma140_report(ts, buf, n_fingers); in cy8ctma140_irq_thread()
143 static int cy8ctma140_init(struct cy8ctma140 *ts) in cy8ctma140_init() argument
150 ret = i2c_master_send(ts->client, addr, 1); in cy8ctma140_init()
152 dev_err(ts->dev, "error sending FW info message\n"); in cy8ctma140_init()
155 ret = i2c_master_recv(ts->client, buf, 5); in cy8ctma140_init()
157 dev_err(ts->dev, "error receiving FW info message\n"); in cy8ctma140_init()
161 dev_err(ts->dev, "got only %d bytes\n", ret); in cy8ctma140_init()
165 dev_dbg(ts->dev, "vendor %c%c, HW ID %.2d, FW ver %.4d\n", in cy8ctma140_init()
171 static int cy8ctma140_power_up(struct cy8ctma140 *ts) in cy8ctma140_power_up() argument
175 error = regulator_bulk_enable(ARRAY_SIZE(ts->regulators), in cy8ctma140_power_up()
176 ts->regulators); in cy8ctma140_power_up()
178 dev_err(ts->dev, "failed to enable regulators\n"); in cy8ctma140_power_up()
187 static void cy8ctma140_power_down(struct cy8ctma140 *ts) in cy8ctma140_power_down() argument
189 regulator_bulk_disable(ARRAY_SIZE(ts->regulators), in cy8ctma140_power_down()
190 ts->regulators); in cy8ctma140_power_down()
196 struct cy8ctma140 *ts = d; in cy8ctma140_power_off_action() local
198 cy8ctma140_power_down(ts); in cy8ctma140_power_off_action()
204 struct cy8ctma140 *ts; in cy8ctma140_probe() local
209 ts = devm_kzalloc(dev, sizeof(*ts), GFP_KERNEL); in cy8ctma140_probe()
210 if (!ts) in cy8ctma140_probe()
217 ts->dev = dev; in cy8ctma140_probe()
218 ts->client = client; in cy8ctma140_probe()
219 ts->input = input; in cy8ctma140_probe()
238 touchscreen_parse_properties(input, true, &ts->props); in cy8ctma140_probe()
249 input_set_drvdata(input, ts); in cy8ctma140_probe()
258 ts->regulators[0].supply = "vcpin"; in cy8ctma140_probe()
259 ts->regulators[1].supply = "vdd"; in cy8ctma140_probe()
260 error = devm_regulator_bulk_get(dev, ARRAY_SIZE(ts->regulators), in cy8ctma140_probe()
261 ts->regulators); in cy8ctma140_probe()
269 error = cy8ctma140_power_up(ts); in cy8ctma140_probe()
273 error = devm_add_action_or_reset(dev, cy8ctma140_power_off_action, ts); in cy8ctma140_probe()
281 IRQF_ONESHOT, CY8CTMA140_NAME, ts); in cy8ctma140_probe()
287 error = cy8ctma140_init(ts); in cy8ctma140_probe()
295 i2c_set_clientdata(client, ts); in cy8ctma140_probe()
303 struct cy8ctma140 *ts = i2c_get_clientdata(client); in cy8ctma140_suspend() local
306 cy8ctma140_power_down(ts); in cy8ctma140_suspend()
314 struct cy8ctma140 *ts = i2c_get_clientdata(client); in cy8ctma140_resume() local
318 error = cy8ctma140_power_up(ts); in cy8ctma140_resume()