Lines Matching +full:3 +full:rd
45 #define BUZZ_CONTROLLER BIT(3)
83 /* PS/3 Motion controller */
122 0x95, 0x03, /* Report Count (3), * 3x Accels */
128 0x95, 0x03, /* Report Count (3), * Skip Accels 2nd frame */
132 0x95, 0x03, /* Report Count (3), * 3x Gyros */
135 0x95, 0x03, /* Report Count (3), * Skip Gyros 2nd frame */
314 * Green 3
322 [3] = BTN_TRIGGER_HAPPY3,
856 rdesc[2] == 0x09 && rdesc[3] == 0x02 && in sony_report_fixup()
879 /* Report Count (3) */ in sony_report_fixup()
890 static void sixaxis_parse_report(struct sony_sc *sc, u8 *rd, int size) in sixaxis_parse_report() argument
905 if (rd[offset] >= 0xee) { in sixaxis_parse_report()
907 battery_charging = !(rd[offset] & 0x01); in sixaxis_parse_report()
910 u8 index = rd[offset] <= 5 ? rd[offset] : 5; in sixaxis_parse_report()
926 val = ((rd[offset+1] << 8) | rd[offset]) - 511; in sixaxis_parse_report()
930 val = 511 - ((rd[offset+5] << 8) | rd[offset+4]); in sixaxis_parse_report()
933 val = 511 - ((rd[offset+3] << 8) | rd[offset+2]); in sixaxis_parse_report()
940 static void dualshock4_parse_report(struct sony_sc *sc, u8 *rd, int size) in dualshock4_parse_report() argument
955 input_report_key(sc->touchpad, BTN_LEFT, rd[offset+2] & 0x2); in dualshock4_parse_report()
971 if (rd[0] == 17) { in dualshock4_parse_report()
975 input_report_abs(input_dev, ABS_X, rd[offset]); in dualshock4_parse_report()
976 input_report_abs(input_dev, ABS_Y, rd[offset+1]); in dualshock4_parse_report()
977 input_report_abs(input_dev, ABS_RX, rd[offset+2]); in dualshock4_parse_report()
978 input_report_abs(input_dev, ABS_RY, rd[offset+3]); in dualshock4_parse_report()
980 value = rd[offset+4] & 0xf; in dualshock4_parse_report()
986 input_report_key(input_dev, BTN_WEST, rd[offset+4] & 0x10); in dualshock4_parse_report()
987 input_report_key(input_dev, BTN_SOUTH, rd[offset+4] & 0x20); in dualshock4_parse_report()
988 input_report_key(input_dev, BTN_EAST, rd[offset+4] & 0x40); in dualshock4_parse_report()
989 input_report_key(input_dev, BTN_NORTH, rd[offset+4] & 0x80); in dualshock4_parse_report()
991 input_report_key(input_dev, BTN_TL, rd[offset+5] & 0x1); in dualshock4_parse_report()
992 input_report_key(input_dev, BTN_TR, rd[offset+5] & 0x2); in dualshock4_parse_report()
993 input_report_key(input_dev, BTN_TL2, rd[offset+5] & 0x4); in dualshock4_parse_report()
994 input_report_key(input_dev, BTN_TR2, rd[offset+5] & 0x8); in dualshock4_parse_report()
995 input_report_key(input_dev, BTN_SELECT, rd[offset+5] & 0x10); in dualshock4_parse_report()
996 input_report_key(input_dev, BTN_START, rd[offset+5] & 0x20); in dualshock4_parse_report()
997 input_report_key(input_dev, BTN_THUMBL, rd[offset+5] & 0x40); in dualshock4_parse_report()
998 input_report_key(input_dev, BTN_THUMBR, rd[offset+5] & 0x80); in dualshock4_parse_report()
1000 input_report_key(input_dev, BTN_MODE, rd[offset+6] & 0x1); in dualshock4_parse_report()
1002 input_report_abs(input_dev, ABS_Z, rd[offset+7]); in dualshock4_parse_report()
1003 input_report_abs(input_dev, ABS_RZ, rd[offset+8]); in dualshock4_parse_report()
1010 timestamp = get_unaligned_le16(&rd[offset]); in dualshock4_parse_report()
1012 sc->timestamp_us = ((unsigned int)timestamp * 16) / 3; in dualshock4_parse_report()
1021 sc->timestamp_us += (delta * 16) / 3; in dualshock4_parse_report()
1029 int raw_data = (short)((rd[offset+1] << 8) | rd[offset]); in dualshock4_parse_report()
1051 cable_state = (rd[offset] >> 4) & 0x01; in dualshock4_parse_report()
1052 battery_capacity = rd[offset] & 0x0F; in dualshock4_parse_report()
1084 max_touch_data = (sc->quirks & DUALSHOCK4_CONTROLLER_BT) ? 4 : 3; in dualshock4_parse_report()
1085 if (rd[offset] > 0 && rd[offset] <= max_touch_data) in dualshock4_parse_report()
1086 num_touch_data = rd[offset]; in dualshock4_parse_report()
1099 * The next 3 bytes are two 12 bit touch coordinates, X and Y. in dualshock4_parse_report()
1107 x = rd[offset+1] | ((rd[offset+2] & 0xF) << 8); in dualshock4_parse_report()
1108 y = ((rd[offset+2] & 0xF0) >> 4) | (rd[offset+3] << 4); in dualshock4_parse_report()
1110 active = !(rd[offset] >> 7); in dualshock4_parse_report()
1126 static void nsg_mrxu_parse_report(struct sony_sc *sc, u8 *rd, int size) in nsg_mrxu_parse_report() argument
1141 * The next 3 bytes are two 12 bit X/Y coordinates for the first touch. in nsg_mrxu_parse_report()
1151 input_report_key(sc->touchpad, BTN_LEFT, rd[offset] & 0x0F); in nsg_mrxu_parse_report()
1152 active = (rd[offset] >> 4); in nsg_mrxu_parse_report()
1153 relx = (s8) rd[offset+5]; in nsg_mrxu_parse_report()
1154 rely = ((s8) rd[offset+10]) * -1; in nsg_mrxu_parse_report()
1162 x = rd[offset] | ((rd[offset+1] & 0x0F) << 8); in nsg_mrxu_parse_report()
1163 y = ((rd[offset+1] & 0xF0) >> 4) | (rd[offset+2] << 4); in nsg_mrxu_parse_report()
1169 contactx = rd[offset+3] & 0x0F; in nsg_mrxu_parse_report()
1170 contacty = rd[offset+3] >> 4; in nsg_mrxu_parse_report()
1201 u8 *rd, int size) in sony_raw_event() argument
1209 if ((sc->quirks & SIXAXIS_CONTROLLER) && rd[0] == 0x01 && size == 49) { in sony_raw_event()
1218 if (rd[1] == 0xff) in sony_raw_event()
1221 swap(rd[41], rd[42]); in sony_raw_event()
1222 swap(rd[43], rd[44]); in sony_raw_event()
1223 swap(rd[45], rd[46]); in sony_raw_event()
1224 swap(rd[47], rd[48]); in sony_raw_event()
1226 sixaxis_parse_report(sc, rd, size); in sony_raw_event()
1227 } else if ((sc->quirks & MOTION_CONTROLLER_BT) && rd[0] == 0x01 && size == 49) { in sony_raw_event()
1228 sixaxis_parse_report(sc, rd, size); in sony_raw_event()
1229 } else if ((sc->quirks & NAVIGATION_CONTROLLER) && rd[0] == 0x01 && in sony_raw_event()
1231 sixaxis_parse_report(sc, rd, size); in sony_raw_event()
1232 } else if ((sc->quirks & DUALSHOCK4_CONTROLLER_USB) && rd[0] == 0x01 && in sony_raw_event()
1234 dualshock4_parse_report(sc, rd, size); in sony_raw_event()
1235 } else if (((sc->quirks & DUALSHOCK4_CONTROLLER_BT) && rd[0] == 0x11 && in sony_raw_event()
1243 crc = ~crc32_le(crc, rd, DS4_INPUT_REPORT_0x11_SIZE-4); in sony_raw_event()
1244 report_crc = get_unaligned_le32(&rd[DS4_INPUT_REPORT_0x11_SIZE-4]); in sony_raw_event()
1251 dualshock4_parse_report(sc, rd, size); in sony_raw_event()
1252 } else if ((sc->quirks & DUALSHOCK4_DONGLE) && rd[0] == 0x01 && in sony_raw_event()
1262 bool connected = (rd[31] & 0x04) ? false : true; in sony_raw_event()
1307 dualshock4_parse_report(sc, rd, size); in sony_raw_event()
1309 } else if ((sc->quirks & NSG_MRXU_REMOTE) && rd[0] == 0x02) { in sony_raw_event()
1310 nsg_mrxu_parse_report(sc, rd, size); in sony_raw_event()
1542 * start rumbling non-stop, so skip step 3 for these controllers. in sixaxis_set_operational_usb()
1549 hid_info(hdev, "can't set operational mode: step 3, ignoring\n"); in sixaxis_set_operational_usb()
1620 for (retries = 0; retries < 3; retries++) { in dualshock4_get_calibration_data()
1649 gyro_yaw_bias = get_unaligned_le16(&buf[3]); in dualshock4_get_calibration_data()
1699 sc->ds4_calib_data[3].abs_code = ABS_X; in dualshock4_get_calibration_data()
1700 sc->ds4_calib_data[3].bias = acc_x_plus - range_2g / 2; in dualshock4_get_calibration_data()
1701 sc->ds4_calib_data[3].sens_numer = 2*DS4_ACC_RES_PER_G; in dualshock4_get_calibration_data()
1702 sc->ds4_calib_data[3].sens_denom = range_2g; in dualshock4_get_calibration_data()
1802 static const u8 color_code[7][3] = { in dualshock4_set_leds_from_id()
1837 value[3] = sc->led_state[2] ? 0xff : 0x00; in buzz_set_leds()
1838 value[4] = sc->led_state[3] ? 0xff : 0x00; in buzz_set_leds()
1991 sc->led_state[3] = 1; in sony_leds_init()
1993 memset(max_brightness, 255, 3); in sony_leds_init()
1994 use_hw_blink[3] = 1; in sony_leds_init()
1999 sc->led_count = 3; in sony_leds_init()
2000 memset(max_brightness, 255, 3); in sony_leds_init()
2098 report->leds_bitmap |= sc->led_state[2] << 3; in sixaxis_send_output_report()
2099 report->leds_bitmap |= sc->led_state[3] << 4; in sixaxis_send_output_report()
2101 /* Set flag for all leds off, required for 3rd party INTEC controller */ in sixaxis_send_output_report()
2108 * Index 0 = LED 4, index 1 = LED 3, etc... in sixaxis_send_output_report()
2116 report->led[3 - n].duty_off = sc->led_delay_off[n]; in sixaxis_send_output_report()
2117 report->led[3 - n].duty_on = sc->led_delay_on[n]; in sixaxis_send_output_report()
2155 buf[3] = 0x07; /* blink + LEDs + motor */ in dualshock4_send_output_report()
2166 /* LED 3 is the global control */ in dualshock4_send_output_report()
2167 if (sc->led_state[3]) { in dualshock4_send_output_report()
2172 offset += 3; in dualshock4_send_output_report()
2176 buf[offset++] = sc->led_delay_on[3]; in dualshock4_send_output_report()
2177 buf[offset++] = sc->led_delay_off[3]; in dualshock4_send_output_report()
2448 &sc->mac_address[5], &sc->mac_address[4], &sc->mac_address[3], in sony_get_bt_devaddr()