From 187ce123f1d7fa75de91c9a2ed8c0f54992b9859 Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Mon, 2 May 2016 21:25:10 +0100 Subject: dx90: fix spurious button events The kernel on this device reports nonexistent key presses, in particular it reports right presses when pressing the left button... Since when it happens, the right press comes after the left one, the new code simply ignores any right press when the left button in pressed. Change-Id: Ib6ced02682d9cecf4c7f6c58834907a667419cd7 --- firmware/target/hosted/ibasso/dx90/button-dx90.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/firmware/target/hosted/ibasso/dx90/button-dx90.c b/firmware/target/hosted/ibasso/dx90/button-dx90.c index 27e4be0c1e..a25bcc30b5 100644 --- a/firmware/target/hosted/ibasso/dx90/button-dx90.c +++ b/firmware/target/hosted/ibasso/dx90/button-dx90.c @@ -82,11 +82,11 @@ int handle_button_event(__u16 code, __s32 value, int last_btns) } } - if( (button == BUTTON_RIGHT) - && ((last_btns & BUTTON_LEFT) == BUTTON_LEFT) - && (value == EVENT_VALUE_BUTTON_RELEASE)) + if(button == BUTTON_RIGHT && ((last_btns & BUTTON_LEFT) == BUTTON_LEFT)) { - /* Workaround for a wrong feedback, only present with DX90. */ + /* Workaround for a wrong feedback, only present with DX90: the kernel + * sometimes report right press in the middle of a [left press, left release] + * interval, which is clearly wrong. */ button = BUTTON_LEFT; } -- cgit v1.2.3