static void fermi_input_event(struct usb_fermi *dev, struct fermi_touch_report_t *touch_report) { int test; // multitouch if (touch_report->touch[0].state == FERMI_TOUCH_DOWN || touch_report->touch[0].state == FERMI_TOUCH) { test=1; input_report_abs(dev->input_dev, ABS_MT_TRACKING_ID, touch_report->touch[0].id); input_report_abs(dev->input_dev, ABS_MT_POSITION_X, touch_report->touch[0].x); input_report_abs(dev->input_dev, ABS_MT_POSITION_Y, touch_report->touch[0].y); input_mt_sync(dev->input_dev); } if (touch_report->touch[1].state == FERMI_TOUCH_DOWN || touch_report->touch[1].state == FERMI_TOUCH) { test=2; input_report_abs(dev->input_dev, ABS_MT_TRACKING_ID, touch_report->touch[1].id); input_report_abs(dev->input_dev, ABS_MT_POSITION_X, touch_report->touch[1].x); input_report_abs(dev->input_dev, ABS_MT_POSITION_Y, touch_report->touch[1].y); input_mt_sync(dev->input_dev); } if (touch_report->count == 0) { input_mt_sync(dev->input_dev); } // mouse if (touch_report->touch[0].state == FERMI_TOUCH_DOWN || touch_report->touch[0].state == FERMI_TOUCH || touch_report->touch[0].state == FERMI_TOUCH_UP || touch_report->touch[0].state == FERMI_TOUCH_HOVER) { test=3; input_report_key(dev->input_dev, BTN_LEFT, touch_report->touch[0].state == FERMI_TOUCH_UP ? 0 : 1); input_report_abs(dev->input_dev, ABS_X, touch_report->touch[0].x); input_report_abs(dev->input_dev, ABS_Y, touch_report->touch[0].y); } // sync input_sync(dev->input_dev); printk("fermi_write test: %d\n", test); }