Lines Matching defs:nd

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