Lines Matching +full:3 +full:rd
50 #define BUZZ_CONTROLLER BIT(3)
111 /* PS/3 Motion controller */
150 0x95, 0x03, /* Report Count (3), * 3x Accels */
156 0x95, 0x03, /* Report Count (3), * Skip Accels 2nd frame */
160 0x95, 0x03, /* Report Count (3), * 3x Gyros */
163 0x95, 0x03, /* Report Count (3), * Skip Gyros 2nd frame */
342 * Green 3
350 [3] = BTN_TRIGGER_HAPPY3,
955 rdesc[2] == 0x09 && rdesc[3] == 0x02 && in sony_report_fixup()
978 /* Report Count (3) */ in sony_report_fixup()
989 static void sixaxis_parse_report(struct sony_sc *sc, u8 *rd, int size) in sixaxis_parse_report() argument
1005 if (rd[offset] >= 0xee) { in sixaxis_parse_report()
1007 battery_status = (rd[offset] & 0x01) ? POWER_SUPPLY_STATUS_FULL : POWER_SUPPLY_STATUS_CHARGING; in sixaxis_parse_report()
1009 u8 index = rd[offset] <= 5 ? rd[offset] : 5; in sixaxis_parse_report()
1023 val = ((rd[offset+1] << 8) | rd[offset]) - 511; in sixaxis_parse_report()
1027 val = 511 - ((rd[offset+5] << 8) | rd[offset+4]); in sixaxis_parse_report()
1030 val = 511 - ((rd[offset+3] << 8) | rd[offset+2]); in sixaxis_parse_report()
1037 static void dualshock4_parse_report(struct sony_sc *sc, u8 *rd, int size) in dualshock4_parse_report() argument
1053 input_report_key(sc->touchpad, BTN_LEFT, rd[offset+2] & 0x2); in dualshock4_parse_report()
1069 if (rd[0] == 17) { in dualshock4_parse_report()
1073 input_report_abs(input_dev, ABS_X, rd[offset]); in dualshock4_parse_report()
1074 input_report_abs(input_dev, ABS_Y, rd[offset+1]); in dualshock4_parse_report()
1075 input_report_abs(input_dev, ABS_RX, rd[offset+2]); in dualshock4_parse_report()
1076 input_report_abs(input_dev, ABS_RY, rd[offset+3]); in dualshock4_parse_report()
1078 value = rd[offset+4] & 0xf; in dualshock4_parse_report()
1084 input_report_key(input_dev, BTN_WEST, rd[offset+4] & 0x10); in dualshock4_parse_report()
1085 input_report_key(input_dev, BTN_SOUTH, rd[offset+4] & 0x20); in dualshock4_parse_report()
1086 input_report_key(input_dev, BTN_EAST, rd[offset+4] & 0x40); in dualshock4_parse_report()
1087 input_report_key(input_dev, BTN_NORTH, rd[offset+4] & 0x80); in dualshock4_parse_report()
1089 input_report_key(input_dev, BTN_TL, rd[offset+5] & 0x1); in dualshock4_parse_report()
1090 input_report_key(input_dev, BTN_TR, rd[offset+5] & 0x2); in dualshock4_parse_report()
1091 input_report_key(input_dev, BTN_TL2, rd[offset+5] & 0x4); in dualshock4_parse_report()
1092 input_report_key(input_dev, BTN_TR2, rd[offset+5] & 0x8); in dualshock4_parse_report()
1093 input_report_key(input_dev, BTN_SELECT, rd[offset+5] & 0x10); in dualshock4_parse_report()
1094 input_report_key(input_dev, BTN_START, rd[offset+5] & 0x20); in dualshock4_parse_report()
1095 input_report_key(input_dev, BTN_THUMBL, rd[offset+5] & 0x40); in dualshock4_parse_report()
1096 input_report_key(input_dev, BTN_THUMBR, rd[offset+5] & 0x80); in dualshock4_parse_report()
1098 input_report_key(input_dev, BTN_MODE, rd[offset+6] & 0x1); in dualshock4_parse_report()
1100 input_report_abs(input_dev, ABS_Z, rd[offset+7]); in dualshock4_parse_report()
1101 input_report_abs(input_dev, ABS_RZ, rd[offset+8]); in dualshock4_parse_report()
1108 timestamp = get_unaligned_le16(&rd[offset]); in dualshock4_parse_report()
1110 sc->timestamp_us = ((unsigned int)timestamp * 16) / 3; in dualshock4_parse_report()
1119 sc->timestamp_us += (delta * 16) / 3; in dualshock4_parse_report()
1127 int raw_data = (short)((rd[offset+1] << 8) | rd[offset]); in dualshock4_parse_report()
1149 cable_state = (rd[offset] >> 4) & 0x01; in dualshock4_parse_report()
1162 u8 battery_data = rd[offset] & 0xf; in dualshock4_parse_report()
1183 u8 battery_data = rd[offset] & 0xf; in dualshock4_parse_report()
1205 max_touch_data = (sc->quirks & DUALSHOCK4_CONTROLLER_BT) ? 4 : 3; in dualshock4_parse_report()
1206 if (rd[offset] > 0 && rd[offset] <= max_touch_data) in dualshock4_parse_report()
1207 num_touch_data = rd[offset]; in dualshock4_parse_report()
1220 * The next 3 bytes are two 12 bit touch coordinates, X and Y. in dualshock4_parse_report()
1228 x = rd[offset+1] | ((rd[offset+2] & 0xF) << 8); in dualshock4_parse_report()
1229 y = ((rd[offset+2] & 0xF0) >> 4) | (rd[offset+3] << 4); in dualshock4_parse_report()
1231 active = !(rd[offset] >> 7); in dualshock4_parse_report()
1247 static void nsg_mrxu_parse_report(struct sony_sc *sc, u8 *rd, int size) in nsg_mrxu_parse_report() argument
1262 * The next 3 bytes are two 12 bit X/Y coordinates for the first touch. in nsg_mrxu_parse_report()
1272 input_report_key(sc->touchpad, BTN_LEFT, rd[offset] & 0x0F); in nsg_mrxu_parse_report()
1273 active = (rd[offset] >> 4); in nsg_mrxu_parse_report()
1274 relx = (s8) rd[offset+5]; in nsg_mrxu_parse_report()
1275 rely = ((s8) rd[offset+10]) * -1; in nsg_mrxu_parse_report()
1283 x = rd[offset] | ((rd[offset+1] & 0x0F) << 8); in nsg_mrxu_parse_report()
1284 y = ((rd[offset+1] & 0xF0) >> 4) | (rd[offset+2] << 4); in nsg_mrxu_parse_report()
1290 contactx = rd[offset+3] & 0x0F; in nsg_mrxu_parse_report()
1291 contacty = rd[offset+3] >> 4; in nsg_mrxu_parse_report()
1322 u8 *rd, int size) in sony_raw_event() argument
1330 if ((sc->quirks & SIXAXIS_CONTROLLER) && rd[0] == 0x01 && size == 49) { in sony_raw_event()
1339 if (rd[1] == 0xff) in sony_raw_event()
1342 swap(rd[41], rd[42]); in sony_raw_event()
1343 swap(rd[43], rd[44]); in sony_raw_event()
1344 swap(rd[45], rd[46]); in sony_raw_event()
1345 swap(rd[47], rd[48]); in sony_raw_event()
1347 sixaxis_parse_report(sc, rd, size); in sony_raw_event()
1348 } else if ((sc->quirks & MOTION_CONTROLLER_BT) && rd[0] == 0x01 && size == 49) { in sony_raw_event()
1349 sixaxis_parse_report(sc, rd, size); in sony_raw_event()
1350 } else if ((sc->quirks & NAVIGATION_CONTROLLER) && rd[0] == 0x01 && in sony_raw_event()
1352 sixaxis_parse_report(sc, rd, size); in sony_raw_event()
1353 } else if ((sc->quirks & DUALSHOCK4_CONTROLLER_USB) && rd[0] == 0x01 && in sony_raw_event()
1355 dualshock4_parse_report(sc, rd, size); in sony_raw_event()
1356 } else if (((sc->quirks & DUALSHOCK4_CONTROLLER_BT) && rd[0] == 0x11 && in sony_raw_event()
1364 crc = ~crc32_le(crc, rd, DS4_INPUT_REPORT_0x11_SIZE-4); in sony_raw_event()
1365 report_crc = get_unaligned_le32(&rd[DS4_INPUT_REPORT_0x11_SIZE-4]); in sony_raw_event()
1372 dualshock4_parse_report(sc, rd, size); in sony_raw_event()
1373 } else if ((sc->quirks & DUALSHOCK4_DONGLE) && rd[0] == 0x01 && in sony_raw_event()
1383 bool connected = (rd[31] & 0x04) ? false : true; in sony_raw_event()
1428 dualshock4_parse_report(sc, rd, size); in sony_raw_event()
1430 } else if ((sc->quirks & NSG_MRXU_REMOTE) && rd[0] == 0x02) { in sony_raw_event()
1431 nsg_mrxu_parse_report(sc, rd, size); in sony_raw_event()
1665 * start rumbling non-stop, so skip step 3 for these controllers. in sixaxis_set_operational_usb()
1672 hid_info(hdev, "can't set operational mode: step 3, ignoring\n"); in sixaxis_set_operational_usb()
1735 for (retries = 0; retries < 3; retries++) { in dualshock4_get_calibration_data()
1765 for (retries = 0; retries < 3; retries++) { in dualshock4_get_calibration_data()
1794 gyro_yaw_bias = get_unaligned_le16(&buf[3]); in dualshock4_get_calibration_data()
1844 sc->ds4_calib_data[3].abs_code = ABS_X; in dualshock4_get_calibration_data()
1845 sc->ds4_calib_data[3].bias = acc_x_plus - range_2g / 2; in dualshock4_get_calibration_data()
1846 sc->ds4_calib_data[3].sens_numer = 2*DS4_ACC_RES_PER_G; in dualshock4_get_calibration_data()
1847 sc->ds4_calib_data[3].sens_denom = range_2g; in dualshock4_get_calibration_data()
1947 static const u8 color_code[7][3] = { in dualshock4_set_leds_from_id()
1982 value[3] = sc->led_state[2] ? 0xff : 0x00; in buzz_set_leds()
1983 value[4] = sc->led_state[3] ? 0xff : 0x00; in buzz_set_leds()
2136 sc->led_state[3] = 1; in sony_leds_init()
2138 memset(max_brightness, 255, 3); in sony_leds_init()
2139 use_hw_blink[3] = 1; in sony_leds_init()
2144 sc->led_count = 3; in sony_leds_init()
2145 memset(max_brightness, 255, 3); in sony_leds_init()
2243 report->leds_bitmap |= sc->led_state[2] << 3; in sixaxis_send_output_report()
2244 report->leds_bitmap |= sc->led_state[3] << 4; in sixaxis_send_output_report()
2246 /* Set flag for all leds off, required for 3rd party INTEC controller */ in sixaxis_send_output_report()
2253 * Index 0 = LED 4, index 1 = LED 3, etc... in sixaxis_send_output_report()
2261 report->led[3 - n].duty_off = sc->led_delay_off[n]; in sixaxis_send_output_report()
2262 report->led[3 - n].duty_on = sc->led_delay_on[n]; in sixaxis_send_output_report()
2300 buf[3] = 0x07; /* blink + LEDs + motor */ in dualshock4_send_output_report()
2311 /* LED 3 is the global control */ in dualshock4_send_output_report()
2312 if (sc->led_state[3]) { in dualshock4_send_output_report()
2317 offset += 3; in dualshock4_send_output_report()
2321 buf[offset++] = sc->led_delay_on[3]; in dualshock4_send_output_report()
2322 buf[offset++] = sc->led_delay_off[3]; in dualshock4_send_output_report()
2587 &sc->mac_address[5], &sc->mac_address[4], &sc->mac_address[3], in sony_get_bt_devaddr()