Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 202197
b: refs/heads/master
c: 963ce8a
h: refs/heads/master
i:
  202195: 0e5181e
v: v3
  • Loading branch information
Michael Hennerich authored and Dmitry Torokhov committed Jul 3, 2010
1 parent ddfe317 commit 7a56bef
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 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: 447b9065b418cbeb6a03ebdcd08629ac26ed8e4a
refs/heads/master: 963ce8ae6dbc7c8dffb1b117ba14673d40b22dda
16 changes: 13 additions & 3 deletions trunk/drivers/input/touchscreen/ad7879.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ static int ad7879_write(struct ad7879 *ts, u8 reg, u16 val)
return ts->bops->write(ts->dev, reg, val);
}

static void ad7879_report(struct ad7879 *ts)
static int ad7879_report(struct ad7879 *ts)
{
struct input_dev *input_dev = ts->input;
unsigned Rt;
Expand Down Expand Up @@ -175,18 +175,25 @@ static void ad7879_report(struct ad7879 *ts)
Rt /= z1;
Rt = (Rt + 2047) >> 12;

if (!timer_pending(&ts->timer))
input_report_key(input_dev, BTN_TOUCH, 1);

input_report_abs(input_dev, ABS_X, x);
input_report_abs(input_dev, ABS_Y, y);
input_report_abs(input_dev, ABS_PRESSURE, Rt);
input_sync(input_dev);
return 0;
}

return -EINVAL;
}

static void ad7879_ts_event_release(struct ad7879 *ts)
{
struct input_dev *input_dev = ts->input;

input_report_abs(input_dev, ABS_PRESSURE, 0);
input_report_key(input_dev, BTN_TOUCH, 0);
input_sync(input_dev);
}

Expand All @@ -202,9 +209,9 @@ static irqreturn_t ad7879_irq(int irq, void *handle)
struct ad7879 *ts = handle;

ad7879_multi_read(ts, AD7879_REG_XPLUS, AD7879_NR_SENSE, ts->conversion_data);
ad7879_report(ts);

mod_timer(&ts->timer, jiffies + TS_PEN_UP_TIMEOUT);
if (!ad7879_report(ts))
mod_timer(&ts->timer, jiffies + TS_PEN_UP_TIMEOUT);

return IRQ_HANDLED;
}
Expand Down Expand Up @@ -506,6 +513,9 @@ struct ad7879 *ad7879_probe(struct device *dev, u8 devid, unsigned int irq,
__set_bit(ABS_Y, input_dev->absbit);
__set_bit(ABS_PRESSURE, input_dev->absbit);

__set_bit(EV_KEY, input_dev->evbit);
__set_bit(BTN_TOUCH, input_dev->keybit);

input_set_abs_params(input_dev, ABS_X,
pdata->x_min ? : 0,
pdata->x_max ? : MAX_12BIT,
Expand Down

0 comments on commit 7a56bef

Please sign in to comment.