50 #include <linux/kernel.h>
51 #include <linux/ptrace.h>
60 static unsigned short s_ausThinkpadIrqToField[16] =
61 { 0xFFFF, 0xFFFF, 0xFFFF, 0x0001, 0x0002, 0x0003, 0xFFFF, 0x0004,
62 0xFFFF, 0xFFFF, 0x0005, 0x0006, 0xFFFF, 0xFFFF, 0xFFFF, 0x0007 };
63 static unsigned short s_ausThinkpadDmaToField[8] =
64 { 0x0001, 0x0002, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x0003, 0x0004 };
65 static unsigned short s_numIrqs = 16, s_numDmas = 8;
71 unsigned short usDspBaseIO = pSettings->
usDspBaseIO;
82 MKWORD(rGpioDriverEnable) = 0;
87 MKWORD(rGpioOutputData) = 0;
99 "tp3780i::UartInterrupt entry irq %x dev_id %p\n", irq, dev_id);
107 unsigned short usDspBaseIO = pSettings->
usDspBaseIO;
108 unsigned short usIPCSource = 0, usIsolationMask, usPCNum;
111 "tp3780i::DspInterrupt entry irq %x dev_id %p\n", irq, dev_id);
115 "tp3780i::DspInterrupt, return from dsp3780i_GetIPCSource, usIPCSource %x\n",
118 for (usPCNum = 1; usPCNum <= 16; usPCNum++) {
119 if (usIPCSource & usIsolationMask) {
120 usIPCSource &= ~usIsolationMask;
122 "tp3780i::DspInterrupt usPCNum %x usIPCSource %x\n",
123 usPCNum, usIPCSource);
128 "tp3780i::DspInterrupt usIntCount %x\n",
132 "tp3780i::DspInterrupt, waking up usPCNum %x\n",
137 "tp3780i::DspInterrupt, no one waiting for IPC %x\n",
141 if (usIPCSource == 0)
144 usIsolationMask = usIsolationMask << 1;
148 "tp3780i::DspInterrupt, return false from dsp3780i_GetIPCSource\n");
185 "tp3780i::tp3780I_Cleanup entry and exit pBDData %p\n", pBDData);
196 "tp3780i::tp3780I_CalcResources entry pBDData %p\n", pBDData);
245 "tp3780i::tp3780I_ClaimResources entry pBDData %p\n", pBDData);
248 if ( pres ==
NULL ) retval = -
EIO;
266 "tp3780i::tp3780I_ReleaseResources entry pBDData %p\n", pBDData);
276 "tp3780i::tp3780I_ReleaseResources exit retval %x\n", retval);
302 || (pSettings->
usDspDma >= s_numDmas)
303 || (s_ausThinkpadIrqToField[pSettings->
usDspIrq] == 0xFFFF)
304 || (s_ausThinkpadDmaToField[pSettings->
usDspDma] == 0xFFFF)
321 || s_ausThinkpadIrqToField[pSettings->
usUartIrq] == 0xFFFF
370 PRINTK_ERROR(
"tp3780i::tp3780I_EnableDSP: Error: Could not get 3780i IRQ %x\n", pSettings->
usDspIrq);
374 "tp3780i::tp3780I_EnableDSP, got interrupt %x bShareDspIrq %x\n",
376 bInterruptAllocated =
TRUE;
385 bDSPPoweredUp =
TRUE;
388 if (
dsp3780I_EnableDSP(pSettings, s_ausThinkpadIrqToField, s_ausThinkpadDmaToField)) {
389 PRINTK_ERROR(
"tp3780i::tp3780I_EnableDSP: Error: dsp7880I_EnableDSP() failed\n");
402 PRINTK_ERROR(
"tp3780i::tp3780I_EnableDSP: Cleaning up\n");
405 if (bInterruptAllocated) {
480 "tp3780i::tp3780I_QueryAbilities entry pBDData %p\n", pBDData);
506 "tp3780i::tp3780I_QueryAbilities exit retval=SUCCESSFUL\n");
512 void __user *pvBuffer,
unsigned int uCount,
513 unsigned long ulDSPAddr)
517 unsigned short usDspBaseIO = pSettings->
usDspBaseIO;
521 "tp3780i::tp3780I_ReadWriteDspDStore entry pBDData %p, uOpcode %x, pvBuffer %p, uCount %x, ulDSPAddr %lx\n",
522 pBDData, uOpcode, pvBuffer, uCount, ulDSPAddr);
540 retval = (bRC) ? -
EIO : 0;
548 void __user *pvBuffer,
unsigned int uCount,
549 unsigned long ulDSPAddr)
553 unsigned short usDspBaseIO = pSettings->
usDspBaseIO;
557 "tp3780i::tp3780I_ReadWriteDspIStore entry pBDData %p, uOpcode %x, pvBuffer %p, uCount %x, ulDSPAddr %lx\n",
558 pBDData, uOpcode, pvBuffer, uCount, ulDSPAddr);
572 retval = (bRC) ? -
EIO : 0;
575 "tp3780i::tp3780I_ReadWriteDspIStore exit retval %x\n", retval);