@@ -822,6 +822,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];
@@ -835,6 +836,7 @@ static void mxt_proc_t9_message(struct mxt_data *data, u8 *message)
y >>= 2;
area = message[5];
+
amplitude = message[6];
vector = message[7];
@@ -864,12 +866,20 @@ 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;
+ }
+
/* if active, pressure must be non-zero */
if (!amplitude)
amplitude = MXT_PRESSURE_DEFAULT;
/* 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);