mtouch
struct xenkbd_mtouch *mtouch)
if (unlikely(!info->mtouch))
if (mtouch->contact_id != info->mtouch_cur_contact_id) {
info->mtouch_cur_contact_id = mtouch->contact_id;
input_mt_slot(info->mtouch, mtouch->contact_id);
switch (mtouch->event_type) {
input_mt_report_slot_state(info->mtouch, MT_TOOL_FINGER, true);
input_report_abs(info->mtouch, ABS_MT_POSITION_X,
mtouch->u.pos.abs_x);
input_report_abs(info->mtouch, ABS_MT_POSITION_Y,
mtouch->u.pos.abs_y);
input_report_abs(info->mtouch, ABS_MT_TOUCH_MAJOR,
mtouch->u.shape.major);
input_report_abs(info->mtouch, ABS_MT_TOUCH_MINOR,
mtouch->u.shape.minor);
input_report_abs(info->mtouch, ABS_MT_ORIENTATION,
mtouch->u.orientation);
input_mt_report_slot_inactive(info->mtouch);
input_mt_sync_frame(info->mtouch);
input_sync(info->mtouch);
xenkbd_handle_mt_event(info, &event->mtouch);
struct input_dev *kbd, *ptr, *mtouch;
mtouch = input_allocate_device();
if (!mtouch)
mtouch->name = "Xen Virtual Multi-touch";
mtouch->phys = info->phys;
mtouch->id.bustype = BUS_PCI;
mtouch->id.vendor = 0x5853;
mtouch->id.product = 0xfffd;
input_set_abs_params(mtouch, ABS_MT_TOUCH_MAJOR,
input_set_abs_params(mtouch, ABS_MT_POSITION_X,
input_set_abs_params(mtouch, ABS_MT_POSITION_Y,
ret = input_mt_init_slots(mtouch, num_cont, INPUT_MT_DIRECT);
input_free_device(mtouch);
ret = input_register_device(mtouch);
input_free_device(mtouch);
info->mtouch = mtouch;
struct input_dev *mtouch;
if (info->mtouch)
input_unregister_device(info->mtouch);
struct mtouch *mtouch = serio_get_drvdata(serio);
input_get_device(mtouch->dev);
input_unregister_device(mtouch->dev);
input_put_device(mtouch->dev);
kfree(mtouch);
struct mtouch *mtouch;
mtouch = kzalloc_obj(*mtouch);
if (!mtouch || !input_dev) {
mtouch->serio = serio;
mtouch->dev = input_dev;
scnprintf(mtouch->phys, sizeof(mtouch->phys), "%s/input0", serio->phys);
input_dev->phys = mtouch->phys;
input_set_abs_params(mtouch->dev, ABS_X, MTOUCH_MIN_XC, MTOUCH_MAX_XC, 0, 0);
input_set_abs_params(mtouch->dev, ABS_Y, MTOUCH_MIN_YC, MTOUCH_MAX_YC, 0, 0);
serio_set_drvdata(serio, mtouch);
err = input_register_device(mtouch->dev);
kfree(mtouch);
static void mtouch_process_format_tablet(struct mtouch *mtouch)
struct input_dev *dev = mtouch->dev;
if (MTOUCH_FORMAT_TABLET_LENGTH == ++mtouch->idx) {
input_report_abs(dev, ABS_X, MTOUCH_GET_XC(mtouch->data));
input_report_abs(dev, ABS_Y, MTOUCH_MAX_YC - MTOUCH_GET_YC(mtouch->data));
input_report_key(dev, BTN_TOUCH, MTOUCH_GET_TOUCHED(mtouch->data));
mtouch->idx = 0;
static void mtouch_process_response(struct mtouch *mtouch)
if (MTOUCH_RESPONSE_END_BYTE == mtouch->data[mtouch->idx++]) {
mtouch->idx = 0;
} else if (MTOUCH_MAX_LENGTH == mtouch->idx) {
mtouch->idx = 0;
struct mtouch *mtouch = serio_get_drvdata(serio);
mtouch->data[mtouch->idx] = data;
if (MTOUCH_FORMAT_TABLET_STATUS_BIT & mtouch->data[0])
mtouch_process_format_tablet(mtouch);
else if (MTOUCH_RESPONSE_BEGIN_BYTE == mtouch->data[0])
mtouch_process_response(mtouch);
printk(KERN_DEBUG "mtouch.c: unknown/unsynchronized data from device, byte %x\n",mtouch->data[0]);
DEFINE_SIMPLE_SYSFS_GROUP_VISIBLE(mtouch);
.is_visible = SYSFS_GROUP_VISIBLE(mtouch),
struct xenkbd_mtouch mtouch;