Lines Matching +full:0 +full:x1c01

51 #define JC_OUTPUT_RUMBLE_AND_SUBCMD	 0x01
52 #define JC_OUTPUT_FW_UPDATE_PKT 0x03
53 #define JC_OUTPUT_RUMBLE_ONLY 0x10
54 #define JC_OUTPUT_MCU_DATA 0x11
55 #define JC_OUTPUT_USB_CMD 0x80
58 #define JC_SUBCMD_STATE 0x00
59 #define JC_SUBCMD_MANUAL_BT_PAIRING 0x01
60 #define JC_SUBCMD_REQ_DEV_INFO 0x02
61 #define JC_SUBCMD_SET_REPORT_MODE 0x03
62 #define JC_SUBCMD_TRIGGERS_ELAPSED 0x04
63 #define JC_SUBCMD_GET_PAGE_LIST_STATE 0x05
64 #define JC_SUBCMD_SET_HCI_STATE 0x06
65 #define JC_SUBCMD_RESET_PAIRING_INFO 0x07
66 #define JC_SUBCMD_LOW_POWER_MODE 0x08
67 #define JC_SUBCMD_SPI_FLASH_READ 0x10
68 #define JC_SUBCMD_SPI_FLASH_WRITE 0x11
69 #define JC_SUBCMD_RESET_MCU 0x20
70 #define JC_SUBCMD_SET_MCU_CONFIG 0x21
71 #define JC_SUBCMD_SET_MCU_STATE 0x22
72 #define JC_SUBCMD_SET_PLAYER_LIGHTS 0x30
73 #define JC_SUBCMD_GET_PLAYER_LIGHTS 0x31
74 #define JC_SUBCMD_SET_HOME_LIGHT 0x38
75 #define JC_SUBCMD_ENABLE_IMU 0x40
76 #define JC_SUBCMD_SET_IMU_SENSITIVITY 0x41
77 #define JC_SUBCMD_WRITE_IMU_REG 0x42
78 #define JC_SUBCMD_READ_IMU_REG 0x43
79 #define JC_SUBCMD_ENABLE_VIBRATION 0x48
80 #define JC_SUBCMD_GET_REGULATED_VOLTAGE 0x50
83 #define JC_INPUT_BUTTON_EVENT 0x3F
84 #define JC_INPUT_SUBCMD_REPLY 0x21
85 #define JC_INPUT_IMU_DATA 0x30
86 #define JC_INPUT_MCU_DATA 0x31
87 #define JC_INPUT_USB_RESPONSE 0x81
90 #define JC_FEATURE_LAST_SUBCMD 0x02
91 #define JC_FEATURE_OTA_FW_UPGRADE 0x70
92 #define JC_FEATURE_SETUP_MEM_READ 0x71
93 #define JC_FEATURE_MEM_READ 0x72
94 #define JC_FEATURE_ERASE_MEM_SECTOR 0x73
95 #define JC_FEATURE_MEM_WRITE 0x74
96 #define JC_FEATURE_LAUNCH 0x75
99 #define JC_USB_CMD_CONN_STATUS 0x01
100 #define JC_USB_CMD_HANDSHAKE 0x02
101 #define JC_USB_CMD_BAUDRATE_3M 0x03
102 #define JC_USB_CMD_NO_TIMEOUT 0x04
103 #define JC_USB_CMD_EN_TIMEOUT 0x05
104 #define JC_USB_RESET 0x06
105 #define JC_USB_PRE_HANDSHAKE 0x91
106 #define JC_USB_SEND_UART 0x92
109 #define JC_CAL_USR_MAGIC_0 0xB2
110 #define JC_CAL_USR_MAGIC_1 0xA1
114 #define JC_CAL_USR_LEFT_MAGIC_ADDR 0x8010
115 #define JC_CAL_USR_LEFT_DATA_ADDR 0x8012
116 #define JC_CAL_USR_LEFT_DATA_END 0x801A
117 #define JC_CAL_USR_RIGHT_MAGIC_ADDR 0x801B
118 #define JC_CAL_USR_RIGHT_DATA_ADDR 0x801D
123 #define JC_CAL_FCT_DATA_LEFT_ADDR 0x603d
124 #define JC_CAL_FCT_DATA_RIGHT_ADDR 0x6046
127 #define JC_IMU_CAL_FCT_DATA_ADDR 0x6020
128 #define JC_IMU_CAL_FCT_DATA_END 0x6037
132 #define JC_IMU_CAL_USR_MAGIC_ADDR 0x8026
133 #define JC_IMU_CAL_USR_DATA_ADDR 0x8028
142 #define JC_DPAD_FUZZ 0
143 #define JC_DPAD_FLAT 0
162 #define JC_IMU_ACCEL_FLAT 0
184 #define JC_IMU_GYRO_FLAT 0
206 { 0x0000, 0x01, 41 }, { 0x0000, 0x02, 42 }, { 0x0000, 0x03, 43 },
207 { 0x0000, 0x04, 44 }, { 0x0000, 0x05, 45 }, { 0x0000, 0x06, 46 },
208 { 0x0000, 0x07, 47 }, { 0x0000, 0x08, 48 }, { 0x0000, 0x09, 49 },
209 { 0x0000, 0x0A, 50 }, { 0x0000, 0x0B, 51 }, { 0x0000, 0x0C, 52 },
210 { 0x0000, 0x0D, 53 }, { 0x0000, 0x0E, 54 }, { 0x0000, 0x0F, 55 },
211 { 0x0000, 0x10, 57 }, { 0x0000, 0x11, 58 }, { 0x0000, 0x12, 59 },
212 { 0x0000, 0x13, 60 }, { 0x0000, 0x14, 62 }, { 0x0000, 0x15, 63 },
213 { 0x0000, 0x16, 64 }, { 0x0000, 0x17, 66 }, { 0x0000, 0x18, 67 },
214 { 0x0000, 0x19, 69 }, { 0x0000, 0x1A, 70 }, { 0x0000, 0x1B, 72 },
215 { 0x0000, 0x1C, 73 }, { 0x0000, 0x1D, 75 }, { 0x0000, 0x1e, 77 },
216 { 0x0000, 0x1f, 78 }, { 0x0000, 0x20, 80 }, { 0x0400, 0x21, 82 },
217 { 0x0800, 0x22, 84 }, { 0x0c00, 0x23, 85 }, { 0x1000, 0x24, 87 },
218 { 0x1400, 0x25, 89 }, { 0x1800, 0x26, 91 }, { 0x1c00, 0x27, 93 },
219 { 0x2000, 0x28, 95 }, { 0x2400, 0x29, 97 }, { 0x2800, 0x2a, 99 },
220 { 0x2c00, 0x2b, 102 }, { 0x3000, 0x2c, 104 }, { 0x3400, 0x2d, 106 },
221 { 0x3800, 0x2e, 108 }, { 0x3c00, 0x2f, 111 }, { 0x4000, 0x30, 113 },
222 { 0x4400, 0x31, 116 }, { 0x4800, 0x32, 118 }, { 0x4c00, 0x33, 121 },
223 { 0x5000, 0x34, 123 }, { 0x5400, 0x35, 126 }, { 0x5800, 0x36, 129 },
224 { 0x5c00, 0x37, 132 }, { 0x6000, 0x38, 135 }, { 0x6400, 0x39, 137 },
225 { 0x6800, 0x3a, 141 }, { 0x6c00, 0x3b, 144 }, { 0x7000, 0x3c, 147 },
226 { 0x7400, 0x3d, 150 }, { 0x7800, 0x3e, 153 }, { 0x7c00, 0x3f, 157 },
227 { 0x8000, 0x40, 160 }, { 0x8400, 0x41, 164 }, { 0x8800, 0x42, 167 },
228 { 0x8c00, 0x43, 171 }, { 0x9000, 0x44, 174 }, { 0x9400, 0x45, 178 },
229 { 0x9800, 0x46, 182 }, { 0x9c00, 0x47, 186 }, { 0xa000, 0x48, 190 },
230 { 0xa400, 0x49, 194 }, { 0xa800, 0x4a, 199 }, { 0xac00, 0x4b, 203 },
231 { 0xb000, 0x4c, 207 }, { 0xb400, 0x4d, 212 }, { 0xb800, 0x4e, 217 },
232 { 0xbc00, 0x4f, 221 }, { 0xc000, 0x50, 226 }, { 0xc400, 0x51, 231 },
233 { 0xc800, 0x52, 236 }, { 0xcc00, 0x53, 241 }, { 0xd000, 0x54, 247 },
234 { 0xd400, 0x55, 252 }, { 0xd800, 0x56, 258 }, { 0xdc00, 0x57, 263 },
235 { 0xe000, 0x58, 269 }, { 0xe400, 0x59, 275 }, { 0xe800, 0x5a, 281 },
236 { 0xec00, 0x5b, 287 }, { 0xf000, 0x5c, 293 }, { 0xf400, 0x5d, 300 },
237 { 0xf800, 0x5e, 306 }, { 0xfc00, 0x5f, 313 }, { 0x0001, 0x60, 320 },
238 { 0x0401, 0x61, 327 }, { 0x0801, 0x62, 334 }, { 0x0c01, 0x63, 341 },
239 { 0x1001, 0x64, 349 }, { 0x1401, 0x65, 357 }, { 0x1801, 0x66, 364 },
240 { 0x1c01, 0x67, 372 }, { 0x2001, 0x68, 381 }, { 0x2401, 0x69, 389 },
241 { 0x2801, 0x6a, 397 }, { 0x2c01, 0x6b, 406 }, { 0x3001, 0x6c, 415 },
242 { 0x3401, 0x6d, 424 }, { 0x3801, 0x6e, 433 }, { 0x3c01, 0x6f, 443 },
243 { 0x4001, 0x70, 453 }, { 0x4401, 0x71, 462 }, { 0x4801, 0x72, 473 },
244 { 0x4c01, 0x73, 483 }, { 0x5001, 0x74, 494 }, { 0x5401, 0x75, 504 },
245 { 0x5801, 0x76, 515 }, { 0x5c01, 0x77, 527 }, { 0x6001, 0x78, 538 },
246 { 0x6401, 0x79, 550 }, { 0x6801, 0x7a, 562 }, { 0x6c01, 0x7b, 574 },
247 { 0x7001, 0x7c, 587 }, { 0x7401, 0x7d, 600 }, { 0x7801, 0x7e, 613 },
248 { 0x7c01, 0x7f, 626 }, { 0x8001, 0x00, 640 }, { 0x8401, 0x00, 654 },
249 { 0x8801, 0x00, 668 }, { 0x8c01, 0x00, 683 }, { 0x9001, 0x00, 698 },
250 { 0x9401, 0x00, 713 }, { 0x9801, 0x00, 729 }, { 0x9c01, 0x00, 745 },
251 { 0xa001, 0x00, 761 }, { 0xa401, 0x00, 778 }, { 0xa801, 0x00, 795 },
252 { 0xac01, 0x00, 812 }, { 0xb001, 0x00, 830 }, { 0xb401, 0x00, 848 },
253 { 0xb801, 0x00, 867 }, { 0xbc01, 0x00, 886 }, { 0xc001, 0x00, 905 },
254 { 0xc401, 0x00, 925 }, { 0xc801, 0x00, 945 }, { 0xcc01, 0x00, 966 },
255 { 0xd001, 0x00, 987 }, { 0xd401, 0x00, 1009 }, { 0xd801, 0x00, 1031 },
256 { 0xdc01, 0x00, 1053 }, { 0xe001, 0x00, 1076 }, { 0xe401, 0x00, 1100 },
257 { 0xe801, 0x00, 1124 }, { 0xec01, 0x00, 1149 }, { 0xf001, 0x00, 1174 },
258 { 0xf401, 0x00, 1199 }, { 0xf801, 0x00, 1226 }, { 0xfc01, 0x00, 1253 }
264 { 0x00, 0x0040, 0 },
265 { 0x02, 0x8040, 10 }, { 0x04, 0x0041, 12 }, { 0x06, 0x8041, 14 },
266 { 0x08, 0x0042, 17 }, { 0x0a, 0x8042, 20 }, { 0x0c, 0x0043, 24 },
267 { 0x0e, 0x8043, 28 }, { 0x10, 0x0044, 33 }, { 0x12, 0x8044, 40 },
268 { 0x14, 0x0045, 47 }, { 0x16, 0x8045, 56 }, { 0x18, 0x0046, 67 },
269 { 0x1a, 0x8046, 80 }, { 0x1c, 0x0047, 95 }, { 0x1e, 0x8047, 112 },
270 { 0x20, 0x0048, 117 }, { 0x22, 0x8048, 123 }, { 0x24, 0x0049, 128 },
271 { 0x26, 0x8049, 134 }, { 0x28, 0x004a, 140 }, { 0x2a, 0x804a, 146 },
272 { 0x2c, 0x004b, 152 }, { 0x2e, 0x804b, 159 }, { 0x30, 0x004c, 166 },
273 { 0x32, 0x804c, 173 }, { 0x34, 0x004d, 181 }, { 0x36, 0x804d, 189 },
274 { 0x38, 0x004e, 198 }, { 0x3a, 0x804e, 206 }, { 0x3c, 0x004f, 215 },
275 { 0x3e, 0x804f, 225 }, { 0x40, 0x0050, 230 }, { 0x42, 0x8050, 235 },
276 { 0x44, 0x0051, 240 }, { 0x46, 0x8051, 245 }, { 0x48, 0x0052, 251 },
277 { 0x4a, 0x8052, 256 }, { 0x4c, 0x0053, 262 }, { 0x4e, 0x8053, 268 },
278 { 0x50, 0x0054, 273 }, { 0x52, 0x8054, 279 }, { 0x54, 0x0055, 286 },
279 { 0x56, 0x8055, 292 }, { 0x58, 0x0056, 298 }, { 0x5a, 0x8056, 305 },
280 { 0x5c, 0x0057, 311 }, { 0x5e, 0x8057, 318 }, { 0x60, 0x0058, 325 },
281 { 0x62, 0x8058, 332 }, { 0x64, 0x0059, 340 }, { 0x66, 0x8059, 347 },
282 { 0x68, 0x005a, 355 }, { 0x6a, 0x805a, 362 }, { 0x6c, 0x005b, 370 },
283 { 0x6e, 0x805b, 378 }, { 0x70, 0x005c, 387 }, { 0x72, 0x805c, 395 },
284 { 0x74, 0x005d, 404 }, { 0x76, 0x805d, 413 }, { 0x78, 0x005e, 422 },
285 { 0x7a, 0x805e, 431 }, { 0x7c, 0x005f, 440 }, { 0x7e, 0x805f, 450 },
286 { 0x80, 0x0060, 460 }, { 0x82, 0x8060, 470 }, { 0x84, 0x0061, 480 },
287 { 0x86, 0x8061, 491 }, { 0x88, 0x0062, 501 }, { 0x8a, 0x8062, 512 },
288 { 0x8c, 0x0063, 524 }, { 0x8e, 0x8063, 535 }, { 0x90, 0x0064, 547 },
289 { 0x92, 0x8064, 559 }, { 0x94, 0x0065, 571 }, { 0x96, 0x8065, 584 },
290 { 0x98, 0x0066, 596 }, { 0x9a, 0x8066, 609 }, { 0x9c, 0x0067, 623 },
291 { 0x9e, 0x8067, 636 }, { 0xa0, 0x0068, 650 }, { 0xa2, 0x8068, 665 },
292 { 0xa4, 0x0069, 679 }, { 0xa6, 0x8069, 694 }, { 0xa8, 0x006a, 709 },
293 { 0xaa, 0x806a, 725 }, { 0xac, 0x006b, 741 }, { 0xae, 0x806b, 757 },
294 { 0xb0, 0x006c, 773 }, { 0xb2, 0x806c, 790 }, { 0xb4, 0x006d, 808 },
295 { 0xb6, 0x806d, 825 }, { 0xb8, 0x006e, 843 }, { 0xba, 0x806e, 862 },
296 { 0xbc, 0x006f, 881 }, { 0xbe, 0x806f, 900 }, { 0xc0, 0x0070, 920 },
297 { 0xc2, 0x8070, 940 }, { 0xc4, 0x0071, 960 }, { 0xc6, 0x8071, 981 },
298 { 0xc8, 0x0072, joycon_max_rumble_amp }
315 JOYCON_CTLR_TYPE_JCL = 0x01,
316 JOYCON_CTLR_TYPE_JCR = 0x02,
317 JOYCON_CTLR_TYPE_PRO = 0x03,
318 JOYCON_CTLR_TYPE_NESL = 0x09,
319 JOYCON_CTLR_TYPE_NESR = 0x0A,
320 JOYCON_CTLR_TYPE_SNES = 0x0B,
321 JOYCON_CTLR_TYPE_GEN = 0x0D,
322 JOYCON_CTLR_TYPE_N64 = 0x0C,
340 #define JC_BTN_Y BIT(0)
507 u8 output_id; /* must be 0x01 for subcommand, 0x10 for rumble only */
515 u8 ack; /* MSB 1 for ACK, 0 for NACK */
559 { 1, 0, 0, 0 },
560 { 1, 1, 0, 0 },
561 { 1, 1, 1, 0 },
563 { 1, 0, 0, 1 },
564 { 1, 0, 1, 0 },
565 { 1, 0, 1, 1 },
566 { 0, 1, 1, 0 },
787 if (ret < 0) in __joycon_hid_send()
833 int consecutive_valid_deltas = 0; in joycon_enforce_subcmd_rate()
834 int attempts = 0; in joycon_enforce_subcmd_rate()
885 if (ret < 0) { in joycon_hid_send_sync()
886 memset(ctlr->input_buf, 0, JC_MAX_RESP_SIZE); in joycon_hid_send_sync()
899 memset(ctlr->input_buf, 0, JC_MAX_RESP_SIZE); in joycon_hid_send_sync()
902 ret = 0; in joycon_hid_send_sync()
947 if (++ctlr->subcmd_num > 0xF) in joycon_send_subcmd()
948 ctlr->subcmd_num = 0; in joycon_send_subcmd()
954 if (ret < 0) in joycon_send_subcmd()
957 ret = 0; in joycon_send_subcmd()
965 u8 buffer[sizeof(*req) + 1] = { 0 }; in joycon_set_player_leds()
969 req->data[0] = (flash << 4) | on; in joycon_set_player_leds()
978 u8 buffer[sizeof(*req) + 5] = { 0 }; in joycon_set_home_led()
984 data[0] = 0x01; in joycon_set_home_led()
987 data[3] = 0x11; in joycon_set_home_led()
988 data[4] = 0x11; in joycon_set_home_led()
999 u8 buffer[sizeof(*req) + 5] = { 0 }; in joycon_request_spi_flash_read()
1026 * returns 0 if magic val is present, 1 if not present, < 0 on error
1038 return reply[0] != JC_CAL_USR_MAGIC_0 || reply[1] != JC_CAL_USR_MAGIC_1; in joycon_check_for_cal_magic()
1060 x_max_above = hid_field_extract(ctlr->hdev, (raw_cal + 0), 0, in joycon_read_stick_calibration()
1064 cal_x->center = hid_field_extract(ctlr->hdev, (raw_cal + 3), 0, in joycon_read_stick_calibration()
1068 x_min_below = hid_field_extract(ctlr->hdev, (raw_cal + 6), 0, in joycon_read_stick_calibration()
1073 cal_x->center = hid_field_extract(ctlr->hdev, (raw_cal + 0), 0, in joycon_read_stick_calibration()
1077 x_min_below = hid_field_extract(ctlr->hdev, (raw_cal + 3), 0, in joycon_read_stick_calibration()
1081 x_max_above = hid_field_extract(ctlr->hdev, (raw_cal + 6), 0, in joycon_read_stick_calibration()
1181 return 0; in joycon_request_calibration()
1191 int i, divz = 0; in joycon_calc_imu_cal_divisors()
1193 for (i = 0; i < 3; i++) { in joycon_calc_imu_cal_divisors()
1199 if (ctlr->imu_cal_accel_divisor[i] == 0) { in joycon_calc_imu_cal_divisors()
1204 if (ctlr->imu_cal_gyro_divisor[i] == 0) { in joycon_calc_imu_cal_divisors()
1214 static const s16 DFLT_ACCEL_OFFSET /*= 0*/;
1216 static const s16 DFLT_GYRO_OFFSET /*= 0*/;
1242 for (i = 0; i < 3; i++) { in joycon_request_imu_calibration()
1253 for (i = 0; i < 3; i++) { in joycon_request_imu_calibration()
1265 "a_o[0]=%d a_o[1]=%d a_o[2]=%d\n" in joycon_request_imu_calibration()
1266 "a_s[0]=%d a_s[1]=%d a_s[2]=%d\n" in joycon_request_imu_calibration()
1267 "g_o[0]=%d g_o[1]=%d g_o[2]=%d\n" in joycon_request_imu_calibration()
1268 "g_s[0]=%d g_s[1]=%d g_s[2]=%d\n", in joycon_request_imu_calibration()
1269 ctlr->accel_cal.offset[0], in joycon_request_imu_calibration()
1272 ctlr->accel_cal.scale[0], in joycon_request_imu_calibration()
1275 ctlr->gyro_cal.offset[0], in joycon_request_imu_calibration()
1278 ctlr->gyro_cal.scale[0], in joycon_request_imu_calibration()
1282 return 0; in joycon_request_imu_calibration()
1288 u8 buffer[sizeof(*req) + 1] = { 0 }; in joycon_set_report_mode()
1292 req->data[0] = 0x30; /* standard, full report mode */ in joycon_set_report_mode()
1301 u8 buffer[sizeof(*req) + 1] = { 0 }; in joycon_enable_rumble()
1305 req->data[0] = 0x01; /* note: 0x00 would disable */ in joycon_enable_rumble()
1314 u8 buffer[sizeof(*req) + 1] = { 0 }; in joycon_enable_imu()
1318 req->data[0] = 0x01; /* note: 0x00 would disable */ in joycon_enable_imu()
1349 for (i = 0; i < 3; i++) { in joycon_input_report_parse_imu_data()
1352 data->accel_x = get_unaligned_le16(raw + 0); in joycon_input_report_parse_imu_data()
1366 struct joycon_imu_data imu_data[3] = {0}; /* 3 reports per packet */ in joycon_parse_imu_report()
1423 ctlr->imu_timestamp_us = 0; in joycon_parse_imu_report()
1424 ctlr->imu_delta_samples_count = 0; in joycon_parse_imu_report()
1425 ctlr->imu_delta_samples_sum = 0; in joycon_parse_imu_report()
1440 ctlr->imu_delta_samples_count = 0; in joycon_parse_imu_report()
1441 ctlr->imu_delta_samples_sum = 0; in joycon_parse_imu_report()
1445 if (ctlr->imu_avg_delta_ms == 0) { in joycon_parse_imu_report()
1447 hid_warn(ctlr->hdev, "calculated avg imu delta of 0\n"); in joycon_parse_imu_report()
1472 for (i = 0; i < 3; i++) { in joycon_parse_imu_report()
1494 value[0] = mult_frac((JC_IMU_PREC_RANGE_SCALE * in joycon_parse_imu_report()
1496 ctlr->gyro_cal.offset[0])), in joycon_parse_imu_report()
1497 ctlr->gyro_cal.scale[0], in joycon_parse_imu_report()
1498 ctlr->imu_cal_gyro_divisor[0]); in joycon_parse_imu_report()
1511 ctlr->accel_cal.scale[0]) / in joycon_parse_imu_report()
1512 ctlr->imu_cal_accel_divisor[0]; in joycon_parse_imu_report()
1548 input_report_abs(idev, ABS_RX, value[0]); in joycon_parse_imu_report()
1570 ctlr->rumble_zero_countdown > 0)) { in joycon_handle_rumble_report()
1572 * When this value reaches 0, we know we've sent multiple in joycon_handle_rumble_report()
1577 if (ctlr->rumble_zero_countdown > 0) in joycon_handle_rumble_report()
1593 ctlr->host_powered = tmp & BIT(0); in joycon_parse_battery_status()
1598 case 0: /* empty */ in joycon_parse_battery_status()
1630 raw_x = hid_field_extract(ctlr->hdev, rep->left_stick, 0, 12); in joycon_report_left_stick()
1648 raw_x = hid_field_extract(ctlr->hdev, rep->right_stick, 0, 12); in joycon_report_right_stick()
1661 int hatx = 0; in joycon_report_dpad()
1662 int haty = 0; in joycon_report_dpad()
1663 u32 btns = hid_field_extract(ctlr->hdev, rep->button_status, 0, 24); in joycon_report_dpad()
1684 u32 status = hid_field_extract(ctlr->hdev, rep->button_status, 0, 24); in joycon_report_buttons()
1746 ctlr->consecutive_valid_report_deltas = 0; in joycon_parse_report()
1780 struct joycon_rumble_output rumble_output = { 0 }; in joycon_send_rumble_data()
1798 if (++ctlr->subcmd_num > 0xF) in joycon_send_rumble_data()
1799 ctlr->subcmd_num = 0; in joycon_send_rumble_data()
1823 if (ret < 0 && ret != -ENODEV && in joycon_rumble_worker()
1830 ctlr->rumble_queue_tail = 0; in joycon_rumble_worker()
1843 int i = 0; in joycon_find_rumble_freq()
1845 if (freq > data[0].freq) { in joycon_find_rumble_freq()
1859 int i = 0; in joycon_find_rumble_amp()
1861 if (amp > data[0].amp) { in joycon_find_rumble_amp()
1881 data[0] = (freq_data_high.high >> 8) & 0xFF; in joycon_encode_rumble()
1882 data[1] = (freq_data_high.high & 0xFF) + amp_data.high; in joycon_encode_rumble()
1883 data[2] = freq_data_low.low + ((amp_data.low >> 8) & 0xFF); in joycon_encode_rumble()
1884 data[3] = amp_data.low & 0xFF; in joycon_encode_rumble()
1930 if (amp_l != 0 || amp_r != 0) in joycon_set_rumble()
1946 next_rq_head = 0; in joycon_set_rumble()
1967 return 0; in joycon_set_rumble()
1976 return 0; in joycon_play_effect()
2053 joycon_set_rumble(ctlr, 0, 0, false); in joycon_config_rumble()
2122 return 0; in joycon_imu_input_create()
2187 return 0; in joycon_input_create()
2197 int val = 0; in joycon_player_led_brightness_set()
2207 for (i = 0; i < JC_NUM_LEDS; i++) in joycon_player_led_brightness_set()
2211 ret = joycon_set_player_leds(ctlr, 0, val); in joycon_player_led_brightness_set()
2244 int led_val = 0; in joycon_leds_create()
2253 if (ret < 0) { in joycon_leds_create()
2261 for (i = 0; i < JC_NUM_LEDS; i++) { in joycon_leds_create()
2280 ret = joycon_set_player_leds(ctlr, 0, led_val); in joycon_leds_create()
2287 for (i = 0; i < JC_NUM_LEDS; i++) { in joycon_leds_create()
2308 led->brightness = 0; in joycon_leds_create()
2309 led->max_brightness = 0xF; in joycon_leds_create()
2313 /* Set the home LED to 0 as default state */ in joycon_leds_create()
2315 ret = joycon_set_home_led(ctlr, 0); in joycon_leds_create()
2319 return 0; in joycon_leds_create()
2329 return 0; in joycon_leds_create()
2338 int ret = 0; in joycon_battery_get_property()
2387 int ret = 0; in joycon_power_supply_create()
2398 ctlr->battery_desc.use_for_apm = 0; in joycon_power_supply_create()
2422 struct joycon_subcmd_request req = { 0 }; in joycon_read_info()
2426 ret = joycon_send_subcmd(ctlr, &req, 0, HZ); in joycon_read_info()
2434 for (i = 4, j = 0; j < 6; i++, j++) in joycon_read_info()
2439 ctlr->mac_addr[0], in joycon_read_info()
2453 * PID as 0x201E, but over bluetooth it will report the PID as 0x2017 in joycon_read_info()
2459 hid_dbg(ctlr->hdev, "controller type = 0x%02X\n", ctlr->ctlr_type); in joycon_read_info()
2461 return 0; in joycon_read_info()
2467 int ret = 0; in joycon_init()
2538 /* Set the reporting mode to 0x30, which is the full report mode */ in joycon_init()
2563 if (data[0] == JC_INPUT_SUBCMD_REPLY || data[0] == JC_INPUT_IMU_DATA || in joycon_ctlr_read_handler()
2564 data[0] == JC_INPUT_MCU_DATA) { in joycon_ctlr_read_handler()
2570 return 0; in joycon_ctlr_read_handler()
2576 int ret = 0; in joycon_ctlr_handle_event()
2586 if (data[0] == JC_INPUT_USB_RESPONSE && in joycon_ctlr_handle_event()
2592 data[0] != JC_INPUT_SUBCMD_REPLY) in joycon_ctlr_handle_event()
2647 ctlr->rumble_queue_head = 0; in nintendo_hid_probe()
2648 ctlr->rumble_queue_tail = 0; in nintendo_hid_probe()
2654 WQ_FREEZABLE | WQ_MEM_RECLAIM, 0); in nintendo_hid_probe()
2674 hdev->version |= 0x8000; in nintendo_hid_probe()
2719 return 0; in nintendo_hid_probe()