Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/overlays/edt-ft5406.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#address-cells = <1>;
#size-cells = <0>;
ft5406: ts@38 {
compatible = "edt,edt-ft5406";
compatible = "edt,edt-ft5506";
reg = <0x38>;

touchscreen-size-x = < 800 >;
Expand Down
21 changes: 20 additions & 1 deletion drivers/input/touchscreen/edt-ft5x06.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ struct edt_ft5x06_ts_data {
int offset_y;
int report_rate;
int max_support_points;
unsigned int known_ids;

char name[EDT_NAME_LEN];

Expand Down Expand Up @@ -197,6 +198,9 @@ static irqreturn_t edt_ft5x06_ts_isr(int irq, void *dev_id)
int i, type, x, y, id;
int offset, tplen, datalen, crclen;
int error;
unsigned int active_ids = 0, known_ids = tsdata->known_ids;
long released_ids;
int b = 0;

switch (tsdata->version) {
case EDT_M06:
Expand Down Expand Up @@ -268,10 +272,25 @@ static irqreturn_t edt_ft5x06_ts_isr(int irq, void *dev_id)

input_mt_slot(tsdata->input, id);
if (input_mt_report_slot_state(tsdata->input, MT_TOOL_FINGER,
type != TOUCH_EVENT_UP))
type != TOUCH_EVENT_UP)) {
touchscreen_report_pos(tsdata->input, &tsdata->prop,
x, y, true);
active_ids |= BIT(id);
} else {
known_ids &= ~BIT(id);
}
}

/* One issue with the device is the TOUCH_UP message is not always
* returned. Instead track which ids we know about and report when they
* are no longer updated
*/
released_ids = known_ids & ~active_ids;
for_each_set_bit_from(b, &released_ids, tsdata->max_support_points) {
input_mt_slot(tsdata->input, b);
input_mt_report_slot_inactive(tsdata->input);
}
tsdata->known_ids = active_ids;

input_mt_report_pointer_emulation(tsdata->input, true);
input_sync(tsdata->input);
Expand Down