[XPERIA X8 General] andrej456:
I'll look through our driver

interested in here is

SYNA_DBG(for (i = 0; i < pkt_size; i++)
printk(KERN_INFO "%s: data[%d]:0x%x\n",
__FUNCTION__, i, pkt[i]);)

finger_state = pkt[0];
finger_state_mask = 0x03;
pkt_offset = 1;
i = 0;
for (; i < ts->info_2D.nbr_of_fingers; i++)
{
if ((finger_state & finger_state_mask) > 0x01) {
printk(KERN_ERR "%s: Error, bad finger_state:0x%02X",
__FUNCTION__, finger_state);
return;
}

f_data[i].x = (pkt[pkt_offset + PKT_INDX_2D_YX_POS_3__0]
& 0x000F);
f_data[i].x |= ((pkt[pkt_offset + PKT_INDX_2D_X_POS_11__4]
<< 4) & 0x0FF0);
f_data[i].y = ((pkt[pkt_offset + PKT_INDX_2D_YX_POS_3__0]
>> 4) & 0x000F);
f_data[i].y |= ((pkt[pkt_offset + PKT_INDX_2D_Y_POS_11__4]
<< 4) & 0x0FF0);
f_data[i].z = pkt[pkt_offset + PKT_INDX_2D_Z];
/* Setting width to the highest axis-value */
f_data[i].w =
((pkt[pkt_offset + PKT_INDX_2D_WIDTH_XY] & 0x0F) >=
(pkt[pkt_offset + PKT_INDX_2D_WIDTH_XY] & 0xF0) >> 4) ?
(pkt[pkt_offset + PKT_INDX_2D_WIDTH_XY] & 0x0F) :
(pkt[pkt_offset + PKT_INDX_2D_WIDTH_XY] & 0xF0) >> 4;

if (ts->flags & SYNAPTICS_FLIP_X)
f_data[i].x = (ts->info_2D.max_x - f_data[i].x);
if (ts->flags & SYNAPTICS_FLIP_Y)
f_data[i].y = (ts->info_2D.max_y - f_data[i].y);
if (ts->flags & SYNAPTICS_SNAP_TO_INACTIVE_EDGE) {
f_data[i].x =
synaptics_snap_to_inactive_edge
(ts, f_data[i].x, 0);
f_data[i].y =
synaptics_snap_to_inactive_edge
(ts, f_data[i].y, 1);
}
if (ts->flags & SYNAPTICS_SWAP_XY)
synpatics_swap(f_data[i].x, f_data[i].y);

finger_state_mask = (finger_state_mask << 2);
pkt_offset += NBR_OF_2D_DATA_REGS_PER_FINGER;
}

/* press- or release to be masked out on finger_0. */
finger_state_mask = 0x01;
if (finger_state & finger_state_mask) {
input_report_abs(ts->input_dev, ABS_X, f_data[0].x);
input_report_abs(ts->input_dev, ABS_Y, f_data[0].y);
}
input_report_abs(ts->input_dev, ABS_PRESSURE, f_data[0].z);
input_report_abs(ts->input_dev, ABS_TOOL_WIDTH, f_data[0].w);
input_report_key(ts->input_dev, BTN_TOUCH,
(finger_state & finger_state_mask));
input_sync(ts->input_dev);
}

and this

ts->snap_down[!!(ts->flags & SYNAPTICS_SWAP_XY)] = -inactive_area_left;
ts->snap_up[!!(ts->flags & SYNAPTICS_SWAP_XY)] = max_x + inactive_area_right;
ts->snap_down[!(ts->flags & SYNAPTICS_SWAP_XY)] = -inactive_area_top;
ts->snap_up[!(ts->flags & SYNAPTICS_SWAP_XY)] = max_y + inactive_area_bottom;
ts->snap_down_on[!!(ts->flags & SYNAPTICS_SWAP_XY)] = snap_left_on;
ts->snap_down_off[!!(ts->flags & SYNAPTICS_SWAP_XY)] = snap_left_off;
ts->snap_up_on[!!(ts->flags & SYNAPTICS_SWAP_XY)] = max_x - snap_right_on;
ts->snap_up_off[!!(ts->flags & SYNAPTICS_SWAP_XY)] = max_x - snap_right_off;
ts->snap_down_on[!(ts->flags & SYNAPTICS_SWAP_XY)] = snap_top_on;
ts->snap_down_off[!(ts->flags & SYNAPTICS_SWAP_XY)] = snap_top_off;
ts->snap_up_on[!(ts->flags & SYNAPTICS_SWAP_XY)] = max_y - snap_bottom_on;
ts->snap_up_off[!(ts->flags & SYNAPTICS_SWAP_XY)] = max_y - snap_bottom_off;
printk(KERN_INFO "synaptics_ts_probe: max_x %d, max_y %d\n", max_x, max_y);
printk(KERN_INFO "synaptics_ts_probe: inactive_x %d %d, inactive_y %d %d\n",
inactive_area_left, inactive_area_right,
inactive_area_top, inactive_area_bottom);
printk(KERN_INFO "synaptics_ts_probe: snap_x %d-%d %d-%d, snap_y %d-%d %d-%d\n",
snap_left_on, snap_left_off, snap_right_on, snap_right_off,
snap_top_on, snap_top_off, snap_bottom_on, snap_bottom_off);

input_set_abs_params(ts->input_dev, ABS_X, -inactive_area_left, max_x + inactive_area_right, fuzz_x, 0);
input_set_abs_params(ts->input_dev, ABS_Y, -inactive_area_top, max_y + inactive_area_bottom, fuzz_y, 0);
input_set_abs_params(ts->input_dev, ABS_PRESSURE, 0, 255, fuzz_p, 0);
input_set_abs_params(ts->input_dev, ABS_TOOL_WIDTH, 0, 15, fuzz_w, 0);
input_set_abs_params(ts->input_dev, ABS_HAT0X, -inactive_area_left, max_x + inactive_area_right, fuzz_x, 0);
input_set_abs_params(ts->input_dev, ABS_HAT0Y, -inactive_area_top, max_y + inactive_area_bottom, fuzz_y, 0);

Explore our driver must understand how everything works.

and then embed the code and try

multitouch protocol

http://www.mjmwired.net/kernel/Documentation/input/multi-touch-protocol.txt