Lines Matching +full:3 +full:k
32 #define TMDC_MODE_3DRP 3
45 static const unsigned char tmdc_byte_a[16] = { 0, 1, 3, 4, 6, 7 };
83 { 1, "ThrustMaster Millennium 3D Inceptor", 6, 2, { 4, 2 }, { 4, 6 }, tmdc_abs, tmdc_btn_joy },
84 { 3, "ThrustMaster Rage 3D Gamepad", 2, 0, { 8, 2 }, { 0, 0 }, tmdc_abs, tmdc_btn_pad },
131 int i[2], j[2], t[2], p, k; in tmdc_read_packet() local
135 for (k = 0; k < 2; k++) { in tmdc_read_packet()
136 t[k] = gameport_time(gameport, TMDC_MAX_START); in tmdc_read_packet()
137 i[k] = j[k] = 0; in tmdc_read_packet()
149 for (k = 0, v = w, u = x; k < 2; k++, v >>= 2, u >>= 2) { in tmdc_read_packet()
151 if (t[k] <= 0 || i[k] >= TMDC_MAX_LENGTH) continue; in tmdc_read_packet()
152 t[k] = p; in tmdc_read_packet()
153 if (j[k] == 0) { /* Start bit */ in tmdc_read_packet()
154 if (~v & 1) t[k] = 0; in tmdc_read_packet()
155 data[k][i[k]] = 0; j[k]++; continue; in tmdc_read_packet()
157 if (j[k] == 9) { /* Stop bit */ in tmdc_read_packet()
158 if (v & 1) t[k] = 0; in tmdc_read_packet()
159 j[k] = 0; i[k]++; continue; in tmdc_read_packet()
161 data[k][i[k]] |= (~v & 1) << (j[k]++ - 1); /* Data bit */ in tmdc_read_packet()
163 t[k]--; in tmdc_read_packet()
174 int i, k, l; in tmdc_parse_packet() local
191 input_report_abs(port->dev, ABS_HAT0X, ((data[i] >> 3) & 1) - ((data[i] >> 1) & 1)); in tmdc_parse_packet()
197 i = tmdc_byte_a[3]; in tmdc_parse_packet()
204 for (k = l = 0; k < 4; k++) { in tmdc_parse_packet()
205 for (i = 0; i < port->btnc[k]; i++) in tmdc_parse_packet()
207 ((data[tmdc_byte_d[k]] >> (i + port->btno[k])) & 1)); in tmdc_parse_packet()
208 l += port->btnc[k]; in tmdc_parse_packet()
296 port->absc, (data[TMDC_BYTE_DEF] & 0xf) << 3, port->mode); in tmdc_setup_port()