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

driver:ucb1400: Add debug messages

parent e7a0798a
No related branches found
No related tags found
2 merge requests!455CI: Update gitlab-ci,!382driver:ucb1400: Add retry to read routine
...@@ -211,7 +211,7 @@ static void ucb1400_poll_touch(struct ucb1400_ts *ucb, struct touch_data *data) ...@@ -211,7 +211,7 @@ static void ucb1400_poll_touch(struct ucb1400_ts *ucb, struct touch_data *data)
int hys_down = SECO_INF_DOWN_HYSTERESIS; int hys_down = SECO_INF_DOWN_HYSTERESIS;
unsigned next_sleep = 0; unsigned next_sleep = 0, timestamp = jiffies_to_msecs(jiffies);
/* Start with a small delay before checking pendown state */ /* Start with a small delay before checking pendown state */
msleep(UCB1400_TS_POLL_PERIOD); msleep(UCB1400_TS_POLL_PERIOD);
...@@ -234,6 +234,7 @@ static void ucb1400_poll_touch(struct ucb1400_ts *ucb, struct touch_data *data) ...@@ -234,6 +234,7 @@ static void ucb1400_poll_touch(struct ucb1400_ts *ucb, struct touch_data *data)
if (!penup) { if (!penup) {
is_pendown = true; is_pendown = true;
is_penup = false;
ucb1400_adc_enable(ucb->ac97); ucb1400_adc_enable(ucb->ac97);
data->x = ucb1400_ts_read_xpos(ucb); data->x = ucb1400_ts_read_xpos(ucb);
...@@ -244,8 +245,15 @@ static void ucb1400_poll_touch(struct ucb1400_ts *ucb, struct touch_data *data) ...@@ -244,8 +245,15 @@ static void ucb1400_poll_touch(struct ucb1400_ts *ucb, struct touch_data *data)
if ((SECO_INVALID_VALUE == data->x) || if ((SECO_INVALID_VALUE == data->x) ||
(SECO_INVALID_VALUE == data->y) || (SECO_INVALID_VALUE == data->y) ||
(SECO_INVALID_VALUE == data->p)) { (SECO_INVALID_VALUE == data->p)) {
++ucb->read_error_count;
dev_dbg(&ucb->ts_idev->dev, "Invalid value (%u)",
ucb->read_error_count);
retry = true; retry = true;
} }
} else if (is_pendown && !is_penup) {
is_penup = true;
dev_dbg(&ucb->ts_idev->dev, "Up: %u ms",
jiffies_to_msecs(jiffies)-timestamp);
} }
/* /*
...@@ -285,6 +293,10 @@ static void ucb1400_poll_touch(struct ucb1400_ts *ucb, struct touch_data *data) ...@@ -285,6 +293,10 @@ static void ucb1400_poll_touch(struct ucb1400_ts *ucb, struct touch_data *data)
hys_down--; hys_down--;
next_sleep = UCB1400_TS_SHORT_POLL_PERIOD; next_sleep = UCB1400_TS_SHORT_POLL_PERIOD;
continue; continue;
} else if (!report_pendown) {
report_pendown = true;
dev_dbg(&ucb->ts_idev->dev, "Down: %u ms",
jiffies_to_msecs(jiffies)-timestamp);
} }
ucb1400_ts_report_event(ucb->ts_idev, data); ucb1400_ts_report_event(ucb->ts_idev, data);
...@@ -402,6 +414,8 @@ static void ucb1400_ts_start(struct ucb1400_ts *ucb) ...@@ -402,6 +414,8 @@ static void ucb1400_ts_start(struct ucb1400_ts *ucb)
"Failed to create workqueue"); "Failed to create workqueue");
} }
} }
ucb->read_error_count = 0;
} }
static int ucb1400_ts_open(struct input_dev *idev) static int ucb1400_ts_open(struct input_dev *idev)
......
...@@ -115,6 +115,7 @@ struct ucb1400_ts { ...@@ -115,6 +115,7 @@ struct ucb1400_ts {
struct seco_filter_data filter_data; struct seco_filter_data filter_data;
struct delayed_work ts_reader; struct delayed_work ts_reader;
struct workqueue_struct *ts_workq; struct workqueue_struct *ts_workq;
unsigned read_error_count;
}; };
struct ucb1400 { struct ucb1400 {
......
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