Skip to content
Snippets Groups Projects
Commit 3e1d1b0b authored by Tobias Kahlki's avatar Tobias Kahlki
Browse files

driver:ucb1400: Re-enable pen-down detection via bias mode

parent 3e36514d
No related branches found
No related tags found
2 merge requests!455CI: Update gitlab-ci,!382driver:ucb1400: Add retry to read routine
...@@ -205,7 +205,7 @@ static void ucb1400_clear_pending_irq(struct ucb1400_ts *ucb) ...@@ -205,7 +205,7 @@ static void ucb1400_clear_pending_irq(struct ucb1400_ts *ucb)
static void ucb1400_poll_touch(struct ucb1400_ts *ucb, struct touch_data *data) static void ucb1400_poll_touch(struct ucb1400_ts *ucb, struct touch_data *data)
{ {
bool penup, discard, retry, is_pendown = false; bool penup, discard, retry, is_pendown = false, should_sleep = false;
int ret; int ret;
int hys_down = SECO_INF_DOWN_HYSTERESIS; int hys_down = SECO_INF_DOWN_HYSTERESIS;
...@@ -219,6 +219,14 @@ static void ucb1400_poll_touch(struct ucb1400_ts *ucb, struct touch_data *data) ...@@ -219,6 +219,14 @@ static void ucb1400_poll_touch(struct ucb1400_ts *ucb, struct touch_data *data)
discard = false; discard = false;
retry = false; retry = false;
ucb1400_ts_mode_int(ucb);
if (should_sleep) {
should_sleep = false;
wait_event_timeout(ucb->ts_wait, ucb->stopped,
msecs_to_jiffies(UCB1400_TS_POLL_PERIOD));
}
penup = ucb1400_ts_pen_up(ucb); penup = ucb1400_ts_pen_up(ucb);
if (!penup) { if (!penup) {
...@@ -258,8 +266,7 @@ static void ucb1400_poll_touch(struct ucb1400_ts *ucb, struct touch_data *data) ...@@ -258,8 +266,7 @@ static void ucb1400_poll_touch(struct ucb1400_ts *ucb, struct touch_data *data)
continue; continue;
/* Skip further processing during debounce period */ /* Skip further processing during debounce period */
wait_event_timeout(ucb->ts_wait, ucb->stopped, should_sleep = true;
msecs_to_jiffies(UCB1400_TS_POLL_PERIOD));
continue; continue;
} }
...@@ -273,15 +280,13 @@ static void ucb1400_poll_touch(struct ucb1400_ts *ucb, struct touch_data *data) ...@@ -273,15 +280,13 @@ static void ucb1400_poll_touch(struct ucb1400_ts *ucb, struct touch_data *data)
if (hys_down) { if (hys_down) {
hys_down--; hys_down--;
wait_event_timeout(ucb->ts_wait, ucb->stopped, should_sleep = true;
msecs_to_jiffies(UCB1400_TS_POLL_PERIOD));
continue; continue;
} }
ucb1400_ts_report_event(ucb->ts_idev, data); ucb1400_ts_report_event(ucb->ts_idev, data);
wait_event_timeout(ucb->ts_wait, ucb->stopped, should_sleep = true;
msecs_to_jiffies(UCB1400_TS_POLL_PERIOD));
} }
/* /*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment