FreeBSD kernel sound device code
mss.c File Reference
#include <dev/sound/pcm/sound.h>
#include <dev/sound/isa/mss.h>
#include <dev/sound/isa/sb.h>
#include <dev/sound/chip.h>
#include <isa/isavar.h>
#include "mixer_if.h"
Include dependency graph for mss.c:

Go to the source code of this file.

Data Structures

struct  mss_chinfo
 
struct  mss_info
 

Macros

#define MSS_DEFAULT_BUFSZ   (4096)
 
#define MSS_INDEXED_REGS   0x20
 
#define OPL_INDEXED_REGS   0x19
 
#define MD_AD1848   0x91
 
#define MD_AD1845   0x92
 
#define MD_CS42XX   0xA1
 
#define MD_CS423X   0xA2
 
#define MD_OPTI930   0xB0
 
#define MD_OPTI931   0xB1
 
#define MD_OPTI925   0xB2
 
#define MD_OPTI924   0xB3
 
#define MD_GUSPNP   0xB8
 
#define MD_GUSMAX   0xB9
 
#define MD_YM0020   0xC1
 
#define MD_VIVO   0xD1
 
#define DV_F_TRUE_MSS   0x00010000 /* mss _with_ base regs */
 
#define FULL_DUPLEX(x)   ((x)->bd_flags & BD_F_DUPLEX)
 

Functions

 SND_DECLARE_FILE ("$FreeBSD$")
 
static int mss_probe (device_t dev)
 
static int mss_attach (device_t dev)
 
static int mss_detect (device_t dev, struct mss_info *mss)
 
static int opti_detect (device_t dev, struct mss_info *mss)
 
static char * ymf_test (device_t dev, struct mss_info *mss)
 
static void ad_unmute (struct mss_info *mss)
 
static int mss_mixer_set (struct mss_info *mss, int dev, int left, int right)
 
static int mss_set_recsrc (struct mss_info *mss, int mask)
 
static int ad_wait_init (struct mss_info *mss, int x)
 
static int ad_read (struct mss_info *mss, int reg)
 
static void ad_write (struct mss_info *mss, int reg, u_char data)
 
static void ad_write_cnt (struct mss_info *mss, int reg, u_short data)
 
static void ad_enter_MCE (struct mss_info *mss)
 
static void ad_leave_MCE (struct mss_info *mss)
 
static void opti_write (struct mss_info *mss, u_char reg, u_char data)
 
static u_char opti_read (struct mss_info *mss, u_char reg)
 
static int opti_init (device_t dev, struct mss_info *mss)
 
static void conf_wr (struct mss_info *mss, u_char reg, u_char data)
 
static u_char conf_rd (struct mss_info *mss, u_char reg)
 
static int pnpmss_probe (device_t dev)
 
static int pnpmss_attach (device_t dev)
 
static void mss_lock (struct mss_info *mss)
 
static void mss_unlock (struct mss_info *mss)
 
static int port_rd (struct resource *port, int off)
 
static void port_wr (struct resource *port, int off, u_int8_t data)
 
static int io_rd (struct mss_info *mss, int reg)
 
static void io_wr (struct mss_info *mss, int reg, u_int8_t data)
 
static void opti_wr (struct mss_info *mss, u_char reg, u_char value)
 
static u_char opti_rd (struct mss_info *mss, u_char reg)
 
static void gus_wr (struct mss_info *mss, u_char reg, u_char value)
 
static u_char gus_rd (struct mss_info *mss, u_char reg)
 
static void mss_release_resources (struct mss_info *mss, device_t dev)
 
static int mss_alloc_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 int mssmix_init (struct snd_mixer *m)
 
static int mssmix_set (struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
 
static u_int32_t mssmix_setrecsrc (struct snd_mixer *m, u_int32_t src)
 
 MIXER_DECLARE (mssmix_mixer)
 
static int ymmix_init (struct snd_mixer *m)
 
static int ymmix_set (struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
 
static u_int32_t ymmix_setrecsrc (struct snd_mixer *m, u_int32_t src)
 
 MIXER_DECLARE (ymmix_mixer)
 
static void gusmax_setup (struct mss_info *mss, device_t dev, struct resource *alt)
 
static int mss_init (struct mss_info *mss, device_t dev)
 
static void mss_intr (void *arg)
 
static void wait_for_calibration (struct mss_info *mss)
 
static int mss_speed (struct mss_chinfo *ch, int speed)
 
static int mss_format (struct mss_chinfo *ch, u_int32_t format)
 
static int mss_trigger (struct mss_chinfo *ch, int go)
 
static void opti931_intr (void *arg)
 
static void * msschan_init (kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir)
 
static int msschan_setformat (kobj_t obj, void *data, u_int32_t format)
 
static u_int32_t msschan_setspeed (kobj_t obj, void *data, u_int32_t speed)
 
static u_int32_t msschan_setblocksize (kobj_t obj, void *data, u_int32_t blocksize)
 
static int msschan_trigger (kobj_t obj, void *data, int go)
 
static u_int32_t msschan_getptr (kobj_t obj, void *data)
 
static struct pcmchan_capsmsschan_getcaps (kobj_t obj, void *data)
 
 CHANNEL_DECLARE (msschan)
 
static int mss_doattach (device_t dev, struct mss_info *mss)
 
static int mss_detach (device_t dev)
 
static int mss_resume (device_t dev)
 
static int mss_suspend (device_t dev)
 
 DRIVER_MODULE (snd_mss, isa, mss_driver, pcm_devclass, 0, 0)
 
 MODULE_DEPEND (snd_mss, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER)
 
 MODULE_VERSION (snd_mss, 1)
 
static int azt2320_mss_mode (struct mss_info *mss, device_t dev)
 
 DRIVER_MODULE (snd_pnpmss, isa, pnpmss_driver, pcm_devclass, 0, 0)
 
 DRIVER_MODULE (snd_pnpmss, acpi, pnpmss_driver, pcm_devclass, 0, 0)
 
 MODULE_DEPEND (snd_pnpmss, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER)
 
 MODULE_VERSION (snd_pnpmss, 1)
 
static int guspcm_probe (device_t dev)
 
static int guspcm_attach (device_t dev)
 
 DRIVER_MODULE (snd_guspcm, gusc, guspcm_driver, pcm_devclass, 0, 0)
 
 MODULE_DEPEND (snd_guspcm, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER)
 
 MODULE_VERSION (snd_guspcm, 1)
 
 ISA_PNP_INFO (pnpmss_ids)
 

Variables

static driver_intr_t mss_intr
 
static driver_intr_t opti931_intr
 
static u_int32_t mss_fmt []
 
static struct pcmchan_caps mss_caps = {4000, 48000, mss_fmt, 0}
 
static u_int32_t guspnp_fmt []
 
static struct pcmchan_caps guspnp_caps = {4000, 48000, guspnp_fmt, 0}
 
static u_int32_t opti931_fmt []
 
static struct pcmchan_caps opti931_caps = {4000, 48000, opti931_fmt, 0}
 
static kobj_method_t mssmix_mixer_methods []
 
static kobj_method_t ymmix_mixer_methods []
 
static kobj_method_t msschan_methods []
 
static device_method_t mss_methods []
 
static driver_t mss_driver
 
static struct isa_pnp_id pnpmss_ids []
 
static device_method_t pnpmss_methods []
 
static driver_t pnpmss_driver
 
static device_method_t guspcm_methods []
 
static driver_t guspcm_driver
 

Macro Definition Documentation

◆ DV_F_TRUE_MSS

#define DV_F_TRUE_MSS   0x00010000 /* mss _with_ base regs */

Definition at line 178 of file mss.c.

◆ FULL_DUPLEX

#define FULL_DUPLEX (   x)    ((x)->bd_flags & BD_F_DUPLEX)

Definition at line 180 of file mss.c.

◆ MD_AD1845

#define MD_AD1845   0x92

Definition at line 166 of file mss.c.

◆ MD_AD1848

#define MD_AD1848   0x91

Definition at line 165 of file mss.c.

◆ MD_CS423X

#define MD_CS423X   0xA2

Definition at line 168 of file mss.c.

◆ MD_CS42XX

#define MD_CS42XX   0xA1

Definition at line 167 of file mss.c.

◆ MD_GUSMAX

#define MD_GUSMAX   0xB9

Definition at line 174 of file mss.c.

◆ MD_GUSPNP

#define MD_GUSPNP   0xB8

Definition at line 173 of file mss.c.

◆ MD_OPTI924

#define MD_OPTI924   0xB3

Definition at line 172 of file mss.c.

◆ MD_OPTI925

#define MD_OPTI925   0xB2

Definition at line 171 of file mss.c.

◆ MD_OPTI930

#define MD_OPTI930   0xB0

Definition at line 169 of file mss.c.

◆ MD_OPTI931

#define MD_OPTI931   0xB1

Definition at line 170 of file mss.c.

◆ MD_VIVO

#define MD_VIVO   0xD1

Definition at line 176 of file mss.c.

◆ MD_YM0020

#define MD_YM0020   0xC1

Definition at line 175 of file mss.c.

◆ MSS_DEFAULT_BUFSZ

#define MSS_DEFAULT_BUFSZ   (4096)

Definition at line 49 of file mss.c.

◆ MSS_INDEXED_REGS

#define MSS_INDEXED_REGS   0x20

Definition at line 50 of file mss.c.

◆ OPL_INDEXED_REGS

#define OPL_INDEXED_REGS   0x19

Definition at line 51 of file mss.c.

Function Documentation

◆ ad_enter_MCE()

static void ad_enter_MCE ( struct mss_info mss)
static

Definition at line 917 of file mss.c.

References ad_wait_init(), BD_F_MCE_BIT, mss_info::bd_flags, io_rd(), io_wr(), MSS_INDEX, MSS_MCE, and prev.

Referenced by mss_format(), mss_init(), and mss_speed().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ad_leave_MCE()

static void ad_leave_MCE ( struct mss_info mss)
static

Definition at line 929 of file mss.c.

References ad_wait_init(), BD_F_MCE_BIT, mss_info::bd_flags, DEB, io_rd(), io_wr(), MSS_INDEX, MSS_MCE, prev, and wait_for_calibration().

Referenced by mss_format(), mss_init(), and mss_speed().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ad_read()

static int ad_read ( struct mss_info mss,
int  reg 
)
static

Definition at line 846 of file mss.c.

References ad_wait_init(), io_rd(), io_wr(), MSS_IDATA, MSS_IDXMASK, MSS_INDEX, and reg.

Referenced by ad_unmute(), mss_detect(), mss_format(), mss_init(), mss_intr(), mss_mixer_set(), mss_set_recsrc(), mss_speed(), mss_suspend(), mss_trigger(), opti931_intr(), and wait_for_calibration().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ad_unmute()

static void ad_unmute ( struct mss_info mss)
static

Definition at line 910 of file mss.c.

References ad_read(), ad_write(), and I6_MUTE.

Referenced by mss_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ad_wait_init()

static int ad_wait_init ( struct mss_info mss,
int  x 
)
static

Definition at line 835 of file mss.c.

References io_rd(), MSS_IDXBUSY, MSS_INDEX, and n.

Referenced by ad_enter_MCE(), ad_leave_MCE(), ad_read(), ad_write(), mss_format(), mss_speed(), and wait_for_calibration().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ad_write()

static void ad_write ( struct mss_info mss,
int  reg,
u_char  data 
)
static

Definition at line 859 of file mss.c.

References ad_wait_init(), data, io_rd(), io_wr(), MSS_IDATA, MSS_IDXMASK, MSS_INDEX, and reg.

Referenced by ad_unmute(), ad_write_cnt(), mss_detect(), mss_format(), mss_init(), mss_intr(), mss_mixer_set(), mss_resume(), mss_set_recsrc(), mss_speed(), mss_trigger(), and mssmix_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ad_write_cnt()

static void ad_write_cnt ( struct mss_info mss,
int  reg,
u_short  data 
)
static

Definition at line 871 of file mss.c.

References ad_write(), and reg.

Referenced by mss_trigger().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ azt2320_mss_mode()

static int azt2320_mss_mode ( struct mss_info mss,
device_t  dev 
)
static

Definition at line 1897 of file mss.c.

References dev, port_rd(), port_wr(), rid, SBDSP_CMD, and SBDSP_STATUS.

Referenced by pnpmss_attach().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ change_bits()

static void change_bits ( mixer_tab t,
u_char *  regval,
int  dev,
int  chn,
int  newval 
)
static

Definition at line 369 of file mss.c.

References DEB, dev, mask, and regno.

Referenced by mss_mixer_set().

Here is the caller graph for this function:

◆ CHANNEL_DECLARE()

CHANNEL_DECLARE ( msschan  )

◆ conf_rd()

static u_char conf_rd ( struct mss_info mss,
u_char  reg 
)
static

Definition at line 236 of file mss.c.

References mss_info::conf_base, port_rd(), port_wr(), and reg.

Referenced by mss_init(), mss_suspend(), and ymf_test().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ conf_wr()

static void conf_wr ( struct mss_info mss,
u_char  reg,
u_char  data 
)
static

Definition at line 229 of file mss.c.

References mss_info::conf_base, port_wr(), reg, and value.

Referenced by mss_init(), mss_resume(), mss_suspend(), ymmix_init(), and ymmix_set().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DRIVER_MODULE() [1/4]

DRIVER_MODULE ( snd_guspcm  ,
gusc  ,
guspcm_driver  ,
pcm_devclass  ,
,
 
)

◆ DRIVER_MODULE() [2/4]

DRIVER_MODULE ( snd_mss  ,
isa  ,
mss_driver  ,
pcm_devclass  ,
,
 
)

◆ DRIVER_MODULE() [3/4]

DRIVER_MODULE ( snd_pnpmss  ,
acpi  ,
pnpmss_driver  ,
pcm_devclass  ,
,
 
)

◆ DRIVER_MODULE() [4/4]

DRIVER_MODULE ( snd_pnpmss  ,
isa  ,
pnpmss_driver  ,
pcm_devclass  ,
,
 
)

◆ gus_rd()

static u_char gus_rd ( struct mss_info mss,
u_char  reg 
)
static

Definition at line 264 of file mss.c.

References mss_info::conf_base, port_rd(), port_wr(), and reg.

Referenced by mss_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gus_wr()

static void gus_wr ( struct mss_info mss,
u_char  reg,
u_char  value 
)
static

Definition at line 257 of file mss.c.

References mss_info::conf_base, port_wr(), reg, and value.

Referenced by mss_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gusmax_setup()

static void gusmax_setup ( struct mss_info mss,
device_t  dev,
struct resource *  alt 
)
static

Definition at line 632 of file mss.c.

References mss_info::conf_base, dev, DV_F_DRQ_MASK, DV_F_DUAL_DMA, and port_wr().

Referenced by mss_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ guspcm_attach()

static int guspcm_attach ( device_t  dev)
static

◆ guspcm_probe()

static int guspcm_probe ( device_t  dev)
static

Definition at line 2208 of file mss.c.

References dev, sndcard_func::func, and SCF_PCM.

◆ io_rd()

static int io_rd ( struct mss_info mss,
int  reg 
)
static

Definition at line 215 of file mss.c.

References BD_F_MSS_OFFSET, mss_info::bd_flags, mss_info::io_base, port_rd(), and reg.

Referenced by ad_enter_MCE(), ad_leave_MCE(), ad_read(), ad_wait_init(), ad_write(), mss_detect(), mss_doattach(), mss_intr(), mss_probe(), and opti931_intr().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ io_wr()

static void io_wr ( struct mss_info mss,
int  reg,
u_int8_t  data 
)
static

Definition at line 222 of file mss.c.

References BD_F_MSS_OFFSET, mss_info::bd_flags, data, mss_info::io_base, port_wr(), and reg.

Referenced by ad_enter_MCE(), ad_leave_MCE(), ad_read(), ad_write(), mss_doattach(), mss_init(), and mss_intr().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ISA_PNP_INFO()

ISA_PNP_INFO ( pnpmss_ids  )

◆ MIXER_DECLARE() [1/2]

MIXER_DECLARE ( mssmix_mixer  )

◆ MIXER_DECLARE() [2/2]

MIXER_DECLARE ( ymmix_mixer  )

◆ MODULE_DEPEND() [1/3]

MODULE_DEPEND ( snd_guspcm  ,
sound  ,
SOUND_MINVER  ,
SOUND_PREFVER  ,
SOUND_MAXVER   
)

◆ MODULE_DEPEND() [2/3]

MODULE_DEPEND ( snd_mss  ,
sound  ,
SOUND_MINVER  ,
SOUND_PREFVER  ,
SOUND_MAXVER   
)

◆ MODULE_DEPEND() [3/3]

MODULE_DEPEND ( snd_pnpmss  ,
sound  ,
SOUND_MINVER  ,
SOUND_PREFVER  ,
SOUND_MAXVER   
)

◆ MODULE_VERSION() [1/3]

MODULE_VERSION ( snd_guspcm  ,
 
)

◆ MODULE_VERSION() [2/3]

MODULE_VERSION ( snd_mss  ,
 
)

◆ MODULE_VERSION() [3/3]

MODULE_VERSION ( snd_pnpmss  ,
 
)

◆ mss_alloc_resources()

static int mss_alloc_resources ( struct mss_info mss,
device_t  dev 
)
static

◆ mss_attach()

static int mss_attach ( device_t  dev)
static

◆ mss_detach()

static int mss_detach ( device_t  dev)
static

Definition at line 1761 of file mss.c.

References dev, mss_release_resources(), pcm_getdevinfo(), pcm_unregister(), and r.

Here is the call graph for this function:

◆ mss_detect()

static int mss_detect ( device_t  dev,
struct mss_info mss 
)
static

Definition at line 1361 of file mss.c.

References ad_read(), ad_write(), mss_info::bd_id, BVDDB, dev, DV_F_DEV_MASK, DV_F_DEV_SHIFT, id, io_rd(), MD_AD1845, MD_AD1848, MD_CS42XX, MD_OPTI924, MD_OPTI930, MD_YM0020, MSS_IDXBUSY, MSS_INDEX, name, opti_detect(), opti_init(), and ymf_test().

Referenced by mss_probe().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mss_doattach()

◆ mss_format()

static int mss_format ( struct mss_chinfo ch,
u_int32_t  format 
)
static

Definition at line 998 of file mss.c.

References ad_enter_MCE(), ad_leave_MCE(), ad_read(), ad_wait_init(), ad_write(), AFMT_CHANNEL, AFMT_ENCODING, mss_chinfo::fmt, fmts, format, and mss_chinfo::parent.

Referenced by mss_resume(), and msschan_setformat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mss_init()

static int mss_init ( struct mss_info mss,
device_t  dev 
)
static

◆ mss_intr()

static void mss_intr ( void *  arg)
static

Definition at line 786 of file mss.c.

References ad_read(), ad_write(), mss_chinfo::buffer, BVDDB, c, mss_chinfo::channel, chn_intr(), DEB, FULL_DUPLEX, io_rd(), io_wr(), mss_lock(), MSS_STATUS, mss_unlock(), mss_info::rch, and sndbuf_runsz().

Here is the call graph for this function:

◆ mss_lock()

static void mss_lock ( struct mss_info mss)
static

◆ mss_mixer_set()

static int mss_mixer_set ( struct mss_info mss,
int  dev,
int  left,
int  right 
)
static

Definition at line 425 of file mss.c.

References ad_read(), ad_write(), mss_info::bd_id, change_bits(), DEB, dev, left, MD_OPTI930, MD_OPTI931, mix_devices, opti930_devices, opti931_devices, right, and val.

Referenced by mssmix_set(), and ymmix_set().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mss_probe()

static int mss_probe ( device_t  dev)
static

◆ mss_release_resources()

static void mss_release_resources ( struct mss_info mss,
device_t  dev 
)
static

◆ mss_resume()

static int mss_resume ( device_t  dev)
static

◆ mss_set_recsrc()

static int mss_set_recsrc ( struct mss_info mss,
int  mask 
)
static

Definition at line 394 of file mss.c.

References ad_read(), ad_write(), and mask.

Referenced by mssmix_setrecsrc(), and ymmix_setrecsrc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mss_speed()

static int mss_speed ( struct mss_chinfo ch,
int  speed 
)
static

Definition at line 949 of file mss.c.

References ad_enter_MCE(), ad_leave_MCE(), ad_read(), ad_wait_init(), ad_write(), mss_info::bd_id, MD_AD1845, mss_chinfo::parent, and speed.

Referenced by mss_resume(), and msschan_setspeed().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mss_suspend()

static int mss_suspend ( device_t  dev)
static

◆ mss_trigger()

static int mss_trigger ( struct mss_chinfo ch,
int  go 
)
static

Definition at line 1032 of file mss.c.

References ad_read(), ad_write(), ad_write_cnt(), AFMT_16BIT, AFMT_CHANNEL, mss_chinfo::blksz, BVDDB, DEB, mss_chinfo::dir, mss_chinfo::fmt, FULL_DUPLEX, go, I9_CEN, I9_PEN, m, mss_chinfo::parent, PCMDIR_PLAY, PCMTRIG_ABORT, PCMTRIG_START, PCMTRIG_STOP, and retry.

Referenced by msschan_trigger().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mss_unlock()

static void mss_unlock ( struct mss_info mss)
static

◆ msschan_getcaps()

static struct pcmchan_caps * msschan_getcaps ( kobj_t  obj,
void *  data 
)
static

◆ msschan_getptr()

static u_int32_t msschan_getptr ( kobj_t  obj,
void *  data 
)
static

Definition at line 1215 of file mss.c.

References mss_chinfo::buffer, data, and sndbuf_dmaptr().

Here is the call graph for this function:

◆ msschan_init()

static void * msschan_init ( kobj_t  obj,
void *  devinfo,
struct snd_dbuf b,
struct pcm_channel c,
int  dir 
)
static

◆ msschan_setblocksize()

static u_int32_t msschan_setblocksize ( kobj_t  obj,
void *  data,
u_int32_t  blocksize 
)
static

Definition at line 1188 of file mss.c.

References mss_chinfo::blksz, blocksize, mss_chinfo::buffer, data, and sndbuf_resize().

Here is the call graph for this function:

◆ msschan_setformat()

static int msschan_setformat ( kobj_t  obj,
void *  data,
u_int32_t  format 
)
static

Definition at line 1162 of file mss.c.

References data, format, mss_format(), mss_lock(), mss_unlock(), and mss_chinfo::parent.

Here is the call graph for this function:

◆ msschan_setspeed()

static u_int32_t msschan_setspeed ( kobj_t  obj,
void *  data,
u_int32_t  speed 
)
static

Definition at line 1174 of file mss.c.

References data, mss_lock(), mss_speed(), mss_unlock(), mss_chinfo::parent, r, and speed.

Here is the call graph for this function:

◆ msschan_trigger()

static int msschan_trigger ( kobj_t  obj,
void *  data,
int  go 
)
static

Definition at line 1199 of file mss.c.

References mss_chinfo::buffer, data, go, mss_lock(), mss_trigger(), mss_unlock(), mss_chinfo::parent, PCMTRIG_COMMON, and sndbuf_dma().

Here is the call graph for this function:

◆ mssmix_init()

static int mssmix_init ( struct snd_mixer m)
static

Definition at line 478 of file mss.c.

References ad_write(), mss_info::bd_id, m, MD_AD1848, MD_GUSMAX, MD_GUSPNP, MD_OPTI930, MD_OPTI931, mix_getdevinfo(), mix_setdevs(), mix_setrecdevs(), MODE1_MIXER_DEVICES, MODE2_MIXER_DEVICES, mss_lock(), MSS_REC_DEVICES, mss_unlock(), OPTI930_MIXER_DEVICES, and OPTI931_MIXER_DEVICES.

Referenced by ymmix_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mssmix_set()

static int mssmix_set ( struct snd_mixer m,
unsigned  dev,
unsigned  left,
unsigned  right 
)
static

Definition at line 514 of file mss.c.

References dev, left, m, mix_getdevinfo(), mss_lock(), mss_mixer_set(), mss_unlock(), and right.

Here is the call graph for this function:

◆ mssmix_setrecsrc()

static u_int32_t mssmix_setrecsrc ( struct snd_mixer m,
u_int32_t  src 
)
static

Definition at line 526 of file mss.c.

References m, mix_getdevinfo(), mss_lock(), mss_set_recsrc(), mss_unlock(), and src.

Here is the call graph for this function:

◆ opti931_intr()

static void opti931_intr ( void *  arg)
static

Definition at line 1080 of file mss.c.

References ad_read(), mss_chinfo::buffer, BVDDB, c, mss_chinfo::channel, chn_intr(), DEB, FULL_DUPLEX, io_rd(), mss_lock(), MSS_STATUS, mss_unlock(), opti_rd(), opti_wr(), mss_info::rch, and sndbuf_runsz().

Here is the call graph for this function:

◆ opti_detect()

static int opti_detect ( device_t  dev,
struct mss_info mss 
)
static

Definition at line 1594 of file mss.c.

References base, mss_info::bd_id, c, cards, mss_info::conf_base, mss_info::conf_rid, dev, mss_info::indir, mss_info::indir_rid, MD_OPTI924, MD_OPTI930, opti_read(), mss_info::optibase, mss_info::passwdreg, and mss_info::password.

Referenced by mss_detect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ opti_init()

static int opti_init ( device_t  dev,
struct mss_info mss 
)
static

◆ opti_rd()

static u_char opti_rd ( struct mss_info mss,
u_char  reg 
)
static

Definition at line 250 of file mss.c.

References mss_info::conf_base, mss_info::opti_offset, port_rd(), port_wr(), and reg.

Referenced by opti931_intr().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ opti_read()

u_char opti_read ( struct mss_info mss,
u_char  reg 
)
static

Definition at line 2163 of file mss.c.

References mss_info::bd_id, mss_info::conf_base, mss_info::indir, MD_OPTI924, MD_OPTI930, mss_info::passwdreg, mss_info::password, port_rd(), port_wr(), and reg.

Referenced by opti_detect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ opti_wr()

static void opti_wr ( struct mss_info mss,
u_char  reg,
u_char  value 
)
static

Definition at line 243 of file mss.c.

References mss_info::conf_base, mss_info::opti_offset, port_wr(), reg, and value.

Referenced by mss_init(), and opti931_intr().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ opti_write()

static void opti_write ( struct mss_info mss,
u_char  reg,
u_char  data 
)
static

Definition at line 2138 of file mss.c.

References mss_info::bd_id, mss_info::conf_base, mss_info::indir, MD_OPTI924, MD_OPTI930, mss_info::passwdreg, mss_info::password, port_wr(), reg, and val.

Referenced by opti_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pnpmss_attach()

◆ pnpmss_probe()

static int pnpmss_probe ( device_t  dev)
static

Definition at line 1947 of file mss.c.

References dev, pnpmss_ids, and vid.

◆ port_rd()

static int port_rd ( struct resource *  port,
int  off 
)
static

Definition at line 195 of file mss.c.

Referenced by azt2320_mss_mode(), conf_rd(), gus_rd(), io_rd(), opti_rd(), opti_read(), and ymf_test().

Here is the caller graph for this function:

◆ port_wr()

static void port_wr ( struct resource *  port,
int  off,
u_int8_t  data 
)
static

Definition at line 206 of file mss.c.

References data.

Referenced by azt2320_mss_mode(), conf_rd(), conf_wr(), gus_rd(), gus_wr(), gusmax_setup(), io_wr(), mss_init(), opti_rd(), opti_read(), opti_wr(), opti_write(), and ymf_test().

Here is the caller graph for this function:

◆ SND_DECLARE_FILE()

SND_DECLARE_FILE ( "$FreeBSD$"  )

◆ wait_for_calibration()

static void wait_for_calibration ( struct mss_info mss)
static

Definition at line 878 of file mss.c.

References ad_read(), ad_wait_init(), mss_info::bd_id, MD_GUSMAX, MD_GUSPNP, and MSS_IDXBUSY.

Referenced by ad_leave_MCE().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ymf_test()

static char * ymf_test ( device_t  dev,
struct mss_info mss 
)
static

Definition at line 1640 of file mss.c.

References mss_info::conf_base, conf_rd(), mss_info::conf_rid, dev, OPL3SAx_DMACONF, OPL3SAx_MISC, port_rd(), and port_wr().

Referenced by mss_attach(), and mss_detect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ymmix_init()

static int ymmix_init ( struct snd_mixer m)
static

Definition at line 547 of file mss.c.

References conf_wr(), m, mix_getdevinfo(), mix_getdevs(), mix_setdevs(), mss_lock(), mss_unlock(), mssmix_init(), OPL3SAx_VOLUMEL, and OPL3SAx_VOLUMER.

Here is the call graph for this function:

◆ ymmix_set()

static int ymmix_set ( struct snd_mixer m,
unsigned  dev,
unsigned  left,
unsigned  right 
)
static

Definition at line 564 of file mss.c.

References conf_wr(), dev, left, m, mix_getdevinfo(), mss_lock(), mss_mixer_set(), mss_unlock(), OPL3SAx_BASS, OPL3SAx_MIC, OPL3SAx_TREBLE, OPL3SAx_VOLUMEL, OPL3SAx_VOLUMER, r, and right.

Here is the call graph for this function:

◆ ymmix_setrecsrc()

static u_int32_t ymmix_setrecsrc ( struct snd_mixer m,
u_int32_t  src 
)
static

Definition at line 610 of file mss.c.

References m, mix_getdevinfo(), mss_lock(), mss_set_recsrc(), mss_unlock(), and src.

Here is the call graph for this function:

Variable Documentation

◆ guspcm_driver

driver_t guspcm_driver
static
Initial value:
= {
"pcm",
}
static device_method_t guspcm_methods[]
Definition: mss.c:2274
#define PCM_SOFTC_SIZE
Definition: sound.h:96

Definition at line 2281 of file mss.c.

◆ guspcm_methods

device_method_t guspcm_methods[]
static
Initial value:
= {
DEVMETHOD(device_probe, guspcm_probe),
DEVMETHOD(device_attach, guspcm_attach),
DEVMETHOD(device_detach, mss_detach),
{ 0, 0 }
}
static int guspcm_attach(device_t dev)
Definition: mss.c:2221
static int mss_detach(device_t dev)
Definition: mss.c:1761
static int guspcm_probe(device_t dev)
Definition: mss.c:2208

Definition at line 2274 of file mss.c.

◆ guspnp_caps

struct pcmchan_caps guspnp_caps = {4000, 48000, guspnp_fmt, 0}
static

Definition at line 154 of file mss.c.

Referenced by msschan_getcaps().

◆ guspnp_fmt

u_int32_t guspnp_fmt[]
static
Initial value:
= {
SND_FORMAT(AFMT_U8, 1, 0),
SND_FORMAT(AFMT_U8, 2, 0),
SND_FORMAT(AFMT_S16_LE, 1, 0),
SND_FORMAT(AFMT_S16_LE, 2, 0),
SND_FORMAT(AFMT_A_LAW, 1, 0),
SND_FORMAT(AFMT_A_LAW, 2, 0),
0
}
#define SND_FORMAT(f, c, e)
Definition: sound.h:238

Definition at line 145 of file mss.c.

◆ mss_caps

struct pcmchan_caps mss_caps = {4000, 48000, mss_fmt, 0}
static

Definition at line 143 of file mss.c.

Referenced by msschan_getcaps().

◆ mss_driver

driver_t mss_driver
static
Initial value:
= {
"pcm",
}
static device_method_t mss_methods[]
Definition: mss.c:1876

Definition at line 1886 of file mss.c.

◆ mss_fmt

u_int32_t mss_fmt[]
static
Initial value:
= {
SND_FORMAT(AFMT_U8, 1, 0),
SND_FORMAT(AFMT_U8, 2, 0),
SND_FORMAT(AFMT_S16_LE, 1, 0),
SND_FORMAT(AFMT_S16_LE, 2, 0),
SND_FORMAT(AFMT_MU_LAW, 1, 0),
SND_FORMAT(AFMT_MU_LAW, 2, 0),
SND_FORMAT(AFMT_A_LAW, 1, 0),
SND_FORMAT(AFMT_A_LAW, 2, 0),
0
}

Definition at line 132 of file mss.c.

◆ mss_intr

driver_intr_t mss_intr
static

Definition at line 97 of file mss.c.

Referenced by mss_doattach(), and mss_resume().

◆ mss_methods

device_method_t mss_methods[]
static
Initial value:
= {
DEVMETHOD(device_probe, mss_probe),
DEVMETHOD(device_attach, mss_attach),
DEVMETHOD(device_detach, mss_detach),
DEVMETHOD(device_suspend, mss_suspend),
DEVMETHOD(device_resume, mss_resume),
{ 0, 0 }
}
static int mss_probe(device_t dev)
Definition: mss.c:1272
static int mss_attach(device_t dev)
Definition: mss.c:1777
static int mss_suspend(device_t dev)
Definition: mss.c:1856
static int mss_resume(device_t dev)
Definition: mss.c:1815

Definition at line 1876 of file mss.c.

◆ msschan_methods

kobj_method_t msschan_methods[]
static
Initial value:
= {
KOBJMETHOD(channel_init, msschan_init),
KOBJMETHOD(channel_setformat, msschan_setformat),
KOBJMETHOD(channel_setspeed, msschan_setspeed),
KOBJMETHOD(channel_setblocksize, msschan_setblocksize),
KOBJMETHOD(channel_trigger, msschan_trigger),
KOBJMETHOD(channel_getptr, msschan_getptr),
KOBJMETHOD(channel_getcaps, msschan_getcaps),
}
#define KOBJMETHOD_END
Definition: midi.c:76
static struct pcmchan_caps * msschan_getcaps(kobj_t obj, void *data)
Definition: mss.c:1222
static int msschan_trigger(kobj_t obj, void *data, int go)
Definition: mss.c:1199
static u_int32_t msschan_setspeed(kobj_t obj, void *data, u_int32_t speed)
Definition: mss.c:1174
static u_int32_t msschan_getptr(kobj_t obj, void *data)
Definition: mss.c:1215
static u_int32_t msschan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize)
Definition: mss.c:1188
static int msschan_setformat(kobj_t obj, void *data, u_int32_t format)
Definition: mss.c:1162
static void * msschan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir)
Definition: mss.c:1146

Definition at line 1242 of file mss.c.

◆ mssmix_mixer_methods

kobj_method_t mssmix_mixer_methods[]
static
Initial value:
= {
KOBJMETHOD(mixer_init, mssmix_init),
KOBJMETHOD(mixer_set, mssmix_set),
}
static int mixer_setrecsrc(struct snd_mixer *mixer, u_int32_t src)
Definition: mixer.c:373
int mixer_init(device_t dev, kobj_class_t cls, void *devinfo)
Definition: mixer.c:725
static int mixer_set(struct snd_mixer *m, u_int dev, u_int32_t muted, u_int lev)
Definition: mixer.c:247
static u_int32_t mssmix_setrecsrc(struct snd_mixer *m, u_int32_t src)
Definition: mss.c:526
static int mssmix_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
Definition: mss.c:514
static int mssmix_init(struct snd_mixer *m)
Definition: mss.c:478

Definition at line 536 of file mss.c.

◆ opti931_caps

struct pcmchan_caps opti931_caps = {4000, 48000, opti931_fmt, 0}
static

Definition at line 163 of file mss.c.

Referenced by msschan_getcaps().

◆ opti931_fmt

u_int32_t opti931_fmt[]
static
Initial value:
= {
SND_FORMAT(AFMT_U8, 1, 0),
SND_FORMAT(AFMT_U8, 2, 0),
SND_FORMAT(AFMT_S16_LE, 1, 0),
SND_FORMAT(AFMT_S16_LE, 2, 0),
0
}

Definition at line 156 of file mss.c.

◆ opti931_intr

driver_intr_t opti931_intr
static

Definition at line 130 of file mss.c.

Referenced by mss_doattach().

◆ pnpmss_driver

driver_t pnpmss_driver
static
Initial value:
= {
"pcm",
}
static device_method_t pnpmss_methods[]
Definition: mss.c:2186

Definition at line 2196 of file mss.c.

◆ pnpmss_ids

struct isa_pnp_id pnpmss_ids[]
static
Initial value:
= {
{0x0000630e, "CS423x"},
{0x0001630e, "CS423x-PCI"},
{0x01000000, "CMI8330"},
{0x2100a865, "Yamaha OPL-SAx"},
{0x1110d315, "ENSONIQ SoundscapeVIVO"},
{0x1093143e, "OPTi931"},
{0x5092143e, "OPTi925"},
{0x0000143e, "OPTi924"},
{0x1022b839, "Neomagic 256AV (non-ac97)"},
{0x01005407, "Aztech 2320"},
{0},
}

Definition at line 1929 of file mss.c.

Referenced by pnpmss_probe().

◆ pnpmss_methods

device_method_t pnpmss_methods[]
static
Initial value:
= {
DEVMETHOD(device_probe, pnpmss_probe),
DEVMETHOD(device_attach, pnpmss_attach),
DEVMETHOD(device_detach, mss_detach),
DEVMETHOD(device_suspend, mss_suspend),
DEVMETHOD(device_resume, mss_resume),
{ 0, 0 }
}
static int pnpmss_probe(device_t dev)
Definition: mss.c:1947
static int pnpmss_attach(device_t dev)
Definition: mss.c:1959

Definition at line 2186 of file mss.c.

◆ ymmix_mixer_methods

kobj_method_t ymmix_mixer_methods[]
static
Initial value:
= {
KOBJMETHOD(mixer_init, ymmix_init),
KOBJMETHOD(mixer_set, ymmix_set),
}
static u_int32_t ymmix_setrecsrc(struct snd_mixer *m, u_int32_t src)
Definition: mss.c:610
static int ymmix_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
Definition: mss.c:564
static int ymmix_init(struct snd_mixer *m)
Definition: mss.c:547

Definition at line 619 of file mss.c.