summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhang Jiejing <jiejing.zhang@freescale.com>2011-04-11 16:02:43 +0800
committerJason Liu <r64343@freescale.com>2012-01-09 20:07:59 +0800
commite041af78bcecb1bbdc8681d977212701d8f0a964 (patch)
tree9388f2897442496bcd06ad7de5ad79f3fc5cfcab
parent53b9067bcf119ed3403324684caf55cb339fcc83 (diff)
ENGR00138130-2 input: max11801: add calibrat function for mx53_ard RevA board
Add calibration for MX53 ARD Rev A board. Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
-rwxr-xr-x[-rw-r--r--]drivers/input/touchscreen/max11801_ts.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/input/touchscreen/max11801_ts.c b/drivers/input/touchscreen/max11801_ts.c
index 4f2713d92791..ca88d6823a98 100644..100755
--- a/drivers/input/touchscreen/max11801_ts.c
+++ b/drivers/input/touchscreen/max11801_ts.c
@@ -96,6 +96,13 @@ static int max11801_write_reg(struct i2c_client *client, int addr, int data)
return i2c_smbus_write_byte_data(client, addr << 1, data);
}
+static void calibration_pointer(int *x_orig, int *y_orig)
+{
+ int y;
+ y = MAX11801_MAX_Y - *y_orig;
+ *y_orig = y;
+}
+
static irqreturn_t max11801_ts_interrupt(int irq, void *dev_id)
{
struct max11801_data *data = dev_id;
@@ -136,6 +143,7 @@ static irqreturn_t max11801_ts_interrupt(int irq, void *dev_id)
case EVENT_INIT:
/* fall through */
case EVENT_MIDDLE:
+ calibration_pointer(&x, &y);
input_report_abs(data->input_dev, ABS_X, x);
input_report_abs(data->input_dev, ABS_Y, y);
input_event(data->input_dev, EV_KEY, BTN_TOUCH, 1);