49 #include <linux/kernel.h>
54 #include <linux/bitops.h>
55 #include <linux/sched.h>
58 #include <asm/uaccess.h>
66 static void PaceMsaAccess(
unsigned short usDspBaseIO)
74 unsigned long ulMsaAddr)
80 "3780i::dsp3780I_ReadMsaCfg entry usDspBaseIO %x ulMsaAddr %lx\n",
81 usDspBaseIO, ulMsaAddr);
87 spin_unlock_irqrestore(&
dsp_lock, flags);
95 unsigned long ulMsaAddr,
unsigned short usValue)
100 "3780i::dsp3780i_WriteMsaCfg entry usDspBaseIO %x ulMsaAddr %lx usValue %x\n",
101 usDspBaseIO, ulMsaAddr, usValue);
107 spin_unlock_irqrestore(&
dsp_lock, flags);
110 static void dsp3780I_WriteGenCfg(
unsigned short usDspBaseIO,
unsigned uIndex,
111 unsigned char ucValue)
118 "3780i::dsp3780i_WriteGenCfg entry usDspBaseIO %x uIndex %x ucValue %x\n",
119 usDspBaseIO, uIndex, ucValue);
124 "3780i::dsp3780i_WriteGenCfg rSlaveControl %x\n",
127 rSlaveControl_Save = rSlaveControl;
131 "3780i::dsp3780i_WriteGenCfg entry rSlaveControl+ConfigMode %x\n",
145 unsigned char dsp3780I_ReadGenCfg(
unsigned short usDspBaseIO,
150 unsigned char ucValue;
154 "3780i::dsp3780i_ReadGenCfg entry usDspBaseIO %x uIndex %x\n",
155 usDspBaseIO, uIndex);
158 rSlaveControl_Save = rSlaveControl;
166 "3780i::dsp3780i_ReadGenCfg exit ucValue %x\n", ucValue);
174 unsigned short *pIrqMap,
175 unsigned short *pDmaMap)
178 unsigned short usDspBaseIO = pSettings->
usDspBaseIO;
195 unsigned short ChipID = 0;
200 "3780i::dsp3780I_EnableDSP entry pSettings->bDSPEnabled %x\n",
211 "3780i::dsp3780i_EnableDSP entry pSettings->bModemEnabled %x\n",
246 rBusmasterCfg1.
Dma = (
unsigned char) pDmaMap[pSettings->
usDspDma];
287 "3780i::dsp3780i_EnableDSP usDspBaseIO %x index %x taddr %x\n",
292 "3780i::dsp3780i_EnableDSP rSlaveContrl %x\n",
300 "3780i::dsp3780i_EnableDSP rSlaveControl 2 %x\n", tval);
303 for (i = 0; i < 11; i++)
312 "3780i::dsp3780i_EnableDSP rSlaveControl 3 %x\n", tval);
336 "3780i::dsp3780i_EnableDSP DSP_HBridgeControl %x rHBridgeControl %x\n",
340 spin_unlock_irqrestore(&
dsp_lock, flags);
349 "3780i::dsp3780I_EnableDSP exiting bRC=TRUE, ChipID %x\n",
358 unsigned short usDspBaseIO = pSettings->
usDspBaseIO;
375 spin_unlock_irqrestore(&
dsp_lock, flags);
388 unsigned short usDspBaseIO = pSettings->
usDspBaseIO;
404 spin_unlock_irqrestore(&
dsp_lock, flags);
433 unsigned short usDspBaseIO = pSettings->
usDspBaseIO;
467 spin_unlock_irqrestore(&
dsp_lock, flags);
477 unsigned uCount,
unsigned long ulDSPAddr)
480 unsigned short __user *pusBuffer = pvBuffer;
485 "3780i::dsp3780I_ReadDStore entry usDspBaseIO %x, pusBuffer %p, uCount %x, ulDSPAddr %lx\n",
486 usDspBaseIO, pusBuffer, uCount, ulDSPAddr);
493 spin_unlock_irqrestore(&
dsp_lock, flags);
496 while (uCount-- != 0) {
499 spin_unlock_irqrestore(&
dsp_lock, flags);
504 "3780I::dsp3780I_ReadDStore uCount %x val %x\n",
507 PaceMsaAccess(usDspBaseIO);
512 "3780I::dsp3780I_ReadDStore exit bRC=TRUE\n");
518 void __user *pvBuffer,
unsigned uCount,
519 unsigned long ulDSPAddr)
522 unsigned short __user *pusBuffer = pvBuffer;
527 "3780i::dsp3780I_ReadAndDStore entry usDspBaseIO %x, pusBuffer %p, uCount %x, ulDSPAddr %lx\n",
528 usDspBaseIO, pusBuffer, uCount, ulDSPAddr);
535 spin_unlock_irqrestore(&
dsp_lock, flags);
538 while (uCount-- != 0) {
541 spin_unlock_irqrestore(&
dsp_lock, flags);
546 "3780I::dsp3780I_ReadAndCleanDStore uCount %x val %x\n",
549 PaceMsaAccess(usDspBaseIO);
554 "3780I::dsp3780I_ReadAndClearDStore exit bRC=TRUE\n");
561 unsigned uCount,
unsigned long ulDSPAddr)
564 unsigned short __user *pusBuffer = pvBuffer;
568 "3780i::dsp3780D_WriteDStore entry usDspBaseIO %x, pusBuffer %p, uCount %x, ulDSPAddr %lx\n",
569 usDspBaseIO, pusBuffer, uCount, ulDSPAddr);
576 spin_unlock_irqrestore(&
dsp_lock, flags);
579 while (uCount-- != 0) {
585 spin_unlock_irqrestore(&
dsp_lock, flags);
588 "3780I::dsp3780I_WriteDStore uCount %x val %x\n",
591 PaceMsaAccess(usDspBaseIO);
596 "3780I::dsp3780D_WriteDStore exit bRC=TRUE\n");
603 unsigned uCount,
unsigned long ulDSPAddr)
606 unsigned short __user *pusBuffer = pvBuffer;
609 "3780i::dsp3780I_ReadIStore entry usDspBaseIO %x, pusBuffer %p, uCount %x, ulDSPAddr %lx\n",
610 usDspBaseIO, pusBuffer, uCount, ulDSPAddr);
617 ulDSPAddr = (ulDSPAddr << 2) | (1 << 22);
621 spin_unlock_irqrestore(&
dsp_lock, flags);
624 while (uCount-- != 0) {
625 unsigned short val_lo, val_hi;
629 spin_unlock_irqrestore(&
dsp_lock, flags);
636 "3780I::dsp3780I_ReadIStore uCount %x val_lo %x val_hi %x\n",
637 uCount, val_lo, val_hi);
639 PaceMsaAccess(usDspBaseIO);
644 "3780I::dsp3780I_ReadIStore exit bRC=TRUE\n");
651 unsigned uCount,
unsigned long ulDSPAddr)
654 unsigned short __user *pusBuffer = pvBuffer;
657 "3780i::dsp3780I_WriteIStore entry usDspBaseIO %x, pusBuffer %p, uCount %x, ulDSPAddr %lx\n",
658 usDspBaseIO, pusBuffer, uCount, ulDSPAddr);
666 ulDSPAddr = (ulDSPAddr << 2) | (1 << 22);
670 spin_unlock_irqrestore(&
dsp_lock, flags);
673 while (uCount-- != 0) {
674 unsigned short val_lo, val_hi;
682 spin_unlock_irqrestore(&
dsp_lock, flags);
685 "3780I::dsp3780I_WriteIStore uCount %x val_lo %x val_hi %x\n",
686 uCount, val_lo, val_hi);
688 PaceMsaAccess(usDspBaseIO);
693 "3780I::dsp3780I_WriteIStore exit bRC=TRUE\n");
700 unsigned short *pusIPCSource)
708 "3780i::dsp3780I_GetIPCSource entry usDspBaseIO %x pusIPCSource %p\n",
709 usDspBaseIO, pusIPCSource);
721 temp = (
unsigned short) ~(*pusIPCSource);
724 "3780i::dsp3780I_GetIPCSource, usIPCSource %x ~ %x\n",
725 *pusIPCSource, temp);
731 spin_unlock_irqrestore(&
dsp_lock, flags);
735 "3780i::dsp3780I_GetIPCSource exit usIPCSource %x\n",