Lines Matching refs:sx8654
96 struct sx8654 { struct
109 static inline void sx865x_penrelease(struct sx8654 *ts) in sx865x_penrelease() argument
119 struct sx8654 *ts = from_timer(ts, t, timer); in sx865x_penrelease_timer_handler()
130 struct sx8654 *ts = handle; in sx8650_irq()
194 struct sx8654 *sx8654 = handle; in sx8654_irq() local
200 irqsrc = i2c_smbus_read_byte_data(sx8654->client, in sx8654_irq()
202 dev_dbg(&sx8654->client->dev, "irqsrc = 0x%x", irqsrc); in sx8654_irq()
208 dev_dbg(&sx8654->client->dev, "pen release interrupt"); in sx8654_irq()
210 input_report_key(sx8654->input, BTN_TOUCH, 0); in sx8654_irq()
211 input_sync(sx8654->input); in sx8654_irq()
215 dev_dbg(&sx8654->client->dev, "pen touch interrupt"); in sx8654_irq()
217 retval = i2c_master_recv(sx8654->client, data, sizeof(data)); in sx8654_irq()
228 touchscreen_report_pos(sx8654->input, &sx8654->props, x, y, in sx8654_irq()
230 input_report_key(sx8654->input, BTN_TOUCH, 1); in sx8654_irq()
231 input_sync(sx8654->input); in sx8654_irq()
233 dev_dbg(&sx8654->client->dev, "point(%4d,%4d)\n", x, y); in sx8654_irq()
240 static int sx8654_reset(struct sx8654 *ts) in sx8654_reset()
261 struct sx8654 *sx8654 = input_get_drvdata(dev); in sx8654_open() local
262 struct i2c_client *client = sx8654->client; in sx8654_open()
286 struct sx8654 *sx8654 = input_get_drvdata(dev); in sx8654_close() local
287 struct i2c_client *client = sx8654->client; in sx8654_close()
292 if (!sx8654->data->has_irq_penrelease) in sx8654_close()
293 del_timer_sync(&sx8654->timer); in sx8654_close()
296 error = i2c_smbus_write_byte(client, sx8654->data->cmd_manual); in sx8654_close()
312 struct sx8654 *sx8654; in sx8654_probe() local
320 sx8654 = devm_kzalloc(&client->dev, sizeof(*sx8654), GFP_KERNEL); in sx8654_probe()
321 if (!sx8654) in sx8654_probe()
324 sx8654->gpio_reset = devm_gpiod_get_optional(&client->dev, "reset", in sx8654_probe()
326 if (IS_ERR(sx8654->gpio_reset)) in sx8654_probe()
327 return dev_err_probe(&client->dev, PTR_ERR(sx8654->gpio_reset), in sx8654_probe()
331 sx8654->data = device_get_match_data(&client->dev); in sx8654_probe()
332 if (!sx8654->data) in sx8654_probe()
333 sx8654->data = (const struct sx865x_data *)id->driver_data; in sx8654_probe()
334 if (!sx8654->data) { in sx8654_probe()
339 if (!sx8654->data->has_irq_penrelease) { in sx8654_probe()
341 timer_setup(&sx8654->timer, sx865x_penrelease_timer_handler, 0); in sx8654_probe()
342 spin_lock_init(&sx8654->lock); in sx8654_probe()
360 touchscreen_parse_properties(input, false, &sx8654->props); in sx8654_probe()
362 sx8654->client = client; in sx8654_probe()
363 sx8654->input = input; in sx8654_probe()
365 input_set_drvdata(sx8654->input, sx8654); in sx8654_probe()
367 error = sx8654_reset(sx8654); in sx8654_probe()
374 sx8654->data->chan_mask); in sx8654_probe()
380 if (sx8654->data->has_reg_irqmask) { in sx8654_probe()
398 NULL, sx8654->data->irqh, in sx8654_probe()
400 client->name, sx8654); in sx8654_probe()
411 error = input_register_device(sx8654->input); in sx8654_probe()