input: ft5x06_ts: Add support for protocol B
Focaltech touchscreen chips can use MT protocol B because they can assign unique id to ABS_MT_TRACKING_ID from finger id provided by hardware. This patch is propagated from 3.18 kernel 'commit 836a4745d978 ("input: ft5x06_ts: Add support for protocol B")' Change-Id: I7f236d819eb805934e12faedaf84407b9de95c0e Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org> Signed-off-by: Shantanu Jain <shjain@codeaurora.org>
This commit is contained in:
parent
a5b633b984
commit
19bdb8e2d1
1 changed files with 18 additions and 13 deletions
|
@ -18,6 +18,7 @@
|
||||||
|
|
||||||
#include <linux/i2c.h>
|
#include <linux/i2c.h>
|
||||||
#include <linux/input.h>
|
#include <linux/input.h>
|
||||||
|
#include <linux/input/mt.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/interrupt.h>
|
#include <linux/interrupt.h>
|
||||||
#include <linux/delay.h>
|
#include <linux/delay.h>
|
||||||
|
@ -298,6 +299,11 @@ static void ft5x06_report_value(struct ft5x06_ts_data *data)
|
||||||
event->pressure = 0;
|
event->pressure = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
input_mt_slot(data->input_dev, i);
|
||||||
|
input_mt_report_slot_state(data->input_dev, MT_TOOL_FINGER,
|
||||||
|
!!event->pressure);
|
||||||
|
|
||||||
|
if (event->pressure == FT_PRESS) {
|
||||||
input_report_abs(data->input_dev, ABS_MT_POSITION_X,
|
input_report_abs(data->input_dev, ABS_MT_POSITION_X,
|
||||||
event->x[i]);
|
event->x[i]);
|
||||||
input_report_abs(data->input_dev, ABS_MT_POSITION_Y,
|
input_report_abs(data->input_dev, ABS_MT_POSITION_Y,
|
||||||
|
@ -308,7 +314,7 @@ static void ft5x06_report_value(struct ft5x06_ts_data *data)
|
||||||
event->finger_id[i]);
|
event->finger_id[i]);
|
||||||
input_report_abs(data->input_dev, ABS_MT_TOUCH_MAJOR,
|
input_report_abs(data->input_dev, ABS_MT_TOUCH_MAJOR,
|
||||||
event->pressure);
|
event->pressure);
|
||||||
input_mt_sync(data->input_dev);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
input_report_key(data->input_dev, BTN_TOUCH, !!fingerdown);
|
input_report_key(data->input_dev, BTN_TOUCH, !!fingerdown);
|
||||||
|
@ -1187,12 +1193,11 @@ static int ft5x06_ts_probe(struct i2c_client *client,
|
||||||
__set_bit(BTN_TOUCH, input_dev->keybit);
|
__set_bit(BTN_TOUCH, input_dev->keybit);
|
||||||
__set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
|
__set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
|
||||||
|
|
||||||
|
input_mt_init_slots(input_dev, CFG_MAX_TOUCH_POINTS);
|
||||||
input_set_abs_params(input_dev, ABS_MT_POSITION_X, pdata->x_min,
|
input_set_abs_params(input_dev, ABS_MT_POSITION_X, pdata->x_min,
|
||||||
pdata->x_max, 0, 0);
|
pdata->x_max, 0, 0);
|
||||||
input_set_abs_params(input_dev, ABS_MT_POSITION_Y, pdata->y_min,
|
input_set_abs_params(input_dev, ABS_MT_POSITION_Y, pdata->y_min,
|
||||||
pdata->y_max, 0, 0);
|
pdata->y_max, 0, 0);
|
||||||
input_set_abs_params(input_dev, ABS_MT_TRACKING_ID, 0,
|
|
||||||
CFG_MAX_TOUCH_POINTS, 0, 0);
|
|
||||||
input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, 0, FT_PRESS, 0, 0);
|
input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, 0, FT_PRESS, 0, 0);
|
||||||
input_set_abs_params(input_dev, ABS_MT_PRESSURE, 0, FT_PRESS, 0, 0);
|
input_set_abs_params(input_dev, ABS_MT_PRESSURE, 0, FT_PRESS, 0, 0);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue