/** * touch_overlay_map - map overlay objects from the device tree and set * key capabilities if buttons are defined. * @list: pointer to the list that will hold the segments * @input: pointer to the already allocated input_dev * * Returns 0 on success and error number otherwise. * * If buttons are defined, key capabilities are set accordingly.
*/ int touch_overlay_map(struct list_head *list, struct input_dev *input)
{ struct fwnode_handle *fw_segment; struct device *dev = input->dev.parent; struct touch_overlay_segment *segment; int error;
/** * touch_overlay_mapped_touchscreen - check if a touchscreen area is mapped * @list: pointer to the list that holds the segments * * Returns true if a touchscreen area is mapped or false otherwise.
*/ bool touch_overlay_mapped_touchscreen(struct list_head *list)
{ struct touch_overlay_segment *segment; struct list_head *ptr;
if (segment->slot == slot && segment->pressed) { /* sliding out of the button releases it */ if (!button_contact) {
input_report_key(input, segment->key, false);
segment->pressed = false; /* keep available for a possible touch event */ returnfalse;
} /* ignore sliding on the button while pressed */
s->frame = mt->frame; returntrue;
} elseif (button_contact) {
input_report_key(input, segment->key, true);
s->frame = mt->frame;
segment->slot = slot;
segment->pressed = true; returntrue;
}
returnfalse;
}
/** * touch_overlay_sync_frame - update the status of the segments and report * buttons whose tracked slot is unused. * @list: pointer to the list that holds the segments * @input: pointer to the input device associated to the contact
*/ void touch_overlay_sync_frame(struct list_head *list, struct input_dev *input)
{ struct touch_overlay_segment *segment; struct input_mt *mt = input->mt; struct input_mt_slot *s; struct list_head *ptr;
s = &mt->slots[segment->slot]; if (!input_mt_is_used(mt, s) && segment->pressed) {
input_report_key(input, segment->key, false);
segment->pressed = false;
}
}
}
EXPORT_SYMBOL(touch_overlay_sync_frame);
/** * touch_overlay_process_contact - process contacts according to the overlay * mapping. This function acts as a filter to release the calling driver * from the contacts that are either related to overlay buttons or out of the * overlay touchscreen area, if defined. * @list: pointer to the list that holds the segments * @input: pointer to the input device associated to the contact * @pos: pointer to the contact position * @slot: slot associated to the contact (0 if multitouch is not supported) * * Returns true if the contact was processed (reported for valid key events * and dropped for contacts outside the overlay touchscreen area) or false * if the contact must be processed by the caller. In that case this function * shifts the (x,y) coordinates to the overlay touchscreen axis if required.
*/ bool touch_overlay_process_contact(struct list_head *list, struct input_dev *input, struct input_mt_pos *pos, int slot)
{ struct touch_overlay_segment *segment; struct list_head *ptr;
/* * buttons must be prioritized over overlay touchscreens to account for * overlappings e.g. a button inside the touchscreen area.
*/
list_for_each(ptr, list) {
segment = list_entry(ptr, struct touch_overlay_segment, list); if (segment->key &&
touch_overlay_button_event(input, segment, pos, slot)) returntrue;
}
/* * valid contacts on the overlay touchscreen are left for the client * to be processed/reported according to its (possibly) unique features.
*/ return !touch_overlay_event_on_ts(list, pos);
}
EXPORT_SYMBOL(touch_overlay_process_contact);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Helper functions for overlay objects on touch devices");
Messung V0.5
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet)
¤
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.