Commit 88f7cc4b04ec1f5fe208a31592c5281624f085cc

Authored by Franklin S. Cooper Jr
Committed by Jacob Stiffler
1 parent 0c2a68cf4d

Input: ti_am335x_tsc - remove udelay in interrupt handler (mainline sync)

TI 3.14 Patch e823ec6f7b5555c65b2b89742fcd705014e8e467 was an early version of
mainline patch 344d635b9a41b19837ccf8083a99ea688027019c.

Backport the differences between these patches.

Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com>

Showing 1 changed file with 13 additions and 6 deletions Side-by-side Diff

drivers/input/touchscreen/ti_am335x_tsc.c
... ... @@ -260,7 +260,7 @@
260 260 {
261 261 struct titsc *ts_dev = dev;
262 262 struct input_dev *input_dev = ts_dev->input;
263   - unsigned int status, irqclr = 0;
  263 + unsigned int fsm, status, irqclr = 0;
264 264 unsigned int x = 0, y = 0;
265 265 unsigned int z1, z2, z;
266 266  
... ... @@ -271,10 +271,15 @@
271 271 }
272 272  
273 273 if (status & IRQENB_PENUP) {
274   - ts_dev->pen_down = false;
275   - input_report_key(input_dev, BTN_TOUCH, 0);
276   - input_report_abs(input_dev, ABS_PRESSURE, 0);
277   - input_sync(input_dev);
  274 + fsm = titsc_readl(ts_dev, REG_ADCFSM);
  275 + if (fsm == ADCFSM_STEPID) {
  276 + ts_dev->pen_down = false;
  277 + input_report_key(input_dev, BTN_TOUCH, 0);
  278 + input_report_abs(input_dev, ABS_PRESSURE, 0);
  279 + input_sync(input_dev);
  280 + } else {
  281 + ts_dev->pen_down = true;
  282 + }
278 283 irqclr |= IRQENB_PENUP;
279 284 }
280 285  
... ... @@ -313,7 +318,9 @@
313 318 }
314 319 if (irqclr) {
315 320 titsc_writel(ts_dev, REG_IRQSTATUS, irqclr);
316   - am335x_tsc_se_set_cache(ts_dev->mfd_tscadc, ts_dev->step_mask);
  321 + if (status & IRQENB_EOS)
  322 + am335x_tsc_se_set_cache(ts_dev->mfd_tscadc,
  323 + ts_dev->step_mask);
317 324 return IRQ_HANDLED;
318 325 }
319 326 return IRQ_NONE;