Skip to content

Commit

Permalink
Input: atmel_mxt_ts - handle reports from T47 Stylus object
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
Acked-by: Benson Leung <bleung@chromium.org>
Acked-by: Yufeng Shen <miletus@chromium.org>
  • Loading branch information
ndyer committed Apr 26, 2016
1 parent 15bb074 commit 56405a5
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion drivers/input/touchscreen/atmel_mxt_ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,7 @@ static void mxt_proc_t9_message(struct mxt_data *data, u8 *message)
int area;
int amplitude;
u8 vector;
int tool;

id = message[0] - data->T9_reportid_min;
status = message[1];
Expand All @@ -763,6 +764,7 @@ static void mxt_proc_t9_message(struct mxt_data *data, u8 *message)
y >>= 2;

area = message[5];

amplitude = message[6];
vector = message[7];

Expand Down Expand Up @@ -793,8 +795,16 @@ static void mxt_proc_t9_message(struct mxt_data *data, u8 *message)
mxt_input_sync(data);
}

/* A size of zero indicates touch is from a linked T47 Stylus */
if (area == 0) {
area = MXT_TOUCH_MAJOR_DEFAULT;
tool = MT_TOOL_PEN;
} else {
tool = MT_TOOL_FINGER;
}

/* Touch active */
input_mt_report_slot_state(input_dev, MT_TOOL_FINGER, 1);
input_mt_report_slot_state(input_dev, tool, 1);
input_report_abs(input_dev, ABS_MT_POSITION_X, x);
input_report_abs(input_dev, ABS_MT_POSITION_Y, y);
input_report_abs(input_dev, ABS_MT_PRESSURE, amplitude);
Expand Down

0 comments on commit 56405a5

Please sign in to comment.