// SPDX-License-Identifier: GPL-2.0-only /* * HID driver for ELO usb touchscreen 4000/4500 * * Copyright (c) 2013 Jiri Slaby * * Data parsing taken from elousb driver by Vojtech Pavlik.
*/
/* * ELO devices have one Button usage in GenDesk field, which makes * hid-input map it to BTN_LEFT; that confuses userspace, which then * considers the device to be a mouse/touchpad instead of touchscreen.
*/
clear_bit(BTN_LEFT, input->keybit);
set_bit(BTN_TOUCH, input->keybit);
set_bit(ABS_PRESSURE, input->absbit);
input_set_abs_params(input, ABS_PRESSURE, 0, 256, 0, 0);
return 0;
}
staticvoid elo_process_data(struct input_dev *input, const u8 *data, int size)
{ int press;
/* get the result */
ret = elo_smartset_send_get(dev, ELO_GET_SMARTSET_RESPONSE, buffer); if (ret < 0) {
dev_err(&dev->dev, "get Diagnostics Command response failed, error %d\n",
ret); goto fail;
}
/* read the ack */ if (*buffer != 'A') {
ret = elo_smartset_send_get(dev, ELO_GET_SMARTSET_RESPONSE,
buffer); if (ret < 0) {
dev_err(&dev->dev, "get acknowledge response failed, error %d\n",
ret); goto fail;
}
}
fail:
ret = elo_flush_smartset_responses(dev); if (ret < 0)
dev_err(&dev->dev, "final FLUSH_SMARTSET_RESPONSES failed, error %d\n",
ret);
queue_delayed_work(wq, &priv->work, ELO_PERIODIC_READ_INTERVAL);
}
/* * Not all Elo devices need the periodic HID descriptor reads. * Only firmware version M needs this.
*/ staticbool elo_broken_firmware(struct usb_device *dev)
{ struct usb_device *hub = dev->parent; struct usb_device *child = NULL;
u16 fw_lvl = le16_to_cpu(dev->descriptor.bcdDevice);
u16 child_vid, child_pid; int i;
if (!use_fw_quirk) returnfalse; if (fw_lvl != 0x10d) returnfalse;
/* iterate sibling devices of the touch controller */
usb_hub_for_each_child(hub, i, child) {
child_vid = le16_to_cpu(child->descriptor.idVendor);
child_pid = le16_to_cpu(child->descriptor.idProduct);
/* * If one of the devices below is present attached as a sibling of * the touch controller then this is a newer IBM 4820 monitor that * does not need the IBM-requested workaround if fw level is * 0x010d - aka 'M'. * No other HW can have this combination.
*/ if (child_vid==0x04b3) { switch (child_pid) { case 0x4676: /* 4820 21x Video */ case 0x4677: /* 4820 51x Video */ case 0x4678: /* 4820 2Lx Video */ case 0x4679: /* 4820 5Lx Video */ returnfalse;
}
}
} returntrue;
}
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.