FreeBSD kernel sound device code
ac97.h File Reference
#include "ac97_if.h"
Include dependency graph for ac97.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define AC97_MUTE   0x8080
 
#define AC97_REG_RESET   0x00
 
#define AC97_CAP_MICCHANNEL   (1 << 0)
 
#define AC97_CAP_TONE   (1 << 2)
 
#define AC97_CAP_SIMSTEREO   (1 << 3)
 
#define AC97_CAP_HEADPHONE   (1 << 4)
 
#define AC97_CAP_LOUDNESS   (1 << 5)
 
#define AC97_CAP_DAC_18   (1 << 6)
 
#define AC97_CAP_DAC_20   (1 << 7)
 
#define AC97_CAP_ADC_18   (1 << 8)
 
#define AC97_CAP_ADC_20   (1 << 9)
 
#define AC97_MIX_MASTER   0x02
 
#define AC97_MIX_AUXOUT   0x04
 
#define AC97_MIX_MONO   0x06
 
#define AC97_MIX_TONE   0x08
 
#define AC97_MIX_BEEP   0x0a
 
#define AC97_MIX_PHONE   0x0c
 
#define AC97_MIX_MIC   0x0e
 
#define AC97_MIX_LINE   0x10
 
#define AC97_MIX_CD   0x12
 
#define AC97_MIX_VIDEO   0x14
 
#define AC97_MIX_AUX   0x16
 
#define AC97_MIX_PCM   0x18
 
#define AC97_REG_RECSEL   0x1a
 
#define AC97_MIX_RGAIN   0x1c
 
#define AC97_MIX_MGAIN   0x1e
 
#define AC97_REG_GEN   0x20
 
#define AC97_REG_3D   0x22
 
#define AC97_REG_POWER   0x26
 
#define AC97_POWER_ADC   (1 << 0)
 
#define AC97_POWER_DAC   (1 << 1)
 
#define AC97_POWER_ANL   (1 << 2)
 
#define AC97_POWER_REF   (1 << 3)
 
#define AC97_POWER_STATUS
 
#define AC97_REGEXT_ID   0x28
 
#define AC97_EXTCAP_VRA   (1 << 0)
 
#define AC97_EXTCAP_DRA   (1 << 1)
 
#define AC97_EXTCAP_VRM   (1 << 3)
 
#define AC97_EXTCAPS   (AC97_EXTCAP_VRA | AC97_EXTCAP_DRA | AC97_EXTCAP_VRM)
 
#define AC97_EXTCAP_SDAC   (1 << 7)
 
#define AC97_REGEXT_STAT   0x2a
 
#define AC97_REGEXT_FDACRATE   0x2c
 
#define AC97_REGEXT_SDACRATE   0x2e
 
#define AC97_REGEXT_LDACRATE   0x30
 
#define AC97_REGEXT_LADCRATE   0x32
 
#define AC97_REGEXT_MADCRATE   0x34
 
#define AC97_MIXEXT_CLFE   0x36
 
#define AC97_MIXEXT_SURROUND   0x38
 
#define AC97_REG_ID1   0x7c
 
#define AC97_REG_ID2   0x7e
 
#define AC97_F_EAPD_INV   0x00000001
 
#define AC97_F_RDCD_BUG   0x00000002
 
#define AC97_DECLARE(name)   static DEFINE_CLASS(name, name ## _methods, sizeof(struct kobj))
 
#define AC97_CREATE(dev, devinfo, cls)   ac97_create(dev, devinfo, &cls ## _class)
 

Functions

kobj_class_t ac97_getmixerclass (void)
 
struct ac97_infoac97_create (device_t dev, void *devinfo, kobj_class_t cls)
 
void ac97_destroy (struct ac97_info *codec)
 
void ac97_setflags (struct ac97_info *codec, u_int32_t val)
 
u_int32_t ac97_getflags (struct ac97_info *codec)
 
int ac97_setrate (struct ac97_info *codec, int which, int rate)
 
int ac97_setextmode (struct ac97_info *codec, u_int16_t mode)
 
u_int16_t ac97_getextmode (struct ac97_info *codec)
 
u_int16_t ac97_getextcaps (struct ac97_info *codec)
 
u_int16_t ac97_getcaps (struct ac97_info *codec)
 
u_int32_t ac97_getsubvendor (struct ac97_info *codec)
 
u_int16_t ac97_rdcd (struct ac97_info *codec, int reg)
 
void ac97_wrcd (struct ac97_info *codec, int reg, u_int16_t val)
 

Macro Definition Documentation

◆ AC97_CAP_ADC_18

#define AC97_CAP_ADC_18   (1 << 8)

Definition at line 41 of file ac97.h.

◆ AC97_CAP_ADC_20

#define AC97_CAP_ADC_20   (1 << 9)

Definition at line 42 of file ac97.h.

◆ AC97_CAP_DAC_18

#define AC97_CAP_DAC_18   (1 << 6)

Definition at line 39 of file ac97.h.

◆ AC97_CAP_DAC_20

#define AC97_CAP_DAC_20   (1 << 7)

Definition at line 40 of file ac97.h.

◆ AC97_CAP_HEADPHONE

#define AC97_CAP_HEADPHONE   (1 << 4)

Definition at line 37 of file ac97.h.

◆ AC97_CAP_LOUDNESS

#define AC97_CAP_LOUDNESS   (1 << 5)

Definition at line 38 of file ac97.h.

◆ AC97_CAP_MICCHANNEL

#define AC97_CAP_MICCHANNEL   (1 << 0)

Definition at line 34 of file ac97.h.

◆ AC97_CAP_SIMSTEREO

#define AC97_CAP_SIMSTEREO   (1 << 3)

Definition at line 36 of file ac97.h.

◆ AC97_CAP_TONE

#define AC97_CAP_TONE   (1 << 2)

Definition at line 35 of file ac97.h.

◆ AC97_CREATE

#define AC97_CREATE (   dev,
  devinfo,
  cls 
)    ac97_create(dev, devinfo, &cls ## _class)

Definition at line 89 of file ac97.h.

◆ AC97_DECLARE

#define AC97_DECLARE (   name)    static DEFINE_CLASS(name, name ## _methods, sizeof(struct kobj))

Definition at line 88 of file ac97.h.

◆ AC97_EXTCAP_DRA

#define AC97_EXTCAP_DRA   (1 << 1)

Definition at line 69 of file ac97.h.

◆ AC97_EXTCAP_SDAC

#define AC97_EXTCAP_SDAC   (1 << 7)

Definition at line 72 of file ac97.h.

◆ AC97_EXTCAP_VRA

#define AC97_EXTCAP_VRA   (1 << 0)

Definition at line 68 of file ac97.h.

◆ AC97_EXTCAP_VRM

#define AC97_EXTCAP_VRM   (1 << 3)

Definition at line 70 of file ac97.h.

◆ AC97_EXTCAPS

#define AC97_EXTCAPS   (AC97_EXTCAP_VRA | AC97_EXTCAP_DRA | AC97_EXTCAP_VRM)

Definition at line 71 of file ac97.h.

◆ AC97_F_EAPD_INV

#define AC97_F_EAPD_INV   0x00000001

Definition at line 85 of file ac97.h.

◆ AC97_F_RDCD_BUG

#define AC97_F_RDCD_BUG   0x00000002

Definition at line 86 of file ac97.h.

◆ AC97_MIX_AUX

#define AC97_MIX_AUX   0x16

Definition at line 53 of file ac97.h.

◆ AC97_MIX_AUXOUT

#define AC97_MIX_AUXOUT   0x04

Definition at line 44 of file ac97.h.

◆ AC97_MIX_BEEP

#define AC97_MIX_BEEP   0x0a

Definition at line 47 of file ac97.h.

◆ AC97_MIX_CD

#define AC97_MIX_CD   0x12

Definition at line 51 of file ac97.h.

◆ AC97_MIX_LINE

#define AC97_MIX_LINE   0x10

Definition at line 50 of file ac97.h.

◆ AC97_MIX_MASTER

#define AC97_MIX_MASTER   0x02

Definition at line 43 of file ac97.h.

◆ AC97_MIX_MGAIN

#define AC97_MIX_MGAIN   0x1e

Definition at line 57 of file ac97.h.

◆ AC97_MIX_MIC

#define AC97_MIX_MIC   0x0e

Definition at line 49 of file ac97.h.

◆ AC97_MIX_MONO

#define AC97_MIX_MONO   0x06

Definition at line 45 of file ac97.h.

◆ AC97_MIX_PCM

#define AC97_MIX_PCM   0x18

Definition at line 54 of file ac97.h.

◆ AC97_MIX_PHONE

#define AC97_MIX_PHONE   0x0c

Definition at line 48 of file ac97.h.

◆ AC97_MIX_RGAIN

#define AC97_MIX_RGAIN   0x1c

Definition at line 56 of file ac97.h.

◆ AC97_MIX_TONE

#define AC97_MIX_TONE   0x08

Definition at line 46 of file ac97.h.

◆ AC97_MIX_VIDEO

#define AC97_MIX_VIDEO   0x14

Definition at line 52 of file ac97.h.

◆ AC97_MIXEXT_CLFE

#define AC97_MIXEXT_CLFE   0x36

Definition at line 80 of file ac97.h.

◆ AC97_MIXEXT_SURROUND

#define AC97_MIXEXT_SURROUND   0x38

Definition at line 81 of file ac97.h.

◆ AC97_MUTE

#define AC97_MUTE   0x8080

Definition at line 31 of file ac97.h.

◆ AC97_POWER_ADC

#define AC97_POWER_ADC   (1 << 0)

Definition at line 61 of file ac97.h.

◆ AC97_POWER_ANL

#define AC97_POWER_ANL   (1 << 2)

Definition at line 63 of file ac97.h.

◆ AC97_POWER_DAC

#define AC97_POWER_DAC   (1 << 1)

Definition at line 62 of file ac97.h.

◆ AC97_POWER_REF

#define AC97_POWER_REF   (1 << 3)

Definition at line 64 of file ac97.h.

◆ AC97_POWER_STATUS

#define AC97_POWER_STATUS
Value:
AC97_POWER_REF | AC97_POWER_ANL )
#define AC97_POWER_ANL
Definition: ac97.h:63
#define AC97_POWER_DAC
Definition: ac97.h:62
#define AC97_POWER_ADC
Definition: ac97.h:61

Definition at line 65 of file ac97.h.

◆ AC97_REG_3D

#define AC97_REG_3D   0x22

Definition at line 59 of file ac97.h.

◆ AC97_REG_GEN

#define AC97_REG_GEN   0x20

Definition at line 58 of file ac97.h.

◆ AC97_REG_ID1

#define AC97_REG_ID1   0x7c

Definition at line 82 of file ac97.h.

◆ AC97_REG_ID2

#define AC97_REG_ID2   0x7e

Definition at line 83 of file ac97.h.

◆ AC97_REG_POWER

#define AC97_REG_POWER   0x26

Definition at line 60 of file ac97.h.

◆ AC97_REG_RECSEL

#define AC97_REG_RECSEL   0x1a

Definition at line 55 of file ac97.h.

◆ AC97_REG_RESET

#define AC97_REG_RESET   0x00

Definition at line 33 of file ac97.h.

◆ AC97_REGEXT_FDACRATE

#define AC97_REGEXT_FDACRATE   0x2c

Definition at line 75 of file ac97.h.

◆ AC97_REGEXT_ID

#define AC97_REGEXT_ID   0x28

Definition at line 67 of file ac97.h.

◆ AC97_REGEXT_LADCRATE

#define AC97_REGEXT_LADCRATE   0x32

Definition at line 78 of file ac97.h.

◆ AC97_REGEXT_LDACRATE

#define AC97_REGEXT_LDACRATE   0x30

Definition at line 77 of file ac97.h.

◆ AC97_REGEXT_MADCRATE

#define AC97_REGEXT_MADCRATE   0x34

Definition at line 79 of file ac97.h.

◆ AC97_REGEXT_SDACRATE

#define AC97_REGEXT_SDACRATE   0x2e

Definition at line 76 of file ac97.h.

◆ AC97_REGEXT_STAT

#define AC97_REGEXT_STAT   0x2a

Definition at line 74 of file ac97.h.

Function Documentation

◆ ac97_create()

struct ac97_info * ac97_create ( device_t  dev,
void *  devinfo,
kobj_class_t  cls 
)

◆ ac97_destroy()

void ac97_destroy ( struct ac97_info codec)

◆ ac97_getcaps()

u_int16_t ac97_getcaps ( struct ac97_info codec)

Definition at line 411 of file ac97.c.

References ac97_info::caps.

Referenced by emu_pci_attach(), and ich_pci_attach().

Here is the caller graph for this function:

◆ ac97_getextcaps()

u_int16_t ac97_getextcaps ( struct ac97_info codec)

Definition at line 405 of file ac97.c.

References ac97_info::extcaps.

Referenced by ich_pci_attach(), and via_attach().

Here is the caller graph for this function:

◆ ac97_getextmode()

u_int16_t ac97_getextmode ( struct ac97_info codec)

Definition at line 399 of file ac97.c.

References ac97_info::extstat.

Referenced by via_attach().

Here is the caller graph for this function:

◆ ac97_getflags()

u_int32_t ac97_getflags ( struct ac97_info codec)

Definition at line 876 of file ac97.c.

References ac97_info::flags.

Referenced by atiixp_chip_post_init(), and ich_pci_attach().

Here is the caller graph for this function:

◆ ac97_getmixerclass()

kobj_class_t ac97_getmixerclass ( void  )

◆ ac97_getsubvendor()

u_int32_t ac97_getsubvendor ( struct ac97_info codec)

Definition at line 417 of file ac97.c.

References ac97_info::subvendor.

Referenced by ad1981b_patch(), ad198x_patch(), alc655_patch(), and cmi9739_patch().

Here is the caller graph for this function:

◆ ac97_rdcd()

u_int16_t ac97_rdcd ( struct ac97_info codec,
int  reg 
)

◆ ac97_setextmode()

int ac97_setextmode ( struct ac97_info codec,
u_int16_t  mode 
)

Definition at line 383 of file ac97.c.

References AC97_EXTCAPS, ac97_rdcd(), AC97_REGEXT_STAT, ac97_wrcd(), ac97_info::dev, ac97_info::extcaps, ac97_info::extstat, ac97_info::lock, snd_mtxlock, and snd_mtxunlock.

Referenced by ich_pci_attach(), ich_pci_resume(), and via_attach().

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

◆ ac97_setflags()

void ac97_setflags ( struct ac97_info codec,
u_int32_t  val 
)

Definition at line 870 of file ac97.c.

References ac97_info::flags, and val.

Referenced by atiixp_chip_post_init(), ich_pci_attach(), and pcmcsa_attach().

Here is the caller graph for this function:

◆ ac97_setrate()

int ac97_setrate ( struct ac97_info codec,
int  which,
int  rate 
)

◆ ac97_wrcd()

void ac97_wrcd ( struct ac97_info codec,
int  reg,
u_int16_t  val 
)