arch-flo-junk/packages/linux-asus-flo/07_Get_touchpanel_working_o...

61 lines
2.5 KiB
Diff

author John Stultz <john.stultz@linaro.org> 2016-02-24 23:02:26 -0800
committer John Stultz <john.stultz@linaro.org> 2017-05-12 14:09:25 -0700
commit c347b88add07696addaf87d8ab8233331b02a393 (patch)
tree 91c8279fbc692fb7d4bc9bd651948df47972a111
parent 18a343b4eb643e0eaf203d812b32b4aff19df17b (diff)
download flo-c347b88add07696addaf87d8ab8233331b02a393.tar.gz
HACK: Get touchpanel working on flo
Hack up the touchpanel to get the x/y coordinates rotated properly.
Also provide proper x_max and y_max values.
Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat
-rw-r--r-- drivers/input/touchscreen/elants_i2c.c 12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/input/touchscreen/elants_i2c.c b/drivers/input/touchscreen/elants_i2c.c
index 6079857..6983302 100644
--- a/drivers/input/touchscreen/elants_i2c.c
+++ b/drivers/input/touchscreen/elants_i2c.c
@@ -801,8 +801,8 @@ static void elants_i2c_mt_event(struct elants_data *ts, u8 *buf)
u8 *pos;
pos = &buf[FW_POS_XY + i * 3];
- x = (((u16)pos[0] & 0xf0) << 4) | pos[1];
- y = (((u16)pos[0] & 0x0f) << 8) | pos[2];
+ y = 2240-((((u16)pos[0] & 0xf0) << 4) | pos[1]);
+ x = ((((u16)pos[0] & 0x0f) << 8) | pos[2]);
p = buf[FW_POS_PRESSURE + i];
w = buf[FW_POS_WIDTH + i];
@@ -1233,8 +1233,9 @@ static int elants_i2c_probe(struct i2c_client *client,
ts->input->name = "Elan Touchscreen";
ts->input->id.bustype = BUS_I2C;
- __set_bit(BTN_TOUCH, ts->input->keybit);
__set_bit(EV_ABS, ts->input->evbit);
+#if 0
+ __set_bit(BTN_TOUCH, ts->input->keybit);
__set_bit(EV_KEY, ts->input->evbit);
/* Single touch input params setup */
@@ -1243,6 +1244,7 @@ static int elants_i2c_probe(struct i2c_client *client,
input_set_abs_params(ts->input, ABS_PRESSURE, 0, 255, 0, 0);
input_abs_set_res(ts->input, ABS_X, ts->x_res);
input_abs_set_res(ts->input, ABS_Y, ts->y_res);
+#endif
/* Multitouch input params setup */
error = input_mt_init_slots(ts->input, MAX_CONTACT_NUM,
@@ -1253,8 +1255,8 @@ static int elants_i2c_probe(struct i2c_client *client,
return error;
}
- input_set_abs_params(ts->input, ABS_MT_POSITION_X, 0, ts->x_max, 0, 0);
- input_set_abs_params(ts->input, ABS_MT_POSITION_Y, 0, ts->y_max, 0, 0);
+ input_set_abs_params(ts->input, ABS_MT_POSITION_X, 0, 1350, 0, 0);
+ input_set_abs_params(ts->input, ABS_MT_POSITION_Y, 0, 2240, 0, 0);
input_set_abs_params(ts->input, ABS_MT_TOUCH_MAJOR, 0, 255, 0, 0);
input_set_abs_params(ts->input, ABS_MT_PRESSURE, 0, 255, 0, 0);
input_abs_set_res(ts->input, ABS_MT_POSITION_X, ts->x_res);