// SPDX-License-Identifier: GPL-2.0-or-later /* * Driver for ChipOne icn8318 i2c touchscreen controller * * Copyright (c) 2015 Red Hat Inc. * * Red Hat authors: * Hans de Goede <hdegoede@redhat.com>
*/
struct icn8318_touch {
__u8 slot;
__be16 x;
__be16 y;
__u8 pressure; /* Seems more like finger width then pressure really */
__u8 event; /* The difference between 2 and 3 is unclear */ #define ICN8318_EVENT_NO_DATA 1/* No finger seen yet since wakeup */ #define ICN8318_EVENT_UPDATE1 2/* New or updated coordinates */ #define ICN8318_EVENT_UPDATE2 3/* New or updated coordinates */ #define ICN8318_EVENT_END 4/* Finger lifted */
} __packed;
ret = icn8318_read_touch_data(data->client, &touch_data); if (ret < 0) {
dev_err(dev, "Error reading touch data: %d\n", ret); return IRQ_HANDLED;
}
if (touch_data.softbutton) { /* * Other data is invalid when a softbutton is pressed. * This needs some extra devicetree bindings to map the icn8318 * softbutton codes to evdev codes. Currently no known devices * use this.
*/ return IRQ_HANDLED;
}
if (touch_data.touch_count > ICN8318_MAX_TOUCHES) {
dev_warn(dev, "Too much touches %d > %d\n",
touch_data.touch_count, ICN8318_MAX_TOUCHES);
touch_data.touch_count = ICN8318_MAX_TOUCHES;
}
for (i = 0; i < touch_data.touch_count; i++) { struct icn8318_touch *touch = &touch_data.touches[i]; bool act = icn8318_touch_active(touch->event);
input_mt_slot(data->input, touch->slot);
input_mt_report_slot_state(data->input, MT_TOOL_FINGER, act); if (!act) continue;
/* This is useless for OF-enabled devices, but it is needed by I2C subsystem */ staticconststruct i2c_device_id icn8318_i2c_id[] = {
{ },
};
MODULE_DEVICE_TABLE(i2c, icn8318_i2c_id);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.