2005-09-16 13:09:08 +02:00
|
|
|
#include "sb16.h"
|
|
|
|
|
|
|
|
/*===========================================================================*
|
|
|
|
* mixer_set
|
|
|
|
*===========================================================================*/
|
|
|
|
PUBLIC int mixer_set(reg, data)
|
|
|
|
int reg;
|
|
|
|
int data;
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
sb16_outb(MIXER_REG, reg);
|
|
|
|
for(i = 0; i < 100; i++);
|
|
|
|
sb16_outb(MIXER_DATA, data);
|
|
|
|
|
|
|
|
return OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*===========================================================================*
|
|
|
|
* sb16_inb
|
|
|
|
*===========================================================================*/
|
|
|
|
PUBLIC int sb16_inb(port)
|
|
|
|
int port;
|
|
|
|
{
|
2006-03-25 00:09:04 +01:00
|
|
|
int s;
|
|
|
|
unsigned long value;
|
2005-09-16 13:09:08 +02:00
|
|
|
|
|
|
|
if ((s=sys_inb(port, &value)) != OK)
|
2010-03-05 16:05:11 +01:00
|
|
|
panic("sys_inb() failed: %d", s);
|
2005-09-16 13:09:08 +02:00
|
|
|
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*===========================================================================*
|
|
|
|
* sb16_outb
|
|
|
|
*===========================================================================*/
|
|
|
|
PUBLIC void sb16_outb(port, value)
|
|
|
|
int port;
|
|
|
|
int value;
|
|
|
|
{
|
|
|
|
int s;
|
|
|
|
|
|
|
|
if ((s=sys_outb(port, value)) != OK)
|
2010-03-05 16:05:11 +01:00
|
|
|
panic("sys_outb() failed: %d", s);
|
2006-03-25 00:09:04 +01:00
|
|
|
}
|