Lines Matching refs:f

509 	struct alps_fields *f = &priv->f;  in alps_report_mt_data()  local
512 input_mt_assign_slots(dev, slot, f->mt, n, 0); in alps_report_mt_data()
514 alps_set_slot(dev, slot[i], f->mt[i].x, f->mt[i].y); in alps_report_mt_data()
523 struct alps_fields *f = &priv->f; in alps_report_semi_mt_data() local
527 f->mt[0].x = f->st.x; in alps_report_semi_mt_data()
528 f->mt[0].y = f->st.y; in alps_report_semi_mt_data()
529 fingers = f->pressure > 0 ? 1 : 0; in alps_report_semi_mt_data()
534 alps_set_slot(dev, 0, f->mt[0].x, f->mt[0].y); in alps_report_semi_mt_data()
536 alps_set_slot(dev, 1, f->mt[1].x, f->mt[1].y); in alps_report_semi_mt_data()
541 input_report_key(dev, BTN_LEFT, f->left); in alps_report_semi_mt_data()
542 input_report_key(dev, BTN_RIGHT, f->right); in alps_report_semi_mt_data()
543 input_report_key(dev, BTN_MIDDLE, f->middle); in alps_report_semi_mt_data()
545 input_report_abs(dev, ABS_PRESSURE, f->pressure); in alps_report_semi_mt_data()
617 static void alps_decode_buttons_v3(struct alps_fields *f, unsigned char *p) in alps_decode_buttons_v3() argument
619 f->left = !!(p[3] & 0x01); in alps_decode_buttons_v3()
620 f->right = !!(p[3] & 0x02); in alps_decode_buttons_v3()
621 f->middle = !!(p[3] & 0x04); in alps_decode_buttons_v3()
623 f->ts_left = !!(p[3] & 0x10); in alps_decode_buttons_v3()
624 f->ts_right = !!(p[3] & 0x20); in alps_decode_buttons_v3()
625 f->ts_middle = !!(p[3] & 0x40); in alps_decode_buttons_v3()
628 static int alps_decode_pinnacle(struct alps_fields *f, unsigned char *p, in alps_decode_pinnacle() argument
631 f->first_mp = !!(p[4] & 0x40); in alps_decode_pinnacle()
632 f->is_mp = !!(p[0] & 0x40); in alps_decode_pinnacle()
634 if (f->is_mp) { in alps_decode_pinnacle()
635 f->fingers = (p[5] & 0x3) + 1; in alps_decode_pinnacle()
636 f->x_map = ((p[4] & 0x7e) << 8) | in alps_decode_pinnacle()
639 f->y_map = ((p[3] & 0x70) << 4) | in alps_decode_pinnacle()
643 f->st.x = ((p[1] & 0x7f) << 4) | ((p[4] & 0x30) >> 2) | in alps_decode_pinnacle()
645 f->st.y = ((p[2] & 0x7f) << 4) | (p[4] & 0x0f); in alps_decode_pinnacle()
646 f->pressure = p[5] & 0x7f; in alps_decode_pinnacle()
648 alps_decode_buttons_v3(f, p); in alps_decode_pinnacle()
654 static int alps_decode_rushmore(struct alps_fields *f, unsigned char *p, in alps_decode_rushmore() argument
657 f->first_mp = !!(p[4] & 0x40); in alps_decode_rushmore()
658 f->is_mp = !!(p[5] & 0x40); in alps_decode_rushmore()
660 if (f->is_mp) { in alps_decode_rushmore()
661 f->fingers = max((p[5] & 0x3), ((p[5] >> 2) & 0x3)) + 1; in alps_decode_rushmore()
662 f->x_map = ((p[5] & 0x10) << 11) | in alps_decode_rushmore()
666 f->y_map = ((p[5] & 0x20) << 6) | in alps_decode_rushmore()
671 f->st.x = ((p[1] & 0x7f) << 4) | ((p[4] & 0x30) >> 2) | in alps_decode_rushmore()
673 f->st.y = ((p[2] & 0x7f) << 4) | (p[4] & 0x0f); in alps_decode_rushmore()
674 f->pressure = p[5] & 0x7f; in alps_decode_rushmore()
676 alps_decode_buttons_v3(f, p); in alps_decode_rushmore()
682 static int alps_decode_dolphin(struct alps_fields *f, unsigned char *p, in alps_decode_dolphin() argument
688 f->first_mp = !!(p[0] & 0x02); in alps_decode_dolphin()
689 f->is_mp = !!(p[0] & 0x20); in alps_decode_dolphin()
691 if (!f->is_mp) { in alps_decode_dolphin()
692 f->st.x = ((p[1] & 0x7f) | ((p[4] & 0x0f) << 7)); in alps_decode_dolphin()
693 f->st.y = ((p[2] & 0x7f) | ((p[4] & 0xf0) << 3)); in alps_decode_dolphin()
694 f->pressure = (p[0] & 4) ? 0 : p[5] & 0x7f; in alps_decode_dolphin()
695 alps_decode_buttons_v3(f, p); in alps_decode_dolphin()
697 f->fingers = ((p[0] & 0x6) >> 1 | in alps_decode_dolphin()
709 f->y_map = palm_data & (BIT(priv->y_bits) - 1); in alps_decode_dolphin()
712 f->x_map = (palm_data >> priv->y_bits) & in alps_decode_dolphin()
724 struct alps_fields *f = &priv->f; in alps_process_touchpad_packet_v3_v5() local
727 memset(f, 0, sizeof(*f)); in alps_process_touchpad_packet_v3_v5()
729 priv->decode_fields(f, packet, psmouse); in alps_process_touchpad_packet_v3_v5()
744 if (f->is_mp) { in alps_process_touchpad_packet_v3_v5()
745 fingers = f->fingers; in alps_process_touchpad_packet_v3_v5()
750 priv->decode_fields(f, priv->multi_data, psmouse); in alps_process_touchpad_packet_v3_v5()
751 if (alps_process_bitmap(priv, f) == 0) in alps_process_touchpad_packet_v3_v5()
766 if (f->is_mp) in alps_process_touchpad_packet_v3_v5()
769 if (!priv->multi_packet && f->first_mp) { in alps_process_touchpad_packet_v3_v5()
783 if (f->st.x && f->st.y && !f->pressure) in alps_process_touchpad_packet_v3_v5()
790 input_report_key(dev2, BTN_LEFT, f->ts_left); in alps_process_touchpad_packet_v3_v5()
791 input_report_key(dev2, BTN_RIGHT, f->ts_right); in alps_process_touchpad_packet_v3_v5()
792 input_report_key(dev2, BTN_MIDDLE, f->ts_middle); in alps_process_touchpad_packet_v3_v5()
894 struct alps_fields *f = &priv->f; in alps_process_packet_v4() local
914 f->left = !!(packet[4] & 0x01); in alps_process_packet_v4()
915 f->right = !!(packet[4] & 0x02); in alps_process_packet_v4()
917 f->st.x = ((packet[1] & 0x7f) << 4) | ((packet[3] & 0x30) >> 2) | in alps_process_packet_v4()
919 f->st.y = ((packet[2] & 0x7f) << 4) | (packet[3] & 0x0f); in alps_process_packet_v4()
920 f->pressure = packet[5] & 0x7f; in alps_process_packet_v4()
925 f->x_map = ((priv->multi_data[2] & 0x1f) << 10) | in alps_process_packet_v4()
929 f->y_map = ((priv->multi_data[5] & 0x01) << 10) | in alps_process_packet_v4()
933 f->fingers = alps_process_bitmap(priv, f); in alps_process_packet_v4()
936 alps_report_semi_mt_data(psmouse, f->fingers); in alps_process_packet_v4()
1027 static int alps_decode_packet_v7(struct alps_fields *f, in alps_decode_packet_v7() argument
1060 alps_get_finger_coordinate_v7(f->mt, p, pkt_id); in alps_decode_packet_v7()
1063 f->fingers = alps_get_mt_count(f->mt); in alps_decode_packet_v7()
1065 f->fingers = 3 + (p[5] & 0x03); in alps_decode_packet_v7()
1067 f->left = (p[0] & 0x80) >> 7; in alps_decode_packet_v7()
1070 f->fingers++; in alps_decode_packet_v7()
1072 f->fingers++; in alps_decode_packet_v7()
1074 f->right = (p[0] & 0x20) >> 5; in alps_decode_packet_v7()
1075 f->middle = (p[0] & 0x10) >> 4; in alps_decode_packet_v7()
1079 if (f->fingers == 1 && f->mt[0].x == 0 && f->mt[0].y == 0) { in alps_decode_packet_v7()
1080 f->mt[0].x = f->mt[1].x; in alps_decode_packet_v7()
1081 f->mt[0].y = f->mt[1].y; in alps_decode_packet_v7()
1082 f->mt[1].x = 0; in alps_decode_packet_v7()
1083 f->mt[1].y = 0; in alps_decode_packet_v7()
1126 struct alps_fields *f = &priv->f; in alps_process_touchpad_packet_v7() local
1128 memset(f, 0, sizeof(*f)); in alps_process_touchpad_packet_v7()
1130 if (priv->decode_fields(f, psmouse->packet, psmouse)) in alps_process_touchpad_packet_v7()
1133 alps_report_mt_data(psmouse, alps_get_mt_count(f->mt)); in alps_process_touchpad_packet_v7()
1135 input_mt_report_finger_count(dev, f->fingers); in alps_process_touchpad_packet_v7()
1137 input_report_key(dev, BTN_LEFT, f->left); in alps_process_touchpad_packet_v7()
1138 input_report_key(dev, BTN_RIGHT, f->right); in alps_process_touchpad_packet_v7()
1139 input_report_key(dev, BTN_MIDDLE, f->middle); in alps_process_touchpad_packet_v7()
1172 static int alps_decode_ss4_v2(struct alps_fields *f, in alps_decode_ss4_v2() argument
1184 f->mt[0].x = SS4_1F_X_V2(p); in alps_decode_ss4_v2()
1185 f->mt[0].y = SS4_1F_Y_V2(p); in alps_decode_ss4_v2()
1186 f->pressure = ((SS4_1F_Z_V2(p)) * 2) & 0x7f; in alps_decode_ss4_v2()
1187 f->fingers = 1; in alps_decode_ss4_v2()
1188 f->first_mp = 0; in alps_decode_ss4_v2()
1189 f->is_mp = 0; in alps_decode_ss4_v2()
1194 f->mt[0].x = SS4_BTL_MF_X_V2(p, 0); in alps_decode_ss4_v2()
1195 f->mt[0].y = SS4_BTL_MF_Y_V2(p, 0); in alps_decode_ss4_v2()
1196 f->mt[1].x = SS4_BTL_MF_X_V2(p, 1); in alps_decode_ss4_v2()
1197 f->mt[1].y = SS4_BTL_MF_Y_V2(p, 1); in alps_decode_ss4_v2()
1199 f->mt[0].x = SS4_STD_MF_X_V2(p, 0); in alps_decode_ss4_v2()
1200 f->mt[0].y = SS4_STD_MF_Y_V2(p, 0); in alps_decode_ss4_v2()
1201 f->mt[1].x = SS4_STD_MF_X_V2(p, 1); in alps_decode_ss4_v2()
1202 f->mt[1].y = SS4_STD_MF_Y_V2(p, 1); in alps_decode_ss4_v2()
1204 f->pressure = SS4_MF_Z_V2(p, 0) ? 0x30 : 0; in alps_decode_ss4_v2()
1207 f->first_mp = 1; in alps_decode_ss4_v2()
1209 f->fingers = 2; in alps_decode_ss4_v2()
1210 f->first_mp = 0; in alps_decode_ss4_v2()
1212 f->is_mp = 0; in alps_decode_ss4_v2()
1218 f->mt[2].x = SS4_BTL_MF_X_V2(p, 0); in alps_decode_ss4_v2()
1219 f->mt[2].y = SS4_BTL_MF_Y_V2(p, 0); in alps_decode_ss4_v2()
1220 f->mt[3].x = SS4_BTL_MF_X_V2(p, 1); in alps_decode_ss4_v2()
1221 f->mt[3].y = SS4_BTL_MF_Y_V2(p, 1); in alps_decode_ss4_v2()
1225 f->mt[2].x = SS4_STD_MF_X_V2(p, 0); in alps_decode_ss4_v2()
1226 f->mt[2].y = SS4_STD_MF_Y_V2(p, 0); in alps_decode_ss4_v2()
1227 f->mt[3].x = SS4_STD_MF_X_V2(p, 1); in alps_decode_ss4_v2()
1228 f->mt[3].y = SS4_STD_MF_Y_V2(p, 1); in alps_decode_ss4_v2()
1233 f->first_mp = 0; in alps_decode_ss4_v2()
1234 f->is_mp = 1; in alps_decode_ss4_v2()
1237 f->fingers = 5; in alps_decode_ss4_v2()
1238 } else if (f->mt[3].x == no_data_x && in alps_decode_ss4_v2()
1239 f->mt[3].y == no_data_y) { in alps_decode_ss4_v2()
1240 f->mt[3].x = 0; in alps_decode_ss4_v2()
1241 f->mt[3].y = 0; in alps_decode_ss4_v2()
1242 f->fingers = 3; in alps_decode_ss4_v2()
1244 f->fingers = 4; in alps_decode_ss4_v2()
1250 memset(f, 0, sizeof(struct alps_fields)); in alps_decode_ss4_v2()
1254 f->left = !!(SS4_BTN_V2(p) & 0x01); in alps_decode_ss4_v2()
1256 f->right = !!(SS4_BTN_V2(p) & 0x02); in alps_decode_ss4_v2()
1257 f->middle = !!(SS4_BTN_V2(p) & 0x04); in alps_decode_ss4_v2()
1268 struct alps_fields *f = &priv->f; in alps_process_packet_ss4_v2() local
1270 memset(f, 0, sizeof(struct alps_fields)); in alps_process_packet_ss4_v2()
1271 priv->decode_fields(f, packet, psmouse); in alps_process_packet_ss4_v2()
1279 if (f->is_mp) { in alps_process_packet_ss4_v2()
1281 priv->decode_fields(f, priv->multi_data, psmouse); in alps_process_packet_ss4_v2()
1291 if (f->is_mp) in alps_process_packet_ss4_v2()
1295 if (!priv->multi_packet && f->first_mp) { in alps_process_packet_ss4_v2()
1303 alps_report_mt_data(psmouse, (f->fingers <= 4) ? f->fingers : 4); in alps_process_packet_ss4_v2()
1305 input_mt_report_finger_count(dev, f->fingers); in alps_process_packet_ss4_v2()
1307 input_report_key(dev, BTN_LEFT, f->left); in alps_process_packet_ss4_v2()
1308 input_report_key(dev, BTN_RIGHT, f->right); in alps_process_packet_ss4_v2()
1309 input_report_key(dev, BTN_MIDDLE, f->middle); in alps_process_packet_ss4_v2()
1311 input_report_abs(dev, ABS_PRESSURE, f->pressure); in alps_process_packet_ss4_v2()