123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- #include "pt_regs.h"
- static void pt_final_sync(struct input_dev *input, int max_slots,
- int mt_sync_count, unsigned long *ids)
- {
- if (mt_sync_count)
- input_sync(input);
- }
- static void pt_input_sync(struct input_dev *input)
- {
- input_mt_sync(input);
- }
- static void pt_input_report(struct input_dev *input, int sig,
- int t, int type)
- {
- if (type == PT_OBJ_STANDARD_FINGER || type == PT_OBJ_GLOVE) {
- input_report_key(input, BTN_TOOL_FINGER, PT_BTN_PRESSED);
- input_report_key(input, BTN_TOOL_PEN, PT_BTN_RELEASED);
- } else if (type == PT_OBJ_STYLUS) {
- input_report_key(input, BTN_TOOL_PEN, PT_BTN_PRESSED);
- input_report_key(input, BTN_TOOL_FINGER, PT_BTN_RELEASED);
- }
- input_report_key(input, BTN_TOUCH, PT_BTN_PRESSED);
- input_report_abs(input, sig, t);
- }
- static void pt_report_slot_liftoff(struct pt_mt_data *md,
- int max_slots)
- {
- input_report_key(md->input, BTN_TOUCH, PT_BTN_RELEASED);
- input_report_key(md->input, BTN_TOOL_FINGER, PT_BTN_RELEASED);
- input_report_key(md->input, BTN_TOOL_PEN, PT_BTN_RELEASED);
- }
- static int pt_input_register_device(struct input_dev *input, int max_slots)
- {
- __set_bit(BTN_TOUCH, input->keybit);
- __set_bit(BTN_TOOL_FINGER, input->keybit);
- __set_bit(BTN_TOOL_PEN, input->keybit);
- return input_register_device(input);
- }
- void pt_init_function_ptrs(struct pt_mt_data *md)
- {
- md->mt_function.report_slot_liftoff = pt_report_slot_liftoff;
- md->mt_function.final_sync = pt_final_sync;
- md->mt_function.input_sync = pt_input_sync;
- md->mt_function.input_report = pt_input_report;
- md->mt_function.input_register_device = pt_input_register_device;
- }
|