On Tue, Sep 27, 2011 at 1:52 PM, Henrik Rydberg <rydberg@xxxxxxxxxxx> wrote: > Hi Javier, > >> Cypress TrueTouch(tm) Standard Product controllers are found in >> a wide range of embedded devices. This driver add support for a >> variety of TTSP controllers. > > please find some comments below. > Hello Henrik, I solved most of the issues you point me out, I have just a small question about one of them: >> + } >> + >> + for (i = 0; i < CY_MAX_ID; i++) { >> + if (ts->slot_prev[i] == CY_USED && >> + ts->slot_curr[i] == CY_UNUSED) >> + cyttsp_report_slot_empty(ts->input, i); >> + ts->slot_prev[i] = ts->slot_curr[i]; >> + ts->slot_curr[i] = CY_UNUSED; >> + } > > Input core handles duplicate calls, so the above could be simplified. > That means that the input MT is able to handle duplicates and I can send the state of all the contacts and it will be able to identify the deltas to send to user-space? Or do I have to keep the deltas and only call input_mt_report_slot_state() when I detect that a finger that was previously down was lifted? 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. Thank you and best regards, -- Javier Martínez Canillas (+34) 682 39 81 69 Barcelona, Spain -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html