Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

char/mwave: remove printk tracing

The printk tracing makes the code hard to follow for no good benefit.
Everyone can use dynamic tracing and/or kprobes.

Drop this unreadable bloatware too.

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patch.msgid.link/20251119091949.825958-5-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jiri Slaby (SUSE) and committed by
Greg Kroah-Hartman
53688a9f 3b4df232

+14 -524
+1 -176
drivers/char/mwave/3780i.c
··· 75 75 unsigned long flags; 76 76 unsigned short val; 77 77 78 - PRINTK_3(TRACE_3780I, 79 - "3780i::dsp3780I_ReadMsaCfg entry usDspBaseIO %x ulMsaAddr %lx\n", 80 - usDspBaseIO, ulMsaAddr); 81 - 82 78 spin_lock_irqsave(&dsp_lock, flags); 83 79 OutWordDsp(DSP_MsaAddrLow, (unsigned short) ulMsaAddr); 84 80 OutWordDsp(DSP_MsaAddrHigh, (unsigned short) (ulMsaAddr >> 16)); 85 81 val = InWordDsp(DSP_MsaDataDSISHigh); 86 82 spin_unlock_irqrestore(&dsp_lock, flags); 87 - 88 - PRINTK_2(TRACE_3780I, "3780i::dsp3780I_ReadMsaCfg exit val %x\n", val); 89 83 90 84 return val; 91 85 } ··· 88 94 unsigned long ulMsaAddr, unsigned short usValue) 89 95 { 90 96 unsigned long flags; 91 - 92 - PRINTK_4(TRACE_3780I, 93 - "3780i::dsp3780i_WriteMsaCfg entry usDspBaseIO %x ulMsaAddr %lx usValue %x\n", 94 - usDspBaseIO, ulMsaAddr, usValue); 95 97 96 98 spin_lock_irqsave(&dsp_lock, flags); 97 99 OutWordDsp(DSP_MsaAddrLow, (unsigned short) ulMsaAddr); ··· 102 112 DSP_ISA_SLAVE_CONTROL rSlaveControl; 103 113 DSP_ISA_SLAVE_CONTROL rSlaveControl_Save; 104 114 105 - 106 - PRINTK_4(TRACE_3780I, 107 - "3780i::dsp3780i_WriteGenCfg entry usDspBaseIO %x uIndex %x ucValue %x\n", 108 - usDspBaseIO, uIndex, ucValue); 109 - 110 115 MKBYTE(rSlaveControl) = InByteDsp(DSP_IsaSlaveControl); 111 - 112 - PRINTK_2(TRACE_3780I, 113 - "3780i::dsp3780i_WriteGenCfg rSlaveControl %x\n", 114 - MKBYTE(rSlaveControl)); 115 116 116 117 rSlaveControl_Save = rSlaveControl; 117 118 rSlaveControl.ConfigMode = true; 118 - 119 - PRINTK_2(TRACE_3780I, 120 - "3780i::dsp3780i_WriteGenCfg entry rSlaveControl+ConfigMode %x\n", 121 - MKBYTE(rSlaveControl)); 122 119 123 120 OutByteDsp(DSP_IsaSlaveControl, MKBYTE(rSlaveControl)); 124 121 OutByteDsp(DSP_ConfigAddress, (unsigned char) uIndex); 125 122 OutByteDsp(DSP_ConfigData, ucValue); 126 123 OutByteDsp(DSP_IsaSlaveControl, MKBYTE(rSlaveControl_Save)); 127 - 128 - PRINTK_1(TRACE_3780I, "3780i::dsp3780i_WriteGenCfg exit\n"); 129 - 130 - 131 124 } 132 125 133 126 int dsp3780I_EnableDSP(DSP_3780I_CONFIG_SETTINGS * pSettings, ··· 135 162 DSP_CLOCK_CONTROL_2 rClockControl2; 136 163 DSP_ISA_SLAVE_CONTROL rSlaveControl; 137 164 DSP_HBRIDGE_CONTROL rHBridgeControl; 138 - unsigned short ChipID = 0; 139 165 unsigned short tval; 140 - 141 - 142 - PRINTK_2(TRACE_3780I, 143 - "3780i::dsp3780I_EnableDSP entry pSettings->bDSPEnabled %x\n", 144 - pSettings->bDSPEnabled); 145 - 146 166 147 167 if (!pSettings->bDSPEnabled) { 148 168 PRINTK_ERROR( KERN_ERR "3780i::dsp3780I_EnableDSP: Error: DSP not enabled. Aborting.\n" ); 149 169 return -EIO; 150 170 } 151 - 152 - 153 - PRINTK_2(TRACE_3780I, 154 - "3780i::dsp3780i_EnableDSP entry pSettings->bModemEnabled %x\n", 155 - pSettings->bModemEnabled); 156 171 157 172 if (pSettings->bModemEnabled) { 158 173 rUartCfg1.Reserved = rUartCfg2.Reserved = 0; ··· 214 253 rSlaveControl.ConfigMode = false; 215 254 rSlaveControl.Reserved = 0; 216 255 217 - PRINTK_4(TRACE_3780I, 218 - "3780i::dsp3780i_EnableDSP usDspBaseIO %x index %x taddr %x\n", 219 - usDspBaseIO, DSP_IsaSlaveControl, 220 - usDspBaseIO + DSP_IsaSlaveControl); 221 - 222 - PRINTK_2(TRACE_3780I, 223 - "3780i::dsp3780i_EnableDSP rSlaveContrl %x\n", 224 - MKWORD(rSlaveControl)); 225 - 226 256 spin_lock_irqsave(&dsp_lock, flags); 227 257 OutWordDsp(DSP_IsaSlaveControl, MKWORD(rSlaveControl)); 228 258 MKWORD(tval) = InWordDsp(DSP_IsaSlaveControl); 229 - 230 - PRINTK_2(TRACE_3780I, 231 - "3780i::dsp3780i_EnableDSP rSlaveControl 2 %x\n", tval); 232 - 233 259 234 260 for (i = 0; i < 11; i++) 235 261 udelay(2000); ··· 225 277 OutWordDsp(DSP_IsaSlaveControl, MKWORD(rSlaveControl)); 226 278 227 279 MKWORD(tval) = InWordDsp(DSP_IsaSlaveControl); 228 - 229 - PRINTK_2(TRACE_3780I, 230 - "3780i::dsp3780i_EnableDSP rSlaveControl 3 %x\n", tval); 231 - 232 280 233 281 /* Program our general configuration registers */ 234 282 WriteGenCfg(DSP_HBridgeCfg1Index, MKBYTE(rHBridgeCfg1)); ··· 246 302 rHBridgeControl.IoAutoInc = false; 247 303 rHBridgeControl.DiagnosticMode = false; 248 304 249 - PRINTK_3(TRACE_3780I, 250 - "3780i::dsp3780i_EnableDSP DSP_HBridgeControl %x rHBridgeControl %x\n", 251 - DSP_HBridgeControl, MKWORD(rHBridgeControl)); 252 - 253 305 OutWordDsp(DSP_HBridgeControl, MKWORD(rHBridgeControl)); 254 306 spin_unlock_irqrestore(&dsp_lock, flags); 255 307 WriteMsaCfg(DSP_LBusTimeoutDisable, MKWORD(rLBusTimeoutDisable)); ··· 253 313 WriteMsaCfg(DSP_ClockControl_2, MKWORD(rClockControl2)); 254 314 WriteMsaCfg(DSP_ChipReset, MKWORD(rChipReset)); 255 315 256 - ChipID = ReadMsaCfg(DSP_ChipID); 257 - 258 - PRINTK_2(TRACE_3780I, 259 - "3780i::dsp3780I_EnableDSP exiting bRC=true, ChipID %x\n", 260 - ChipID); 316 + ReadMsaCfg(DSP_ChipID); 261 317 262 318 return 0; 263 319 } ··· 263 327 unsigned long flags; 264 328 unsigned short usDspBaseIO = pSettings->usDspBaseIO; 265 329 DSP_ISA_SLAVE_CONTROL rSlaveControl; 266 - 267 - 268 - PRINTK_1(TRACE_3780I, "3780i::dsp3780i_DisableDSP entry\n"); 269 330 270 331 rSlaveControl.ClockControl = 0; 271 332 rSlaveControl.SoftReset = true; ··· 279 346 280 347 udelay(5); 281 348 282 - 283 - PRINTK_1(TRACE_3780I, "3780i::dsp3780i_DisableDSP exit\n"); 284 - 285 349 return 0; 286 350 } 287 351 ··· 289 359 DSP_BOOT_DOMAIN rBootDomain; 290 360 DSP_HBRIDGE_CONTROL rHBridgeControl; 291 361 292 - 293 - PRINTK_1(TRACE_3780I, "3780i::dsp3780i_Reset entry\n"); 294 - 295 362 spin_lock_irqsave(&dsp_lock, flags); 296 363 /* Mask DSP to PC interrupt */ 297 364 MKWORD(rHBridgeControl) = InWordDsp(DSP_HBridgeControl); 298 - 299 - PRINTK_2(TRACE_3780I, "3780i::dsp3780i_Reset rHBridgeControl %x\n", 300 - MKWORD(rHBridgeControl)); 301 365 302 366 rHBridgeControl.EnableDspInt = false; 303 367 OutWordDsp(DSP_HBridgeControl, MKWORD(rHBridgeControl)); ··· 303 379 rBootDomain.NMI = true; 304 380 rBootDomain.Reserved = 0; 305 381 306 - PRINTK_2(TRACE_3780I, "3780i::dsp3780i_Reset rBootDomain %x\n", 307 - MKWORD(rBootDomain)); 308 - 309 382 WriteMsaCfg(DSP_MspBootDomain, MKWORD(rBootDomain)); 310 383 311 384 /* Reset all the chiplets and then reactivate them */ ··· 310 389 udelay(5); 311 390 WriteMsaCfg(DSP_ChipReset, 312 391 (unsigned short) (~pSettings->usChipletEnable)); 313 - 314 - 315 - PRINTK_1(TRACE_3780I, "3780i::dsp3780i_Reset exit bRC=0\n"); 316 392 317 393 return 0; 318 394 } ··· 321 403 unsigned short usDspBaseIO = pSettings->usDspBaseIO; 322 404 DSP_BOOT_DOMAIN rBootDomain; 323 405 DSP_HBRIDGE_CONTROL rHBridgeControl; 324 - 325 - 326 - PRINTK_1(TRACE_3780I, "3780i::dsp3780i_Run entry\n"); 327 - 328 406 329 407 /* Transition the core to a running state */ 330 408 rBootDomain.ResetCore = true; ··· 344 430 MKWORD(rHBridgeControl) = InWordDsp(DSP_HBridgeControl); 345 431 rHBridgeControl.EnableDspInt = true; 346 432 347 - PRINTK_2(TRACE_3780I, "3780i::dsp3780i_Run rHBridgeControl %x\n", 348 - MKWORD(rHBridgeControl)); 349 - 350 433 OutWordDsp(DSP_HBridgeControl, MKWORD(rHBridgeControl)); 351 434 spin_unlock_irqrestore(&dsp_lock, flags); 352 - 353 - 354 - PRINTK_1(TRACE_3780I, "3780i::dsp3780i_Run exit bRC=true\n"); 355 435 356 436 return 0; 357 437 } ··· 357 449 unsigned long flags; 358 450 unsigned short __user *pusBuffer = pvBuffer; 359 451 unsigned short val; 360 - 361 - 362 - PRINTK_5(TRACE_3780I, 363 - "3780i::dsp3780I_ReadDStore entry usDspBaseIO %x, pusBuffer %p, uCount %x, ulDSPAddr %lx\n", 364 - usDspBaseIO, pusBuffer, uCount, ulDSPAddr); 365 - 366 452 367 453 /* Set the initial MSA address. No adjustments need to be made to data store addresses */ 368 454 spin_lock_irqsave(&dsp_lock, flags); ··· 372 470 if(put_user(val, pusBuffer++)) 373 471 return -EFAULT; 374 472 375 - PRINTK_3(TRACE_3780I, 376 - "3780I::dsp3780I_ReadDStore uCount %x val %x\n", 377 - uCount, val); 378 - 379 473 PaceMsaAccess(usDspBaseIO); 380 474 } 381 - 382 - 383 - PRINTK_1(TRACE_3780I, 384 - "3780I::dsp3780I_ReadDStore exit bRC=true\n"); 385 475 386 476 return 0; 387 477 } ··· 385 491 unsigned long flags; 386 492 unsigned short __user *pusBuffer = pvBuffer; 387 493 unsigned short val; 388 - 389 - 390 - PRINTK_5(TRACE_3780I, 391 - "3780i::dsp3780I_ReadAndDStore entry usDspBaseIO %x, pusBuffer %p, uCount %x, ulDSPAddr %lx\n", 392 - usDspBaseIO, pusBuffer, uCount, ulDSPAddr); 393 - 394 494 395 495 /* Set the initial MSA address. No adjustments need to be made to data store addresses */ 396 496 spin_lock_irqsave(&dsp_lock, flags); ··· 400 512 if(put_user(val, pusBuffer++)) 401 513 return -EFAULT; 402 514 403 - PRINTK_3(TRACE_3780I, 404 - "3780I::dsp3780I_ReadAndCleanDStore uCount %x val %x\n", 405 - uCount, val); 406 - 407 515 PaceMsaAccess(usDspBaseIO); 408 516 } 409 - 410 - 411 - PRINTK_1(TRACE_3780I, 412 - "3780I::dsp3780I_ReadAndClearDStore exit bRC=true\n"); 413 517 414 518 return 0; 415 519 } ··· 412 532 { 413 533 unsigned long flags; 414 534 unsigned short __user *pusBuffer = pvBuffer; 415 - 416 - 417 - PRINTK_5(TRACE_3780I, 418 - "3780i::dsp3780D_WriteDStore entry usDspBaseIO %x, pusBuffer %p, uCount %x, ulDSPAddr %lx\n", 419 - usDspBaseIO, pusBuffer, uCount, ulDSPAddr); 420 - 421 535 422 536 /* Set the initial MSA address. No adjustments need to be made to data store addresses */ 423 537 spin_lock_irqsave(&dsp_lock, flags); ··· 428 554 OutWordDsp(DSP_MsaDataDSISHigh, val); 429 555 spin_unlock_irqrestore(&dsp_lock, flags); 430 556 431 - PRINTK_3(TRACE_3780I, 432 - "3780I::dsp3780I_WriteDStore uCount %x val %x\n", 433 - uCount, val); 434 - 435 557 PaceMsaAccess(usDspBaseIO); 436 558 } 437 - 438 - 439 - PRINTK_1(TRACE_3780I, 440 - "3780I::dsp3780D_WriteDStore exit bRC=true\n"); 441 559 442 560 return 0; 443 561 } ··· 440 574 { 441 575 unsigned long flags; 442 576 unsigned short __user *pusBuffer = pvBuffer; 443 - 444 - PRINTK_5(TRACE_3780I, 445 - "3780i::dsp3780I_ReadIStore entry usDspBaseIO %x, pusBuffer %p, uCount %x, ulDSPAddr %lx\n", 446 - usDspBaseIO, pusBuffer, uCount, ulDSPAddr); 447 577 448 578 /* 449 579 * Set the initial MSA address. To convert from an instruction store ··· 464 602 if(put_user(val_hi, pusBuffer++)) 465 603 return -EFAULT; 466 604 467 - PRINTK_4(TRACE_3780I, 468 - "3780I::dsp3780I_ReadIStore uCount %x val_lo %x val_hi %x\n", 469 - uCount, val_lo, val_hi); 470 - 471 605 PaceMsaAccess(usDspBaseIO); 472 606 473 607 } 474 - 475 - PRINTK_1(TRACE_3780I, 476 - "3780I::dsp3780I_ReadIStore exit bRC=true\n"); 477 608 478 609 return 0; 479 610 } ··· 477 622 { 478 623 unsigned long flags; 479 624 unsigned short __user *pusBuffer = pvBuffer; 480 - 481 - PRINTK_5(TRACE_3780I, 482 - "3780i::dsp3780I_WriteIStore entry usDspBaseIO %x, pusBuffer %p, uCount %x, ulDSPAddr %lx\n", 483 - usDspBaseIO, pusBuffer, uCount, ulDSPAddr); 484 - 485 625 486 626 /* 487 627 * Set the initial MSA address. To convert from an instruction store ··· 501 651 OutWordDsp(DSP_MsaDataDSISHigh, val_hi); 502 652 spin_unlock_irqrestore(&dsp_lock, flags); 503 653 504 - PRINTK_4(TRACE_3780I, 505 - "3780I::dsp3780I_WriteIStore uCount %x val_lo %x val_hi %x\n", 506 - uCount, val_lo, val_hi); 507 - 508 654 PaceMsaAccess(usDspBaseIO); 509 - 510 655 } 511 - 512 - PRINTK_1(TRACE_3780I, 513 - "3780I::dsp3780I_WriteIStore exit bRC=true\n"); 514 656 515 657 return 0; 516 658 } ··· 513 671 { 514 672 unsigned long flags; 515 673 DSP_HBRIDGE_CONTROL rHBridgeControl; 516 - unsigned short temp; 517 - 518 - 519 - PRINTK_3(TRACE_3780I, 520 - "3780i::dsp3780I_GetIPCSource entry usDspBaseIO %x pusIPCSource %p\n", 521 - usDspBaseIO, pusIPCSource); 522 674 523 675 /* 524 676 * Disable DSP to PC interrupts, read the interrupt register, ··· 524 688 OutWordDsp(DSP_HBridgeControl, MKWORD(rHBridgeControl)); 525 689 526 690 *pusIPCSource = InWordDsp(DSP_Interrupt); 527 - temp = (unsigned short) ~(*pusIPCSource); 528 - 529 - PRINTK_3(TRACE_3780I, 530 - "3780i::dsp3780I_GetIPCSource, usIPCSource %x ~ %x\n", 531 - *pusIPCSource, temp); 532 - 533 691 OutWordDsp(DSP_Interrupt, (unsigned short) ~(*pusIPCSource)); 534 692 535 693 rHBridgeControl.EnableDspInt = true; 536 694 OutWordDsp(DSP_HBridgeControl, MKWORD(rHBridgeControl)); 537 695 spin_unlock_irqrestore(&dsp_lock, flags); 538 - 539 - 540 - PRINTK_2(TRACE_3780I, 541 - "3780i::dsp3780I_GetIPCSource exit usIPCSource %x\n", 542 - *pusIPCSource); 543 696 544 697 return 0; 545 698 }
-3
drivers/char/mwave/Makefile
··· 8 8 obj-$(CONFIG_MWAVE) += mwave.o 9 9 10 10 mwave-y := mwavedd.o smapi.o tp3780i.o 3780i.o 11 - 12 - # To compile in lots (~20 KiB) of run-time enablable printk()s for debugging: 13 - ccflags-y += -DMW_TRACE
-10
drivers/char/mwave/README
··· 4 4 The mwave module takes the following options. Note that these options 5 5 are not saved by the BIOS and so do not persist after unload and reload. 6 6 7 - mwave_debug=value, where value is bitwise OR of trace flags: 8 - 0x0001 mwavedd api tracing 9 - 0x0002 smapi api tracing 10 - 0x0004 3780i tracing 11 - 0x0008 tp3780i tracing 12 - 13 - Tracing only occurs if the driver has been compiled with the 14 - MW_TRACE macro #defined (i.e. let ccflags-y := -DMW_TRACE 15 - in the Makefile). 16 - 17 7 mwave_3780i_irq=5/7/10/11/15 18 8 If the dsp irq has not been setup and stored in bios by the 19 9 thinkpad configuration utility then this parameter allows the
+1 -115
drivers/char/mwave/mwavedd.c
··· 75 75 * We'll depend on users using the tpctl utility to do that for now 76 76 */ 77 77 static DEFINE_MUTEX(mwave_mutex); 78 - int mwave_debug = 0; 79 78 int mwave_3780i_irq = 0; 80 79 int mwave_3780i_io = 0; 81 80 int mwave_uart_irq = 0; 82 81 int mwave_uart_io = 0; 83 - module_param(mwave_debug, int, 0); 84 82 module_param_hw(mwave_3780i_irq, int, irq, 0); 85 83 module_param_hw(mwave_3780i_io, int, ioport, 0); 86 84 module_param_hw(mwave_uart_irq, int, irq, 0); ··· 93 95 pMWAVE_DEVICE_DATA pDrvData = &mwave_s_mdd; 94 96 void __user *arg = (void __user *)ioarg; 95 97 96 - PRINTK_4(TRACE_MWAVE, 97 - "mwavedd::mwave_ioctl, entry file %p cmd %x arg %x\n", 98 - file, iocmd, (int) ioarg); 99 - 100 98 switch (iocmd) { 101 99 102 100 case IOCTL_MW_RESET: 103 - PRINTK_1(TRACE_MWAVE, 104 - "mwavedd::mwave_ioctl, IOCTL_MW_RESET" 105 - " calling tp3780I_ResetDSP\n"); 106 101 mutex_lock(&mwave_mutex); 107 102 retval = tp3780I_ResetDSP(&pDrvData->rBDData); 108 103 mutex_unlock(&mwave_mutex); 109 - PRINTK_2(TRACE_MWAVE, 110 - "mwavedd::mwave_ioctl, IOCTL_MW_RESET" 111 - " retval %x from tp3780I_ResetDSP\n", 112 - retval); 113 104 break; 114 105 115 106 case IOCTL_MW_RUN: 116 - PRINTK_1(TRACE_MWAVE, 117 - "mwavedd::mwave_ioctl, IOCTL_MW_RUN" 118 - " calling tp3780I_StartDSP\n"); 119 107 mutex_lock(&mwave_mutex); 120 108 retval = tp3780I_StartDSP(&pDrvData->rBDData); 121 109 mutex_unlock(&mwave_mutex); 122 - PRINTK_2(TRACE_MWAVE, 123 - "mwavedd::mwave_ioctl, IOCTL_MW_RUN" 124 - " retval %x from tp3780I_StartDSP\n", 125 - retval); 126 110 break; 127 111 128 112 case IOCTL_MW_DSP_ABILITIES: { 129 113 MW_ABILITIES rAbilities; 130 114 131 - PRINTK_1(TRACE_MWAVE, 132 - "mwavedd::mwave_ioctl," 133 - " IOCTL_MW_DSP_ABILITIES calling" 134 - " tp3780I_QueryAbilities\n"); 135 115 mutex_lock(&mwave_mutex); 136 116 retval = tp3780I_QueryAbilities(&pDrvData->rBDData, 137 117 &rAbilities); 138 118 mutex_unlock(&mwave_mutex); 139 - PRINTK_2(TRACE_MWAVE, 140 - "mwavedd::mwave_ioctl, IOCTL_MW_DSP_ABILITIES" 141 - " retval %x from tp3780I_QueryAbilities\n", 142 - retval); 143 119 if (retval == 0) { 144 120 if( copy_to_user(arg, &rAbilities, 145 121 sizeof(MW_ABILITIES)) ) 146 122 return -EFAULT; 147 123 } 148 - PRINTK_2(TRACE_MWAVE, 149 - "mwavedd::mwave_ioctl, IOCTL_MW_DSP_ABILITIES" 150 - " exit retval %x\n", 151 - retval); 152 124 } 153 125 break; 154 126 ··· 132 164 return -EFAULT; 133 165 pusBuffer = (unsigned short __user *) (rReadData.pBuf); 134 166 135 - PRINTK_4(TRACE_MWAVE, 136 - "mwavedd::mwave_ioctl IOCTL_MW_READ_DATA," 137 - " size %lx, ioarg %lx pusBuffer %p\n", 138 - rReadData.ulDataLength, ioarg, pusBuffer); 139 167 mutex_lock(&mwave_mutex); 140 168 retval = tp3780I_ReadWriteDspDStore(&pDrvData->rBDData, 141 169 iocmd, ··· 151 187 return -EFAULT; 152 188 pusBuffer = (unsigned short __user *) (rReadData.pBuf); 153 189 154 - PRINTK_4(TRACE_MWAVE, 155 - "mwavedd::mwave_ioctl IOCTL_MW_READ_INST," 156 - " size %lx, ioarg %lx pusBuffer %p\n", 157 - rReadData.ulDataLength / 2, ioarg, 158 - pusBuffer); 159 190 mutex_lock(&mwave_mutex); 160 191 retval = tp3780I_ReadWriteDspDStore(&pDrvData->rBDData, 161 192 iocmd, pusBuffer, ··· 169 210 return -EFAULT; 170 211 pusBuffer = (unsigned short __user *) (rWriteData.pBuf); 171 212 172 - PRINTK_4(TRACE_MWAVE, 173 - "mwavedd::mwave_ioctl IOCTL_MW_WRITE_DATA," 174 - " size %lx, ioarg %lx pusBuffer %p\n", 175 - rWriteData.ulDataLength, ioarg, 176 - pusBuffer); 177 213 mutex_lock(&mwave_mutex); 178 214 retval = tp3780I_ReadWriteDspDStore(&pDrvData->rBDData, 179 215 iocmd, pusBuffer, ··· 187 233 return -EFAULT; 188 234 pusBuffer = (unsigned short __user *)(rWriteData.pBuf); 189 235 190 - PRINTK_4(TRACE_MWAVE, 191 - "mwavedd::mwave_ioctl IOCTL_MW_WRITE_INST," 192 - " size %lx, ioarg %lx pusBuffer %p\n", 193 - rWriteData.ulDataLength, ioarg, 194 - pusBuffer); 195 236 mutex_lock(&mwave_mutex); 196 237 retval = tp3780I_ReadWriteDspIStore(&pDrvData->rBDData, 197 238 iocmd, pusBuffer, ··· 209 260 } 210 261 ipcnum = array_index_nospec(ipcnum, 211 262 ARRAY_SIZE(pDrvData->IPCs)); 212 - PRINTK_3(TRACE_MWAVE, 213 - "mwavedd::mwave_ioctl IOCTL_MW_REGISTER_IPC" 214 - " ipcnum %x entry usIntCount %x\n", 215 - ipcnum, 216 - pDrvData->IPCs[ipcnum].usIntCount); 217 263 218 264 mutex_lock(&mwave_mutex); 219 265 pDrvData->IPCs[ipcnum].bIsHere = false; 220 266 pDrvData->IPCs[ipcnum].bIsEnabled = true; 221 267 mutex_unlock(&mwave_mutex); 222 - 223 - PRINTK_2(TRACE_MWAVE, 224 - "mwavedd::mwave_ioctl IOCTL_MW_REGISTER_IPC" 225 - " ipcnum %x exit\n", 226 - ipcnum); 227 268 } 228 269 break; 229 270 ··· 229 290 } 230 291 ipcnum = array_index_nospec(ipcnum, 231 292 ARRAY_SIZE(pDrvData->IPCs)); 232 - PRINTK_3(TRACE_MWAVE, 233 - "mwavedd::mwave_ioctl IOCTL_MW_GET_IPC" 234 - " ipcnum %x, usIntCount %x\n", 235 - ipcnum, 236 - pDrvData->IPCs[ipcnum].usIntCount); 237 - 293 + 238 294 mutex_lock(&mwave_mutex); 239 295 if (pDrvData->IPCs[ipcnum].bIsEnabled == true) { 240 296 DECLARE_WAITQUEUE(wait, current); 241 297 242 - PRINTK_2(TRACE_MWAVE, 243 - "mwavedd::mwave_ioctl, thread for" 244 - " ipc %x going to sleep\n", 245 - ipcnum); 246 298 add_wait_queue(&pDrvData->IPCs[ipcnum].ipc_wait_queue, &wait); 247 299 pDrvData->IPCs[ipcnum].bIsHere = true; 248 300 set_current_state(TASK_INTERRUPTIBLE); ··· 241 311 /* the interrupt handler while we were gone */ 242 312 if (pDrvData->IPCs[ipcnum].usIntCount == 1) { /* first int has occurred (race condition) */ 243 313 pDrvData->IPCs[ipcnum].usIntCount = 2; /* first int has been handled */ 244 - PRINTK_2(TRACE_MWAVE, 245 - "mwavedd::mwave_ioctl" 246 - " IOCTL_MW_GET_IPC ipcnum %x" 247 - " handling first int\n", 248 - ipcnum); 249 314 } else { /* either 1st int has not yet occurred, or we have already handled the first int */ 250 315 schedule(); 251 316 if (pDrvData->IPCs[ipcnum].usIntCount == 1) { 252 317 pDrvData->IPCs[ipcnum].usIntCount = 2; 253 318 } 254 - PRINTK_2(TRACE_MWAVE, 255 - "mwavedd::mwave_ioctl" 256 - " IOCTL_MW_GET_IPC ipcnum %x" 257 - " woke up and returning to" 258 - " application\n", 259 - ipcnum); 260 319 } 261 320 pDrvData->IPCs[ipcnum].bIsHere = false; 262 321 remove_wait_queue(&pDrvData->IPCs[ipcnum].ipc_wait_queue, &wait); 263 322 set_current_state(TASK_RUNNING); 264 - PRINTK_2(TRACE_MWAVE, 265 - "mwavedd::mwave_ioctl IOCTL_MW_GET_IPC," 266 - " returning thread for ipc %x" 267 - " processing\n", 268 - ipcnum); 269 323 } 270 324 mutex_unlock(&mwave_mutex); 271 325 } ··· 258 344 case IOCTL_MW_UNREGISTER_IPC: { 259 345 unsigned int ipcnum = (unsigned int) ioarg; 260 346 261 - PRINTK_2(TRACE_MWAVE, 262 - "mwavedd::mwave_ioctl IOCTL_MW_UNREGISTER_IPC" 263 - " ipcnum %x\n", 264 - ipcnum); 265 347 if (ipcnum >= ARRAY_SIZE(pDrvData->IPCs)) { 266 348 PRINTK_ERROR(KERN_ERR_MWAVE 267 349 "mwavedd::mwave_ioctl:" ··· 282 372 default: 283 373 return -ENOTTY; 284 374 } /* switch */ 285 - 286 - PRINTK_2(TRACE_MWAVE, "mwavedd::mwave_ioctl, exit retval %x\n", retval); 287 375 288 376 return retval; 289 377 } ··· 348 440 { 349 441 pMWAVE_DEVICE_DATA pDrvData = &mwave_s_mdd; 350 442 351 - PRINTK_1(TRACE_MWAVE, "mwavedd::mwave_exit entry\n"); 352 - 353 443 if ( pDrvData->sLine >= 0 ) { 354 444 serial8250_unregister_port(pDrvData->sLine); 355 445 } ··· 363 457 if (pDrvData->bBDInitialized) { 364 458 tp3780I_Cleanup(&pDrvData->rBDData); 365 459 } 366 - 367 - PRINTK_1(TRACE_MWAVE, "mwavedd::mwave_exit exit\n"); 368 460 } 369 461 370 462 module_exit(mwave_exit); ··· 372 468 int i; 373 469 int retval = 0; 374 470 pMWAVE_DEVICE_DATA pDrvData = &mwave_s_mdd; 375 - 376 - PRINTK_1(TRACE_MWAVE, "mwavedd::mwave_init entry\n"); 377 471 378 472 memset(&mwave_s_mdd, 0, sizeof(MWAVE_DEVICE_DATA)); 379 473 ··· 390 488 } 391 489 392 490 retval = tp3780I_InitializeBoardData(&pDrvData->rBDData); 393 - PRINTK_2(TRACE_MWAVE, 394 - "mwavedd::mwave_init, return from tp3780I_InitializeBoardData" 395 - " retval %x\n", 396 - retval); 397 491 if (retval) { 398 492 PRINTK_ERROR(KERN_ERR_MWAVE 399 493 "mwavedd::mwave_init: Error:" ··· 399 501 pDrvData->bBDInitialized = true; 400 502 401 503 retval = tp3780I_CalcResources(&pDrvData->rBDData); 402 - PRINTK_2(TRACE_MWAVE, 403 - "mwavedd::mwave_init, return from tp3780I_CalcResources" 404 - " retval %x\n", 405 - retval); 406 504 if (retval) { 407 505 PRINTK_ERROR(KERN_ERR_MWAVE 408 506 "mwavedd:mwave_init: Error:" ··· 407 513 } 408 514 409 515 retval = tp3780I_ClaimResources(&pDrvData->rBDData); 410 - PRINTK_2(TRACE_MWAVE, 411 - "mwavedd::mwave_init, return from tp3780I_ClaimResources" 412 - " retval %x\n", 413 - retval); 414 516 if (retval) { 415 517 PRINTK_ERROR(KERN_ERR_MWAVE 416 518 "mwavedd:mwave_init: Error:" ··· 416 526 pDrvData->bResourcesClaimed = true; 417 527 418 528 retval = tp3780I_EnableDSP(&pDrvData->rBDData); 419 - PRINTK_2(TRACE_MWAVE, 420 - "mwavedd::mwave_init, return from tp3780I_EnableDSP" 421 - " retval %x\n", 422 - retval); 423 529 if (retval) { 424 530 PRINTK_ERROR(KERN_ERR_MWAVE 425 531 "mwavedd:mwave_init: Error:"
-59
drivers/char/mwave/mwavedd.h
··· 56 56 #include <linux/uaccess.h> 57 57 #include <linux/wait.h> 58 58 59 - extern int mwave_debug; 60 59 extern int mwave_3780i_irq; 61 60 extern int mwave_3780i_io; 62 61 extern int mwave_uart_irq; ··· 63 64 64 65 #define PRINTK_ERROR printk 65 66 #define KERN_ERR_MWAVE KERN_ERR "mwave: " 66 - 67 - #define TRACE_MWAVE 0x0001 68 - #define TRACE_SMAPI 0x0002 69 - #define TRACE_3780I 0x0004 70 - #define TRACE_TP3780I 0x0008 71 - 72 - #ifdef MW_TRACE 73 - #define PRINTK_1(f,s) \ 74 - if (f & (mwave_debug)) { \ 75 - printk(s); \ 76 - } 77 - 78 - #define PRINTK_2(f,s,v1) \ 79 - if (f & (mwave_debug)) { \ 80 - printk(s,v1); \ 81 - } 82 - 83 - #define PRINTK_3(f,s,v1,v2) \ 84 - if (f & (mwave_debug)) { \ 85 - printk(s,v1,v2); \ 86 - } 87 - 88 - #define PRINTK_4(f,s,v1,v2,v3) \ 89 - if (f & (mwave_debug)) { \ 90 - printk(s,v1,v2,v3); \ 91 - } 92 - 93 - #define PRINTK_5(f,s,v1,v2,v3,v4) \ 94 - if (f & (mwave_debug)) { \ 95 - printk(s,v1,v2,v3,v4); \ 96 - } 97 - 98 - #define PRINTK_6(f,s,v1,v2,v3,v4,v5) \ 99 - if (f & (mwave_debug)) { \ 100 - printk(s,v1,v2,v3,v4,v5); \ 101 - } 102 - 103 - #define PRINTK_7(f,s,v1,v2,v3,v4,v5,v6) \ 104 - if (f & (mwave_debug)) { \ 105 - printk(s,v1,v2,v3,v4,v5,v6); \ 106 - } 107 - 108 - #define PRINTK_8(f,s,v1,v2,v3,v4,v5,v6,v7) \ 109 - if (f & (mwave_debug)) { \ 110 - printk(s,v1,v2,v3,v4,v5,v6,v7); \ 111 - } 112 - 113 - #else 114 - #define PRINTK_1(f,s) 115 - #define PRINTK_2(f,s,v1) 116 - #define PRINTK_3(f,s,v1,v2) 117 - #define PRINTK_4(f,s,v1,v2,v3) 118 - #define PRINTK_5(f,s,v1,v2,v3,v4) 119 - #define PRINTK_6(f,s,v1,v2,v3,v4,v5) 120 - #define PRINTK_7(f,s,v1,v2,v3,v4,v5,v6) 121 - #define PRINTK_8(f,s,v1,v2,v3,v4,v5,v6,v7) 122 - #endif 123 - 124 67 125 68 typedef struct _MWAVE_IPC { 126 69 unsigned short usIntCount; /* 0=none, 1=first, 2=greater than 1st */
+3 -50
drivers/char/mwave/smapi.c
··· 69 69 unsigned short usSmapiOK = -EIO, *pusSmapiOK = &usSmapiOK; 70 70 unsigned int inBXCX = (inBX << 16) | inCX; 71 71 unsigned int inDISI = (inDI << 16) | inSI; 72 - int retval = 0; 73 - 74 - PRINTK_5(TRACE_SMAPI, "inBX %x inCX %x inDI %x inSI %x\n", 75 - inBX, inCX, inDI, inSI); 76 72 77 73 __asm__ __volatile__("movw $0x5380,%%ax\n\t" 78 74 "movl %7,%%ebx\n\t" ··· 103 107 :"%eax", "%ebx", "%ecx", "%edx", "%edi", 104 108 "%esi"); 105 109 106 - PRINTK_8(TRACE_SMAPI, 107 - "myoutAX %x myoutBX %x myoutCX %x myoutDX %x myoutDI %x myoutSI %x usSmapiOK %x\n", 108 - myoutAX, myoutBX, myoutCX, myoutDX, myoutDI, myoutSI, 109 - usSmapiOK); 110 110 *outAX = myoutAX; 111 111 *outBX = myoutBX; 112 112 *outCX = myoutCX; ··· 110 118 *outDI = myoutDI; 111 119 *outSI = myoutSI; 112 120 113 - retval = (usSmapiOK == 1) ? 0 : -EIO; 114 - PRINTK_2(TRACE_SMAPI, "smapi::smapi_request exit retval %x\n", retval); 115 - return retval; 121 + return usSmapiOK == 1 ? 0 : -EIO; 116 122 } 117 123 118 124 ··· 124 134 static const unsigned short ausUartBases[] = { 125 135 0x03F8, 0x02F8, 0x03E8, 0x02E8 }; 126 136 127 - PRINTK_1(TRACE_SMAPI, "smapi::smapi_query_DSP_cfg entry\n"); 128 - 129 137 bRC = smapi_request(0x1802, 0x0000, 0, 0, 130 138 &usAX, &usBX, &usCX, &usDX, &usDI, &usSI); 131 139 if (bRC) { 132 140 PRINTK_ERROR(KERN_ERR_MWAVE "smapi::smapi_query_DSP_cfg: Error: Could not get DSP Settings. Aborting.\n"); 133 141 return bRC; 134 142 } 135 - 136 - PRINTK_1(TRACE_SMAPI, "smapi::smapi_query_DSP_cfg, smapi_request OK\n"); 137 143 138 144 pSettings->bDSPPresent = ((usBX & 0x0100) != 0); 139 145 pSettings->bDSPEnabled = ((usCX & 0x0001) != 0); ··· 140 154 } else { 141 155 pSettings->usDspBaseIO = 0; 142 156 } 143 - PRINTK_6(TRACE_SMAPI, 144 - "smapi::smapi_query_DSP_cfg get DSP Settings bDSPPresent %x bDSPEnabled %x usDspIRQ %x usDspDMA %x usDspBaseIO %x\n", 145 - pSettings->bDSPPresent, pSettings->bDSPEnabled, 146 - pSettings->usDspIRQ, pSettings->usDspDMA, 147 - pSettings->usDspBaseIO); 148 157 149 158 /* check for illegal values */ 150 159 if ( pSettings->usDspBaseIO == 0 ) ··· 154 173 return bRC; 155 174 } 156 175 157 - PRINTK_1(TRACE_SMAPI, "smapi::smapi_query_DSP_cfg, smapi_request OK\n"); 158 - 159 176 pSettings->bModemEnabled = ((usCX & 0x0001) != 0); 160 177 pSettings->usUartIRQ = usSI & 0x000F; 161 178 if (((usSI & 0xFF00) >> 8) < ARRAY_SIZE(ausUartBases)) { ··· 162 183 pSettings->usUartBaseIO = 0; 163 184 } 164 185 165 - PRINTK_4(TRACE_SMAPI, 166 - "smapi::smapi_query_DSP_cfg get DSP modem settings bModemEnabled %x usUartIRQ %x usUartBaseIO %x\n", 167 - pSettings->bModemEnabled, 168 - pSettings->usUartIRQ, 169 - pSettings->usUartBaseIO); 170 - 171 186 /* check for illegal values */ 172 187 if ( pSettings->usUartBaseIO == 0 ) 173 188 PRINTK_ERROR(KERN_ERR_MWAVE "smapi::smapi_query_DSP_cfg: Worry: UART base I/O address is 0\n"); 174 189 if ( pSettings->usUartIRQ == 0 ) 175 190 PRINTK_ERROR(KERN_ERR_MWAVE "smapi::smapi_query_DSP_cfg: Worry: UART IRQ line is 0\n"); 176 - 177 - PRINTK_2(TRACE_SMAPI, "smapi::smapi_query_DSP_cfg exit bRC %x\n", bRC); 178 191 179 192 return bRC; 180 193 } ··· 188 217 3, 4 }; 189 218 190 219 unsigned short dspio_index = 0, uartio_index = 0; 191 - 192 - PRINTK_5(TRACE_SMAPI, 193 - "smapi::smapi_set_DSP_cfg entry mwave_3780i_irq %x mwave_3780i_io %x mwave_uart_irq %x mwave_uart_io %x\n", 194 - mwave_3780i_irq, mwave_3780i_io, mwave_uart_irq, mwave_uart_io); 195 220 196 221 if (mwave_3780i_io) { 197 222 for (i = 0; i < ARRAY_SIZE(ausDspBases); i++) { ··· 341 374 if (bRC) goto exit_smapi_request_error; 342 375 343 376 /* normal exit: */ 344 - PRINTK_1(TRACE_SMAPI, "smapi::smapi_set_DSP_cfg exit\n"); 345 377 return 0; 346 378 347 379 exit_conflict: ··· 355 389 356 390 int smapi_set_DSP_power_state(bool bOn) 357 391 { 358 - int bRC; 359 392 unsigned short usAX, usBX, usCX, usDX, usDI, usSI; 360 393 unsigned short usPowerFunction; 361 394 362 - PRINTK_2(TRACE_SMAPI, "smapi::smapi_set_DSP_power_state entry bOn %x\n", bOn); 363 - 364 395 usPowerFunction = (bOn) ? 1 : 0; 365 396 366 - bRC = smapi_request(0x4901, 0x0000, 0, usPowerFunction, 367 - &usAX, &usBX, &usCX, &usDX, &usDI, &usSI); 368 - 369 - PRINTK_2(TRACE_SMAPI, "smapi::smapi_set_DSP_power_state exit bRC %x\n", bRC); 370 - 371 - return bRC; 397 + return smapi_request(0x4901, 0x0000, 0, usPowerFunction, &usAX, &usBX, &usCX, &usDX, &usDI, 398 + &usSI); 372 399 } 373 400 374 401 int smapi_init(void) ··· 370 411 unsigned short usSmapiID = 0; 371 412 unsigned long flags; 372 413 373 - PRINTK_1(TRACE_SMAPI, "smapi::smapi_init entry\n"); 374 - 375 414 spin_lock_irqsave(&rtc_lock, flags); 376 415 usSmapiID = CMOS_READ(0x7C); 377 416 usSmapiID |= (CMOS_READ(0x7D) << 8); 378 417 spin_unlock_irqrestore(&rtc_lock, flags); 379 - PRINTK_2(TRACE_SMAPI, "smapi::smapi_init usSmapiID %x\n", usSmapiID); 380 418 381 419 if (usSmapiID == 0x5349) { 382 420 spin_lock_irqsave(&rtc_lock, flags); ··· 383 427 if (g_usSmapiPort == 0) { 384 428 PRINTK_ERROR("smapi::smapi_init, ERROR unable to read from SMAPI port\n"); 385 429 } else { 386 - PRINTK_2(TRACE_SMAPI, 387 - "smapi::smapi_init, exit true g_usSmapiPort %x\n", 388 - g_usSmapiPort); 389 430 retval = 0; 390 431 //SmapiQuerySystemID(); 391 432 }
+9 -111
drivers/char/mwave/tp3780i.c
··· 73 73 DSP_GPIO_DRIVER_ENABLE_15_8 rGpioDriverEnable; 74 74 DSP_GPIO_MODE_15_8 rGpioMode; 75 75 76 - PRINTK_1(TRACE_TP3780I, "tp3780i::EnableSRAM, entry\n"); 77 - 78 76 MKWORD(rGpioMode) = ReadMsaCfg(DSP_GpioModeControl_15_8); 79 77 rGpioMode.GpioMode10 = 0; 80 78 WriteMsaCfg(DSP_GpioModeControl_15_8, MKWORD(rGpioMode)); ··· 86 88 rGpioOutputData.Latch10 = 0; 87 89 rGpioOutputData.Mask10 = true; 88 90 WriteMsaCfg(DSP_GpioOutputData_15_8, MKWORD(rGpioOutputData)); 89 - 90 - PRINTK_1(TRACE_TP3780I, "tp3780i::EnableSRAM exit\n"); 91 91 } 92 92 93 93 94 94 static irqreturn_t UartInterrupt(int irq, void *dev_id) 95 95 { 96 - PRINTK_3(TRACE_TP3780I, 97 - "tp3780i::UartInterrupt entry irq %x dev_id %p\n", irq, dev_id); 98 96 return IRQ_HANDLED; 99 97 } 100 98 ··· 101 107 unsigned short usDspBaseIO = pSettings->usDspBaseIO; 102 108 unsigned short usIPCSource = 0, usIsolationMask, usPCNum; 103 109 104 - PRINTK_3(TRACE_TP3780I, 105 - "tp3780i::DspInterrupt entry irq %x dev_id %p\n", irq, dev_id); 106 - 107 110 if (dsp3780I_GetIPCSource(usDspBaseIO, &usIPCSource) == 0) { 108 - PRINTK_2(TRACE_TP3780I, 109 - "tp3780i::DspInterrupt, return from dsp3780i_GetIPCSource, usIPCSource %x\n", 110 - usIPCSource); 111 111 usIsolationMask = 1; 112 112 for (usPCNum = 1; usPCNum <= 16; usPCNum++) { 113 113 if (usIPCSource & usIsolationMask) { 114 114 usIPCSource &= ~usIsolationMask; 115 - PRINTK_3(TRACE_TP3780I, 116 - "tp3780i::DspInterrupt usPCNum %x usIPCSource %x\n", 117 - usPCNum, usIPCSource); 118 115 if (pDrvData->IPCs[usPCNum - 1].usIntCount == 0) { 119 116 pDrvData->IPCs[usPCNum - 1].usIntCount = 1; 120 117 } 121 - PRINTK_2(TRACE_TP3780I, 122 - "tp3780i::DspInterrupt usIntCount %x\n", 123 - pDrvData->IPCs[usPCNum - 1].usIntCount); 124 118 if (pDrvData->IPCs[usPCNum - 1].bIsEnabled == true) { 125 - PRINTK_2(TRACE_TP3780I, 126 - "tp3780i::DspInterrupt, waking up usPCNum %x\n", 127 - usPCNum - 1); 128 119 wake_up_interruptible(&pDrvData->IPCs[usPCNum - 1].ipc_wait_queue); 129 - } else { 130 - PRINTK_2(TRACE_TP3780I, 131 - "tp3780i::DspInterrupt, no one waiting for IPC %x\n", 132 - usPCNum - 1); 133 120 } 134 121 } 135 122 if (usIPCSource == 0) ··· 118 143 /* try next IPC */ 119 144 usIsolationMask = usIsolationMask << 1; 120 145 } 121 - } else { 122 - PRINTK_1(TRACE_TP3780I, 123 - "tp3780i::DspInterrupt, return false from dsp3780i_GetIPCSource\n"); 124 146 } 125 - PRINTK_1(TRACE_TP3780I, "tp3780i::DspInterrupt exit\n"); 126 147 return IRQ_HANDLED; 127 148 } 128 149 ··· 127 156 { 128 157 int retval = 0; 129 158 DSP_3780I_CONFIG_SETTINGS *pSettings = &pBDData->rDspSettings; 130 - 131 - 132 - PRINTK_2(TRACE_TP3780I, "tp3780i::tp3780I_InitializeBoardData entry pBDData %p\n", pBDData); 133 159 134 160 pBDData->bDSPEnabled = false; 135 161 pSettings->bInterruptClaimed = false; ··· 140 172 } 141 173 } 142 174 143 - PRINTK_2(TRACE_TP3780I, "tp3780i::tp3780I_InitializeBoardData exit retval %x\n", retval); 144 - 145 175 return retval; 146 176 } 147 177 148 178 void tp3780I_Cleanup(THINKPAD_BD_DATA *pBDData) 149 179 { 150 - PRINTK_2(TRACE_TP3780I, 151 - "tp3780i::tp3780I_Cleanup entry and exit pBDData %p\n", pBDData); 152 180 } 153 181 154 182 int tp3780I_CalcResources(THINKPAD_BD_DATA * pBDData) 155 183 { 156 184 SMAPI_DSP_SETTINGS rSmapiInfo; 157 185 DSP_3780I_CONFIG_SETTINGS *pSettings = &pBDData->rDspSettings; 158 - 159 - PRINTK_2(TRACE_TP3780I, 160 - "tp3780i::tp3780I_CalcResources entry pBDData %p\n", pBDData); 161 186 162 187 if (smapi_query_DSP_cfg(&rSmapiInfo)) { 163 188 PRINTK_ERROR(KERN_ERR_MWAVE "tp3780i::tp3780I_CalcResources: Error: Could not query DSP config. Aborting.\n"); ··· 186 225 pBDData->bShareDspIrq = pBDData->bShareUartIrq = 0; 187 226 } 188 227 189 - PRINTK_1(TRACE_TP3780I, "tp3780i::tp3780I_CalcResources exit\n"); 190 - 191 228 return 0; 192 229 } 193 230 ··· 196 237 DSP_3780I_CONFIG_SETTINGS *pSettings = &pBDData->rDspSettings; 197 238 struct resource *pres; 198 239 199 - PRINTK_2(TRACE_TP3780I, 200 - "tp3780i::tp3780I_ClaimResources entry pBDData %p\n", pBDData); 201 - 202 240 pres = request_region(pSettings->usDspBaseIO, 16, "mwave_3780i"); 203 241 if ( pres == NULL ) retval = -EIO; 204 242 205 243 if (retval) { 206 244 PRINTK_ERROR(KERN_ERR_MWAVE "tp3780i::tp3780I_ClaimResources: Error: Could not claim I/O region starting at %x\n", pSettings->usDspBaseIO); 207 - retval = -EIO; 245 + return -EIO; 208 246 } 209 - 210 - PRINTK_2(TRACE_TP3780I, "tp3780i::tp3780I_ClaimResources exit retval %x\n", retval); 211 247 212 248 return retval; 213 249 } 214 250 215 251 int tp3780I_ReleaseResources(THINKPAD_BD_DATA * pBDData) 216 252 { 217 - int retval = 0; 218 253 DSP_3780I_CONFIG_SETTINGS *pSettings = &pBDData->rDspSettings; 219 - 220 - PRINTK_2(TRACE_TP3780I, 221 - "tp3780i::tp3780I_ReleaseResources entry pBDData %p\n", pBDData); 222 254 223 255 release_region(pSettings->usDspBaseIO & (~3), 16); 224 256 ··· 218 268 pSettings->bInterruptClaimed = false; 219 269 } 220 270 221 - PRINTK_2(TRACE_TP3780I, 222 - "tp3780i::tp3780I_ReleaseResources exit retval %x\n", retval); 223 - 224 - return retval; 271 + return 0; 225 272 } 226 273 227 274 ··· 227 280 { 228 281 DSP_3780I_CONFIG_SETTINGS *pSettings = &pBDData->rDspSettings; 229 282 bool bDSPPoweredUp = false, bInterruptAllocated = false; 230 - 231 - PRINTK_2(TRACE_TP3780I, "tp3780i::tp3780I_EnableDSP entry pBDData %p\n", pBDData); 232 283 233 284 if (pBDData->bDSPEnabled) { 234 285 PRINTK_ERROR(KERN_ERR_MWAVE "tp3780i::tp3780I_EnableDSP: Error: DSP already enabled!\n"); ··· 311 366 PRINTK_ERROR("tp3780i::tp3780I_EnableDSP: Error: Could not get 3780i IRQ %x\n", pSettings->usDspIrq); 312 367 goto exit_cleanup; 313 368 } else { 314 - PRINTK_3(TRACE_TP3780I, 315 - "tp3780i::tp3780I_EnableDSP, got interrupt %x bShareDspIrq %x\n", 316 - pSettings->usDspIrq, pBDData->bShareDspIrq); 317 369 bInterruptAllocated = true; 318 370 pSettings->bInterruptClaimed = true; 319 371 } ··· 332 390 333 391 pBDData->bDSPEnabled = true; 334 392 335 - PRINTK_1(TRACE_TP3780I, "tp3780i::tp3780I_EnableDSP exit\n"); 336 - 337 393 return 0; 338 394 339 395 exit_cleanup: ··· 348 408 349 409 int tp3780I_DisableDSP(THINKPAD_BD_DATA * pBDData) 350 410 { 351 - int retval = 0; 352 411 DSP_3780I_CONFIG_SETTINGS *pSettings = &pBDData->rDspSettings; 353 - 354 - PRINTK_2(TRACE_TP3780I, "tp3780i::tp3780I_DisableDSP entry pBDData %p\n", pBDData); 355 412 356 413 if (pBDData->bDSPEnabled) { 357 414 dsp3780I_DisableDSP(&pBDData->rDspSettings); ··· 360 423 pBDData->bDSPEnabled = false; 361 424 } 362 425 363 - PRINTK_2(TRACE_TP3780I, "tp3780i::tp3780I_DisableDSP exit retval %x\n", retval); 364 - 365 - return retval; 426 + return 0; 366 427 } 367 428 368 429 369 430 int tp3780I_ResetDSP(THINKPAD_BD_DATA * pBDData) 370 431 { 371 - int retval = 0; 372 432 DSP_3780I_CONFIG_SETTINGS *pSettings = &pBDData->rDspSettings; 373 - 374 - PRINTK_2(TRACE_TP3780I, "tp3780i::tp3780I_ResetDSP entry pBDData %p\n", 375 - pBDData); 376 433 377 434 if (dsp3780I_Reset(pSettings) == 0) { 378 435 EnableSRAM(pBDData); 379 - } else { 380 - retval = -EIO; 436 + return 0; 381 437 } 382 - 383 - PRINTK_2(TRACE_TP3780I, "tp3780i::tp3780I_ResetDSP exit retval %x\n", retval); 384 - 385 - return retval; 438 + return -EIO; 386 439 } 387 440 388 441 389 442 int tp3780I_StartDSP(THINKPAD_BD_DATA * pBDData) 390 443 { 391 - int retval = 0; 392 444 DSP_3780I_CONFIG_SETTINGS *pSettings = &pBDData->rDspSettings; 393 - 394 - PRINTK_2(TRACE_TP3780I, "tp3780i::tp3780I_StartDSP entry pBDData %p\n", pBDData); 395 445 396 446 if (dsp3780I_Run(pSettings) == 0) { 397 447 // @BUG @TBD EnableSRAM(pBDData); 398 448 } else { 399 - retval = -EIO; 449 + return -EIO; 400 450 } 401 451 402 - PRINTK_2(TRACE_TP3780I, "tp3780i::tp3780I_StartDSP exit retval %x\n", retval); 403 - 404 - return retval; 452 + return 0; 405 453 } 406 454 407 455 408 456 int tp3780I_QueryAbilities(THINKPAD_BD_DATA * pBDData, MW_ABILITIES * pAbilities) 409 457 { 410 - PRINTK_2(TRACE_TP3780I, 411 - "tp3780i::tp3780I_QueryAbilities entry pBDData %p\n", pBDData); 412 - 413 458 memset(pAbilities, 0, sizeof(*pAbilities)); 414 459 /* fill out standard constant fields */ 415 460 pAbilities->instr_per_sec = pBDData->rDspSettings.uIps; ··· 416 497 memcpy(pAbilities->bios_task_name, TP_ABILITIES_BIOSTASK_NAME, 417 498 sizeof(TP_ABILITIES_BIOSTASK_NAME)); 418 499 419 - PRINTK_1(TRACE_TP3780I, 420 - "tp3780i::tp3780I_QueryAbilities exit retval=SUCCESSFUL\n"); 421 - 422 500 return 0; 423 501 } 424 502 ··· 423 507 void __user *pvBuffer, unsigned int uCount, 424 508 unsigned long ulDSPAddr) 425 509 { 426 - int retval = 0; 427 510 DSP_3780I_CONFIG_SETTINGS *pSettings = &pBDData->rDspSettings; 428 511 unsigned short usDspBaseIO = pSettings->usDspBaseIO; 429 512 bool bRC = 0; 430 - 431 - PRINTK_6(TRACE_TP3780I, 432 - "tp3780i::tp3780I_ReadWriteDspDStore entry pBDData %p, uOpcode %x, pvBuffer %p, uCount %x, ulDSPAddr %lx\n", 433 - pBDData, uOpcode, pvBuffer, uCount, ulDSPAddr); 434 513 435 514 if (pBDData->bDSPEnabled) { 436 515 switch (uOpcode) { ··· 443 532 } 444 533 } 445 534 446 - retval = (bRC) ? -EIO : 0; 447 - PRINTK_2(TRACE_TP3780I, "tp3780i::tp3780I_ReadWriteDspDStore exit retval %x\n", retval); 448 - 449 - return retval; 535 + return bRC ? -EIO : 0; 450 536 } 451 537 452 538 ··· 451 543 void __user *pvBuffer, unsigned int uCount, 452 544 unsigned long ulDSPAddr) 453 545 { 454 - int retval = 0; 455 546 DSP_3780I_CONFIG_SETTINGS *pSettings = &pBDData->rDspSettings; 456 547 unsigned short usDspBaseIO = pSettings->usDspBaseIO; 457 548 bool bRC = 0; 458 - 459 - PRINTK_6(TRACE_TP3780I, 460 - "tp3780i::tp3780I_ReadWriteDspIStore entry pBDData %p, uOpcode %x, pvBuffer %p, uCount %x, ulDSPAddr %lx\n", 461 - pBDData, uOpcode, pvBuffer, uCount, ulDSPAddr); 462 549 463 550 if (pBDData->bDSPEnabled) { 464 551 switch (uOpcode) { ··· 467 564 } 468 565 } 469 566 470 - retval = (bRC) ? -EIO : 0; 471 - 472 - PRINTK_2(TRACE_TP3780I, 473 - "tp3780i::tp3780I_ReadWriteDspIStore exit retval %x\n", retval); 474 - 475 - return retval; 567 + return bRC ? -EIO : 0; 476 568 } 477 569