Skip to content

Commit

Permalink
Input: ucb1400_ts - fix a misleading function name
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Hans J. Koch authored and Dmitry Torokhov committed Jul 13, 2009
1 parent f737069 commit f9c2273
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/input/touchscreen/ucb1400_ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);

/*
Expand Down

0 comments on commit f9c2273

Please sign in to comment.