Generic MPU401 driver: Add Ice1712 card, Fix line size > 80
This commit is contained in:
committed by
Jérôme Duval
parent
1684be5e39
commit
6ffb178a00
@@ -28,7 +28,8 @@
|
|||||||
/*-----------------------------*/
|
/*-----------------------------*/
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
create_device(int port, void ** out_storage, uint32 workarounds, void (*interrupt_op)(int32 op, void * card), void * card)
|
create_device(int port, void ** out_storage, uint32 workarounds,
|
||||||
|
void (*interrupt_op)(int32 op, void * card), void * card)
|
||||||
{
|
{
|
||||||
mpu401device mpu_device;
|
mpu401device mpu_device;
|
||||||
mpu401device *mpuptr;
|
mpu401device *mpuptr;
|
||||||
@@ -41,7 +42,8 @@ create_device(int port, void ** out_storage, uint32 workarounds, void (*interrup
|
|||||||
mpu_device.interrupt_op = interrupt_op;
|
mpu_device.interrupt_op = interrupt_op;
|
||||||
mpu_device.card = card;
|
mpu_device.card = card;
|
||||||
|
|
||||||
LOG(("create_device count= %ld, addrport 0x%x, workarounds: %d",mpu_device.count, mpu_device.addrport, mpu_device.workarounds));
|
LOG(("create_device count= %ld, addrport 0x%x, workarounds: %d",
|
||||||
|
mpu_device.count, mpu_device.addrport, mpu_device.workarounds));
|
||||||
|
|
||||||
// basically, each call to create device allocates memory for
|
// basically, each call to create device allocates memory for
|
||||||
//a structure with the specific device info. The pointer to this is
|
//a structure with the specific device info. The pointer to this is
|
||||||
@@ -57,15 +59,14 @@ create_device(int port, void ** out_storage, uint32 workarounds, void (*interrup
|
|||||||
/*-----------------------------*/
|
/*-----------------------------*/
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
create_device_v2(int port, void ** out_storage, uint32 workarounds, void (*interrupt_op)(int32 op, void * card), void * card)
|
create_device_v2(int port, void ** out_storage, uint32 workarounds,
|
||||||
|
void (*interrupt_op)(int32 op, void * card), void * card)
|
||||||
{
|
{
|
||||||
mpu401device *mpuptr;
|
mpu401device *mpuptr;
|
||||||
mpu401device mpu_device;
|
mpu401device mpu_device;
|
||||||
|
|
||||||
LOG(("v2: create_device, **out_storage %p ,workarounds %ld ,void *card %p\n",out_storage, workarounds, card));
|
// not sure exactly how v2 of the module works. I think that two ports
|
||||||
|
// are created. One for midi in data, and another for midi out data.
|
||||||
// not sure exactly how v2 of the module works. I think that two ports are
|
|
||||||
// created. One for midi in data, and another for midi out data.
|
|
||||||
// Instead of transfering data using a buffer and pointer, the midi
|
// Instead of transfering data using a buffer and pointer, the midi
|
||||||
// data is transfered via the global ports.
|
// data is transfered via the global ports.
|
||||||
// If the ports are created in the midi server, then the port id's
|
// If the ports are created in the midi server, then the port id's
|
||||||
@@ -73,16 +74,18 @@ create_device_v2(int port, void ** out_storage, uint32 workarounds, void (*inter
|
|||||||
// If the ports are created in this hook call, the the port id's
|
// If the ports are created in this hook call, the the port id's
|
||||||
// should be returned to the midi server.
|
// should be returned to the midi server.
|
||||||
|
|
||||||
// One version of read/write hook functions are used for both v1, v2. Therefore, in
|
// One version of read/write hook functions are used for both v1, v2.
|
||||||
// those calls, it needs to be known whether the mididata is to be read/written
|
// Therefore, in those calls, it needs to be known whether the mididata
|
||||||
// to a buffer, or to the port.
|
// is to be read/written to a buffer, or to the port.
|
||||||
|
|
||||||
mpu_device.addrport = port;
|
mpu_device.addrport = port;
|
||||||
mpu_device.workarounds = workarounds;
|
mpu_device.workarounds = workarounds;
|
||||||
mpu_device.V2 = TRUE;
|
mpu_device.V2 = TRUE;
|
||||||
mpu_device.count =1;
|
mpu_device.count = 1;
|
||||||
mpu_device.card = card;
|
mpu_device.card = card;
|
||||||
|
|
||||||
|
LOG(("create_device count= %ld, addrport 0x%x, workarounds: %d",
|
||||||
|
mpu_device.count, mpu_device.addrport, mpu_device.workarounds));
|
||||||
|
|
||||||
mpuptr = (mpu401device*)malloc(sizeof(mpu401device));
|
mpuptr = (mpu401device*)malloc(sizeof(mpu401device));
|
||||||
memcpy(mpuptr, &mpu_device, sizeof(mpu_device));
|
memcpy(mpuptr, &mpu_device, sizeof(mpu_device));
|
||||||
@@ -100,8 +103,9 @@ delete_device(void * storage)
|
|||||||
{
|
{
|
||||||
mpu401device * mpu_device = (mpu401device *)storage;
|
mpu401device * mpu_device = (mpu401device *)storage;
|
||||||
|
|
||||||
LOG(("device->addrport= 0x%x count= %ld\n",mpu_device->addrport, mpu_device->count));
|
LOG(("device->addrport= 0x%x count= %ld\n",
|
||||||
LOG(("delete_device: *storage:%p\n",storage));
|
mpu_device->addrport, mpu_device->count));
|
||||||
|
LOG(("delete_device: *storage:%p\n", storage));
|
||||||
|
|
||||||
free(mpu_device); // free the memory allocated in create_device
|
free(mpu_device); // free the memory allocated in create_device
|
||||||
|
|
||||||
@@ -119,8 +123,10 @@ midi_open(void * storage, uint32 flags, void ** out_cookie)
|
|||||||
int ack_byte;
|
int ack_byte;
|
||||||
mpu401device * mpu_device = (mpu401device *)storage;
|
mpu401device * mpu_device = (mpu401device *)storage;
|
||||||
|
|
||||||
LOG(("open() flags: %ld, * storage: %p, **out_cookie: %p\n",flags, storage,out_cookie));
|
LOG(("open() flags: %ld, *storage: %p, **out_cookie: %p\n", flags,
|
||||||
LOG(("open: device->addrport 0x%x ,workarounds 0x%x\n",mpu_device->addrport, mpu_device->workarounds));
|
storage, out_cookie));
|
||||||
|
LOG(("open: device->addrport 0x%x ,workarounds 0x%x\n",
|
||||||
|
mpu_device->addrport, mpu_device->workarounds));
|
||||||
|
|
||||||
// the undocumented V2 module is not complete
|
// the undocumented V2 module is not complete
|
||||||
// we will allow the device to be created since some drivers depend on it
|
// we will allow the device to be created since some drivers depend on it
|
||||||
@@ -129,29 +135,55 @@ midi_open(void * storage, uint32 flags, void ** out_cookie)
|
|||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|
||||||
switch (mpu_device->workarounds){
|
switch (mpu_device->workarounds){
|
||||||
case 0x11020004: // This is still required for Creative Audigy, Audidy2
|
case 0x11020004: // Still required for Creative Audigy, Audigy2
|
||||||
case 0x11020005:
|
case 0x11020005:
|
||||||
case 0:
|
case 0:
|
||||||
// don't know the current mpu state
|
// don't know the current mpu state
|
||||||
PRINT(("reset MPU401\n"));
|
PRINT(("reset MPU401\n"));
|
||||||
Write_MPU401(mpu_device->addrport, UARTCMD, mpu_device->workarounds, MPU401_RESET);
|
Write_MPU401(mpu_device->addrport, UARTCMD,
|
||||||
|
mpu_device->workarounds, MPU401_RESET);
|
||||||
snooze(30000);
|
snooze(30000);
|
||||||
Write_MPU401(mpu_device->addrport, UARTCMD, mpu_device->workarounds, MPU401_RESET);
|
Write_MPU401(mpu_device->addrport, UARTCMD,
|
||||||
|
mpu_device->workarounds, MPU401_RESET);
|
||||||
snooze(30000);
|
snooze(30000);
|
||||||
ack_byte = Read_MPU401(mpu_device->addrport, UARTDATA, mpu_device->workarounds);
|
ack_byte = Read_MPU401(mpu_device->addrport, UARTDATA,
|
||||||
|
mpu_device->workarounds);
|
||||||
PRINT(("enable UART mode\n"));
|
PRINT(("enable UART mode\n"));
|
||||||
Write_MPU401(mpu_device->addrport, UARTCMD, mpu_device->workarounds, MPU401_UART);
|
Write_MPU401(mpu_device->addrport, UARTCMD,
|
||||||
|
mpu_device->workarounds, MPU401_UART);
|
||||||
snooze(30000);
|
snooze(30000);
|
||||||
ack_byte = Read_MPU401(mpu_device->addrport, UARTDATA, mpu_device->workarounds );
|
ack_byte = Read_MPU401(mpu_device->addrport, UARTDATA,
|
||||||
|
mpu_device->workarounds );
|
||||||
PRINT(("port cmd ack is 0x%x\n", ack_byte));
|
PRINT(("port cmd ack is 0x%x\n", ack_byte));
|
||||||
*out_cookie = mpu_device;
|
*out_cookie = mpu_device;
|
||||||
break;
|
break;
|
||||||
|
case 0x14121712:
|
||||||
|
PRINT(("reset MPU401\n"));
|
||||||
|
Write_MPU401(mpu_device->addrport, UARTDATA,
|
||||||
|
mpu_device->workarounds, 0x00);
|
||||||
|
snooze(30000);
|
||||||
|
Write_MPU401(mpu_device->addrport, UARTCMD,
|
||||||
|
mpu_device->workarounds, MPU401_RESET);
|
||||||
|
snooze(30000);
|
||||||
|
ack_byte = Read_MPU401(mpu_device->addrport, UARTDATA,
|
||||||
|
mpu_device->workarounds);
|
||||||
|
PRINT(("enable UART mode\n"));
|
||||||
|
Write_MPU401(mpu_device->addrport, UARTDATA,
|
||||||
|
mpu_device->workarounds, 0x00);
|
||||||
|
snooze(30000);
|
||||||
|
Write_MPU401(mpu_device->addrport, UARTCMD,
|
||||||
|
mpu_device->workarounds, MPU401_UART);
|
||||||
|
snooze(30000);
|
||||||
|
ack_byte = Read_MPU401(mpu_device->addrport, UARTDATA,
|
||||||
|
mpu_device->workarounds );
|
||||||
|
PRINT(("port cmd ack is 0x%x\n", ack_byte));
|
||||||
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
// Some devices are always in UART mode
|
// Some devices are always in UART mode
|
||||||
PRINT(("already in UART mode\n"));
|
PRINT(("already in UART mode\n"));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
PRINT(("Unknown workaround value: %d\n", mpu_device->workarounds));
|
PRINT(("Unknown workaround: %d\n", mpu_device->workarounds));
|
||||||
break;
|
break;
|
||||||
} //end switch
|
} //end switch
|
||||||
|
|
||||||
@@ -164,12 +196,12 @@ midi_open(void * storage, uint32 flags, void ** out_cookie)
|
|||||||
mpu_device->writesemaphore = create_sem(1, semname);
|
mpu_device->writesemaphore = create_sem(1, semname);
|
||||||
|
|
||||||
// clear midi-in buffer
|
// clear midi-in buffer
|
||||||
mbuf_bytes=0;
|
mbuf_bytes = 0;
|
||||||
mbuf_current=0;
|
mbuf_current=0;
|
||||||
mbuf_start=0;
|
mbuf_start=0;
|
||||||
|
|
||||||
//Enable midi interrupts
|
//Enable midi interrupts
|
||||||
mpu_device->interrupt_op(B_MPU_401_ENABLE_CARD_INT, mpu_device->card );
|
mpu_device->interrupt_op(B_MPU_401_ENABLE_CARD_INT, mpu_device->card);
|
||||||
|
|
||||||
if ((mpu_device->readsemaphore > B_OK)
|
if ((mpu_device->readsemaphore > B_OK)
|
||||||
&& (mpu_device->writesemaphore > B_OK)) {
|
&& (mpu_device->writesemaphore > B_OK)) {
|
||||||
@@ -192,13 +224,13 @@ midi_close(void * cookie)
|
|||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|
||||||
//Disable soundcard midi interrupts
|
//Disable soundcard midi interrupts
|
||||||
mpu_device->interrupt_op(B_MPU_401_DISABLE_CARD_INT, mpu_device->card );
|
mpu_device->interrupt_op(B_MPU_401_DISABLE_CARD_INT, mpu_device->card);
|
||||||
|
|
||||||
// Delete the semaphores
|
// Delete the semaphores
|
||||||
delete_sem(mpu_device->readsemaphore);
|
delete_sem(mpu_device->readsemaphore);
|
||||||
delete_sem(mpu_device->writesemaphore);
|
delete_sem(mpu_device->writesemaphore);
|
||||||
|
|
||||||
atomic_add(&mpu_device->count, -1);
|
atomic_add(&mpu_device->count, -1);
|
||||||
PRINT(("midi_close() done (count = %lu)\n", mpu_device->count));
|
PRINT(("midi_close() done (count = %lu)\n", mpu_device->count));
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
@@ -249,7 +281,8 @@ midi_read(void *cookie, off_t pos, void *buffer, size_t *num_bytes)
|
|||||||
|
|
||||||
i=0;
|
i=0;
|
||||||
*num_bytes=0;
|
*num_bytes=0;
|
||||||
bestat = acquire_sem_etc ( mpu_device->readsemaphore, 1, B_CAN_INTERRUPT, 0);
|
bestat = acquire_sem_etc(mpu_device->readsemaphore, 1,
|
||||||
|
B_CAN_INTERRUPT, 0);
|
||||||
if (bestat == B_INTERRUPTED) {
|
if (bestat == B_INTERRUPTED) {
|
||||||
//PRINT(("acquire_sem B_INTERRUPTED!\n"));
|
//PRINT(("acquire_sem B_INTERRUPTED!\n"));
|
||||||
return B_INTERRUPTED;
|
return B_INTERRUPTED;
|
||||||
@@ -258,17 +291,16 @@ midi_read(void *cookie, off_t pos, void *buffer, size_t *num_bytes)
|
|||||||
TRACE(("acquire_sem not B_OK %d\n",(int)bestat));
|
TRACE(("acquire_sem not B_OK %d\n",(int)bestat));
|
||||||
*num_bytes = 1;
|
*num_bytes = 1;
|
||||||
return B_INTERRUPTED;
|
return B_INTERRUPTED;
|
||||||
}
|
} else {
|
||||||
if (bestat == B_OK) {
|
|
||||||
status = lock();
|
status = lock();
|
||||||
*(data+i) = mpubuffer[mbuf_start];
|
*(data+i) = mpubuffer[mbuf_start];
|
||||||
i++;
|
i++;
|
||||||
mbuf_start++; // pointer to data in ringbuffer
|
mbuf_start++; // pointer to data in ringbuffer
|
||||||
if (mbuf_start >= (MBUF_ELEMENTS-1))
|
if (mbuf_start >= (MBUF_ELEMENTS-1))
|
||||||
mbuf_start = 0; //wraparound of ringbuffer
|
mbuf_start = 0; //wraparound of ringbuffer
|
||||||
*num_bytes =1; // tell caller how many bytes are being returned in buffer
|
*num_bytes = 1; // How many bytes are being returned in buffer
|
||||||
if (mbuf_bytes>0)
|
if (mbuf_bytes>0)
|
||||||
mbuf_bytes--; // bytes read from buffer, so decrement buffer count
|
mbuf_bytes--; // bytes read from buffer, so decrement buffer count
|
||||||
unlock(status);
|
unlock(status);
|
||||||
//PRINT(("bytes in buffer: %d\n",mbuf_bytes));
|
//PRINT(("bytes in buffer: %d\n",mbuf_bytes));
|
||||||
}
|
}
|
||||||
@@ -291,13 +323,17 @@ midi_write(void * cookie, off_t pos, const void * data, size_t * num_bytes)
|
|||||||
count = *num_bytes;
|
count = *num_bytes;
|
||||||
|
|
||||||
/* Only for deep debugging..will slow things down */
|
/* Only for deep debugging..will slow things down */
|
||||||
//PRINT(("write %d bytes, addrport 0x%x, workarounds 0x%x\n",(int)count,mpu_device->addrport, mpu_device->workarounds));
|
/*PRINT(("write %d bytes, addrport 0x%x, workarounds 0x%x\n",
|
||||||
|
(int)count, mpu_device->addrport, mpu_device->workarounds));*/
|
||||||
|
|
||||||
acquire_sem(mpu_device->writesemaphore);
|
acquire_sem(mpu_device->writesemaphore);
|
||||||
for (i=0; i<count; i++) {
|
for (i=0; i<count; i++) {
|
||||||
// wait until device is ready
|
// wait until device is ready
|
||||||
while ((Read_MPU401(mpu_device->addrport, UARTCMD, mpu_device->workarounds) & MPU401_OK2WR));
|
while ((Read_MPU401(mpu_device->addrport, UARTCMD,
|
||||||
Write_MPU401(mpu_device->addrport, UARTDATA, mpu_device->workarounds, *(bufdata+i));
|
mpu_device->workarounds) & MPU401_OK2WR));
|
||||||
|
|
||||||
|
Write_MPU401(mpu_device->addrport, UARTDATA,
|
||||||
|
mpu_device->workarounds, *(bufdata+i));
|
||||||
}
|
}
|
||||||
|
|
||||||
*num_bytes = 0;
|
*num_bytes = 0;
|
||||||
@@ -314,40 +350,48 @@ interrupt_hook(void * cookie)
|
|||||||
status_t bestat;
|
status_t bestat;
|
||||||
mpu401device *mpu_device = (mpu401device *)cookie;
|
mpu401device *mpu_device = (mpu401device *)cookie;
|
||||||
|
|
||||||
//PRINT(("irq! port: 0x%x\n",mpu_device->addrport)); /* Only for deep debugging..will slow things down */
|
/* Only for deep debugging..will slow things down */
|
||||||
|
//PRINT(("irq! port: 0x%x\n",mpu_device->addrport));
|
||||||
|
|
||||||
/* Input data is available when bit 7 of the Status port is zero. Conversely, when bit 7 is
|
/* Input data is available when bit 7 of the Status port is zero.
|
||||||
is a one, no MIDI data is available. Reading from the data port will often clear the
|
Conversely, when bit 7 is is a one, no MIDI data is available.
|
||||||
interrupt signal depending on the sound card. */
|
Reading from the data port will often clear the interrupt signal
|
||||||
|
depending on the sound card. */
|
||||||
|
|
||||||
if ((Read_MPU401(mpu_device->addrport, UARTCMD, mpu_device->workarounds) & MPU401_OK2RD) == 0) {
|
if ((Read_MPU401(mpu_device->addrport, UARTCMD,
|
||||||
|
mpu_device->workarounds) & MPU401_OK2RD) == 0) {
|
||||||
/* Okay, midi data waiting to be read from device */
|
/* Okay, midi data waiting to be read from device */
|
||||||
if (mbuf_current >= (MBUF_ELEMENTS-1))
|
if (mbuf_current >= (MBUF_ELEMENTS-1))
|
||||||
mbuf_current = 0;
|
mbuf_current = 0;
|
||||||
|
|
||||||
|
/* store midi data byte into buffer */
|
||||||
mpubuffer[mbuf_current] = Read_MPU401(mpu_device->addrport,
|
mpubuffer[mbuf_current] = Read_MPU401(mpu_device->addrport,
|
||||||
UARTDATA, mpu_device->workarounds); /* store midi data byte into buffer */
|
UARTDATA, mpu_device->workarounds);
|
||||||
mbuf_current++; /* pointer to next blank byte */
|
mbuf_current++; /* pointer to next blank byte */
|
||||||
mbuf_bytes++; /* increment count of midi data bytes */
|
mbuf_bytes++; /* increment count of midi data bytes */
|
||||||
|
|
||||||
bestat = release_sem_etc(mpu_device->readsemaphore, 1, B_DO_NOT_RESCHEDULE);
|
bestat = release_sem_etc(mpu_device->readsemaphore, 1,
|
||||||
|
B_DO_NOT_RESCHEDULE);
|
||||||
|
|
||||||
return TRUE; //B_INVOKE_SCHEDULER
|
return TRUE; //B_INVOKE_SCHEDULER
|
||||||
}
|
}
|
||||||
|
|
||||||
/* No midi data from this interrupt */
|
/* No midi data from this interrupt */
|
||||||
return FALSE; //B_UNHANDLED_INTERRUPT
|
return FALSE; //B_UNHANDLED_INTERRUPT
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-----------------------------------------------------------------*/
|
/*-----------------------------------------------------------------*/
|
||||||
|
|
||||||
uchar
|
uchar
|
||||||
Read_MPU401(unsigned int addrport, const char cmdtype, unsigned int workarounds)
|
Read_MPU401(unsigned int addrport, const char cmdtype,
|
||||||
|
unsigned int workarounds)
|
||||||
{
|
{
|
||||||
uchar mpudatabyte;
|
uchar mpudatabyte;
|
||||||
cpu_status status;
|
cpu_status status;
|
||||||
unsigned int regptr;
|
unsigned int regptr;
|
||||||
|
|
||||||
//PRINT(("read workaround 0x%x\n",workarounds)); /* Only for deep debugging..will slow things down */
|
/* Only for deep debugging..will slow things down */
|
||||||
|
//PRINT(("read workaround 0x%x\n",workarounds));
|
||||||
switch (workarounds) {
|
switch (workarounds) {
|
||||||
case 0x11020004: /* Creative Audigy Gameport */
|
case 0x11020004: /* Creative Audigy Gameport */
|
||||||
regptr = (((I_MPU1 + cmdtype) << 16) & PTR_ADDRESS_MASK);
|
regptr = (((I_MPU1 + cmdtype) << 16) & PTR_ADDRESS_MASK);
|
||||||
@@ -365,8 +409,14 @@ Read_MPU401(unsigned int addrport, const char cmdtype, unsigned int workarounds)
|
|||||||
unlock(status);
|
unlock(status);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 0x14121712:
|
||||||
|
status = lock();
|
||||||
|
mpudatabyte = gPCI->read_io_8(addrport + cmdtype);
|
||||||
|
unlock(status);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
mpudatabyte = gISA->read_io_8(addrport + cmdtype );
|
mpudatabyte = gISA->read_io_8(addrport + cmdtype);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return mpudatabyte;
|
return mpudatabyte;
|
||||||
@@ -374,7 +424,8 @@ Read_MPU401(unsigned int addrport, const char cmdtype, unsigned int workarounds)
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
Write_MPU401(unsigned int addrport, const char cmdtype, unsigned int workarounds, uchar mpudatabyte )
|
Write_MPU401(unsigned int addrport, const char cmdtype,
|
||||||
|
unsigned int workarounds, uchar mpudatabyte)
|
||||||
{
|
{
|
||||||
cpu_status status;
|
cpu_status status;
|
||||||
unsigned int regptr;
|
unsigned int regptr;
|
||||||
@@ -382,22 +433,28 @@ Write_MPU401(unsigned int addrport, const char cmdtype, unsigned int workarounds
|
|||||||
/* Only for deep debugging..will slow things down */
|
/* Only for deep debugging..will slow things down */
|
||||||
//PRINT(("write workaround 0x%x at addr: 0x%x\n",workarounds,addrport));
|
//PRINT(("write workaround 0x%x at addr: 0x%x\n",workarounds,addrport));
|
||||||
switch (workarounds) {
|
switch (workarounds) {
|
||||||
case 0x11020004: /* Creative Audigy Gameport */
|
case 0x11020004: /* Creative Audigy Gameport */
|
||||||
regptr = (((I_MPU1 + cmdtype ) << 16) & PTR_ADDRESS_MASK);
|
regptr = (((I_MPU1 + cmdtype ) << 16) & PTR_ADDRESS_MASK);
|
||||||
status = lock();
|
status = lock();
|
||||||
gPCI->write_io_32(addrport + D_PTR, regptr); /*DATA or CMD */
|
gPCI->write_io_32(addrport + D_PTR, regptr); /*DATA or CMD */
|
||||||
gPCI->write_io_32(addrport + D_DATA, mpudatabyte );
|
gPCI->write_io_32(addrport + D_DATA, mpudatabyte );
|
||||||
unlock(status);
|
unlock(status);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x11020005: /* Creative Audigy LiveDrive */
|
case 0x11020005: /* Creative Audigy LiveDrive */
|
||||||
regptr = (((I_MPU2 + cmdtype ) << 16) & PTR_ADDRESS_MASK);
|
regptr = (((I_MPU2 + cmdtype ) << 16) & PTR_ADDRESS_MASK);
|
||||||
status = lock();
|
status = lock();
|
||||||
gPCI->write_io_32(addrport + D_PTR, regptr); /*DATA2 or CMD2 */
|
gPCI->write_io_32(addrport + D_PTR, regptr); /*DATA2 or CMD2 */
|
||||||
gPCI->write_io_32(addrport + D_DATA, mpudatabyte );
|
gPCI->write_io_32(addrport + D_DATA, mpudatabyte );
|
||||||
unlock(status);
|
unlock(status);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 0x14121712:
|
||||||
|
status = lock();
|
||||||
|
gPCI->write_io_8(addrport + cmdtype, mpudatabyte);
|
||||||
|
unlock(status);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
gISA->write_io_8(addrport + cmdtype, mpudatabyte);
|
gISA->write_io_8(addrport + cmdtype, mpudatabyte);
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user