24 #define AC97_BUFFER_COUNT 32 27 #define ARG_MUTE ac97_argument_list[0].value.uint64 28 #define ARG_VOLUME ac97_argument_list[1].value.dbl 29 #define ARG_SAMPLE_RATE ac97_argument_list[2].value.uint64 30 extern cmdline_argument_t ac97_argument_list[]; 34 #define AC97_MIXER_RESET 0x00 35 #define AC97_MIXER_MASTER 0x02 36 #define AC97_MIXER_PCM_OUT 0x18 37 #define AC97_PCM_RATE_FRONT 0x2C 38 #define AC97_PCM_RATE_SURROUND 0x2E 39 #define AC97_PCM_RATE_LFE 0x30 42 //XXX when adding bus master registers, remember to add non-byte widths to getter function 43 #define AC97_DESCRIPTOR_PCM_OUT 0x10 44 #define AC97_CIV_PCM_OUT 0x14 45 #define AC97_LVI_PCM_OUT 0x15 46 #define AC97_STATUS_PCM_OUT 0x16 47 #define AC97_CONTROL_PCM_OUT 0x1B 48 #define AC97_GLOBAL_CONTROL 0x2C 117 } extended_audio_statctrl;
123 UINT16 _unhandled3[5];
124 UINT16 _unhandled4[8];
125 UINT16 _unhandled5[8];
126 UINT16 _unhandled6[8];
127 UINT16 _unhandled7[6];
200 #define ac97_mixer_value(LEFT,RIGHT,MUTE) ((((LEFT)&0x3F)<<8)|((RIGHT)&0x3F)|((MUTE)?0x8000:0)) 217 #define AC97_DUMP_VOLUME 0x00000001 218 #define AC97_DUMP_OTHER 0x80000000 219 #define AC97_DUMP_ALL -1 220 void dump_audio_registers(ac97_handle_t *handle, UINTN flags); ac97_buffers_s16_t * buffers
ring buffer for audio output
Definition: ac97.h:163
UINT16 pcm_lr_adc_rate
offset 0x32
Definition: ac97.h:121
EFI_STATUS set_ac97_cmdline_volume(ac97_handle_t *handle)
Takes the "volume" and "mute" command-line arguments and configures the AC'97 PCM OUT channel with th...
Definition: ac97.c:188
UINT16 amap
slot/DAC mappings support
Definition: ac97.h:90
UINT16 ldac
PCM LFE DAC support.
Definition: ac97.h:89
UINT16 record_select
offset 0x1A
Definition: ac97.h:70
UINT16 master_vol
offset 0x02
Definition: ac97.h:58
UINT16 prl
MIC ADC suppressed.
Definition: ac97.h:114
cmdline_argument_group_t ac97_arguments
command-line argument group for AC'97
Definition: ac97.c:67
UINT16 vendor_id1
offset 0x7C
Definition: ac97.h:128
UINT16 spcv
S/PDIF configuration valid.
Definition: ac97.h:110
data type for bus master status register
Definition: ac97.h:172
UINT16 dsa
DAC slot assignments.
Definition: ac97.h:86
UINT16 rev
codec revision
Definition: ac97.h:91
UINT16 line_in_vol
offset 0x10
Definition: ac97.h:65
UINT16 aux_out_vol
offset 0x04
Definition: ac97.h:59
UINT16 _reserved24
offset 0x24
Definition: ac97.h:75
UINT16 length
length of buffer, in bytes
Definition: ac97.h:136
UINT16 cd_vol
offset 0x12
Definition: ac97.h:66
EFI_STATUS set_ac97_cmdline_sample_rate(ac97_handle_t *handle)
Takes the "sample rate" command-line argument and sets the AC'97 PCM OUT channel's sample rate to tha...
Definition: ac97.c:228
void * mapping
DMA memory mapping for transferring audio data to AC'97.
Definition: ac97.h:166
UINT16 vendor_id2
offset 0x7E
Definition: ac97.h:129
UINT16 powerdown_ctrlstat
offset 0x26
Definition: ac97.h:76
UINT16 record_gain
offset 0x1C
Definition: ac97.h:71
UINT16 pcm_out_vol
offset 0x18
Definition: ac97.h:69
UINT16 _reserved
(reserved)
Definition: ac97.h:142
UINT16 mic_vol
offset 0x0E
Definition: ac97.h:64
UINT16 last_valid_buffer_completion_interrupt
LVBCI.
Definition: ac97.h:179
void * init_ac97_handle(ac97_handle_t *handle, EFI_PCI_IO_PROTOCOL *pip)
Initializes an AC'97 handle.
Definition: ac97.c:273
EFI_STATUS read_mixer_reg(ac97_handle_t *handle, UINT32 reg, UINT16 *value)
Reads an AC'97 mixer register.
Definition: ac97.c:135
EFI_STATUS ac97_play(ac97_handle_t *handle)
Starts AC'97 playback.
Definition: ac97.c:345
UINT16 dra
double-rate PCM audio support
Definition: ac97.h:83
UINT16 ioc
interrupt on completion
Definition: ac97.h:144
UINT16 _reserved
(reserved)
Definition: ac97.h:182
UINT16 aux_in_vol
offset 0x16
Definition: ac97.h:68
UINT16 general_purpose
offset 0x20
Definition: ac97.h:73
UINT16 pcm_mic_adc_rate
offset 0x34
Definition: ac97.h:122
data type for signed 16-bit integer audio buffers descriptor
Definition: ac97.h:154
EFI_PCI_IO_PROTOCOL * pci
UEFI PCI handle to use.
Definition: ac97.h:167
UINT16 record_gain_mic
offset 0x1E
Definition: ac97.h:72
EFI_PCI_IO_PROTOCOL * find_ac97_device()
Gets a PCI device handle for the AC'97 device.
Definition: ac97.c:75
UINT16 prj
PCM surround DACs suppressed.
Definition: ac97.h:112
EFI_PHYSICAL_ADDRESS device_address
physical memory address to access the AC'97 codec
Definition: ac97.h:165
UINT16 spsa
S/PDIF source.
Definition: ac97.h:105
UINT16 vrm
variable rate MIC input support
Definition: ac97.h:85
UINT16 buffer_completion_interrupt
BCIS.
Definition: ac97.h:180
UINT16 pc_beep_vol
offset 0x0A
Definition: ac97.h:62
UINT32 address
start of buffer
Definition: ac97.h:135
UINT16 vcfg
S/PDIF idle configuration.
Definition: ac97.h:115
Functions for accessing PCI devices.
UINT16 raw
raw access
Definition: ac97.h:79
void print_volume_register_mono(UINT16 *text, UINT16 value)
Prints a mono volume register's contents.
Definition: ac97.c:421
AC'97 handle, this is the high-level handle for library use.
Definition: ac97.h:161
UINT16 pri
PCM center DAC suppressed.
Definition: ac97.h:111
UINT16 raw
raw access to buffer configuration
Definition: ac97.h:139
EFI_STATUS flush_ac97_output(ac97_handle_t *handle)
Flushes all pending AC'97 memory writes.
Definition: ac97.c:333
UINT16 bup
buffer underrun policy
Definition: ac97.h:143
UINT16 spdif
S/PDIF support.
Definition: ac97.h:84
UINT16 master_tone
offset 0x08
Definition: ac97.h:61
UINT16 video_vol
offset 0x14
Definition: ac97.h:67
UINT16 _reserved
(reserved)
Definition: ac97.h:92
UINT16 current_equals_last_valid
CELV.
Definition: ac97.h:178
UINTN buffer_pages
number of memory pages allocated for audio buffers
Definition: ac97.h:164
UINT16 id
codec configuration
Definition: ac97.h:93
void print_volume_register(UINT16 *text, UINT16 value)
Prints a volume register's contents.
Definition: ac97.c:407
EFI_STATUS write_mixer_reg(ac97_handle_t *handle, UINT32 reg, UINT16 value)
Writes to an AC'97 mixer register.
Definition: ac97.c:122
UINT16 vra
variable rate PCM audio support
Definition: ac97.h:82
EFI_STATUS write_busmaster_reg(ac97_handle_t *handle, UINT32 reg, UINTN value)
Writes to an AC'97 bus master register.
Definition: ac97.c:164
UINT16 cdac
PCM center DAC support.
Definition: ac97.h:87
UINT16 three_d_control
offset 0x22
Definition: ac97.h:74
UINT16 sdac
PCM surround DAC support.
Definition: ac97.h:88
UINT16 fifo_error
FIFOE.
Definition: ac97.h:181
data type for AC'97 buffer descriptor
Definition: ac97.h:133
UINT16 raw
raw access
Definition: ac97.h:174
EFI_STATUS read_busmaster_reg(ac97_handle_t *handle, UINT32 reg, UINTN *value)
Reads an AC'97 bus master register.
Definition: ac97.c:177
model for group of command line arguments
Definition: cmdline.h:50
Data type for an AC'97 "baseline audio register set".
Definition: ac97.h:55
UINT16 prk
PCM LFE DACs suppressed.
Definition: ac97.h:113
Command line parameter parser.
UINT16 dma_controller_halted
DCH.
Definition: ac97.h:177
void close_ac97_handle(ac97_handle_t *handle)
Destroys an AC'97 handle.
Definition: ac97.c:316
UINT16 madc
MIC ADC ready.
Definition: ac97.h:109
UINT16 pcm_front_dac_rate
offset 0x2C
Definition: ac97.h:118
UINT16 pcm_lfe_dac_rate
offset 0x30
Definition: ac97.h:120
UINT16 pcm_surr_dac_rate
offset 0x2E
Definition: ac97.h:119
UINT16 reset
offset 0x00
Definition: ac97.h:57
void ac97_wait_until_last_buffer_sent(ac97_handle_t *handle, UINTN timeout_in_milliseconds)
Waits until the AC'97 codec signaled the "last valid buffer completion" event.
Definition: ac97.c:379
UINT16 phone_vol
offset 0x0C
Definition: ac97.h:63
UINT8 max_master_vol
maximum master volume, either 31 or 63, depending on hardware
Definition: ac97.h:168
UINT16 mono_vol
offset 0x06
Definition: ac97.h:60