Lines Matching +full:has +full:- +full:touchscreen
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * mcs5000_ts.c - Touchscreen driver for MELFAS MCS-5000 controller
8 * Based on wm97xx-core.c
85 /* Touchscreen absolute values */
98 /* Each client has this additional data */
108 struct i2c_client *client = data->client; in mcs5000_ts_interrupt()
117 dev_err(&client->dev, "%s, err[%d]\n", __func__, err); in mcs5000_ts_interrupt()
123 input_report_key(data->input_dev, BTN_TOUCH, 0); in mcs5000_ts_interrupt()
124 input_sync(data->input_dev); in mcs5000_ts_interrupt()
131 input_report_key(data->input_dev, BTN_TOUCH, 1); in mcs5000_ts_interrupt()
132 input_report_abs(data->input_dev, ABS_X, x); in mcs5000_ts_interrupt()
133 input_report_abs(data->input_dev, ABS_Y, y); in mcs5000_ts_interrupt()
134 input_sync(data->input_dev); in mcs5000_ts_interrupt()
150 dev_err(&client->dev, "Unknown ts input type %d\n", in mcs5000_ts_interrupt()
162 struct i2c_client *client = data->client; in mcs5000_ts_phys_init()
170 platform_data->x_size >> 8); in mcs5000_ts_phys_init()
172 platform_data->x_size & 0xff); in mcs5000_ts_phys_init()
174 platform_data->y_size >> 8); in mcs5000_ts_phys_init()
176 platform_data->y_size & 0xff); in mcs5000_ts_phys_init()
179 i2c_smbus_write_byte_data(data->client, MCS5000_TS_OP_MODE, in mcs5000_ts_phys_init()
190 pdata = dev_get_platdata(&client->dev); in mcs5000_ts_probe()
192 return -EINVAL; in mcs5000_ts_probe()
194 data = devm_kzalloc(&client->dev, sizeof(*data), GFP_KERNEL); in mcs5000_ts_probe()
196 dev_err(&client->dev, "Failed to allocate memory\n"); in mcs5000_ts_probe()
197 return -ENOMEM; in mcs5000_ts_probe()
200 data->client = client; in mcs5000_ts_probe()
202 input_dev = devm_input_allocate_device(&client->dev); in mcs5000_ts_probe()
204 dev_err(&client->dev, "Failed to allocate input device\n"); in mcs5000_ts_probe()
205 return -ENOMEM; in mcs5000_ts_probe()
208 input_dev->name = "MELFAS MCS-5000 Touchscreen"; in mcs5000_ts_probe()
209 input_dev->id.bustype = BUS_I2C; in mcs5000_ts_probe()
210 input_dev->dev.parent = &client->dev; in mcs5000_ts_probe()
212 __set_bit(EV_ABS, input_dev->evbit); in mcs5000_ts_probe()
213 __set_bit(EV_KEY, input_dev->evbit); in mcs5000_ts_probe()
214 __set_bit(BTN_TOUCH, input_dev->keybit); in mcs5000_ts_probe()
218 data->input_dev = input_dev; in mcs5000_ts_probe()
220 if (pdata->cfg_pin) in mcs5000_ts_probe()
221 pdata->cfg_pin(); in mcs5000_ts_probe()
223 error = devm_request_threaded_irq(&client->dev, client->irq, in mcs5000_ts_probe()
228 dev_err(&client->dev, "Failed to register interrupt\n"); in mcs5000_ts_probe()
232 error = input_register_device(data->input_dev); in mcs5000_ts_probe()
234 dev_err(&client->dev, "Failed to register input device\n"); in mcs5000_ts_probe()
287 MODULE_DESCRIPTION("Touchscreen driver for MELFAS MCS-5000 controller");