FreeBSD kernel sound device code
sb.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SBDSP_RST   0x6
 
#define DSP_READ   0xA
 
#define DSP_WRITE   0xC
 
#define SBDSP_CMD   0xC
 
#define SBDSP_STATUS   0xC
 
#define DSP_DATA_AVAIL   0xE
 
#define DSP_DATA_AVL16   0xF
 
#define SB_MIX_ADDR   0x4
 
#define SB_MIX_DATA   0x5
 
#define DSP_DAC8   0x10 /* direct DAC output */
 
#define DSP_ADC8   0x20 /* direct ADC input */
 
#define DSP_CMD_DAC8   0x14 /* single cycle 8-bit dma out */
 
#define DSP_CMD_ADC8   0x24 /* single cycle 8-bit dma in */
 
#define DSP_CMD_DAC8_AUTO   0x1c /* auto 8-bit dma out */
 
#define DSP_CMD_ADC8_AUTO   0x2c /* auto 8-bit dma out */
 
#define DSP_CMD_HSSIZE   0x48 /* high speed dma count */
 
#define DSP_CMD_HSDAC_AUTO   0x90 /* high speed dac, auto */
 
#define DSP_CMD_HSADC_AUTO   0x98 /* high speed adc, auto */
 
#define DSP_CMD_DMAMODE(stereo, bit16)   (0xA0 | (stereo ? 8:0) | (bit16 ? 4:0))
 
#define DSP_CMD_DAC2   0x16 /* 2-bit adpcm dma out (cont) */
 
#define DSP_CMD_DAC2S   0x17 /* 2-bit adpcm dma out (start) */
 
#define DSP_CMD_DAC2S_AUTO   0x1f /* auto 2-bit adpcm dma out (start) */
 
#define DSP_CMD_O16   0xb0
 
#define DSP_CMD_I16   0xb8
 
#define DSP_CMD_O8   0xc0
 
#define DSP_CMD_I8   0xc8
 
#define DSP_MODE_U8MONO   0x00
 
#define DSP_MODE_U8STEREO   0x20
 
#define DSP_MODE_S16MONO   0x10
 
#define DSP_MODE_S16STEREO   0x30
 
#define DSP_CMD_SPKON   0xD1
 
#define DSP_CMD_SPKOFF   0xD3
 
#define DSP_CMD_SPKR(on)   (0xD1 | (on ? 0:2))
 
#define DSP_CMD_DMAPAUSE_8   0xD0
 
#define DSP_CMD_DMAPAUSE_16   0xD5
 
#define DSP_CMD_DMAEXIT_8   0xDA
 
#define DSP_CMD_DMAEXIT_16   0xD9
 
#define DSP_CMD_TCONST   0x40 /* set time constant */
 
#define DSP_CMD_HSDAC   0x91 /* high speed dac */
 
#define DSP_CMD_HSADC   0x99 /* high speed adc */
 
#define DSP_CMD_GETVER   0xE1
 
#define DSP_CMD_GETID   0xE7 /* return id bytes */
 
#define DSP_CMD_OUT16   0x41 /* send parms for dma out on sb16 */
 
#define DSP_CMD_IN16   0x42 /* send parms for dma in on sb16 */
 
#define DSP_DMA16   0xb0
 
#define DSP_DMA8   0xc0
 
#define DSP_F16_DAC   0x00
 
#define DSP_F16_ADC   0x08
 
#define DSP_F16_AUTO   0x04
 
#define DSP_F16_FIFO_ON   0x02
 
#define DSP_F16_STEREO   0x20
 
#define DSP_F16_SIGNED   0x10
 
#define IMODE_NONE   0
 
#define IMODE_OUTPUT   PCM_ENABLE_OUTPUT
 
#define IMODE_INPUT   PCM_ENABLE_INPUT
 
#define IMODE_INIT   3
 
#define IMODE_MIDI   4
 
#define NORMAL_MIDI   0
 
#define UART_MIDI   1
 
#define BD_F_HISPEED   0x0001 /* doing high speed ... */
 
#define BD_F_DUP_MIDI   0x0008 /* duplex midi */
 
#define BD_F_MIX_MASK   0x0070 /* up to 8 mixers (I know of 3) */
 
#define BD_F_MIX_CT1335   0x0010 /* CT1335 */
 
#define BD_F_MIX_CT1345   0x0020 /* CT1345 */
 
#define BD_F_MIX_CT1745   0x0030 /* CT1745 */
 
#define BD_F_SB16   0x0100 /* this is a SB16 */
 
#define BD_F_SB16X   0x0200 /* this is a vibra16X or clone */
 
#define BD_F_ESS   0x0800 /* this is an ESS chip */
 
#define BD_F_DMARUN   0x2000
 
#define BD_F_DMARUN2   0x4000
 
#define VOC_VOL   0x04
 
#define MIC_VOL   0x0A
 
#define MIC_MIX   0x0A
 
#define RECORD_SRC   0x0C
 
#define IN_FILTER   0x0C
 
#define OUT_FILTER   0x0E
 
#define MASTER_VOL   0x22
 
#define FM_VOL   0x26
 
#define CD_VOL   0x28
 
#define LINE_VOL   0x2E
 
#define IRQ_NR   0x80
 
#define DMA_NR   0x81
 
#define IRQ_STAT   0x82
 
#define COVOX_VOL   0x42
 
#define TREBLE_LVL   0x44
 
#define BASS_LVL   0x46
 
#define FREQ_HI   (1 << 3)/* Use High-frequency ANFI filters */
 
#define FREQ_LOW   0 /* Use Low-frequency ANFI filters */
 
#define FILT_ON   0 /* Yes, 0 to turn it on, 1 for off */
 
#define FILT_OFF   (1 << 5)
 
#define MONO_DAC   0x00
 
#define STEREO_DAC   0x02
 
#define SB16_IMASK_L   0x3d
 
#define SB16_IMASK_R   0x3e
 
#define SB16_OMASK   0x3c
 

Functions

void sbc_lock (struct sbc_softc *)
 
void sbc_lockassert (struct sbc_softc *)
 
void sbc_unlock (struct sbc_softc *)
 

Macro Definition Documentation

◆ BASS_LVL

#define BASS_LVL   0x46

Definition at line 200 of file sb.h.

◆ BD_F_DMARUN

#define BD_F_DMARUN   0x2000

Definition at line 175 of file sb.h.

◆ BD_F_DMARUN2

#define BD_F_DMARUN2   0x4000

Definition at line 176 of file sb.h.

◆ BD_F_DUP_MIDI

#define BD_F_DUP_MIDI   0x0008 /* duplex midi */

Definition at line 162 of file sb.h.

◆ BD_F_ESS

#define BD_F_ESS   0x0800 /* this is an ESS chip */

Definition at line 174 of file sb.h.

◆ BD_F_HISPEED

#define BD_F_HISPEED   0x0001 /* doing high speed ... */

Definition at line 155 of file sb.h.

◆ BD_F_MIX_CT1335

#define BD_F_MIX_CT1335   0x0010 /* CT1335 */

Definition at line 165 of file sb.h.

◆ BD_F_MIX_CT1345

#define BD_F_MIX_CT1345   0x0020 /* CT1345 */

Definition at line 166 of file sb.h.

◆ BD_F_MIX_CT1745

#define BD_F_MIX_CT1745   0x0030 /* CT1745 */

Definition at line 167 of file sb.h.

◆ BD_F_MIX_MASK

#define BD_F_MIX_MASK   0x0070 /* up to 8 mixers (I know of 3) */

Definition at line 164 of file sb.h.

◆ BD_F_SB16

#define BD_F_SB16   0x0100 /* this is a SB16 */

Definition at line 169 of file sb.h.

◆ BD_F_SB16X

#define BD_F_SB16X   0x0200 /* this is a vibra16X or clone */

Definition at line 170 of file sb.h.

◆ CD_VOL

#define CD_VOL   0x28

Definition at line 189 of file sb.h.

◆ COVOX_VOL

#define COVOX_VOL   0x42

Definition at line 198 of file sb.h.

◆ DMA_NR

#define DMA_NR   0x81

Definition at line 192 of file sb.h.

◆ DSP_ADC8

#define DSP_ADC8   0x20 /* direct ADC input */

Definition at line 65 of file sb.h.

◆ DSP_CMD_ADC8

#define DSP_CMD_ADC8   0x24 /* single cycle 8-bit dma in */

Definition at line 69 of file sb.h.

◆ DSP_CMD_ADC8_AUTO

#define DSP_CMD_ADC8_AUTO   0x2c /* auto 8-bit dma out */

Definition at line 73 of file sb.h.

◆ DSP_CMD_DAC2

#define DSP_CMD_DAC2   0x16 /* 2-bit adpcm dma out (cont) */

Definition at line 84 of file sb.h.

◆ DSP_CMD_DAC2S

#define DSP_CMD_DAC2S   0x17 /* 2-bit adpcm dma out (start) */

Definition at line 85 of file sb.h.

◆ DSP_CMD_DAC2S_AUTO

#define DSP_CMD_DAC2S_AUTO   0x1f /* auto 2-bit adpcm dma out (start) */

Definition at line 87 of file sb.h.

◆ DSP_CMD_DAC8

#define DSP_CMD_DAC8   0x14 /* single cycle 8-bit dma out */

Definition at line 68 of file sb.h.

◆ DSP_CMD_DAC8_AUTO

#define DSP_CMD_DAC8_AUTO   0x1c /* auto 8-bit dma out */

Definition at line 72 of file sb.h.

◆ DSP_CMD_DMAEXIT_16

#define DSP_CMD_DMAEXIT_16   0xD9

Definition at line 107 of file sb.h.

◆ DSP_CMD_DMAEXIT_8

#define DSP_CMD_DMAEXIT_8   0xDA

Definition at line 106 of file sb.h.

◆ DSP_CMD_DMAMODE

#define DSP_CMD_DMAMODE (   stereo,
  bit16 
)    (0xA0 | (stereo ? 8:0) | (bit16 ? 4:0))

Definition at line 82 of file sb.h.

◆ DSP_CMD_DMAPAUSE_16

#define DSP_CMD_DMAPAUSE_16   0xD5

Definition at line 105 of file sb.h.

◆ DSP_CMD_DMAPAUSE_8

#define DSP_CMD_DMAPAUSE_8   0xD0

Definition at line 104 of file sb.h.

◆ DSP_CMD_GETID

#define DSP_CMD_GETID   0xE7 /* return id bytes */

Definition at line 113 of file sb.h.

◆ DSP_CMD_GETVER

#define DSP_CMD_GETVER   0xE1

Definition at line 112 of file sb.h.

◆ DSP_CMD_HSADC

#define DSP_CMD_HSADC   0x99 /* high speed adc */

Definition at line 110 of file sb.h.

◆ DSP_CMD_HSADC_AUTO

#define DSP_CMD_HSADC_AUTO   0x98 /* high speed adc, auto */

Definition at line 77 of file sb.h.

◆ DSP_CMD_HSDAC

#define DSP_CMD_HSDAC   0x91 /* high speed dac */

Definition at line 109 of file sb.h.

◆ DSP_CMD_HSDAC_AUTO

#define DSP_CMD_HSDAC_AUTO   0x90 /* high speed dac, auto */

Definition at line 76 of file sb.h.

◆ DSP_CMD_HSSIZE

#define DSP_CMD_HSSIZE   0x48 /* high speed dma count */

Definition at line 75 of file sb.h.

◆ DSP_CMD_I16

#define DSP_CMD_I16   0xb8

Definition at line 91 of file sb.h.

◆ DSP_CMD_I8

#define DSP_CMD_I8   0xc8

Definition at line 93 of file sb.h.

◆ DSP_CMD_IN16

#define DSP_CMD_IN16   0x42 /* send parms for dma in on sb16 */

Definition at line 116 of file sb.h.

◆ DSP_CMD_O16

#define DSP_CMD_O16   0xb0

Definition at line 90 of file sb.h.

◆ DSP_CMD_O8

#define DSP_CMD_O8   0xc0

Definition at line 92 of file sb.h.

◆ DSP_CMD_OUT16

#define DSP_CMD_OUT16   0x41 /* send parms for dma out on sb16 */

Definition at line 115 of file sb.h.

◆ DSP_CMD_SPKOFF

#define DSP_CMD_SPKOFF   0xD3

Definition at line 101 of file sb.h.

◆ DSP_CMD_SPKON

#define DSP_CMD_SPKON   0xD1

Definition at line 100 of file sb.h.

◆ DSP_CMD_SPKR

#define DSP_CMD_SPKR (   on)    (0xD1 | (on ? 0:2))

Definition at line 102 of file sb.h.

◆ DSP_CMD_TCONST

#define DSP_CMD_TCONST   0x40 /* set time constant */

Definition at line 108 of file sb.h.

◆ DSP_DAC8

#define DSP_DAC8   0x10 /* direct DAC output */

Definition at line 64 of file sb.h.

◆ DSP_DATA_AVAIL

#define DSP_DATA_AVAIL   0xE

Definition at line 48 of file sb.h.

◆ DSP_DATA_AVL16

#define DSP_DATA_AVL16   0xF

Definition at line 49 of file sb.h.

◆ DSP_DMA16

#define DSP_DMA16   0xb0

Definition at line 130 of file sb.h.

◆ DSP_DMA8

#define DSP_DMA8   0xc0

Definition at line 131 of file sb.h.

◆ DSP_F16_ADC

#define DSP_F16_ADC   0x08

Definition at line 133 of file sb.h.

◆ DSP_F16_AUTO

#define DSP_F16_AUTO   0x04

Definition at line 134 of file sb.h.

◆ DSP_F16_DAC

#define DSP_F16_DAC   0x00

Definition at line 132 of file sb.h.

◆ DSP_F16_FIFO_ON

#define DSP_F16_FIFO_ON   0x02

Definition at line 135 of file sb.h.

◆ DSP_F16_SIGNED

#define DSP_F16_SIGNED   0x10

Definition at line 141 of file sb.h.

◆ DSP_F16_STEREO

#define DSP_F16_STEREO   0x20

Definition at line 140 of file sb.h.

◆ DSP_MODE_S16MONO

#define DSP_MODE_S16MONO   0x10

Definition at line 97 of file sb.h.

◆ DSP_MODE_S16STEREO

#define DSP_MODE_S16STEREO   0x30

Definition at line 98 of file sb.h.

◆ DSP_MODE_U8MONO

#define DSP_MODE_U8MONO   0x00

Definition at line 95 of file sb.h.

◆ DSP_MODE_U8STEREO

#define DSP_MODE_U8STEREO   0x20

Definition at line 96 of file sb.h.

◆ DSP_READ

#define DSP_READ   0xA

Definition at line 44 of file sb.h.

◆ DSP_WRITE

#define DSP_WRITE   0xC

Definition at line 45 of file sb.h.

◆ FILT_OFF

#define FILT_OFF   (1 << 5)

Definition at line 205 of file sb.h.

◆ FILT_ON

#define FILT_ON   0 /* Yes, 0 to turn it on, 1 for off */

Definition at line 204 of file sb.h.

◆ FM_VOL

#define FM_VOL   0x26

Definition at line 188 of file sb.h.

◆ FREQ_HI

#define FREQ_HI   (1 << 3)/* Use High-frequency ANFI filters */

Definition at line 202 of file sb.h.

◆ FREQ_LOW

#define FREQ_LOW   0 /* Use Low-frequency ANFI filters */

Definition at line 203 of file sb.h.

◆ IMODE_INIT

#define IMODE_INIT   3

Definition at line 146 of file sb.h.

◆ IMODE_INPUT

#define IMODE_INPUT   PCM_ENABLE_INPUT

Definition at line 145 of file sb.h.

◆ IMODE_MIDI

#define IMODE_MIDI   4

Definition at line 147 of file sb.h.

◆ IMODE_NONE

#define IMODE_NONE   0

Definition at line 143 of file sb.h.

◆ IMODE_OUTPUT

#define IMODE_OUTPUT   PCM_ENABLE_OUTPUT

Definition at line 144 of file sb.h.

◆ IN_FILTER

#define IN_FILTER   0x0C

Definition at line 185 of file sb.h.

◆ IRQ_NR

#define IRQ_NR   0x80

Definition at line 191 of file sb.h.

◆ IRQ_STAT

#define IRQ_STAT   0x82

Definition at line 193 of file sb.h.

◆ LINE_VOL

#define LINE_VOL   0x2E

Definition at line 190 of file sb.h.

◆ MASTER_VOL

#define MASTER_VOL   0x22

Definition at line 187 of file sb.h.

◆ MIC_MIX

#define MIC_MIX   0x0A

Definition at line 183 of file sb.h.

◆ MIC_VOL

#define MIC_VOL   0x0A

Definition at line 182 of file sb.h.

◆ MONO_DAC

#define MONO_DAC   0x00

Definition at line 207 of file sb.h.

◆ NORMAL_MIDI

#define NORMAL_MIDI   0

Definition at line 149 of file sb.h.

◆ OUT_FILTER

#define OUT_FILTER   0x0E

Definition at line 186 of file sb.h.

◆ RECORD_SRC

#define RECORD_SRC   0x0C

Definition at line 184 of file sb.h.

◆ SB16_IMASK_L

#define SB16_IMASK_L   0x3d

Definition at line 213 of file sb.h.

◆ SB16_IMASK_R

#define SB16_IMASK_R   0x3e

Definition at line 214 of file sb.h.

◆ SB16_OMASK

#define SB16_OMASK   0x3c

Definition at line 215 of file sb.h.

◆ SB_MIX_ADDR

#define SB_MIX_ADDR   0x4

Definition at line 51 of file sb.h.

◆ SB_MIX_DATA

#define SB_MIX_DATA   0x5

Definition at line 52 of file sb.h.

◆ SBDSP_CMD

#define SBDSP_CMD   0xC

Definition at line 46 of file sb.h.

◆ SBDSP_RST

#define SBDSP_RST   0x6

Definition at line 43 of file sb.h.

◆ SBDSP_STATUS

#define SBDSP_STATUS   0xC

Definition at line 47 of file sb.h.

◆ STEREO_DAC

#define STEREO_DAC   0x02

Definition at line 208 of file sb.h.

◆ TREBLE_LVL

#define TREBLE_LVL   0x44

Definition at line 199 of file sb.h.

◆ UART_MIDI

#define UART_MIDI   1

Definition at line 150 of file sb.h.

◆ VOC_VOL

#define VOC_VOL   0x04

Definition at line 181 of file sb.h.

Function Documentation

◆ sbc_lock()

void sbc_lock ( struct sbc_softc scp)

Definition at line 124 of file sbc.c.

References sbc_softc::lock, and snd_mtxlock.

Referenced by ess_lock(), sb_lock(), sbc_detach(), sbc_setup_intr(), and sbc_teardown_intr().

Here is the caller graph for this function:

◆ sbc_lockassert()

void sbc_lockassert ( struct sbc_softc scp)

Definition at line 130 of file sbc.c.

References sbc_softc::lock, and snd_mtxassert().

Referenced by sb_lockassert().

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

◆ sbc_unlock()

void sbc_unlock ( struct sbc_softc scp)

Definition at line 136 of file sbc.c.

References sbc_softc::lock, and snd_mtxunlock.

Referenced by ess_unlock(), sb_unlock(), sbc_setup_intr(), and sbc_teardown_intr().

Here is the caller graph for this function: