3 * tp3780i.c -- board driver for 3780i on ThinkPads
6 * Written By: Mike Sullivan IBM Corporation
8 * Copyright (C) 1999 IBM Corporation
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
21 * THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR
22 * CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT
23 * LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
24 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
25 * solely responsible for determining the appropriateness of using and
26 * distributing the Program and assumes all risks associated with its
27 * exercise of rights under this Agreement, including but not limited to
28 * the risks and costs of program errors, damage to or loss of data,
29 * programs or equipment, and unavailability or interruption of operations.
31 * DISCLAIMER OF LIABILITY
32 * NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY
33 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
34 * DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND
35 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
36 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
37 * USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
38 * HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES
40 * You should have received a copy of the GNU General Public License
41 * along with this program; if not, write to the Free Software
42 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
45 * 10/23/2000 - Alpha Release
46 * First release to the public
49 #include <linux/interrupt.h>
50 #include <linux/kernel.h>
51 #include <linux/ptrace.h>
52 #include <linux/ioport.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;
68 static void EnableSRAM(THINKPAD_BD_DATA
* pBDData
)
70 DSP_3780I_CONFIG_SETTINGS
*pSettings
= &pBDData
->rDspSettings
;
71 unsigned short usDspBaseIO
= pSettings
->usDspBaseIO
;
72 DSP_GPIO_OUTPUT_DATA_15_8 rGpioOutputData
;
73 DSP_GPIO_DRIVER_ENABLE_15_8 rGpioDriverEnable
;
74 DSP_GPIO_MODE_15_8 rGpioMode
;
76 PRINTK_1(TRACE_TP3780I
, "tp3780i::EnableSRAM, entry\n");
78 MKWORD(rGpioMode
) = ReadMsaCfg(DSP_GpioModeControl_15_8
);
79 rGpioMode
.GpioMode10
= 0;
80 WriteMsaCfg(DSP_GpioModeControl_15_8
, MKWORD(rGpioMode
));
82 MKWORD(rGpioDriverEnable
) = 0;
83 rGpioDriverEnable
.Enable10
= true;
84 rGpioDriverEnable
.Mask10
= true;
85 WriteMsaCfg(DSP_GpioDriverEnable_15_8
, MKWORD(rGpioDriverEnable
));
87 MKWORD(rGpioOutputData
) = 0;
88 rGpioOutputData
.Latch10
= 0;
89 rGpioOutputData
.Mask10
= true;
90 WriteMsaCfg(DSP_GpioOutputData_15_8
, MKWORD(rGpioOutputData
));
92 PRINTK_1(TRACE_TP3780I
, "tp3780i::EnableSRAM exit\n");
96 static irqreturn_t
UartInterrupt(int irq
, void *dev_id
)
98 PRINTK_3(TRACE_TP3780I
,
99 "tp3780i::UartInterrupt entry irq %x dev_id %p\n", irq
, dev_id
);
103 static irqreturn_t
DspInterrupt(int irq
, void *dev_id
)
105 pMWAVE_DEVICE_DATA pDrvData
= &mwave_s_mdd
;
106 DSP_3780I_CONFIG_SETTINGS
*pSettings
= &pDrvData
->rBDData
.rDspSettings
;
107 unsigned short usDspBaseIO
= pSettings
->usDspBaseIO
;
108 unsigned short usIPCSource
= 0, usIsolationMask
, usPCNum
;
110 PRINTK_3(TRACE_TP3780I
,
111 "tp3780i::DspInterrupt entry irq %x dev_id %p\n", irq
, dev_id
);
113 if (dsp3780I_GetIPCSource(usDspBaseIO
, &usIPCSource
) == 0) {
114 PRINTK_2(TRACE_TP3780I
,
115 "tp3780i::DspInterrupt, return from dsp3780i_GetIPCSource, usIPCSource %x\n",
118 for (usPCNum
= 1; usPCNum
<= 16; usPCNum
++) {
119 if (usIPCSource
& usIsolationMask
) {
120 usIPCSource
&= ~usIsolationMask
;
121 PRINTK_3(TRACE_TP3780I
,
122 "tp3780i::DspInterrupt usPCNum %x usIPCSource %x\n",
123 usPCNum
, usIPCSource
);
124 if (pDrvData
->IPCs
[usPCNum
- 1].usIntCount
== 0) {
125 pDrvData
->IPCs
[usPCNum
- 1].usIntCount
= 1;
127 PRINTK_2(TRACE_TP3780I
,
128 "tp3780i::DspInterrupt usIntCount %x\n",
129 pDrvData
->IPCs
[usPCNum
- 1].usIntCount
);
130 if (pDrvData
->IPCs
[usPCNum
- 1].bIsEnabled
== true) {
131 PRINTK_2(TRACE_TP3780I
,
132 "tp3780i::DspInterrupt, waking up usPCNum %x\n",
134 wake_up_interruptible(&pDrvData
->IPCs
[usPCNum
- 1].ipc_wait_queue
);
136 PRINTK_2(TRACE_TP3780I
,
137 "tp3780i::DspInterrupt, no one waiting for IPC %x\n",
141 if (usIPCSource
== 0)
144 usIsolationMask
= usIsolationMask
<< 1;
147 PRINTK_1(TRACE_TP3780I
,
148 "tp3780i::DspInterrupt, return false from dsp3780i_GetIPCSource\n");
150 PRINTK_1(TRACE_TP3780I
, "tp3780i::DspInterrupt exit\n");
155 int tp3780I_InitializeBoardData(THINKPAD_BD_DATA
* pBDData
)
158 DSP_3780I_CONFIG_SETTINGS
*pSettings
= &pBDData
->rDspSettings
;
161 PRINTK_2(TRACE_TP3780I
, "tp3780i::tp3780I_InitializeBoardData entry pBDData %p\n", pBDData
);
163 pBDData
->bDSPEnabled
= false;
164 pSettings
->bInterruptClaimed
= false;
166 retval
= smapi_init();
168 PRINTK_ERROR(KERN_ERR_MWAVE
"tp3780i::tp3780I_InitializeBoardData: Error: SMAPI is not available on this machine\n");
170 if (mwave_3780i_irq
|| mwave_3780i_io
|| mwave_uart_irq
|| mwave_uart_io
) {
171 retval
= smapi_set_DSP_cfg();
175 PRINTK_2(TRACE_TP3780I
, "tp3780i::tp3780I_InitializeBoardData exit retval %x\n", retval
);
180 void tp3780I_Cleanup(THINKPAD_BD_DATA
*pBDData
)
182 PRINTK_2(TRACE_TP3780I
,
183 "tp3780i::tp3780I_Cleanup entry and exit pBDData %p\n", pBDData
);
186 int tp3780I_CalcResources(THINKPAD_BD_DATA
* pBDData
)
188 SMAPI_DSP_SETTINGS rSmapiInfo
;
189 DSP_3780I_CONFIG_SETTINGS
*pSettings
= &pBDData
->rDspSettings
;
191 PRINTK_2(TRACE_TP3780I
,
192 "tp3780i::tp3780I_CalcResources entry pBDData %p\n", pBDData
);
194 if (smapi_query_DSP_cfg(&rSmapiInfo
)) {
195 PRINTK_ERROR(KERN_ERR_MWAVE
"tp3780i::tp3780I_CalcResources: Error: Could not query DSP config. Aborting.\n");
201 ( rSmapiInfo
.usDspIRQ
== 0 )
202 || ( rSmapiInfo
.usDspBaseIO
== 0 )
203 || ( rSmapiInfo
.usUartIRQ
== 0 )
204 || ( rSmapiInfo
.usUartBaseIO
== 0 )
206 PRINTK_ERROR(KERN_ERR_MWAVE
"tp3780i::tp3780I_CalcResources: Error: Illegal resource setting. Aborting.\n");
210 pSettings
->bDSPEnabled
= (rSmapiInfo
.bDSPEnabled
&& rSmapiInfo
.bDSPPresent
);
211 pSettings
->bModemEnabled
= rSmapiInfo
.bModemEnabled
;
212 pSettings
->usDspIrq
= rSmapiInfo
.usDspIRQ
;
213 pSettings
->usDspDma
= rSmapiInfo
.usDspDMA
;
214 pSettings
->usDspBaseIO
= rSmapiInfo
.usDspBaseIO
;
215 pSettings
->usUartIrq
= rSmapiInfo
.usUartIRQ
;
216 pSettings
->usUartBaseIO
= rSmapiInfo
.usUartBaseIO
;
218 pSettings
->uDStoreSize
= TP_ABILITIES_DATA_SIZE
;
219 pSettings
->uIStoreSize
= TP_ABILITIES_INST_SIZE
;
220 pSettings
->uIps
= TP_ABILITIES_INTS_PER_SEC
;
222 if (pSettings
->bDSPEnabled
&& pSettings
->bModemEnabled
&& pSettings
->usDspIrq
== pSettings
->usUartIrq
) {
223 pBDData
->bShareDspIrq
= pBDData
->bShareUartIrq
= 1;
225 pBDData
->bShareDspIrq
= pBDData
->bShareUartIrq
= 0;
228 PRINTK_1(TRACE_TP3780I
, "tp3780i::tp3780I_CalcResources exit\n");
234 int tp3780I_ClaimResources(THINKPAD_BD_DATA
* pBDData
)
237 DSP_3780I_CONFIG_SETTINGS
*pSettings
= &pBDData
->rDspSettings
;
238 struct resource
*pres
;
240 PRINTK_2(TRACE_TP3780I
,
241 "tp3780i::tp3780I_ClaimResources entry pBDData %p\n", pBDData
);
243 pres
= request_region(pSettings
->usDspBaseIO
, 16, "mwave_3780i");
244 if ( pres
== NULL
) retval
= -EIO
;
247 PRINTK_ERROR(KERN_ERR_MWAVE
"tp3780i::tp3780I_ClaimResources: Error: Could not claim I/O region starting at %x\n", pSettings
->usDspBaseIO
);
251 PRINTK_2(TRACE_TP3780I
, "tp3780i::tp3780I_ClaimResources exit retval %x\n", retval
);
256 int tp3780I_ReleaseResources(THINKPAD_BD_DATA
* pBDData
)
259 DSP_3780I_CONFIG_SETTINGS
*pSettings
= &pBDData
->rDspSettings
;
261 PRINTK_2(TRACE_TP3780I
,
262 "tp3780i::tp3780I_ReleaseResources entry pBDData %p\n", pBDData
);
264 release_region(pSettings
->usDspBaseIO
& (~3), 16);
266 if (pSettings
->bInterruptClaimed
) {
267 free_irq(pSettings
->usDspIrq
, NULL
);
268 pSettings
->bInterruptClaimed
= false;
271 PRINTK_2(TRACE_TP3780I
,
272 "tp3780i::tp3780I_ReleaseResources exit retval %x\n", retval
);
279 int tp3780I_EnableDSP(THINKPAD_BD_DATA
* pBDData
)
281 DSP_3780I_CONFIG_SETTINGS
*pSettings
= &pBDData
->rDspSettings
;
282 bool bDSPPoweredUp
= false, bInterruptAllocated
= false;
284 PRINTK_2(TRACE_TP3780I
, "tp3780i::tp3780I_EnableDSP entry pBDData %p\n", pBDData
);
286 if (pBDData
->bDSPEnabled
) {
287 PRINTK_ERROR(KERN_ERR_MWAVE
"tp3780i::tp3780I_EnableDSP: Error: DSP already enabled!\n");
291 if (!pSettings
->bDSPEnabled
) {
292 PRINTK_ERROR(KERN_ERR_MWAVE
"tp3780::tp3780I_EnableDSP: Error: pSettings->bDSPEnabled not set\n");
297 (pSettings
->usDspIrq
>= s_numIrqs
)
298 || (pSettings
->usDspDma
>= s_numDmas
)
299 || (s_ausThinkpadIrqToField
[pSettings
->usDspIrq
] == 0xFFFF)
300 || (s_ausThinkpadDmaToField
[pSettings
->usDspDma
] == 0xFFFF)
302 PRINTK_ERROR(KERN_ERR_MWAVE
"tp3780i::tp3780I_EnableDSP: Error: invalid irq %x\n", pSettings
->usDspIrq
);
307 ((pSettings
->usDspBaseIO
& 0xF00F) != 0)
308 || (pSettings
->usDspBaseIO
& 0x0FF0) == 0
310 PRINTK_ERROR(KERN_ERR_MWAVE
"tp3780i::tp3780I_EnableDSP: Error: Invalid DSP base I/O address %x\n", pSettings
->usDspBaseIO
);
314 if (pSettings
->bModemEnabled
) {
316 pSettings
->usUartIrq
>= s_numIrqs
317 || s_ausThinkpadIrqToField
[pSettings
->usUartIrq
] == 0xFFFF
319 PRINTK_ERROR(KERN_ERR_MWAVE
"tp3780i::tp3780I_EnableDSP: Error: Invalid UART IRQ %x\n", pSettings
->usUartIrq
);
322 switch (pSettings
->usUartBaseIO
) {
330 PRINTK_ERROR("tp3780i::tp3780I_EnableDSP: Error: Invalid UART base I/O address %x\n", pSettings
->usUartBaseIO
);
335 pSettings
->bDspIrqActiveLow
= pSettings
->bDspIrqPulse
= true;
336 pSettings
->bUartIrqActiveLow
= pSettings
->bUartIrqPulse
= true;
338 if (pBDData
->bShareDspIrq
) {
339 pSettings
->bDspIrqActiveLow
= false;
341 if (pBDData
->bShareUartIrq
) {
342 pSettings
->bUartIrqActiveLow
= false;
345 pSettings
->usNumTransfers
= TP_CFG_NumTransfers
;
346 pSettings
->usReRequest
= TP_CFG_RerequestTimer
;
347 pSettings
->bEnableMEMCS16
= TP_CFG_MEMCS16
;
348 pSettings
->usIsaMemCmdWidth
= TP_CFG_IsaMemCmdWidth
;
349 pSettings
->bGateIOCHRDY
= TP_CFG_GateIOCHRDY
;
350 pSettings
->bEnablePwrMgmt
= TP_CFG_EnablePwrMgmt
;
351 pSettings
->usHBusTimerLoadValue
= TP_CFG_HBusTimerValue
;
352 pSettings
->bDisableLBusTimeout
= TP_CFG_DisableLBusTimeout
;
353 pSettings
->usN_Divisor
= TP_CFG_N_Divisor
;
354 pSettings
->usM_Multiplier
= TP_CFG_M_Multiplier
;
355 pSettings
->bPllBypass
= TP_CFG_PllBypass
;
356 pSettings
->usChipletEnable
= TP_CFG_ChipletEnable
;
358 if (request_irq(pSettings
->usUartIrq
, &UartInterrupt
, 0, "mwave_uart", NULL
)) {
359 PRINTK_ERROR(KERN_ERR_MWAVE
"tp3780i::tp3780I_EnableDSP: Error: Could not get UART IRQ %x\n", pSettings
->usUartIrq
);
361 } else { /* no conflict just release */
362 free_irq(pSettings
->usUartIrq
, NULL
);
365 if (request_irq(pSettings
->usDspIrq
, &DspInterrupt
, 0, "mwave_3780i", NULL
)) {
366 PRINTK_ERROR("tp3780i::tp3780I_EnableDSP: Error: Could not get 3780i IRQ %x\n", pSettings
->usDspIrq
);
369 PRINTK_3(TRACE_TP3780I
,
370 "tp3780i::tp3780I_EnableDSP, got interrupt %x bShareDspIrq %x\n",
371 pSettings
->usDspIrq
, pBDData
->bShareDspIrq
);
372 bInterruptAllocated
= true;
373 pSettings
->bInterruptClaimed
= true;
376 smapi_set_DSP_power_state(false);
377 if (smapi_set_DSP_power_state(true)) {
378 PRINTK_ERROR(KERN_ERR_MWAVE
"tp3780i::tp3780I_EnableDSP: Error: smapi_set_DSP_power_state(true) failed\n");
381 bDSPPoweredUp
= true;
384 if (dsp3780I_EnableDSP(pSettings
, s_ausThinkpadIrqToField
, s_ausThinkpadDmaToField
)) {
385 PRINTK_ERROR("tp3780i::tp3780I_EnableDSP: Error: dsp7880I_EnableDSP() failed\n");
391 pBDData
->bDSPEnabled
= true;
393 PRINTK_1(TRACE_TP3780I
, "tp3780i::tp3780I_EnableDSP exit\n");
398 PRINTK_ERROR("tp3780i::tp3780I_EnableDSP: Cleaning up\n");
400 smapi_set_DSP_power_state(false);
401 if (bInterruptAllocated
) {
402 free_irq(pSettings
->usDspIrq
, NULL
);
403 pSettings
->bInterruptClaimed
= false;
409 int tp3780I_DisableDSP(THINKPAD_BD_DATA
* pBDData
)
412 DSP_3780I_CONFIG_SETTINGS
*pSettings
= &pBDData
->rDspSettings
;
414 PRINTK_2(TRACE_TP3780I
, "tp3780i::tp3780I_DisableDSP entry pBDData %p\n", pBDData
);
416 if (pBDData
->bDSPEnabled
) {
417 dsp3780I_DisableDSP(&pBDData
->rDspSettings
);
418 if (pSettings
->bInterruptClaimed
) {
419 free_irq(pSettings
->usDspIrq
, NULL
);
420 pSettings
->bInterruptClaimed
= false;
422 smapi_set_DSP_power_state(false);
423 pBDData
->bDSPEnabled
= false;
426 PRINTK_2(TRACE_TP3780I
, "tp3780i::tp3780I_DisableDSP exit retval %x\n", retval
);
432 int tp3780I_ResetDSP(THINKPAD_BD_DATA
* pBDData
)
435 DSP_3780I_CONFIG_SETTINGS
*pSettings
= &pBDData
->rDspSettings
;
437 PRINTK_2(TRACE_TP3780I
, "tp3780i::tp3780I_ResetDSP entry pBDData %p\n",
440 if (dsp3780I_Reset(pSettings
) == 0) {
446 PRINTK_2(TRACE_TP3780I
, "tp3780i::tp3780I_ResetDSP exit retval %x\n", retval
);
452 int tp3780I_StartDSP(THINKPAD_BD_DATA
* pBDData
)
455 DSP_3780I_CONFIG_SETTINGS
*pSettings
= &pBDData
->rDspSettings
;
457 PRINTK_2(TRACE_TP3780I
, "tp3780i::tp3780I_StartDSP entry pBDData %p\n", pBDData
);
459 if (dsp3780I_Run(pSettings
) == 0) {
460 // @BUG @TBD EnableSRAM(pBDData);
465 PRINTK_2(TRACE_TP3780I
, "tp3780i::tp3780I_StartDSP exit retval %x\n", retval
);
471 int tp3780I_QueryAbilities(THINKPAD_BD_DATA
* pBDData
, MW_ABILITIES
* pAbilities
)
473 PRINTK_2(TRACE_TP3780I
,
474 "tp3780i::tp3780I_QueryAbilities entry pBDData %p\n", pBDData
);
476 memset(pAbilities
, 0, sizeof(*pAbilities
));
477 /* fill out standard constant fields */
478 pAbilities
->instr_per_sec
= pBDData
->rDspSettings
.uIps
;
479 pAbilities
->data_size
= pBDData
->rDspSettings
.uDStoreSize
;
480 pAbilities
->inst_size
= pBDData
->rDspSettings
.uIStoreSize
;
481 pAbilities
->bus_dma_bw
= pBDData
->rDspSettings
.uDmaBandwidth
;
483 /* fill out dynamically determined fields */
484 pAbilities
->component_list
[0] = 0x00010000 | MW_ADC_MASK
;
485 pAbilities
->component_list
[1] = 0x00010000 | MW_ACI_MASK
;
486 pAbilities
->component_list
[2] = 0x00010000 | MW_AIC1_MASK
;
487 pAbilities
->component_list
[3] = 0x00010000 | MW_AIC2_MASK
;
488 pAbilities
->component_list
[4] = 0x00010000 | MW_CDDAC_MASK
;
489 pAbilities
->component_list
[5] = 0x00010000 | MW_MIDI_MASK
;
490 pAbilities
->component_list
[6] = 0x00010000 | MW_UART_MASK
;
491 pAbilities
->component_count
= 7;
493 /* Fill out Mwave OS and BIOS task names */
495 memcpy(pAbilities
->mwave_os_name
, TP_ABILITIES_MWAVEOS_NAME
,
496 sizeof(TP_ABILITIES_MWAVEOS_NAME
));
497 memcpy(pAbilities
->bios_task_name
, TP_ABILITIES_BIOSTASK_NAME
,
498 sizeof(TP_ABILITIES_BIOSTASK_NAME
));
500 PRINTK_1(TRACE_TP3780I
,
501 "tp3780i::tp3780I_QueryAbilities exit retval=SUCCESSFUL\n");
506 int tp3780I_ReadWriteDspDStore(THINKPAD_BD_DATA
* pBDData
, unsigned int uOpcode
,
507 void __user
*pvBuffer
, unsigned int uCount
,
508 unsigned long ulDSPAddr
)
511 DSP_3780I_CONFIG_SETTINGS
*pSettings
= &pBDData
->rDspSettings
;
512 unsigned short usDspBaseIO
= pSettings
->usDspBaseIO
;
515 PRINTK_6(TRACE_TP3780I
,
516 "tp3780i::tp3780I_ReadWriteDspDStore entry pBDData %p, uOpcode %x, pvBuffer %p, uCount %x, ulDSPAddr %lx\n",
517 pBDData
, uOpcode
, pvBuffer
, uCount
, ulDSPAddr
);
519 if (pBDData
->bDSPEnabled
) {
521 case IOCTL_MW_READ_DATA
:
522 bRC
= dsp3780I_ReadDStore(usDspBaseIO
, pvBuffer
, uCount
, ulDSPAddr
);
525 case IOCTL_MW_READCLEAR_DATA
:
526 bRC
= dsp3780I_ReadAndClearDStore(usDspBaseIO
, pvBuffer
, uCount
, ulDSPAddr
);
529 case IOCTL_MW_WRITE_DATA
:
530 bRC
= dsp3780I_WriteDStore(usDspBaseIO
, pvBuffer
, uCount
, ulDSPAddr
);
535 retval
= (bRC
) ? -EIO
: 0;
536 PRINTK_2(TRACE_TP3780I
, "tp3780i::tp3780I_ReadWriteDspDStore exit retval %x\n", retval
);
542 int tp3780I_ReadWriteDspIStore(THINKPAD_BD_DATA
* pBDData
, unsigned int uOpcode
,
543 void __user
*pvBuffer
, unsigned int uCount
,
544 unsigned long ulDSPAddr
)
547 DSP_3780I_CONFIG_SETTINGS
*pSettings
= &pBDData
->rDspSettings
;
548 unsigned short usDspBaseIO
= pSettings
->usDspBaseIO
;
551 PRINTK_6(TRACE_TP3780I
,
552 "tp3780i::tp3780I_ReadWriteDspIStore entry pBDData %p, uOpcode %x, pvBuffer %p, uCount %x, ulDSPAddr %lx\n",
553 pBDData
, uOpcode
, pvBuffer
, uCount
, ulDSPAddr
);
555 if (pBDData
->bDSPEnabled
) {
557 case IOCTL_MW_READ_INST
:
558 bRC
= dsp3780I_ReadIStore(usDspBaseIO
, pvBuffer
, uCount
, ulDSPAddr
);
561 case IOCTL_MW_WRITE_INST
:
562 bRC
= dsp3780I_WriteIStore(usDspBaseIO
, pvBuffer
, uCount
, ulDSPAddr
);
567 retval
= (bRC
) ? -EIO
: 0;
569 PRINTK_2(TRACE_TP3780I
,
570 "tp3780i::tp3780I_ReadWriteDspIStore exit retval %x\n", retval
);