32#ifdef HAVE_KERNEL_OPTION_HEADERS
45#include <isa/isavar.h>
49#define MSS_DEFAULT_BUFSZ (4096)
50#define MSS_INDEXED_REGS 0x20
51#define OPL_INDEXED_REGS 0x19
165#define MD_AD1848 0x91
166#define MD_AD1845 0x92
167#define MD_CS42XX 0xA1
168#define MD_CS423X 0xA2
169#define MD_OPTI930 0xB0
170#define MD_OPTI931 0xB1
171#define MD_OPTI925 0xB2
172#define MD_OPTI924 0xB3
173#define MD_GUSPNP 0xB8
174#define MD_GUSMAX 0xB9
175#define MD_YM0020 0xC1
178#define DV_F_TRUE_MSS 0x00010000
180#define FULL_DUPLEX(x) ((x)->bd_flags & BD_F_DUPLEX)
198 return bus_space_read_1(rman_get_bustag(port),
199 rman_get_bushandle(port),
209 bus_space_write_1(rman_get_bustag(port),
210 rman_get_bushandle(port),
275 bus_teardown_intr(
dev, mss->
irq, mss->
ih);
276 bus_release_resource(
dev, SYS_RES_IRQ, mss->
irq_rid,
282 isa_dma_release(rman_get_start(mss->
drq2));
283 bus_release_resource(
dev, SYS_RES_DRQ, mss->
drq2_rid,
289 isa_dma_release(rman_get_start(mss->
drq1));
290 bus_release_resource(
dev, SYS_RES_DRQ, mss->
drq1_rid,
295 bus_release_resource(
dev, SYS_RES_IOPORT, mss->
io_rid,
300 bus_release_resource(
dev, SYS_RES_IOPORT, mss->
conf_rid,
305 bus_release_resource(
dev, SYS_RES_IOPORT, mss->
indir_rid,
321 int pdma, rdma, ok = 1;
323 mss->
io_base = bus_alloc_resource_any(
dev, SYS_RES_IOPORT,
326 mss->
irq = bus_alloc_resource_any(
dev, SYS_RES_IRQ,
329 mss->
drq1 = bus_alloc_resource_any(
dev, SYS_RES_DRQ,
333 mss->
conf_base = bus_alloc_resource_any(
dev, SYS_RES_IOPORT,
337 mss->
drq2 = bus_alloc_resource_any(
dev, SYS_RES_DRQ,
346 pdma = rman_get_start(mss->
drq1);
347 isa_dma_acquire(pdma);
348 isa_dmainit(pdma, mss->
bufsize);
351 rdma = rman_get_start(mss->
drq2);
352 isa_dma_acquire(rdma);
353 isa_dmainit(rdma, mss->
bufsize);
374 DEB(printf(
"ch_bits dev %d ch %d val %d old 0x%02x "
375 "r %d p %d bit %d off %d\n",
376 dev, chn, newval, *regval,
378 (*t)[
dev][chn].nbits, (*t)[
dev][chn].bitoffs ) );
380 if ( (*t)[
dev][chn].polarity == 1)
381 newval = 100 - newval ;
383 mask = (1 << (*t)[
dev][chn].nbits) - 1;
384 newval = (int) ((newval *
mask) + 50) / 100;
385 shift = (*t)[
dev][chn].bitoffs ;
387 *regval &= ~(
mask << shift);
388 *regval |= (newval &
mask) << shift;
399 case SOUND_MASK_LINE:
400 case SOUND_MASK_LINE3:
405 case SOUND_MASK_LINE1:
409 case SOUND_MASK_IMIX:
415 mask = SOUND_MASK_MIC;
431 switch (mss->
bd_id) {
442 if ((*mix_d)[
dev][LEFT_CHN].nbits == 0) {
443 DEB(printf(
"nbits = 0 for dev %d\n",
dev));
451 regoffs = (*mix_d)[
dev][LEFT_CHN].regno;
454 if (regoffs != 0)
val = (
left == 0)? old | 0x80 : old & 0x7f;
458 DEB(printf(
"LEFT: dev %d reg %d old 0x%02x new 0x%02x\n",
461 if ((*mix_d)[
dev][RIGHT_CHN].nbits != 0) {
463 regoffs = (*mix_d)[
dev][RIGHT_CHN].regno;
465 if (regoffs != 1)
val = (
right == 0)? old | 0x80 : old & 0x7f;
469 DEB(printf(
"RIGHT: dev %d reg %d old 0x%02x new 0x%02x\n",
553 | SOUND_MASK_BASS | SOUND_MASK_TREBLE);
571 case SOUND_MIXER_VOLUME:
572 if (
left) t = 15 - (
left * 15) / 100;
580 case SOUND_MIXER_MIC:
582 if (
left) t = 31 - (
left * 31) / 100;
587 case SOUND_MIXER_BASS:
588 l = (
left * 7) / 100;
594 case SOUND_MIXER_TREBLE:
595 l = (
left * 7) / 100;
634 static const unsigned char irq_bits[16] = {
635 0, 0, 0, 3, 0, 2, 0, 4, 0, 1, 0, 5, 6, 0, 0, 7
637 static const unsigned char dma_bits[8] = {
638 0, 1, 0, 2, 0, 3, 4, 5
640 device_t parent = device_get_parent(
dev);
641 unsigned char irqctl, dmactl;
652 irqctl = irq_bits[isa_get_irq(parent)];
655 dmactl = dma_bits[isa_get_drq(parent)];
664 port_wr(alt, 0x0b, dmactl | 0x80);
684 struct resource *alt;
698 (rman_get_start(mss->
conf_base) & ~3) + 2
717 alt = bus_alloc_resource_any(
dev, SYS_RES_IOPORT, &
rid,
720 printf(
"XXX couldn't init GUS PnP/MAX\n");
726 bus_release_resource(
dev, SYS_RES_IOPORT,
rid, alt);
743 gus_wr(mss, 0x5b, tmp | 1);
744 BVDDB(printf(
"GUS: silicon rev %c\n",
'A' + ((tmp & 0xf) >> 4)));
751 BVDDB(printf(
"Yamaha: ver 0x%x DMA config 0x%x\n", r6, r9);)
789 u_char
c = 0, served = 0;
792 DEB(printf(
"mss_intr\n"));
818 BVDDB(printf(
"mss_intr: irq, but not from mss\n"));
819 }
else if (served == 0) {
820 BVDDB(printf(
"mss_intr: unexpected irq with reason %x\n",
c));
841 printf(
"AD_WAIT_INIT FAILED %d 0x%02x\n", arg,
n);
891 if (t &
MSS_IDXBUSY) printf(
"mss: Auto calibration timed out(1).\n");
898 for (t = 100; t > 0 && (
ad_read(mss, 11) & 0x20) == 0; t--);
904 for (t = 100; t > 0 && (
ad_read(mss, 11) & 0x20) == 0; t--) DELAY(100);
906 for (t = 100; t > 0 &&
ad_read(mss, 11) & 0x20; t--) DELAY(100);
934 DEB(printf(
"--- hey, leave_MCE: MCE bit was not set!\n"));
973 static int speeds[] =
974 {8000, 5512, 16000, 11025, 27429, 18900, 32000, 22050,
975 -1, 37800, -1, 44100, 48000, 33075, 9600, 6615};
977 for (i = 1; i < 16; i++)
979 abs(
speed-speeds[i]) < abs(
speed-speeds[sel])) sel = i;
1012 {AFMT_U8, AFMT_MU_LAW, AFMT_S16_LE, AFMT_A_LAW,
1013 -1, AFMT_IMA_ADPCM, AFMT_U16_BE, -1};
1016 for (i = 0; i < 8; i++)
if (arg ==
fmts[i])
break;
1023 if (
ad_read(mss, 12) & 0x40) {
1036 int retry, wr, cnt, ss;
1046 cnt = (ch->
blksz / ss) - 1;
1048 DEB(
if (
m & 4) printf(
"OUCH! reg 9 0x%02x\n",
m););
1070 if (
retry == 0)
BVDDB(printf(
"stop dma, failed to set bit 0x%02x 0x%02x\n", \
1083 u_char masked = 0, i11, mc11,
c = 0;
1089 if (!(reason & 1)) {
1090 DEB(printf(
"intr: flag 0, mcir11 0x%02x\n",
ad_read(mss, 11)));
1101 DEB(printf(
"Warning: CD interrupt\n");)
1105 DEB(printf(
"Warning: MPU interrupt\n");)
1108 if (mc11 & masked)
BVDDB(printf(
"irq reset failed, mc11 0x%02x, 0x%02x\n",\
1118 DEB(printf(
"one more try...\n");)
1119 if (--loops)
goto again;
1120 else BVDDB(printf(
"intr, but mc11 not set\n");)
1122 if (loops == 0)
BVDDB(printf(
"intr, nothing in mcir11 0x%02x\n", mc11));
1138 if (--loops)
goto again;
1140 DEB(printf(
"xxx too many loops\n");)
1275 int flags,
irq, drq, result = ENXIO, setres = 0;
1278 if (isa_get_logicalid(
dev))
return ENXIO;
1280 mss = (
struct mss_info *)malloc(
sizeof *mss, M_DEVBUF, M_NOWAIT | M_ZERO);
1281 if (!mss)
return ENXIO;
1288 mss->
io_base = bus_alloc_resource_anywhere(
dev, SYS_RES_IOPORT,
1289 &mss->
io_rid, 8, RF_ACTIVE);
1291 BVDDB(printf(
"mss_probe: no address given, try 0x%x\n", 0x530));
1295 bus_set_resource(
dev, SYS_RES_IOPORT, mss->
io_rid,
1297 mss->
io_base = bus_alloc_resource_anywhere(
dev, SYS_RES_IOPORT,
1304 flags = device_get_flags(
dev);
1306 drq = isa_get_drq(
dev);
1316 device_set_desc(
dev,
"MSS");
1317 tmpx = tmp =
io_rd(mss, 3);
1319 BVDDB(printf(
"I/O addr inactive (%x), try pseudo_mss\n", tmp));
1324 if (!(tmp == 0x04 || tmp == 0x0f || tmp == 0x00 || tmp == 0x05)) {
1325 BVDDB(printf(
"No MSS signature detected on port 0x%jx (0x%x)\n",
1326 rman_get_start(mss->
io_base), tmpx));
1330 printf(
"MSS: Bad IRQ %d\n",
irq);
1333 if (!(drq == 0 || drq == 1 || drq == 3)) {
1334 printf(
"MSS: Bad DMA %d\n", drq);
1340 printf(
"MSS: Can't use DMA0 with a 8 bit card/slot\n");
1343 if (!(
irq == 7 ||
irq == 9)) {
1344 printf(
"MSS: Can't use IRQ%d with a 8 bit card/slot\n",
1354 if (setres) ISA_DELETE_RESOURCE(device_get_parent(
dev),
dev,
1355 SYS_RES_IOPORT, mss->
io_rid);
1364 u_char tmp = 0, tmp1, tmp2;
1365 char *
name, *yamaha;
1367 if (mss->
bd_id != 0) {
1368 device_printf(
dev,
"presel bd_id 0x%04x -- %s\n", mss->
bd_id,
1369 device_get_desc(
dev));
1377 switch (mss->
bd_id) {
1385 printf(
"Found OPTi device %s\n",
name);
1399 for (i = 0; i < 10; i++)
1404 BVDDB(printf(
"mss_detect, busy still set (0x%02x)\n", tmp));
1417 if (tmp1 != 0xaa || tmp2 != 0x45) {
1418 BVDDB(printf(
"mss_detect error - IREG (%x/%x)\n", tmp1, tmp2));
1426 if (tmp1 != 0x45 || tmp2 != 0xaa) {
1427 BVDDB(printf(
"mss_detect error - IREG2 (%x/%x)\n", tmp1, tmp2));
1440 if ((tmp & 0x0f) != (tmp1 & 0x0f)) {
1441 BVDDB(printf(
"mss_detect - I12 (0x%02x was 0x%02x)\n", tmp1, tmp));
1451 BVDDB(printf(
"mss_detect - chip revision 0x%02x\n", tmp & 0x0f);)
1462 for (i = 0; i < 16; i++) {
1464 BVDDB(printf(
"mss_detect warning - I%d: 0x%02x/0x%02x\n",
1485 if (tmp1 & 0x80)
name =
"CS4248";
1486 if ((tmp1 & 0xf0) == 0x00) {
1487 BVDDB(printf(
"this should be an OPTi931\n");)
1488 }
else if ((tmp1 & 0xc0) != 0xC0)
goto gotit;
1496 if ((tmp1 =
ad_read(mss, 16)) == 0x45)
goto gotit;
1499 if ((tmp1 =
ad_read(mss, 16)) == 0xaa) {
1500 BVDDB(printf(
"mss_detect error - step H(%x)\n", tmp1));
1506 if ((
ad_read(mss, 25) & 0xe7) == (tmp1 & 0xe7)) {
1557 if (
ad_read(mss, 23) != tmp) {
1577 BVDDB(printf(
"unknown id 0x%02x, assuming CS4231\n",
id);)
1583 BVDDB(printf(
"mss_detect() - Detected %s\n",
name));
1585 device_set_flags(
dev,
1597 static const struct opticard {
1617 mss->
indir = bus_alloc_resource(
dev, SYS_RES_IOPORT,
1619 cards[
c].indir_reg+1, 1, RF_ACTIVE);
1621 mss->
conf_base = bus_alloc_resource(
dev, SYS_RES_IOPORT,
1642 static int ports[] = {0x370, 0x310, 0x538};
1643 int p, i, j, version;
1644 static char *chipset[] = {
1646 "OPL3-SA2 (YMF711)",
1647 "OPL3-SA3 (YMF715)",
1648 "OPL3-SA3 (YMF715)",
1649 "OPL3-SAx (YMF719)",
1650 "OPL3-SAx (YMF719)",
1651 "OPL3-SAx (YMF719)",
1652 "OPL3-SAx (YMF719)",
1655 for (p = 0; p < 3; p++) {
1660 ports[p], ports[p] + 1, 2,
1670 bus_release_resource(
dev, SYS_RES_IOPORT,
1676 return chipset[version];
1684 int pdma, rdma, flags = device_get_flags(
dev);
1691 pdma = rman_get_start(mss->
drq1);
1692 rdma = rman_get_start(mss->
drq2);
1695 static char interrupt_bits[12] =
1696 {-1, -1, -1, -1, -1, 0x28, -1, 0x08, -1, 0x10, 0x18, 0x20};
1697 static char pdma_bits[4] = {1, 2, -1, 3};
1698 static char valid_rdma[4] = {1, 0, -1, 0};
1701 if (!mss->
irq || (bits = interrupt_bits[rman_get_start(mss->
irq)]) == -1)
1703 io_wr(mss, 0, bits | 0x40);
1704 if ((
io_rd(mss, 3) & 0x40) == 0) device_printf(
dev,
"IRQ Conflict?\n");
1706 if (pdma_bits[pdma] == -1)
goto no;
1707 bits |= pdma_bits[pdma];
1709 if (rdma == valid_rdma[pdma]) bits |= 4;
1711 printf(
"invalid dual dma config %d:%d\n", pdma, rdma);
1715 io_wr(mss, 0, bits);
1716 printf(
"drq/irq conf %x\n",
io_rd(mss, 0));
1719 switch (mss->
bd_id) {
1728 if (bus_dma_tag_create(bus_get_dma_tag(
dev), 2,
1730 BUS_SPACE_MAXADDR_24BIT,
1737 device_printf(
dev,
"unable to create dma tag\n");
1747 rman_get_start(mss->
io_base), rman_get_start(mss->
irq), pdma, status2, mss->
bufsize);
1780 int flags = device_get_flags(
dev);
1782 gone_in_dev(
dev, 14,
"ISA sound driver");
1783 mss = (
struct mss_info *)malloc(
sizeof *mss, M_DEVBUF, M_NOWAIT | M_ZERO);
1784 if (!mss)
return ENXIO;
1792 bus_set_resource(
dev, SYS_RES_DRQ, 1,
1837 mss_format(&mss->pch, mss->pch.channel->format);
1838 mss_speed(&mss->pch, mss->pch.channel->speed);
1899 struct resource *sbport;
1904 sbport = bus_alloc_resource_any(
dev, SYS_RES_IOPORT, &
rid, RF_ACTIVE);
1906 for (i = 0; i < 1000; i++) {
1908 DELAY((i > 100) ? 1000 : 10);
1914 for (i = 0; i < 1000; i++) {
1916 DELAY((i > 100) ? 1000 : 10);
1924 bus_release_resource(
dev, SYS_RES_IOPORT,
rid, sbport);
1930 {0x0000630e,
"CS423x"},
1931 {0x0001630e,
"CS423x-PCI"},
1932 {0x01000000,
"CMI8330"},
1933 {0x2100a865,
"Yamaha OPL-SAx"},
1934 {0x1110d315,
"ENSONIQ SoundscapeVIVO"},
1935 {0x1093143e,
"OPTi931"},
1936 {0x5092143e,
"OPTi925"},
1937 {0x0000143e,
"OPTi924"},
1938 {0x1022b839,
"Neomagic 256AV (non-ac97)"},
1939 {0x01005407,
"Aztech 2320"},
1941 {0x0000561e,
"GusPnP"},
1951 lid = isa_get_logicalid(
dev);
1952 vid = isa_get_vendorid(
dev);
1953 if (lid == 0x01000000 &&
vid != 0x0100a90d)
1963 mss = malloc(
sizeof(*mss), M_DEVBUF, M_WAITOK | M_ZERO);
1971 switch (isa_get_logicalid(
dev)) {
2010 free(mss, M_DEVBUF);
2022 free(mss, M_DEVBUF);
2055 int flags = device_get_flags(
dev);
2059 bus_set_resource(
dev, SYS_RES_IOPORT, mss->
conf_rid,
2062 mss->
conf_base = bus_alloc_resource(
dev, SYS_RES_IOPORT,
2071 mss->
io_base = bus_alloc_resource_anywhere(
dev, SYS_RES_IOPORT,
2072 &mss->
io_rid, 8, RF_ACTIVE);
2075 mss->
io_base = bus_alloc_resource(
dev, SYS_RES_IOPORT,
2076 &mss->
io_rid, 0x530, 0x537, 8, RF_ACTIVE);
2081 switch (rman_get_start(mss->
io_base)) {
2095 printf(
"opti_init: invalid MSS base address!\n");
2099 switch (mss->
bd_id) {
2119 u_int32_t
irq = isa_get_irq(
dev);
2120 u_int32_t drq = isa_get_drq(
dev);
2121 bus_set_resource(
dev, SYS_RES_IRQ, 0,
irq, 1);
2122 bus_set_resource(
dev, SYS_RES_DRQ, mss->
drq1_rid, drq, 1);
2124 bus_set_resource(
dev, SYS_RES_DRQ, 1,
2142 switch(mss->
bd_id) {
2167 switch(mss->
bd_id) {
2216 device_set_desc(
dev,
"GUS CS4231");
2223 device_t parent = device_get_parent(
dev);
2228 mss = (
struct mss_info *)malloc(
sizeof *mss, M_DEVBUF, M_NOWAIT | M_ZERO);
2239 if (isa_get_logicalid(parent) == 0)
2247 flags = device_get_flags(parent);
2251 mss->conf_base = bus_alloc_resource_anywhere(
dev, SYS_RES_IOPORT,
2255 if (mss->conf_base == NULL) {
2260 base = isa_get_port(parent);
2263 if (isa_get_drq(
dev) > 3)
2267 ctl |= (
base >> 4) & 0x0f;
2268 port_wr(mss->conf_base, 6, ctl);
int sndbuf_alloc(struct snd_dbuf *b, bus_dma_tag_t dmatag, int dmaflags, unsigned int size)
int sndbuf_resize(struct snd_dbuf *b, unsigned int blkcnt, unsigned int blksz)
unsigned int sndbuf_runsz(struct snd_dbuf *b)
void chn_intr(struct pcm_channel *c)
#define PCMTRIG_COMMON(x)
struct pcmchan_matrix * m
static struct card_type cards[]
static int mixer_setrecsrc(struct snd_mixer *mixer, u_int32_t src)
int mixer_init(device_t dev, kobj_class_t cls, void *devinfo)
static int mixer_set(struct snd_mixer *m, u_int dev, u_int32_t muted, u_int lev)
u_int32_t mix_getdevs(struct snd_mixer *m)
void mix_setdevs(struct snd_mixer *m, u_int32_t v)
void * mix_getdevinfo(struct snd_mixer *m)
void mix_setrecdevs(struct snd_mixer *m, u_int32_t v)
Record mask of available recording devices.
static int mss_trigger(struct mss_chinfo *ch, int go)
static void ad_unmute(struct mss_info *mss)
MIXER_DECLARE(mssmix_mixer)
static struct pcmchan_caps * msschan_getcaps(kobj_t obj, void *data)
static int opti_init(device_t dev, struct mss_info *mss)
static struct pcmchan_caps guspnp_caps
static int ad_wait_init(struct mss_info *mss, int x)
static void ad_leave_MCE(struct mss_info *mss)
static void mss_lock(struct mss_info *mss)
static u_int32_t ymmix_setrecsrc(struct snd_mixer *m, u_int32_t src)
static void mss_unlock(struct mss_info *mss)
static void ad_write(struct mss_info *mss, int reg, u_char data)
static int pnpmss_probe(device_t dev)
static int port_rd(struct resource *port, int off)
static int opti_detect(device_t dev, struct mss_info *mss)
static int mss_probe(device_t dev)
static int azt2320_mss_mode(struct mss_info *mss, device_t dev)
static struct pcmchan_caps mss_caps
static u_int32_t opti931_fmt[]
static void gus_wr(struct mss_info *mss, u_char reg, u_char value)
static int mss_attach(device_t dev)
static device_method_t guspcm_methods[]
static char * ymf_test(device_t dev, struct mss_info *mss)
static driver_t mss_driver
static int msschan_trigger(kobj_t obj, void *data, int go)
static int mss_format(struct mss_chinfo *ch, u_int32_t format)
static int io_rd(struct mss_info *mss, int reg)
static u_int32_t msschan_setspeed(kobj_t obj, void *data, u_int32_t speed)
static device_method_t mss_methods[]
static u_int32_t msschan_getptr(kobj_t obj, void *data)
static struct pcmchan_caps opti931_caps
static driver_t guspcm_driver
static u_int32_t mssmix_setrecsrc(struct snd_mixer *m, u_int32_t src)
static u_int32_t guspnp_fmt[]
SND_DECLARE_FILE("$FreeBSD$")
static int mss_detect(device_t dev, struct mss_info *mss)
static u_char gus_rd(struct mss_info *mss, u_char reg)
static void port_wr(struct resource *port, int off, u_int8_t data)
static int mss_speed(struct mss_chinfo *ch, int speed)
static void opti_wr(struct mss_info *mss, u_char reg, u_char value)
static int mss_suspend(device_t dev)
static void ad_enter_MCE(struct mss_info *mss)
static kobj_method_t mssmix_mixer_methods[]
static u_int32_t msschan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize)
MODULE_DEPEND(snd_mss, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER)
static int mss_set_recsrc(struct mss_info *mss, int mask)
static int mss_doattach(device_t dev, struct mss_info *mss)
#define MSS_DEFAULT_BUFSZ
MODULE_VERSION(snd_mss, 1)
DRIVER_MODULE(snd_mss, isa, mss_driver, pcm_devclass, 0, 0)
static int guspcm_attach(device_t dev)
static void io_wr(struct mss_info *mss, int reg, u_int8_t data)
static u_char opti_rd(struct mss_info *mss, u_char reg)
static kobj_method_t msschan_methods[]
static u_char opti_read(struct mss_info *mss, u_char reg)
static int mss_detach(device_t dev)
static u_int32_t mss_fmt[]
static void conf_wr(struct mss_info *mss, u_char reg, u_char data)
static void wait_for_calibration(struct mss_info *mss)
static driver_t pnpmss_driver
static int mss_init(struct mss_info *mss, device_t dev)
static struct isa_pnp_id pnpmss_ids[]
static int ymmix_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
static int msschan_setformat(kobj_t obj, void *data, u_int32_t format)
static int ymmix_init(struct snd_mixer *m)
static int mss_resume(device_t dev)
static void opti_write(struct mss_info *mss, u_char reg, u_char data)
static int mssmix_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
static int mssmix_init(struct snd_mixer *m)
static int mss_mixer_set(struct mss_info *mss, int dev, int left, int right)
static void mss_release_resources(struct mss_info *mss, device_t dev)
static void change_bits(mixer_tab *t, u_char *regval, int dev, int chn, int newval)
static void ad_write_cnt(struct mss_info *mss, int reg, u_short data)
static int ad_read(struct mss_info *mss, int reg)
static int pnpmss_attach(device_t dev)
static kobj_method_t ymmix_mixer_methods[]
static device_method_t pnpmss_methods[]
static u_char conf_rd(struct mss_info *mss, u_char reg)
static void gusmax_setup(struct mss_info *mss, device_t dev, struct resource *alt)
static driver_intr_t opti931_intr
static int mss_alloc_resources(struct mss_info *mss, device_t dev)
static driver_intr_t mss_intr
static void * msschan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir)
static int guspcm_probe(device_t dev)
struct mixer_def mixer_tab[32][2]
#define OPTI930_MIXER_DEVICES
#define MODE1_MIXER_DEVICES
#define OPTI931_MIXER_DEVICES
#define MODE2_MIXER_DEVICES
mixer_ent mix_devices[32][2]
mixer_ent opti930_devices[32][2]
mixer_ent opti931_devices[32][2]
int sndbuf_dmasetup(struct snd_dbuf *b, struct resource *drq)
void sndbuf_dma(struct snd_dbuf *b, int go)
int sndbuf_dmaptr(struct snd_dbuf *b)
void * snd_mtxcreate(const char *desc, const char *type)
void pcm_setflags(device_t dev, uint32_t val)
void * pcm_getdevinfo(device_t dev)
uint32_t pcm_getflags(device_t dev)
int pcm_setstatus(device_t dev, char *str)
void snd_mtxfree(void *m)
int pcm_addchan(device_t dev, int dir, kobj_class_t cls, void *devinfo)
int pcm_unregister(device_t dev)
int pcm_register(device_t dev, void *devinfo, int numplay, int numrec)
int snd_setup_intr(device_t dev, struct resource *res, int flags, driver_intr_t hand, void *param, void **cookiep)
unsigned int pcm_getbuffersize(device_t dev, unsigned int minbufsz, unsigned int deflt, unsigned int maxbufsz)
#define SND_FORMAT(f, c, e)
struct pcm_channel * channel
char mss_indexed_regs[MSS_INDEXED_REGS]
struct mss_chinfo pch rch
char opl_indexed_regs[OPL_INDEXED_REGS]
struct resource * io_base
struct resource * conf_base
bus_dma_tag_t parent_dmat