Lines Matching +full:vio +full:- +full:supply
1 // SPDX-License-Identifier: GPL-2.0-or-later
29 struct regulator *vio; member
41 enable_irq(ts->client->irq); in zet6223_start()
50 disable_irq(ts->client->irq); in zet6223_stop()
62 u8 bufsize = 3 + 4 * ts->fingernum; in zet6223_irq()
68 ret = i2c_master_recv(ts->client, buf, bufsize); in zet6223_irq()
70 error = ret < 0 ? ret : -EIO; in zet6223_irq()
71 dev_err_ratelimited(&ts->client->dev, in zet6223_irq()
80 for (i = 0; i < ts->fingernum; i++) { in zet6223_irq()
81 if (!(finger_bits & BIT(15 - 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()
102 regulator_bulk_disable(ARRAY_SIZE(ts->supplies), ts->supplies); in zet6223_power_off()
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()
140 ret = i2c_master_send(ts->client, &cmd, sizeof(cmd)); in zet6223_query_device()
142 error = ret < 0 ? ret : -EIO; 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()
150 error = ret < 0 ? ret : -EIO; 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()
173 struct device *dev = &client->dev; in zet6223_probe()
178 if (!client->irq) { in zet6223_probe()
180 return -EINVAL; in zet6223_probe()
185 return -ENOMEM; in zet6223_probe()
187 ts->client = client; in zet6223_probe()
197 ts->input = input = devm_input_allocate_device(dev); in zet6223_probe()
199 return -ENOMEM; in zet6223_probe()
203 input->name = client->name; in zet6223_probe()
204 input->id.bustype = BUS_I2C; in zet6223_probe()
205 input->open = zet6223_start; in zet6223_probe()
206 input->close = zet6223_stop; 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()
218 error = devm_request_threaded_irq(dev, client->irq, NULL, zet6223_irq, in zet6223_probe()
219 IRQF_ONESHOT, client->name, ts); in zet6223_probe()
222 client->irq, error); in zet6223_probe()