Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 286912
b: refs/heads/master
c: 0af5e4c
h: refs/heads/master
v: v3
  • Loading branch information
Russell King committed Jan 22, 2012
1 parent 00e6baa commit b604cf8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 28 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c23bb602af24a635d0894aa7091e184385bf8a9f
refs/heads/master: 0af5e4c36e70cfd4ae96d3704a425c414f530f2a
32 changes: 5 additions & 27 deletions trunk/drivers/mfd/ucb1x00-ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ struct ucb1x00_ts {
u16 x_res;
u16 y_res;

unsigned int restart:1;
unsigned int adcsync:1;
};

Expand Down Expand Up @@ -207,15 +206,17 @@ static int ucb1x00_thread(void *_ts)
{
struct ucb1x00_ts *ts = _ts;
DECLARE_WAITQUEUE(wait, current);
bool frozen, ignore = false;
int valid = 0;

set_freezable();
add_wait_queue(&ts->irq_wait, &wait);
while (!kthread_should_stop()) {
while (!kthread_freezable_should_stop(&frozen)) {
unsigned int x, y, p;
signed long timeout;

ts->restart = 0;
if (frozen)
ignore = true;

ucb1x00_adc_enable(ts->ucb);

Expand Down Expand Up @@ -258,7 +259,7 @@ static int ucb1x00_thread(void *_ts)
* space. We therefore leave it to user space
* to do any filtering they please.
*/
if (!ts->restart) {
if (!ignore) {
ucb1x00_ts_evt_add(ts, p, x, y);
valid = 1;
}
Expand All @@ -267,8 +268,6 @@ static int ucb1x00_thread(void *_ts)
timeout = HZ / 100;
}

try_to_freeze();

schedule_timeout(timeout);
}

Expand Down Expand Up @@ -340,26 +339,6 @@ static void ucb1x00_ts_close(struct input_dev *idev)
ucb1x00_disable(ts->ucb);
}

#ifdef CONFIG_PM
static int ucb1x00_ts_resume(struct ucb1x00_dev *dev)
{
struct ucb1x00_ts *ts = dev->priv;

if (ts->rtask != NULL) {
/*
* Restart the TS thread to ensure the
* TS interrupt mode is set up again
* after sleep.
*/
ts->restart = 1;
wake_up(&ts->irq_wait);
}
return 0;
}
#else
#define ucb1x00_ts_resume NULL
#endif


/*
* Initialisation.
Expand Down Expand Up @@ -425,7 +404,6 @@ static void ucb1x00_ts_remove(struct ucb1x00_dev *dev)
static struct ucb1x00_driver ucb1x00_ts_driver = {
.add = ucb1x00_ts_add,
.remove = ucb1x00_ts_remove,
.resume = ucb1x00_ts_resume,
};

static int __init ucb1x00_ts_init(void)
Expand Down

0 comments on commit b604cf8

Please sign in to comment.