Lines Matching +full:2 +full:nd

96 	__u8 b =  (raw[0] & 0x3c) >> 2;  in ntrig_version_string()
98 __u8 d = ((raw[3] & 0x07) << 3) | ((raw[2] & 0xe0) >> 5); in ntrig_version_string()
99 __u8 e = raw[2] & 0x07; in ntrig_version_string()
158 ret = ntrig_version_string(&data[2], buf); in ntrig_report_version()
161 buf, data[2], data[3], data[4], data[5]); in ntrig_report_version()
173 struct ntrig_data *nd = hid_get_drvdata(hdev); in show_phys_width() local
175 return sprintf(buf, "%d\n", nd->sensor_physical_width); in show_phys_width()
185 struct ntrig_data *nd = hid_get_drvdata(hdev); in show_phys_height() local
187 return sprintf(buf, "%d\n", nd->sensor_physical_height); in show_phys_height()
197 struct ntrig_data *nd = hid_get_drvdata(hdev); in show_log_width() local
199 return sprintf(buf, "%d\n", nd->sensor_logical_width); in show_log_width()
209 struct ntrig_data *nd = hid_get_drvdata(hdev); in show_log_height() local
211 return sprintf(buf, "%d\n", nd->sensor_logical_height); in show_log_height()
221 struct ntrig_data *nd = hid_get_drvdata(hdev); in show_min_width() local
223 return sprintf(buf, "%d\n", nd->min_width * in show_min_width()
224 nd->sensor_physical_width / in show_min_width()
225 nd->sensor_logical_width); in show_min_width()
233 struct ntrig_data *nd = hid_get_drvdata(hdev); in set_min_width() local
240 if (val > nd->sensor_physical_width) in set_min_width()
243 nd->min_width = val * nd->sensor_logical_width / in set_min_width()
244 nd->sensor_physical_width; in set_min_width()
256 struct ntrig_data *nd = hid_get_drvdata(hdev); in show_min_height() local
258 return sprintf(buf, "%d\n", nd->min_height * in show_min_height()
259 nd->sensor_physical_height / in show_min_height()
260 nd->sensor_logical_height); in show_min_height()
268 struct ntrig_data *nd = hid_get_drvdata(hdev); in set_min_height() local
275 if (val > nd->sensor_physical_height) in set_min_height()
278 nd->min_height = val * nd->sensor_logical_height / in set_min_height()
279 nd->sensor_physical_height; in set_min_height()
292 struct ntrig_data *nd = hid_get_drvdata(hdev); in show_activate_slack() local
294 return sprintf(buf, "%d\n", nd->activate_slack); in show_activate_slack()
302 struct ntrig_data *nd = hid_get_drvdata(hdev); in set_activate_slack() local
312 nd->activate_slack = val; in set_activate_slack()
325 struct ntrig_data *nd = hid_get_drvdata(hdev); in show_activation_width() local
327 return sprintf(buf, "%d\n", nd->activation_width * in show_activation_width()
328 nd->sensor_physical_width / in show_activation_width()
329 nd->sensor_logical_width); in show_activation_width()
337 struct ntrig_data *nd = hid_get_drvdata(hdev); in set_activation_width() local
344 if (val > nd->sensor_physical_width) in set_activation_width()
347 nd->activation_width = val * nd->sensor_logical_width / in set_activation_width()
348 nd->sensor_physical_width; in set_activation_width()
361 struct ntrig_data *nd = hid_get_drvdata(hdev); in show_activation_height() local
363 return sprintf(buf, "%d\n", nd->activation_height * in show_activation_height()
364 nd->sensor_physical_height / in show_activation_height()
365 nd->sensor_logical_height); in show_activation_height()
373 struct ntrig_data *nd = hid_get_drvdata(hdev); in set_activation_height() local
380 if (val > nd->sensor_physical_height) in set_activation_height()
383 nd->activation_height = val * nd->sensor_logical_height / in set_activation_height()
384 nd->sensor_physical_height; in set_activation_height()
397 struct ntrig_data *nd = hid_get_drvdata(hdev); in show_deactivate_slack() local
399 return sprintf(buf, "%d\n", -nd->deactivate_slack); in show_deactivate_slack()
407 struct ntrig_data *nd = hid_get_drvdata(hdev); in set_deactivate_slack() local
422 nd->deactivate_slack = -val; in set_deactivate_slack()
458 struct ntrig_data *nd = hid_get_drvdata(hdev); in ntrig_input_mapping() local
474 if (!nd->sensor_logical_width) { in ntrig_input_mapping()
475 nd->sensor_logical_width = in ntrig_input_mapping()
478 nd->sensor_physical_width = in ntrig_input_mapping()
481 nd->activation_width = activation_width * in ntrig_input_mapping()
482 nd->sensor_logical_width / in ntrig_input_mapping()
483 nd->sensor_physical_width; in ntrig_input_mapping()
484 nd->min_width = min_width * in ntrig_input_mapping()
485 nd->sensor_logical_width / in ntrig_input_mapping()
486 nd->sensor_physical_width; in ntrig_input_mapping()
496 if (!nd->sensor_logical_height) { in ntrig_input_mapping()
497 nd->sensor_logical_height = in ntrig_input_mapping()
500 nd->sensor_physical_height = in ntrig_input_mapping()
503 nd->activation_height = activation_height * in ntrig_input_mapping()
504 nd->sensor_logical_height / in ntrig_input_mapping()
505 nd->sensor_physical_height; in ntrig_input_mapping()
506 nd->min_height = min_height * in ntrig_input_mapping()
507 nd->sensor_logical_height / in ntrig_input_mapping()
508 nd->sensor_physical_height; in ntrig_input_mapping()
569 struct ntrig_data *nd = hid_get_drvdata(hid); in ntrig_event() local
590 nd->reading_mt = true; in ntrig_event()
591 nd->first_contact_touch = false; in ntrig_event()
594 nd->tipswitch = value; in ntrig_event()
598 nd->confidence = value; in ntrig_event()
601 nd->x = value; in ntrig_event()
603 nd->mt_foot_count = 0; in ntrig_event()
606 nd->y = value; in ntrig_event()
609 nd->id = value; in ntrig_event()
612 nd->w = value; in ntrig_event()
615 nd->h = value; in ntrig_event()
621 if (!nd->reading_mt) { in ntrig_event()
627 nd->tipswitch); in ntrig_event()
629 nd->tipswitch); in ntrig_event()
630 input_event(input, EV_ABS, ABS_X, nd->x); in ntrig_event()
631 input_event(input, EV_ABS, ABS_Y, nd->y); in ntrig_event()
643 if (nd->mt_foot_count >= 4) in ntrig_event()
646 nd->mt_footer[nd->mt_foot_count++] = value; in ntrig_event()
649 if (nd->mt_foot_count != 4) in ntrig_event()
653 if (nd->mt_footer[2]) { in ntrig_event()
661 nd->act_state = deactivate_slack - 1; in ntrig_event()
662 nd->confidence = false; in ntrig_event()
670 if (nd->mt_footer[0]) { in ntrig_event()
676 if (nd->w < nd->min_width || in ntrig_event()
677 nd->h < nd->min_height) in ntrig_event()
678 nd->confidence = false; in ntrig_event()
682 if (nd->act_state > 0) { in ntrig_event()
686 if (nd->w >= nd->activation_width && in ntrig_event()
687 nd->h >= nd->activation_height) { in ntrig_event()
688 if (nd->id) in ntrig_event()
692 nd->act_state = 0; in ntrig_event()
699 nd->act_state = 1; in ntrig_event()
711 if (!nd->confidence) in ntrig_event()
715 if (nd->id == 0) { in ntrig_event()
722 nd->first_contact_touch = nd->confidence; in ntrig_event()
723 input_event(input, EV_ABS, ABS_X, nd->x); in ntrig_event()
724 input_event(input, EV_ABS, ABS_Y, nd->y); in ntrig_event()
728 input_event(input, EV_ABS, ABS_MT_POSITION_X, nd->x); in ntrig_event()
729 input_event(input, EV_ABS, ABS_MT_POSITION_Y, nd->y); in ntrig_event()
735 if (nd->w > nd->h) { in ntrig_event()
739 ABS_MT_TOUCH_MAJOR, nd->w); in ntrig_event()
741 ABS_MT_TOUCH_MINOR, nd->h); in ntrig_event()
746 ABS_MT_TOUCH_MAJOR, nd->h); in ntrig_event()
748 ABS_MT_TOUCH_MINOR, nd->w); in ntrig_event()
754 if (!nd->reading_mt) /* Just to be sure */ in ntrig_event()
757 nd->reading_mt = false; in ntrig_event()
781 if (nd->act_state > 0) { /* Currently inactive */ in ntrig_event()
787 nd->act_state = (nd->act_state > value) in ntrig_event()
788 ? nd->act_state - value in ntrig_event()
795 nd->act_state = nd->activate_slack; in ntrig_event()
804 if (value && nd->act_state >= in ntrig_event()
805 nd->deactivate_slack) in ntrig_event()
810 nd->act_state = 0; in ntrig_event()
811 else if (nd->act_state <= nd->deactivate_slack) in ntrig_event()
816 nd->act_state = in ntrig_event()
817 nd->activate_slack; in ntrig_event()
819 nd->act_state--; in ntrig_event()
824 if (nd->first_contact_touch && nd->act_state <= 0) { in ntrig_event()
896 struct ntrig_data *nd; in ntrig_probe() local
903 nd = kmalloc(sizeof(struct ntrig_data), GFP_KERNEL); in ntrig_probe()
904 if (!nd) { in ntrig_probe()
909 nd->reading_mt = false; in ntrig_probe()
910 nd->min_width = 0; in ntrig_probe()
911 nd->min_height = 0; in ntrig_probe()
912 nd->activate_slack = activate_slack; in ntrig_probe()
913 nd->act_state = activate_slack; in ntrig_probe()
914 nd->deactivate_slack = -deactivate_slack; in ntrig_probe()
915 nd->sensor_logical_width = 1; in ntrig_probe()
916 nd->sensor_logical_height = 1; in ntrig_probe()
917 nd->sensor_physical_width = 1; in ntrig_probe()
918 nd->sensor_physical_height = 1; in ntrig_probe()
920 hid_set_drvdata(hdev, nd); in ntrig_probe()
959 kfree(nd); in ntrig_probe()