aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen/ucb1400_ts.c
diff options
context:
space:
mode:
authorHans J. Koch <hjk@linutronix.de>2009-07-12 23:51:25 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2009-07-13 01:19:26 -0400
commitf9c22736940cdc8f5e2db0109fc9493e0cbd895d (patch)
tree0fb8313b432b69347c1203249b06014941dca822 /drivers/input/touchscreen/ucb1400_ts.c
parentf7370699fbbb18f97442d6f47cc2d478a911ad6f (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.c5
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)
128 return ucb1400_adc_read(ucb->ac97, 0, adcsync); 128 return ucb1400_adc_read(ucb->ac97, 0, adcsync);
129} 129}
130 130
131static inline int ucb1400_ts_pen_down(struct snd_ac97 *ac97) 131static inline int ucb1400_ts_pen_up(struct snd_ac97 *ac97)
132{ 132{
133 unsigned short val = ucb1400_reg_read(ac97, UCB_TS_CR); 133 unsigned short val = ucb1400_reg_read(ac97, UCB_TS_CR);
134
134 return val & (UCB_TS_CR_TSPX_LOW | UCB_TS_CR_TSMX_LOW); 135 return val & (UCB_TS_CR_TSPX_LOW | UCB_TS_CR_TSMX_LOW);
135} 136}
136 137
@@ -209,7 +210,7 @@ static int ucb1400_ts_thread(void *_ucb)
209 210
210 msleep(10); 211 msleep(10);
211 212
212 if (ucb1400_ts_pen_down(ucb->ac97)) { 213 if (ucb1400_ts_pen_up(ucb->ac97)) {
213 ucb1400_ts_irq_enable(ucb->ac97); 214 ucb1400_ts_irq_enable(ucb->ac97);
214 215
215 /* 216 /*