diff options
author | Hans J. Koch <hjk@linutronix.de> | 2009-07-12 20:51:25 -0700 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-07-12 22:19:26 -0700 |
commit | f9c22736940cdc8f5e2db0109fc9493e0cbd895d (patch) | |
tree | 0fb8313b432b69347c1203249b06014941dca822 /drivers/input/touchscreen/ucb1400_ts.c | |
parent | f7370699fbbb18f97442d6f47cc2d478a911ad6f (diff) |
Input: ucb1400_ts - fix a misleading function name
The driver for UCB1400 touchscreen controllers contains a function named
ucb1400_ts_pen_down(), but it returns 0 if the pen is down and 1 if it's up.
This causes confusion, especially since it's used as a boolean truth value
later in the code. This patch renames it.
Signed-off-by: Hans J. Koch <hjk@linutronix.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/touchscreen/ucb1400_ts.c')
-rw-r--r-- | drivers/input/touchscreen/ucb1400_ts.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/input/touchscreen/ucb1400_ts.c b/drivers/input/touchscreen/ucb1400_ts.c index 6954f5500108..e85483578bd4 100644 --- a/drivers/input/touchscreen/ucb1400_ts.c +++ b/drivers/input/touchscreen/ucb1400_ts.c @@ -128,9 +128,10 @@ static inline unsigned int ucb1400_ts_read_yres(struct ucb1400_ts *ucb) return ucb1400_adc_read(ucb->ac97, 0, adcsync); } -static inline int ucb1400_ts_pen_down(struct snd_ac97 *ac97) +static inline int ucb1400_ts_pen_up(struct snd_ac97 *ac97) { unsigned short val = ucb1400_reg_read(ac97, UCB_TS_CR); + return val & (UCB_TS_CR_TSPX_LOW | UCB_TS_CR_TSMX_LOW); } @@ -209,7 +210,7 @@ static int ucb1400_ts_thread(void *_ucb) msleep(10); - if (ucb1400_ts_pen_down(ucb->ac97)) { + if (ucb1400_ts_pen_up(ucb->ac97)) { ucb1400_ts_irq_enable(ucb->ac97); /* |