To be more precise, the correct approach is:
for (i = 0; i < CY_MAX_ID; i++)
if (!(used & (1 << i)))
cyttsp_report_slot_empty(ts->input, i);
or
for (i = 0; i < CY_MAX_ID; i++)
if (previous & (1 << i) &&
!(used & (1 << i)))
cyttsp_report_slot_empty(ts->input, i);
where used is a bitmask to store each contact state for this event and
previous is a bitmask to store the state for the previous event.
I looked at input_mt_report_slot_state() and it seems that it only
checks whether the active parameter to send an ABS_MT_TRACKING_ID -1
input event, so I think that I should use the latter.
Please implement the first version; the event never gets sent unless
there is an actual change, which you can see by following the code
deeper. If/when there are more drivers in need of a similar approach,
I might integrate the logic in the input-mt core instead.
Thanks,
Henrik