diff options
Diffstat (limited to 'drivers/input/touchscreen/stmpe-ts.c')
-rw-r--r-- | drivers/input/touchscreen/stmpe-ts.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/drivers/input/touchscreen/stmpe-ts.c b/drivers/input/touchscreen/stmpe-ts.c index ae88e13c99ff..dbd94f3c957a 100644 --- a/drivers/input/touchscreen/stmpe-ts.c +++ b/drivers/input/touchscreen/stmpe-ts.c @@ -48,17 +48,6 @@ #define STMPE_IRQ_TOUCH_DET 0 -#define SAMPLE_TIME(x) ((x & 0xf) << 4) -#define MOD_12B(x) ((x & 0x1) << 3) -#define REF_SEL(x) ((x & 0x1) << 1) -#define ADC_FREQ(x) (x & 0x3) -#define AVE_CTRL(x) ((x & 0x3) << 6) -#define DET_DELAY(x) ((x & 0x7) << 3) -#define SETTLING(x) (x & 0x7) -#define FRACTION_Z(x) (x & 0x7) -#define I_DRIVE(x) (x & 0x1) -#define OP_MODE(x) ((x & 0x7) << 1) - #define STMPE_TS_NAME "stmpe-ts" #define XY_MASK 0xfff @@ -118,6 +107,7 @@ static void stmpe_work(struct work_struct *work) __stmpe_reset_fifo(ts->stmpe); input_report_abs(ts->idev, ABS_PRESSURE, 0); + input_report_key(ts->idev, BTN_TOUCH, 0); input_sync(ts->idev); } @@ -148,9 +138,17 @@ static irqreturn_t stmpe_ts_handler(int irq, void *data) y = ((data_set[1] & 0xf) << 8) | data_set[2]; z = data_set[3]; +#ifndef CONFIG_ANDROID input_report_abs(ts->idev, ABS_X, x); input_report_abs(ts->idev, ABS_Y, y); +#else /* !CONFIG_ANDROID */ + /* Hack: rotate touch for now due to missing calibration integration + Note: 12-bit touch resolution */ + input_report_abs(ts->idev, ABS_X, 4096 - x); + input_report_abs(ts->idev, ABS_Y, 4096 - y); +#endif /* !CONFIG_ANDROID */ input_report_abs(ts->idev, ABS_PRESSURE, z); + input_report_key(ts->idev, BTN_TOUCH, (z != 0)); input_sync(ts->idev); /* flush the FIFO after we have read out our values. */ @@ -161,7 +159,7 @@ static irqreturn_t stmpe_ts_handler(int irq, void *data) STMPE_TSC_CTRL_TSC_EN, STMPE_TSC_CTRL_TSC_EN); /* start polling for touch_det to detect release */ - schedule_delayed_work(&ts->work, HZ / 50); + schedule_delayed_work(&ts->work, HZ / 10); return IRQ_HANDLED; } |