* [hid:for-5.16/nintendo 9/20] drivers/hid/hid-nintendo.c:132:45: warning: unused variable 'joycon_rumble_frequencies'
@ 2021-10-27 23:26 ` kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-10-27 23:26 UTC (permalink / raw)
To: Daniel J. Ogorchock; +Cc: llvm, kbuild-all, linux-input, Jiri Kosina
[-- Attachment #1: Type: text/plain, Size: 19090 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git for-5.16/nintendo
head: dad74e18f72a852ae40ad7b4246841a1b7e196b5
commit: c4eae84feff3e68c2f385aa10faea4a96791e7ad [9/20] HID: nintendo: add rumble support
config: arm-randconfig-r013-20211027 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 5db7568a6a1fcb408eb8988abdaff2a225a8eb72)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git/commit/?id=c4eae84feff3e68c2f385aa10faea4a96791e7ad
git remote add hid https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git
git fetch --no-tags hid for-5.16/nintendo
git checkout c4eae84feff3e68c2f385aa10faea4a96791e7ad
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
^
drivers/hid/hid-nintendo.c:44:17: warning: unused variable 'JC_OUTPUT_RUMBLE_ONLY' [-Wunused-const-variable]
static const u8 JC_OUTPUT_RUMBLE_ONLY = 0x10;
^
drivers/hid/hid-nintendo.c:45:17: warning: unused variable 'JC_OUTPUT_MCU_DATA' [-Wunused-const-variable]
static const u8 JC_OUTPUT_MCU_DATA = 0x11;
^
drivers/hid/hid-nintendo.c:49:17: warning: unused variable 'JC_SUBCMD_STATE' [-Wunused-const-variable]
static const u8 JC_SUBCMD_STATE /*= 0x00*/;
^
drivers/hid/hid-nintendo.c:50:17: warning: unused variable 'JC_SUBCMD_MANUAL_BT_PAIRING' [-Wunused-const-variable]
static const u8 JC_SUBCMD_MANUAL_BT_PAIRING = 0x01;
^
drivers/hid/hid-nintendo.c:51:17: warning: unused variable 'JC_SUBCMD_REQ_DEV_INFO' [-Wunused-const-variable]
static const u8 JC_SUBCMD_REQ_DEV_INFO = 0x02;
^
drivers/hid/hid-nintendo.c:53:17: warning: unused variable 'JC_SUBCMD_TRIGGERS_ELAPSED' [-Wunused-const-variable]
static const u8 JC_SUBCMD_TRIGGERS_ELAPSED = 0x04;
^
drivers/hid/hid-nintendo.c:54:17: warning: unused variable 'JC_SUBCMD_GET_PAGE_LIST_STATE' [-Wunused-const-variable]
static const u8 JC_SUBCMD_GET_PAGE_LIST_STATE = 0x05;
^
drivers/hid/hid-nintendo.c:55:17: warning: unused variable 'JC_SUBCMD_SET_HCI_STATE' [-Wunused-const-variable]
static const u8 JC_SUBCMD_SET_HCI_STATE = 0x06;
^
drivers/hid/hid-nintendo.c:56:17: warning: unused variable 'JC_SUBCMD_RESET_PAIRING_INFO' [-Wunused-const-variable]
static const u8 JC_SUBCMD_RESET_PAIRING_INFO = 0x07;
^
drivers/hid/hid-nintendo.c:57:17: warning: unused variable 'JC_SUBCMD_LOW_POWER_MODE' [-Wunused-const-variable]
static const u8 JC_SUBCMD_LOW_POWER_MODE = 0x08;
^
drivers/hid/hid-nintendo.c:59:17: warning: unused variable 'JC_SUBCMD_SPI_FLASH_WRITE' [-Wunused-const-variable]
static const u8 JC_SUBCMD_SPI_FLASH_WRITE = 0x11;
^
drivers/hid/hid-nintendo.c:60:17: warning: unused variable 'JC_SUBCMD_RESET_MCU' [-Wunused-const-variable]
static const u8 JC_SUBCMD_RESET_MCU = 0x20;
^
drivers/hid/hid-nintendo.c:61:17: warning: unused variable 'JC_SUBCMD_SET_MCU_CONFIG' [-Wunused-const-variable]
static const u8 JC_SUBCMD_SET_MCU_CONFIG = 0x21;
^
drivers/hid/hid-nintendo.c:62:17: warning: unused variable 'JC_SUBCMD_SET_MCU_STATE' [-Wunused-const-variable]
static const u8 JC_SUBCMD_SET_MCU_STATE = 0x22;
^
drivers/hid/hid-nintendo.c:64:17: warning: unused variable 'JC_SUBCMD_GET_PLAYER_LIGHTS' [-Wunused-const-variable]
static const u8 JC_SUBCMD_GET_PLAYER_LIGHTS = 0x31;
^
drivers/hid/hid-nintendo.c:66:17: warning: unused variable 'JC_SUBCMD_ENABLE_IMU' [-Wunused-const-variable]
static const u8 JC_SUBCMD_ENABLE_IMU = 0x40;
^
drivers/hid/hid-nintendo.c:67:17: warning: unused variable 'JC_SUBCMD_SET_IMU_SENSITIVITY' [-Wunused-const-variable]
static const u8 JC_SUBCMD_SET_IMU_SENSITIVITY = 0x41;
^
drivers/hid/hid-nintendo.c:68:17: warning: unused variable 'JC_SUBCMD_WRITE_IMU_REG' [-Wunused-const-variable]
static const u8 JC_SUBCMD_WRITE_IMU_REG = 0x42;
^
drivers/hid/hid-nintendo.c:69:17: warning: unused variable 'JC_SUBCMD_READ_IMU_REG' [-Wunused-const-variable]
static const u8 JC_SUBCMD_READ_IMU_REG = 0x43;
^
drivers/hid/hid-nintendo.c:71:17: warning: unused variable 'JC_SUBCMD_GET_REGULATED_VOLTAGE' [-Wunused-const-variable]
static const u8 JC_SUBCMD_GET_REGULATED_VOLTAGE = 0x50;
^
drivers/hid/hid-nintendo.c:74:17: warning: unused variable 'JC_INPUT_BUTTON_EVENT' [-Wunused-const-variable]
static const u8 JC_INPUT_BUTTON_EVENT = 0x3F;
^
drivers/hid/hid-nintendo.c:81:17: warning: unused variable 'JC_FEATURE_LAST_SUBCMD' [-Wunused-const-variable]
static const u8 JC_FEATURE_LAST_SUBCMD = 0x02;
^
drivers/hid/hid-nintendo.c:82:17: warning: unused variable 'JC_FEATURE_OTA_FW_UPGRADE' [-Wunused-const-variable]
static const u8 JC_FEATURE_OTA_FW_UPGRADE = 0x70;
^
drivers/hid/hid-nintendo.c:83:17: warning: unused variable 'JC_FEATURE_SETUP_MEM_READ' [-Wunused-const-variable]
static const u8 JC_FEATURE_SETUP_MEM_READ = 0x71;
^
drivers/hid/hid-nintendo.c:84:17: warning: unused variable 'JC_FEATURE_MEM_READ' [-Wunused-const-variable]
static const u8 JC_FEATURE_MEM_READ = 0x72;
^
drivers/hid/hid-nintendo.c:85:17: warning: unused variable 'JC_FEATURE_ERASE_MEM_SECTOR' [-Wunused-const-variable]
static const u8 JC_FEATURE_ERASE_MEM_SECTOR = 0x73;
^
drivers/hid/hid-nintendo.c:86:17: warning: unused variable 'JC_FEATURE_MEM_WRITE' [-Wunused-const-variable]
static const u8 JC_FEATURE_MEM_WRITE = 0x74;
^
drivers/hid/hid-nintendo.c:87:17: warning: unused variable 'JC_FEATURE_LAUNCH' [-Wunused-const-variable]
static const u8 JC_FEATURE_LAUNCH = 0x75;
^
drivers/hid/hid-nintendo.c:90:17: warning: unused variable 'JC_USB_CMD_CONN_STATUS' [-Wunused-const-variable]
static const u8 JC_USB_CMD_CONN_STATUS = 0x01;
^
drivers/hid/hid-nintendo.c:94:17: warning: unused variable 'JC_USB_CMD_EN_TIMEOUT' [-Wunused-const-variable]
static const u8 JC_USB_CMD_EN_TIMEOUT = 0x05;
^
drivers/hid/hid-nintendo.c:95:17: warning: unused variable 'JC_USB_RESET' [-Wunused-const-variable]
static const u8 JC_USB_RESET = 0x06;
^
drivers/hid/hid-nintendo.c:96:17: warning: unused variable 'JC_USB_PRE_HANDSHAKE' [-Wunused-const-variable]
static const u8 JC_USB_PRE_HANDSHAKE = 0x91;
^
drivers/hid/hid-nintendo.c:97:17: warning: unused variable 'JC_USB_SEND_UART' [-Wunused-const-variable]
static const u8 JC_USB_SEND_UART = 0x92;
^
>> drivers/hid/hid-nintendo.c:132:45: warning: unused variable 'joycon_rumble_frequencies' [-Wunused-const-variable]
static const struct joycon_rumble_freq_data joycon_rumble_frequencies[] = {
^
>> drivers/hid/hid-nintendo.c:190:44: warning: unused variable 'joycon_rumble_amplitudes' [-Wunused-const-variable]
static const struct joycon_rumble_amp_data joycon_rumble_amplitudes[] = {
^
>> drivers/hid/hid-nintendo.c:308:18: warning: unused variable 'JC_RUMBLE_DFLT_LOW_FREQ' [-Wunused-const-variable]
static const u16 JC_RUMBLE_DFLT_LOW_FREQ = 160;
^
>> drivers/hid/hid-nintendo.c:309:18: warning: unused variable 'JC_RUMBLE_DFLT_HIGH_FREQ' [-Wunused-const-variable]
static const u16 JC_RUMBLE_DFLT_HIGH_FREQ = 320;
^
38 warnings generated.
vim +/joycon_rumble_frequencies +132 drivers/hid/hid-nintendo.c
127
128 /*
129 * These tables are from
130 * https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering/blob/master/rumble_data_table.md
131 */
> 132 static const struct joycon_rumble_freq_data joycon_rumble_frequencies[] = {
133 /* high, low, freq */
134 { 0x0000, 0x01, 41 }, { 0x0000, 0x02, 42 }, { 0x0000, 0x03, 43 },
135 { 0x0000, 0x04, 44 }, { 0x0000, 0x05, 45 }, { 0x0000, 0x06, 46 },
136 { 0x0000, 0x07, 47 }, { 0x0000, 0x08, 48 }, { 0x0000, 0x09, 49 },
137 { 0x0000, 0x0A, 50 }, { 0x0000, 0x0B, 51 }, { 0x0000, 0x0C, 52 },
138 { 0x0000, 0x0D, 53 }, { 0x0000, 0x0E, 54 }, { 0x0000, 0x0F, 55 },
139 { 0x0000, 0x10, 57 }, { 0x0000, 0x11, 58 }, { 0x0000, 0x12, 59 },
140 { 0x0000, 0x13, 60 }, { 0x0000, 0x14, 62 }, { 0x0000, 0x15, 63 },
141 { 0x0000, 0x16, 64 }, { 0x0000, 0x17, 66 }, { 0x0000, 0x18, 67 },
142 { 0x0000, 0x19, 69 }, { 0x0000, 0x1A, 70 }, { 0x0000, 0x1B, 72 },
143 { 0x0000, 0x1C, 73 }, { 0x0000, 0x1D, 75 }, { 0x0000, 0x1e, 77 },
144 { 0x0000, 0x1f, 78 }, { 0x0000, 0x20, 80 }, { 0x0400, 0x21, 82 },
145 { 0x0800, 0x22, 84 }, { 0x0c00, 0x23, 85 }, { 0x1000, 0x24, 87 },
146 { 0x1400, 0x25, 89 }, { 0x1800, 0x26, 91 }, { 0x1c00, 0x27, 93 },
147 { 0x2000, 0x28, 95 }, { 0x2400, 0x29, 97 }, { 0x2800, 0x2a, 99 },
148 { 0x2c00, 0x2b, 102 }, { 0x3000, 0x2c, 104 }, { 0x3400, 0x2d, 106 },
149 { 0x3800, 0x2e, 108 }, { 0x3c00, 0x2f, 111 }, { 0x4000, 0x30, 113 },
150 { 0x4400, 0x31, 116 }, { 0x4800, 0x32, 118 }, { 0x4c00, 0x33, 121 },
151 { 0x5000, 0x34, 123 }, { 0x5400, 0x35, 126 }, { 0x5800, 0x36, 129 },
152 { 0x5c00, 0x37, 132 }, { 0x6000, 0x38, 135 }, { 0x6400, 0x39, 137 },
153 { 0x6800, 0x3a, 141 }, { 0x6c00, 0x3b, 144 }, { 0x7000, 0x3c, 147 },
154 { 0x7400, 0x3d, 150 }, { 0x7800, 0x3e, 153 }, { 0x7c00, 0x3f, 157 },
155 { 0x8000, 0x40, 160 }, { 0x8400, 0x41, 164 }, { 0x8800, 0x42, 167 },
156 { 0x8c00, 0x43, 171 }, { 0x9000, 0x44, 174 }, { 0x9400, 0x45, 178 },
157 { 0x9800, 0x46, 182 }, { 0x9c00, 0x47, 186 }, { 0xa000, 0x48, 190 },
158 { 0xa400, 0x49, 194 }, { 0xa800, 0x4a, 199 }, { 0xac00, 0x4b, 203 },
159 { 0xb000, 0x4c, 207 }, { 0xb400, 0x4d, 212 }, { 0xb800, 0x4e, 217 },
160 { 0xbc00, 0x4f, 221 }, { 0xc000, 0x50, 226 }, { 0xc400, 0x51, 231 },
161 { 0xc800, 0x52, 236 }, { 0xcc00, 0x53, 241 }, { 0xd000, 0x54, 247 },
162 { 0xd400, 0x55, 252 }, { 0xd800, 0x56, 258 }, { 0xdc00, 0x57, 263 },
163 { 0xe000, 0x58, 269 }, { 0xe400, 0x59, 275 }, { 0xe800, 0x5a, 281 },
164 { 0xec00, 0x5b, 287 }, { 0xf000, 0x5c, 293 }, { 0xf400, 0x5d, 300 },
165 { 0xf800, 0x5e, 306 }, { 0xfc00, 0x5f, 313 }, { 0x0001, 0x60, 320 },
166 { 0x0401, 0x61, 327 }, { 0x0801, 0x62, 334 }, { 0x0c01, 0x63, 341 },
167 { 0x1001, 0x64, 349 }, { 0x1401, 0x65, 357 }, { 0x1801, 0x66, 364 },
168 { 0x1c01, 0x67, 372 }, { 0x2001, 0x68, 381 }, { 0x2401, 0x69, 389 },
169 { 0x2801, 0x6a, 397 }, { 0x2c01, 0x6b, 406 }, { 0x3001, 0x6c, 415 },
170 { 0x3401, 0x6d, 424 }, { 0x3801, 0x6e, 433 }, { 0x3c01, 0x6f, 443 },
171 { 0x4001, 0x70, 453 }, { 0x4401, 0x71, 462 }, { 0x4801, 0x72, 473 },
172 { 0x4c01, 0x73, 483 }, { 0x5001, 0x74, 494 }, { 0x5401, 0x75, 504 },
173 { 0x5801, 0x76, 515 }, { 0x5c01, 0x77, 527 }, { 0x6001, 0x78, 538 },
174 { 0x6401, 0x79, 550 }, { 0x6801, 0x7a, 562 }, { 0x6c01, 0x7b, 574 },
175 { 0x7001, 0x7c, 587 }, { 0x7401, 0x7d, 600 }, { 0x7801, 0x7e, 613 },
176 { 0x7c01, 0x7f, 626 }, { 0x8001, 0x00, 640 }, { 0x8401, 0x00, 654 },
177 { 0x8801, 0x00, 668 }, { 0x8c01, 0x00, 683 }, { 0x9001, 0x00, 698 },
178 { 0x9401, 0x00, 713 }, { 0x9801, 0x00, 729 }, { 0x9c01, 0x00, 745 },
179 { 0xa001, 0x00, 761 }, { 0xa401, 0x00, 778 }, { 0xa801, 0x00, 795 },
180 { 0xac01, 0x00, 812 }, { 0xb001, 0x00, 830 }, { 0xb401, 0x00, 848 },
181 { 0xb801, 0x00, 867 }, { 0xbc01, 0x00, 886 }, { 0xc001, 0x00, 905 },
182 { 0xc401, 0x00, 925 }, { 0xc801, 0x00, 945 }, { 0xcc01, 0x00, 966 },
183 { 0xd001, 0x00, 987 }, { 0xd401, 0x00, 1009 }, { 0xd801, 0x00, 1031 },
184 { 0xdc01, 0x00, 1053 }, { 0xe001, 0x00, 1076 }, { 0xe401, 0x00, 1100 },
185 { 0xe801, 0x00, 1124 }, { 0xec01, 0x00, 1149 }, { 0xf001, 0x00, 1174 },
186 { 0xf401, 0x00, 1199 }, { 0xf801, 0x00, 1226 }, { 0xfc01, 0x00, 1253 }
187 };
188
189 #define joycon_max_rumble_amp (1003)
> 190 static const struct joycon_rumble_amp_data joycon_rumble_amplitudes[] = {
191 /* high, low, amp */
192 { 0x00, 0x0040, 0 },
193 { 0x02, 0x8040, 10 }, { 0x04, 0x0041, 12 }, { 0x06, 0x8041, 14 },
194 { 0x08, 0x0042, 17 }, { 0x0a, 0x8042, 20 }, { 0x0c, 0x0043, 24 },
195 { 0x0e, 0x8043, 28 }, { 0x10, 0x0044, 33 }, { 0x12, 0x8044, 40 },
196 { 0x14, 0x0045, 47 }, { 0x16, 0x8045, 56 }, { 0x18, 0x0046, 67 },
197 { 0x1a, 0x8046, 80 }, { 0x1c, 0x0047, 95 }, { 0x1e, 0x8047, 112 },
198 { 0x20, 0x0048, 117 }, { 0x22, 0x8048, 123 }, { 0x24, 0x0049, 128 },
199 { 0x26, 0x8049, 134 }, { 0x28, 0x004a, 140 }, { 0x2a, 0x804a, 146 },
200 { 0x2c, 0x004b, 152 }, { 0x2e, 0x804b, 159 }, { 0x30, 0x004c, 166 },
201 { 0x32, 0x804c, 173 }, { 0x34, 0x004d, 181 }, { 0x36, 0x804d, 189 },
202 { 0x38, 0x004e, 198 }, { 0x3a, 0x804e, 206 }, { 0x3c, 0x004f, 215 },
203 { 0x3e, 0x804f, 225 }, { 0x40, 0x0050, 230 }, { 0x42, 0x8050, 235 },
204 { 0x44, 0x0051, 240 }, { 0x46, 0x8051, 245 }, { 0x48, 0x0052, 251 },
205 { 0x4a, 0x8052, 256 }, { 0x4c, 0x0053, 262 }, { 0x4e, 0x8053, 268 },
206 { 0x50, 0x0054, 273 }, { 0x52, 0x8054, 279 }, { 0x54, 0x0055, 286 },
207 { 0x56, 0x8055, 292 }, { 0x58, 0x0056, 298 }, { 0x5a, 0x8056, 305 },
208 { 0x5c, 0x0057, 311 }, { 0x5e, 0x8057, 318 }, { 0x60, 0x0058, 325 },
209 { 0x62, 0x8058, 332 }, { 0x64, 0x0059, 340 }, { 0x66, 0x8059, 347 },
210 { 0x68, 0x005a, 355 }, { 0x6a, 0x805a, 362 }, { 0x6c, 0x005b, 370 },
211 { 0x6e, 0x805b, 378 }, { 0x70, 0x005c, 387 }, { 0x72, 0x805c, 395 },
212 { 0x74, 0x005d, 404 }, { 0x76, 0x805d, 413 }, { 0x78, 0x005e, 422 },
213 { 0x7a, 0x805e, 431 }, { 0x7c, 0x005f, 440 }, { 0x7e, 0x805f, 450 },
214 { 0x80, 0x0060, 460 }, { 0x82, 0x8060, 470 }, { 0x84, 0x0061, 480 },
215 { 0x86, 0x8061, 491 }, { 0x88, 0x0062, 501 }, { 0x8a, 0x8062, 512 },
216 { 0x8c, 0x0063, 524 }, { 0x8e, 0x8063, 535 }, { 0x90, 0x0064, 547 },
217 { 0x92, 0x8064, 559 }, { 0x94, 0x0065, 571 }, { 0x96, 0x8065, 584 },
218 { 0x98, 0x0066, 596 }, { 0x9a, 0x8066, 609 }, { 0x9c, 0x0067, 623 },
219 { 0x9e, 0x8067, 636 }, { 0xa0, 0x0068, 650 }, { 0xa2, 0x8068, 665 },
220 { 0xa4, 0x0069, 679 }, { 0xa6, 0x8069, 694 }, { 0xa8, 0x006a, 709 },
221 { 0xaa, 0x806a, 725 }, { 0xac, 0x006b, 741 }, { 0xae, 0x806b, 757 },
222 { 0xb0, 0x006c, 773 }, { 0xb2, 0x806c, 790 }, { 0xb4, 0x006d, 808 },
223 { 0xb6, 0x806d, 825 }, { 0xb8, 0x006e, 843 }, { 0xba, 0x806e, 862 },
224 { 0xbc, 0x006f, 881 }, { 0xbe, 0x806f, 900 }, { 0xc0, 0x0070, 920 },
225 { 0xc2, 0x8070, 940 }, { 0xc4, 0x0071, 960 }, { 0xc6, 0x8071, 981 },
226 { 0xc8, 0x0072, joycon_max_rumble_amp }
227 };
228
229 /* States for controller state machine */
230 enum joycon_ctlr_state {
231 JOYCON_CTLR_STATE_INIT,
232 JOYCON_CTLR_STATE_READ,
233 };
234
235 struct joycon_stick_cal {
236 s32 max;
237 s32 min;
238 s32 center;
239 };
240
241 /*
242 * All the controller's button values are stored in a u32.
243 * They can be accessed with bitwise ANDs.
244 */
245 static const u32 JC_BTN_Y = BIT(0);
246 static const u32 JC_BTN_X = BIT(1);
247 static const u32 JC_BTN_B = BIT(2);
248 static const u32 JC_BTN_A = BIT(3);
249 static const u32 JC_BTN_SR_R = BIT(4);
250 static const u32 JC_BTN_SL_R = BIT(5);
251 static const u32 JC_BTN_R = BIT(6);
252 static const u32 JC_BTN_ZR = BIT(7);
253 static const u32 JC_BTN_MINUS = BIT(8);
254 static const u32 JC_BTN_PLUS = BIT(9);
255 static const u32 JC_BTN_RSTICK = BIT(10);
256 static const u32 JC_BTN_LSTICK = BIT(11);
257 static const u32 JC_BTN_HOME = BIT(12);
258 static const u32 JC_BTN_CAP = BIT(13); /* capture button */
259 static const u32 JC_BTN_DOWN = BIT(16);
260 static const u32 JC_BTN_UP = BIT(17);
261 static const u32 JC_BTN_RIGHT = BIT(18);
262 static const u32 JC_BTN_LEFT = BIT(19);
263 static const u32 JC_BTN_SR_L = BIT(20);
264 static const u32 JC_BTN_SL_L = BIT(21);
265 static const u32 JC_BTN_L = BIT(22);
266 static const u32 JC_BTN_ZL = BIT(23);
267
268 enum joycon_msg_type {
269 JOYCON_MSG_TYPE_NONE,
270 JOYCON_MSG_TYPE_USB,
271 JOYCON_MSG_TYPE_SUBCMD,
272 };
273
274 struct joycon_subcmd_request {
275 u8 output_id; /* must be 0x01 for subcommand, 0x10 for rumble only */
276 u8 packet_num; /* incremented every send */
277 u8 rumble_data[8];
278 u8 subcmd_id;
279 u8 data[]; /* length depends on the subcommand */
280 } __packed;
281
282 struct joycon_subcmd_reply {
283 u8 ack; /* MSB 1 for ACK, 0 for NACK */
284 u8 id; /* id of requested subcmd */
285 u8 data[]; /* will be at most 35 bytes */
286 } __packed;
287
288 struct joycon_input_report {
289 u8 id;
290 u8 timer;
291 u8 bat_con; /* battery and connection info */
292 u8 button_status[3];
293 u8 left_stick[3];
294 u8 right_stick[3];
295 u8 vibrator_report;
296
297 /*
298 * If support for firmware updates, gyroscope data, and/or NFC/IR
299 * are added in the future, this can be swapped for a union.
300 */
301 struct joycon_subcmd_reply reply;
302 } __packed;
303
304 #define JC_MAX_RESP_SIZE (sizeof(struct joycon_input_report) + 35)
305 #define JC_RUMBLE_DATA_SIZE 8
306 #define JC_RUMBLE_QUEUE_SIZE 8
307
> 308 static const u16 JC_RUMBLE_DFLT_LOW_FREQ = 160;
> 309 static const u16 JC_RUMBLE_DFLT_HIGH_FREQ = 320;
310 static const u16 JC_RUMBLE_PERIOD_MS = 50;
311
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 30877 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* [hid:for-5.16/nintendo 9/20] drivers/hid/hid-nintendo.c:132:45: warning: unused variable 'joycon_rumble_frequencies'
@ 2021-10-27 23:26 ` kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-10-27 23:26 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 19420 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git for-5.16/nintendo
head: dad74e18f72a852ae40ad7b4246841a1b7e196b5
commit: c4eae84feff3e68c2f385aa10faea4a96791e7ad [9/20] HID: nintendo: add rumble support
config: arm-randconfig-r013-20211027 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 5db7568a6a1fcb408eb8988abdaff2a225a8eb72)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git/commit/?id=c4eae84feff3e68c2f385aa10faea4a96791e7ad
git remote add hid https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git
git fetch --no-tags hid for-5.16/nintendo
git checkout c4eae84feff3e68c2f385aa10faea4a96791e7ad
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
^
drivers/hid/hid-nintendo.c:44:17: warning: unused variable 'JC_OUTPUT_RUMBLE_ONLY' [-Wunused-const-variable]
static const u8 JC_OUTPUT_RUMBLE_ONLY = 0x10;
^
drivers/hid/hid-nintendo.c:45:17: warning: unused variable 'JC_OUTPUT_MCU_DATA' [-Wunused-const-variable]
static const u8 JC_OUTPUT_MCU_DATA = 0x11;
^
drivers/hid/hid-nintendo.c:49:17: warning: unused variable 'JC_SUBCMD_STATE' [-Wunused-const-variable]
static const u8 JC_SUBCMD_STATE /*= 0x00*/;
^
drivers/hid/hid-nintendo.c:50:17: warning: unused variable 'JC_SUBCMD_MANUAL_BT_PAIRING' [-Wunused-const-variable]
static const u8 JC_SUBCMD_MANUAL_BT_PAIRING = 0x01;
^
drivers/hid/hid-nintendo.c:51:17: warning: unused variable 'JC_SUBCMD_REQ_DEV_INFO' [-Wunused-const-variable]
static const u8 JC_SUBCMD_REQ_DEV_INFO = 0x02;
^
drivers/hid/hid-nintendo.c:53:17: warning: unused variable 'JC_SUBCMD_TRIGGERS_ELAPSED' [-Wunused-const-variable]
static const u8 JC_SUBCMD_TRIGGERS_ELAPSED = 0x04;
^
drivers/hid/hid-nintendo.c:54:17: warning: unused variable 'JC_SUBCMD_GET_PAGE_LIST_STATE' [-Wunused-const-variable]
static const u8 JC_SUBCMD_GET_PAGE_LIST_STATE = 0x05;
^
drivers/hid/hid-nintendo.c:55:17: warning: unused variable 'JC_SUBCMD_SET_HCI_STATE' [-Wunused-const-variable]
static const u8 JC_SUBCMD_SET_HCI_STATE = 0x06;
^
drivers/hid/hid-nintendo.c:56:17: warning: unused variable 'JC_SUBCMD_RESET_PAIRING_INFO' [-Wunused-const-variable]
static const u8 JC_SUBCMD_RESET_PAIRING_INFO = 0x07;
^
drivers/hid/hid-nintendo.c:57:17: warning: unused variable 'JC_SUBCMD_LOW_POWER_MODE' [-Wunused-const-variable]
static const u8 JC_SUBCMD_LOW_POWER_MODE = 0x08;
^
drivers/hid/hid-nintendo.c:59:17: warning: unused variable 'JC_SUBCMD_SPI_FLASH_WRITE' [-Wunused-const-variable]
static const u8 JC_SUBCMD_SPI_FLASH_WRITE = 0x11;
^
drivers/hid/hid-nintendo.c:60:17: warning: unused variable 'JC_SUBCMD_RESET_MCU' [-Wunused-const-variable]
static const u8 JC_SUBCMD_RESET_MCU = 0x20;
^
drivers/hid/hid-nintendo.c:61:17: warning: unused variable 'JC_SUBCMD_SET_MCU_CONFIG' [-Wunused-const-variable]
static const u8 JC_SUBCMD_SET_MCU_CONFIG = 0x21;
^
drivers/hid/hid-nintendo.c:62:17: warning: unused variable 'JC_SUBCMD_SET_MCU_STATE' [-Wunused-const-variable]
static const u8 JC_SUBCMD_SET_MCU_STATE = 0x22;
^
drivers/hid/hid-nintendo.c:64:17: warning: unused variable 'JC_SUBCMD_GET_PLAYER_LIGHTS' [-Wunused-const-variable]
static const u8 JC_SUBCMD_GET_PLAYER_LIGHTS = 0x31;
^
drivers/hid/hid-nintendo.c:66:17: warning: unused variable 'JC_SUBCMD_ENABLE_IMU' [-Wunused-const-variable]
static const u8 JC_SUBCMD_ENABLE_IMU = 0x40;
^
drivers/hid/hid-nintendo.c:67:17: warning: unused variable 'JC_SUBCMD_SET_IMU_SENSITIVITY' [-Wunused-const-variable]
static const u8 JC_SUBCMD_SET_IMU_SENSITIVITY = 0x41;
^
drivers/hid/hid-nintendo.c:68:17: warning: unused variable 'JC_SUBCMD_WRITE_IMU_REG' [-Wunused-const-variable]
static const u8 JC_SUBCMD_WRITE_IMU_REG = 0x42;
^
drivers/hid/hid-nintendo.c:69:17: warning: unused variable 'JC_SUBCMD_READ_IMU_REG' [-Wunused-const-variable]
static const u8 JC_SUBCMD_READ_IMU_REG = 0x43;
^
drivers/hid/hid-nintendo.c:71:17: warning: unused variable 'JC_SUBCMD_GET_REGULATED_VOLTAGE' [-Wunused-const-variable]
static const u8 JC_SUBCMD_GET_REGULATED_VOLTAGE = 0x50;
^
drivers/hid/hid-nintendo.c:74:17: warning: unused variable 'JC_INPUT_BUTTON_EVENT' [-Wunused-const-variable]
static const u8 JC_INPUT_BUTTON_EVENT = 0x3F;
^
drivers/hid/hid-nintendo.c:81:17: warning: unused variable 'JC_FEATURE_LAST_SUBCMD' [-Wunused-const-variable]
static const u8 JC_FEATURE_LAST_SUBCMD = 0x02;
^
drivers/hid/hid-nintendo.c:82:17: warning: unused variable 'JC_FEATURE_OTA_FW_UPGRADE' [-Wunused-const-variable]
static const u8 JC_FEATURE_OTA_FW_UPGRADE = 0x70;
^
drivers/hid/hid-nintendo.c:83:17: warning: unused variable 'JC_FEATURE_SETUP_MEM_READ' [-Wunused-const-variable]
static const u8 JC_FEATURE_SETUP_MEM_READ = 0x71;
^
drivers/hid/hid-nintendo.c:84:17: warning: unused variable 'JC_FEATURE_MEM_READ' [-Wunused-const-variable]
static const u8 JC_FEATURE_MEM_READ = 0x72;
^
drivers/hid/hid-nintendo.c:85:17: warning: unused variable 'JC_FEATURE_ERASE_MEM_SECTOR' [-Wunused-const-variable]
static const u8 JC_FEATURE_ERASE_MEM_SECTOR = 0x73;
^
drivers/hid/hid-nintendo.c:86:17: warning: unused variable 'JC_FEATURE_MEM_WRITE' [-Wunused-const-variable]
static const u8 JC_FEATURE_MEM_WRITE = 0x74;
^
drivers/hid/hid-nintendo.c:87:17: warning: unused variable 'JC_FEATURE_LAUNCH' [-Wunused-const-variable]
static const u8 JC_FEATURE_LAUNCH = 0x75;
^
drivers/hid/hid-nintendo.c:90:17: warning: unused variable 'JC_USB_CMD_CONN_STATUS' [-Wunused-const-variable]
static const u8 JC_USB_CMD_CONN_STATUS = 0x01;
^
drivers/hid/hid-nintendo.c:94:17: warning: unused variable 'JC_USB_CMD_EN_TIMEOUT' [-Wunused-const-variable]
static const u8 JC_USB_CMD_EN_TIMEOUT = 0x05;
^
drivers/hid/hid-nintendo.c:95:17: warning: unused variable 'JC_USB_RESET' [-Wunused-const-variable]
static const u8 JC_USB_RESET = 0x06;
^
drivers/hid/hid-nintendo.c:96:17: warning: unused variable 'JC_USB_PRE_HANDSHAKE' [-Wunused-const-variable]
static const u8 JC_USB_PRE_HANDSHAKE = 0x91;
^
drivers/hid/hid-nintendo.c:97:17: warning: unused variable 'JC_USB_SEND_UART' [-Wunused-const-variable]
static const u8 JC_USB_SEND_UART = 0x92;
^
>> drivers/hid/hid-nintendo.c:132:45: warning: unused variable 'joycon_rumble_frequencies' [-Wunused-const-variable]
static const struct joycon_rumble_freq_data joycon_rumble_frequencies[] = {
^
>> drivers/hid/hid-nintendo.c:190:44: warning: unused variable 'joycon_rumble_amplitudes' [-Wunused-const-variable]
static const struct joycon_rumble_amp_data joycon_rumble_amplitudes[] = {
^
>> drivers/hid/hid-nintendo.c:308:18: warning: unused variable 'JC_RUMBLE_DFLT_LOW_FREQ' [-Wunused-const-variable]
static const u16 JC_RUMBLE_DFLT_LOW_FREQ = 160;
^
>> drivers/hid/hid-nintendo.c:309:18: warning: unused variable 'JC_RUMBLE_DFLT_HIGH_FREQ' [-Wunused-const-variable]
static const u16 JC_RUMBLE_DFLT_HIGH_FREQ = 320;
^
38 warnings generated.
vim +/joycon_rumble_frequencies +132 drivers/hid/hid-nintendo.c
127
128 /*
129 * These tables are from
130 * https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering/blob/master/rumble_data_table.md
131 */
> 132 static const struct joycon_rumble_freq_data joycon_rumble_frequencies[] = {
133 /* high, low, freq */
134 { 0x0000, 0x01, 41 }, { 0x0000, 0x02, 42 }, { 0x0000, 0x03, 43 },
135 { 0x0000, 0x04, 44 }, { 0x0000, 0x05, 45 }, { 0x0000, 0x06, 46 },
136 { 0x0000, 0x07, 47 }, { 0x0000, 0x08, 48 }, { 0x0000, 0x09, 49 },
137 { 0x0000, 0x0A, 50 }, { 0x0000, 0x0B, 51 }, { 0x0000, 0x0C, 52 },
138 { 0x0000, 0x0D, 53 }, { 0x0000, 0x0E, 54 }, { 0x0000, 0x0F, 55 },
139 { 0x0000, 0x10, 57 }, { 0x0000, 0x11, 58 }, { 0x0000, 0x12, 59 },
140 { 0x0000, 0x13, 60 }, { 0x0000, 0x14, 62 }, { 0x0000, 0x15, 63 },
141 { 0x0000, 0x16, 64 }, { 0x0000, 0x17, 66 }, { 0x0000, 0x18, 67 },
142 { 0x0000, 0x19, 69 }, { 0x0000, 0x1A, 70 }, { 0x0000, 0x1B, 72 },
143 { 0x0000, 0x1C, 73 }, { 0x0000, 0x1D, 75 }, { 0x0000, 0x1e, 77 },
144 { 0x0000, 0x1f, 78 }, { 0x0000, 0x20, 80 }, { 0x0400, 0x21, 82 },
145 { 0x0800, 0x22, 84 }, { 0x0c00, 0x23, 85 }, { 0x1000, 0x24, 87 },
146 { 0x1400, 0x25, 89 }, { 0x1800, 0x26, 91 }, { 0x1c00, 0x27, 93 },
147 { 0x2000, 0x28, 95 }, { 0x2400, 0x29, 97 }, { 0x2800, 0x2a, 99 },
148 { 0x2c00, 0x2b, 102 }, { 0x3000, 0x2c, 104 }, { 0x3400, 0x2d, 106 },
149 { 0x3800, 0x2e, 108 }, { 0x3c00, 0x2f, 111 }, { 0x4000, 0x30, 113 },
150 { 0x4400, 0x31, 116 }, { 0x4800, 0x32, 118 }, { 0x4c00, 0x33, 121 },
151 { 0x5000, 0x34, 123 }, { 0x5400, 0x35, 126 }, { 0x5800, 0x36, 129 },
152 { 0x5c00, 0x37, 132 }, { 0x6000, 0x38, 135 }, { 0x6400, 0x39, 137 },
153 { 0x6800, 0x3a, 141 }, { 0x6c00, 0x3b, 144 }, { 0x7000, 0x3c, 147 },
154 { 0x7400, 0x3d, 150 }, { 0x7800, 0x3e, 153 }, { 0x7c00, 0x3f, 157 },
155 { 0x8000, 0x40, 160 }, { 0x8400, 0x41, 164 }, { 0x8800, 0x42, 167 },
156 { 0x8c00, 0x43, 171 }, { 0x9000, 0x44, 174 }, { 0x9400, 0x45, 178 },
157 { 0x9800, 0x46, 182 }, { 0x9c00, 0x47, 186 }, { 0xa000, 0x48, 190 },
158 { 0xa400, 0x49, 194 }, { 0xa800, 0x4a, 199 }, { 0xac00, 0x4b, 203 },
159 { 0xb000, 0x4c, 207 }, { 0xb400, 0x4d, 212 }, { 0xb800, 0x4e, 217 },
160 { 0xbc00, 0x4f, 221 }, { 0xc000, 0x50, 226 }, { 0xc400, 0x51, 231 },
161 { 0xc800, 0x52, 236 }, { 0xcc00, 0x53, 241 }, { 0xd000, 0x54, 247 },
162 { 0xd400, 0x55, 252 }, { 0xd800, 0x56, 258 }, { 0xdc00, 0x57, 263 },
163 { 0xe000, 0x58, 269 }, { 0xe400, 0x59, 275 }, { 0xe800, 0x5a, 281 },
164 { 0xec00, 0x5b, 287 }, { 0xf000, 0x5c, 293 }, { 0xf400, 0x5d, 300 },
165 { 0xf800, 0x5e, 306 }, { 0xfc00, 0x5f, 313 }, { 0x0001, 0x60, 320 },
166 { 0x0401, 0x61, 327 }, { 0x0801, 0x62, 334 }, { 0x0c01, 0x63, 341 },
167 { 0x1001, 0x64, 349 }, { 0x1401, 0x65, 357 }, { 0x1801, 0x66, 364 },
168 { 0x1c01, 0x67, 372 }, { 0x2001, 0x68, 381 }, { 0x2401, 0x69, 389 },
169 { 0x2801, 0x6a, 397 }, { 0x2c01, 0x6b, 406 }, { 0x3001, 0x6c, 415 },
170 { 0x3401, 0x6d, 424 }, { 0x3801, 0x6e, 433 }, { 0x3c01, 0x6f, 443 },
171 { 0x4001, 0x70, 453 }, { 0x4401, 0x71, 462 }, { 0x4801, 0x72, 473 },
172 { 0x4c01, 0x73, 483 }, { 0x5001, 0x74, 494 }, { 0x5401, 0x75, 504 },
173 { 0x5801, 0x76, 515 }, { 0x5c01, 0x77, 527 }, { 0x6001, 0x78, 538 },
174 { 0x6401, 0x79, 550 }, { 0x6801, 0x7a, 562 }, { 0x6c01, 0x7b, 574 },
175 { 0x7001, 0x7c, 587 }, { 0x7401, 0x7d, 600 }, { 0x7801, 0x7e, 613 },
176 { 0x7c01, 0x7f, 626 }, { 0x8001, 0x00, 640 }, { 0x8401, 0x00, 654 },
177 { 0x8801, 0x00, 668 }, { 0x8c01, 0x00, 683 }, { 0x9001, 0x00, 698 },
178 { 0x9401, 0x00, 713 }, { 0x9801, 0x00, 729 }, { 0x9c01, 0x00, 745 },
179 { 0xa001, 0x00, 761 }, { 0xa401, 0x00, 778 }, { 0xa801, 0x00, 795 },
180 { 0xac01, 0x00, 812 }, { 0xb001, 0x00, 830 }, { 0xb401, 0x00, 848 },
181 { 0xb801, 0x00, 867 }, { 0xbc01, 0x00, 886 }, { 0xc001, 0x00, 905 },
182 { 0xc401, 0x00, 925 }, { 0xc801, 0x00, 945 }, { 0xcc01, 0x00, 966 },
183 { 0xd001, 0x00, 987 }, { 0xd401, 0x00, 1009 }, { 0xd801, 0x00, 1031 },
184 { 0xdc01, 0x00, 1053 }, { 0xe001, 0x00, 1076 }, { 0xe401, 0x00, 1100 },
185 { 0xe801, 0x00, 1124 }, { 0xec01, 0x00, 1149 }, { 0xf001, 0x00, 1174 },
186 { 0xf401, 0x00, 1199 }, { 0xf801, 0x00, 1226 }, { 0xfc01, 0x00, 1253 }
187 };
188
189 #define joycon_max_rumble_amp (1003)
> 190 static const struct joycon_rumble_amp_data joycon_rumble_amplitudes[] = {
191 /* high, low, amp */
192 { 0x00, 0x0040, 0 },
193 { 0x02, 0x8040, 10 }, { 0x04, 0x0041, 12 }, { 0x06, 0x8041, 14 },
194 { 0x08, 0x0042, 17 }, { 0x0a, 0x8042, 20 }, { 0x0c, 0x0043, 24 },
195 { 0x0e, 0x8043, 28 }, { 0x10, 0x0044, 33 }, { 0x12, 0x8044, 40 },
196 { 0x14, 0x0045, 47 }, { 0x16, 0x8045, 56 }, { 0x18, 0x0046, 67 },
197 { 0x1a, 0x8046, 80 }, { 0x1c, 0x0047, 95 }, { 0x1e, 0x8047, 112 },
198 { 0x20, 0x0048, 117 }, { 0x22, 0x8048, 123 }, { 0x24, 0x0049, 128 },
199 { 0x26, 0x8049, 134 }, { 0x28, 0x004a, 140 }, { 0x2a, 0x804a, 146 },
200 { 0x2c, 0x004b, 152 }, { 0x2e, 0x804b, 159 }, { 0x30, 0x004c, 166 },
201 { 0x32, 0x804c, 173 }, { 0x34, 0x004d, 181 }, { 0x36, 0x804d, 189 },
202 { 0x38, 0x004e, 198 }, { 0x3a, 0x804e, 206 }, { 0x3c, 0x004f, 215 },
203 { 0x3e, 0x804f, 225 }, { 0x40, 0x0050, 230 }, { 0x42, 0x8050, 235 },
204 { 0x44, 0x0051, 240 }, { 0x46, 0x8051, 245 }, { 0x48, 0x0052, 251 },
205 { 0x4a, 0x8052, 256 }, { 0x4c, 0x0053, 262 }, { 0x4e, 0x8053, 268 },
206 { 0x50, 0x0054, 273 }, { 0x52, 0x8054, 279 }, { 0x54, 0x0055, 286 },
207 { 0x56, 0x8055, 292 }, { 0x58, 0x0056, 298 }, { 0x5a, 0x8056, 305 },
208 { 0x5c, 0x0057, 311 }, { 0x5e, 0x8057, 318 }, { 0x60, 0x0058, 325 },
209 { 0x62, 0x8058, 332 }, { 0x64, 0x0059, 340 }, { 0x66, 0x8059, 347 },
210 { 0x68, 0x005a, 355 }, { 0x6a, 0x805a, 362 }, { 0x6c, 0x005b, 370 },
211 { 0x6e, 0x805b, 378 }, { 0x70, 0x005c, 387 }, { 0x72, 0x805c, 395 },
212 { 0x74, 0x005d, 404 }, { 0x76, 0x805d, 413 }, { 0x78, 0x005e, 422 },
213 { 0x7a, 0x805e, 431 }, { 0x7c, 0x005f, 440 }, { 0x7e, 0x805f, 450 },
214 { 0x80, 0x0060, 460 }, { 0x82, 0x8060, 470 }, { 0x84, 0x0061, 480 },
215 { 0x86, 0x8061, 491 }, { 0x88, 0x0062, 501 }, { 0x8a, 0x8062, 512 },
216 { 0x8c, 0x0063, 524 }, { 0x8e, 0x8063, 535 }, { 0x90, 0x0064, 547 },
217 { 0x92, 0x8064, 559 }, { 0x94, 0x0065, 571 }, { 0x96, 0x8065, 584 },
218 { 0x98, 0x0066, 596 }, { 0x9a, 0x8066, 609 }, { 0x9c, 0x0067, 623 },
219 { 0x9e, 0x8067, 636 }, { 0xa0, 0x0068, 650 }, { 0xa2, 0x8068, 665 },
220 { 0xa4, 0x0069, 679 }, { 0xa6, 0x8069, 694 }, { 0xa8, 0x006a, 709 },
221 { 0xaa, 0x806a, 725 }, { 0xac, 0x006b, 741 }, { 0xae, 0x806b, 757 },
222 { 0xb0, 0x006c, 773 }, { 0xb2, 0x806c, 790 }, { 0xb4, 0x006d, 808 },
223 { 0xb6, 0x806d, 825 }, { 0xb8, 0x006e, 843 }, { 0xba, 0x806e, 862 },
224 { 0xbc, 0x006f, 881 }, { 0xbe, 0x806f, 900 }, { 0xc0, 0x0070, 920 },
225 { 0xc2, 0x8070, 940 }, { 0xc4, 0x0071, 960 }, { 0xc6, 0x8071, 981 },
226 { 0xc8, 0x0072, joycon_max_rumble_amp }
227 };
228
229 /* States for controller state machine */
230 enum joycon_ctlr_state {
231 JOYCON_CTLR_STATE_INIT,
232 JOYCON_CTLR_STATE_READ,
233 };
234
235 struct joycon_stick_cal {
236 s32 max;
237 s32 min;
238 s32 center;
239 };
240
241 /*
242 * All the controller's button values are stored in a u32.
243 * They can be accessed with bitwise ANDs.
244 */
245 static const u32 JC_BTN_Y = BIT(0);
246 static const u32 JC_BTN_X = BIT(1);
247 static const u32 JC_BTN_B = BIT(2);
248 static const u32 JC_BTN_A = BIT(3);
249 static const u32 JC_BTN_SR_R = BIT(4);
250 static const u32 JC_BTN_SL_R = BIT(5);
251 static const u32 JC_BTN_R = BIT(6);
252 static const u32 JC_BTN_ZR = BIT(7);
253 static const u32 JC_BTN_MINUS = BIT(8);
254 static const u32 JC_BTN_PLUS = BIT(9);
255 static const u32 JC_BTN_RSTICK = BIT(10);
256 static const u32 JC_BTN_LSTICK = BIT(11);
257 static const u32 JC_BTN_HOME = BIT(12);
258 static const u32 JC_BTN_CAP = BIT(13); /* capture button */
259 static const u32 JC_BTN_DOWN = BIT(16);
260 static const u32 JC_BTN_UP = BIT(17);
261 static const u32 JC_BTN_RIGHT = BIT(18);
262 static const u32 JC_BTN_LEFT = BIT(19);
263 static const u32 JC_BTN_SR_L = BIT(20);
264 static const u32 JC_BTN_SL_L = BIT(21);
265 static const u32 JC_BTN_L = BIT(22);
266 static const u32 JC_BTN_ZL = BIT(23);
267
268 enum joycon_msg_type {
269 JOYCON_MSG_TYPE_NONE,
270 JOYCON_MSG_TYPE_USB,
271 JOYCON_MSG_TYPE_SUBCMD,
272 };
273
274 struct joycon_subcmd_request {
275 u8 output_id; /* must be 0x01 for subcommand, 0x10 for rumble only */
276 u8 packet_num; /* incremented every send */
277 u8 rumble_data[8];
278 u8 subcmd_id;
279 u8 data[]; /* length depends on the subcommand */
280 } __packed;
281
282 struct joycon_subcmd_reply {
283 u8 ack; /* MSB 1 for ACK, 0 for NACK */
284 u8 id; /* id of requested subcmd */
285 u8 data[]; /* will be at most 35 bytes */
286 } __packed;
287
288 struct joycon_input_report {
289 u8 id;
290 u8 timer;
291 u8 bat_con; /* battery and connection info */
292 u8 button_status[3];
293 u8 left_stick[3];
294 u8 right_stick[3];
295 u8 vibrator_report;
296
297 /*
298 * If support for firmware updates, gyroscope data, and/or NFC/IR
299 * are added in the future, this can be swapped for a union.
300 */
301 struct joycon_subcmd_reply reply;
302 } __packed;
303
304 #define JC_MAX_RESP_SIZE (sizeof(struct joycon_input_report) + 35)
305 #define JC_RUMBLE_DATA_SIZE 8
306 #define JC_RUMBLE_QUEUE_SIZE 8
307
> 308 static const u16 JC_RUMBLE_DFLT_LOW_FREQ = 160;
> 309 static const u16 JC_RUMBLE_DFLT_HIGH_FREQ = 320;
310 static const u16 JC_RUMBLE_PERIOD_MS = 50;
311
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 30877 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-10-27 23:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-27 23:26 [hid:for-5.16/nintendo 9/20] drivers/hid/hid-nintendo.c:132:45: warning: unused variable 'joycon_rumble_frequencies' kernel test robot
2021-10-27 23:26 ` kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.