OpenCore
1.0.4
OpenCore Bootloader
|
#include "AudioDxe.h"
Go to the source code of this file.
Data Structures | |
struct | _HDA_WIDGET_DEV |
struct | _HDA_FUNC_GROUP |
struct | _HDA_CODEC_DEV |
struct | _HDA_CODEC_INFO_PRIVATE_DATA |
struct | _AUDIO_IO_PRIVATE_DATA |
Macros | |
#define | HDA_CODEC_PRIVATE_DATA_SIGNATURE SIGNATURE_32('H','D','C','O') |
#define | HDA_CODEC_INFO_PRIVATE_DATA_FROM_THIS(This) |
#define | AUDIO_IO_PRIVATE_DATA_FROM_THIS(This) |
#define | GPIO_SETUP_STAGE_DATA BIT0 |
#define | GPIO_SETUP_STAGE_DIRECTION BIT1 |
#define | GPIO_SETUP_STAGE_ENABLE BIT2 |
#define | GPIO_SETUP_STAGE_NONE 0 |
#define | GPIO_SETUP_STAGE_ALL |
#define | GPIO_PIN_MASK_AUTO 0 |
Auto: use all reported available pins. | |
Typedefs | |
typedef struct _HDA_CODEC_DEV | HDA_CODEC_DEV |
typedef struct _HDA_FUNC_GROUP | HDA_FUNC_GROUP |
typedef struct _HDA_WIDGET_DEV | HDA_WIDGET_DEV |
typedef struct _HDA_CODEC_INFO_PRIVATE_DATA | HDA_CODEC_INFO_PRIVATE_DATA |
typedef struct _AUDIO_IO_PRIVATE_DATA | AUDIO_IO_PRIVATE_DATA |
Functions | |
EFI_STATUS EFIAPI | HdaCodecInfoGetAddress (IN EFI_HDA_CODEC_INFO_PROTOCOL *This, OUT UINT8 *Address) |
EFI_STATUS EFIAPI | HdaCodecInfoGetCodecName (IN EFI_HDA_CODEC_INFO_PROTOCOL *This, OUT CONST CHAR16 **CodecName) |
EFI_STATUS EFIAPI | HdaCodecInfoGetVendorId (IN EFI_HDA_CODEC_INFO_PROTOCOL *This, OUT UINT32 *VendorId) |
EFI_STATUS EFIAPI | HdaCodecInfoGetRevisionId (IN EFI_HDA_CODEC_INFO_PROTOCOL *This, OUT UINT32 *RevisionId) |
EFI_STATUS EFIAPI | HdaCodecInfoGetAudioFuncId (IN EFI_HDA_CODEC_INFO_PROTOCOL *This, OUT UINT8 *AudioFuncId, OUT BOOLEAN *UnsolCapable) |
EFI_STATUS EFIAPI | HdaCodecInfoGetDefaultRatesFormats (IN EFI_HDA_CODEC_INFO_PROTOCOL *This, OUT UINT32 *Rates, OUT UINT32 *Formats) |
EFI_STATUS EFIAPI | HdaCodecInfoGetDefaultAmpCaps (IN EFI_HDA_CODEC_INFO_PROTOCOL *This, OUT UINT32 *AmpInCaps, OUT UINT32 *AmpOutCaps) |
EFI_STATUS EFIAPI | HdaCodecInfoGetWidgets (IN EFI_HDA_CODEC_INFO_PROTOCOL *This, OUT HDA_WIDGET **Widgets, OUT UINTN *WidgetCount) |
EFI_STATUS EFIAPI | HdaCodecInfoFreeWidgetsBuffer (IN HDA_WIDGET *Widgets, IN UINTN WidgetCount) |
EFI_STATUS EFIAPI | HdaCodecAudioIoGetOutputs (IN EFI_AUDIO_IO_PROTOCOL *This, OUT EFI_AUDIO_IO_PROTOCOL_PORT **OutputPorts, OUT UINTN *OutputPortsCount) |
EFI_STATUS EFIAPI | HdaCodecAudioIoRawGainToDecibels (IN EFI_AUDIO_IO_PROTOCOL *This, IN UINT64 OutputIndexMask, IN UINT8 GainParam, OUT INT8 *Gain) |
EFI_STATUS EFIAPI | HdaCodecAudioIoSetupPlayback (IN EFI_AUDIO_IO_PROTOCOL *This, IN UINT64 OutputIndexMask, IN INT8 Gain, IN EFI_AUDIO_IO_PROTOCOL_FREQ Freq, IN EFI_AUDIO_IO_PROTOCOL_BITS Bits, IN UINT8 Channels, IN UINTN PlaybackDelay) |
EFI_STATUS EFIAPI | HdaCodecAudioIoStartPlayback (IN EFI_AUDIO_IO_PROTOCOL *This, IN VOID *Data, IN UINTN DataLength, IN UINTN Position OPTIONAL) |
EFI_STATUS EFIAPI | HdaCodecAudioIoStartPlaybackAsync (IN EFI_AUDIO_IO_PROTOCOL *This, IN VOID *Data, IN UINTN DataLength, IN UINTN Position OPTIONAL, IN EFI_AUDIO_IO_CALLBACK Callback OPTIONAL, IN VOID *Context OPTIONAL) |
EFI_STATUS EFIAPI | HdaCodecAudioIoStopPlayback (IN EFI_AUDIO_IO_PROTOCOL *This) |
EFI_STATUS EFIAPI | HdaCodecPrintDefaults (HDA_CODEC_DEV *HdaCodecDev) |
EFI_STATUS EFIAPI | HdaCodecGetOutputDac (IN HDA_WIDGET_DEV *HdaWidget, OUT HDA_WIDGET_DEV **HdaOutputWidget) |
EFI_STATUS EFIAPI | HdaCodecGetSupportedPcmRates (IN HDA_WIDGET_DEV *HdaPinWidget, OUT UINT32 *SupportedRates) |
EFI_STATUS EFIAPI | HdaCodecDisableWidgetPath (IN HDA_WIDGET_DEV *HdaWidget) |
EFI_STATUS EFIAPI | HdaCodecWidgetRawGainToDecibels (IN HDA_WIDGET_DEV *HdaWidget, IN UINT8 GainParam, OUT INT8 *Gain) |
EFI_STATUS EFIAPI | HdaCodecEnableWidgetPath (IN HDA_WIDGET_DEV *HdaWidget, IN INT8 Gain, IN UINT8 StreamId, IN UINT16 StreamFormat) |
VOID EFIAPI | HdaCodecCleanup (IN HDA_CODEC_DEV *HdaCodecDev) |
EFI_STATUS EFIAPI | HdaCodecDriverBindingSupported (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL) |
EFI_STATUS EFIAPI | HdaCodecDriverBindingStart (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL) |
EFI_STATUS EFIAPI | HdaCodecDriverBindingStop (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer OPTIONAL) |
Variables | |
UINTN | gGpioSetupStageMask |
UINTN | gGpioPinMask |
UINTN | gCodecSetupDelay |
BOOLEAN | gUseForcedCodec |
UINTN | gForcedCodec |
BOOLEAN | gCodecUseConnNoneNode |
#define AUDIO_IO_PRIVATE_DATA_FROM_THIS | ( | This | ) |
Definition at line 159 of file HdaCodec.h.
#define GPIO_PIN_MASK_AUTO 0 |
Auto: use all reported available pins.
Definition at line 383 of file HdaCodec.h.
#define GPIO_SETUP_STAGE_ALL |
Definition at line 376 of file HdaCodec.h.
#define GPIO_SETUP_STAGE_DATA BIT0 |
Definition at line 370 of file HdaCodec.h.
#define GPIO_SETUP_STAGE_DIRECTION BIT1 |
Definition at line 371 of file HdaCodec.h.
#define GPIO_SETUP_STAGE_ENABLE BIT2 |
Definition at line 372 of file HdaCodec.h.
#define GPIO_SETUP_STAGE_NONE 0 |
Definition at line 374 of file HdaCodec.h.
#define HDA_CODEC_INFO_PRIVATE_DATA_FROM_THIS | ( | This | ) |
Definition at line 143 of file HdaCodec.h.
#define HDA_CODEC_PRIVATE_DATA_SIGNATURE SIGNATURE_32('H','D','C','O') |
Definition at line 35 of file HdaCodec.h.
typedef struct _AUDIO_IO_PRIVATE_DATA AUDIO_IO_PRIVATE_DATA |
Definition at line 34 of file HdaCodec.h.
typedef struct _HDA_CODEC_DEV HDA_CODEC_DEV |
Definition at line 30 of file HdaCodec.h.
typedef struct _HDA_CODEC_INFO_PRIVATE_DATA HDA_CODEC_INFO_PRIVATE_DATA |
Definition at line 33 of file HdaCodec.h.
typedef struct _HDA_FUNC_GROUP HDA_FUNC_GROUP |
Definition at line 31 of file HdaCodec.h.
typedef struct _HDA_WIDGET_DEV HDA_WIDGET_DEV |
Definition at line 32 of file HdaCodec.h.
EFI_STATUS EFIAPI HdaCodecAudioIoGetOutputs | ( | IN EFI_AUDIO_IO_PROTOCOL * | This, |
OUT EFI_AUDIO_IO_PROTOCOL_PORT ** | OutputPorts, | ||
OUT UINTN * | OutputPortsCount ) |
Gets the collection of output ports.
[in] | This | A pointer to the EFI_AUDIO_IO_PROTOCOL instance. |
[out] | OutputPorts | A pointer to a buffer where the output ports will be placed. |
[out] | OutputPortsCount | The number of ports in OutputPorts. |
EFI_SUCCESS | The audio data was played successfully. |
EFI_INVALID_PARAMETER | One or more parameters are invalid. |
Definition at line 59 of file HdaCodecAudioIo.c.
EFI_STATUS EFIAPI HdaCodecAudioIoRawGainToDecibels | ( | IN EFI_AUDIO_IO_PROTOCOL * | This, |
IN UINT64 | OutputIndexMask, | ||
IN UINT8 | GainParam, | ||
OUT INT8 * | Gain ) |
Convert raw amplifier gain setting to decibel gain value; converts using the parameters of the first channel specified in OutputIndexMask which has non-zero amp capabilities. Note: It seems very typical - though it is certainly not required by the spec - that all amps on a codec which have non-zero amp capabilities, actually all have the same params as each other.
[in] | This | A pointer to the EFI_AUDIO_IO_PROTOCOL instance. |
[in] | OutputIndexMask | A mask indicating the desired outputs. |
[in] | GainParam | The raw gain parameter for the amplifier. |
[out] | Gain | The amplifier gain (or attentuation if negative) in dB to use, relative to 0 dB level (0 dB is usually at at or near max available volume, but is not required to be so in the spec). |
EFI_SUCCESS | The gain value was calculated successfully. |
EFI_INVALID_PARAMETER | One or more parameters are invalid. |
Definition at line 270 of file HdaCodecAudioIo.c.
EFI_STATUS EFIAPI HdaCodecAudioIoSetupPlayback | ( | IN EFI_AUDIO_IO_PROTOCOL * | This, |
IN UINT64 | OutputIndexMask, | ||
IN INT8 | Gain, | ||
IN EFI_AUDIO_IO_PROTOCOL_FREQ | Freq, | ||
IN EFI_AUDIO_IO_PROTOCOL_BITS | Bits, | ||
IN UINT8 | Channels, | ||
IN UINTN | PlaybackDelay ) |
Sets up the device to play audio data. Basic caching is implemented: no actions are taken the second and subsequent times that set up is called again with exactly the same paremeters.
[in] | This | A pointer to the EFI_AUDIO_IO_PROTOCOL instance. |
[in] | OutputIndexMask | A mask indicating the desired outputs. |
[in] | Gain | The amplifier gain (or attentuation if negative) in dB to use, relative to 0 dB level (0 dB is usually at at or near max available volume, but is not required to be so in the spec). |
[in] | Bits | The width in bits of the source data. |
[in] | Freq | The frequency of the source data. |
[in] | Channels | The number of channels the source data contains. |
[in] | PlaybackDelay | The required delay before playback after a change in setup. |
EFI_SUCCESS | The audio data was played successfully. |
EFI_INVALID_PARAMETER | One or more parameters are invalid. |
< TODO: Why does Clover has TRUE here?
< TODO: Why does Clover has TRUE here?
< Enable all available pins
Definition at line 327 of file HdaCodecAudioIo.c.
EFI_STATUS EFIAPI HdaCodecAudioIoStartPlayback | ( | IN EFI_AUDIO_IO_PROTOCOL * | This, |
IN VOID * | Data, | ||
IN UINTN | DataLength, | ||
IN UINTN Position | OPTIONAL ) |
Begins playback on the device and waits for playback to complete.
[in] | This | A pointer to the EFI_AUDIO_IO_PROTOCOL instance. |
[in] | Data | A pointer to the buffer containing the audio data to play. |
[in] | DataLength | The size, in bytes, of the data buffer specified by Data. |
[in] | Position | The position in the buffer to start at. |
EFI_SUCCESS | The audio data was played successfully. |
EFI_INVALID_PARAMETER | One or more parameters are invalid. |
Definition at line 764 of file HdaCodecAudioIo.c.
EFI_STATUS EFIAPI HdaCodecAudioIoStartPlaybackAsync | ( | IN EFI_AUDIO_IO_PROTOCOL * | This, |
IN VOID * | Data, | ||
IN UINTN | DataLength, | ||
IN UINTN Position | OPTIONAL, | ||
IN EFI_AUDIO_IO_CALLBACK Callback | OPTIONAL, | ||
IN VOID *Context | OPTIONAL ) |
Begins playback on the device asynchronously.
[in] | This | A pointer to the EFI_AUDIO_IO_PROTOCOL instance. |
[in] | Data | A pointer to the buffer containing the audio data to play. |
[in] | DataLength | The size, in bytes, of the data buffer specified by Data. |
[in] | Position | The position in the buffer to start at. |
[in] | Callback | A pointer to an optional callback to be invoked when playback is complete. |
[in] | Context | A pointer to data to be passed to the callback function. |
EFI_SUCCESS | The audio data was played successfully. |
EFI_INVALID_PARAMETER | One or more parameters are invalid. |
Definition at line 840 of file HdaCodecAudioIo.c.
EFI_STATUS EFIAPI HdaCodecAudioIoStopPlayback | ( | IN EFI_AUDIO_IO_PROTOCOL * | This | ) |
Stops playback on the device.
[in] | This | A pointer to the EFI_AUDIO_IO_PROTOCOL instance. |
EFI_SUCCESS | The audio data was played successfully. |
EFI_INVALID_PARAMETER | One or more parameters are invalid. |
Definition at line 890 of file HdaCodecAudioIo.c.
VOID EFIAPI HdaCodecCleanup | ( | IN HDA_CODEC_DEV * | HdaCodecDev | ) |
Definition at line 1612 of file HdaCodec.c.
EFI_STATUS EFIAPI HdaCodecDisableWidgetPath | ( | IN HDA_WIDGET_DEV * | HdaWidget | ) |
Definition at line 1228 of file HdaCodec.c.
EFI_STATUS EFIAPI HdaCodecDriverBindingStart | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | ControllerHandle, | ||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath | OPTIONAL ) |
Definition at line 1765 of file HdaCodec.c.
EFI_STATUS EFIAPI HdaCodecDriverBindingStop | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | ControllerHandle, | ||
IN UINTN | NumberOfChildren, | ||
IN EFI_HANDLE *ChildHandleBuffer | OPTIONAL ) |
Definition at line 1854 of file HdaCodec.c.
EFI_STATUS EFIAPI HdaCodecDriverBindingSupported | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | ControllerHandle, | ||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath | OPTIONAL ) |
Definition at line 1717 of file HdaCodec.c.
EFI_STATUS EFIAPI HdaCodecEnableWidgetPath | ( | IN HDA_WIDGET_DEV * | HdaWidget, |
IN INT8 | Gain, | ||
IN UINT8 | StreamId, | ||
IN UINT16 | StreamFormat ) |
Definition at line 1344 of file HdaCodec.c.
EFI_STATUS EFIAPI HdaCodecGetOutputDac | ( | IN HDA_WIDGET_DEV * | HdaWidget, |
OUT HDA_WIDGET_DEV ** | HdaOutputWidget ) |
Definition at line 1153 of file HdaCodec.c.
EFI_STATUS EFIAPI HdaCodecGetSupportedPcmRates | ( | IN HDA_WIDGET_DEV * | HdaPinWidget, |
OUT UINT32 * | SupportedRates ) |
Definition at line 1183 of file HdaCodec.c.
EFI_STATUS EFIAPI HdaCodecInfoFreeWidgetsBuffer | ( | IN HDA_WIDGET * | Widgets, |
IN UINTN | WidgetCount ) |
Frees an array of HDA_WIDGET.
[in] | Widgets | A pointer to the buffer array of widgets that is to be freed. |
[in] | WidgetCount | The number of widgets in Widgets. |
EFI_SUCCESS | The buffer was freed. |
EFI_INVALID_PARAMETER | One or more parameters are invalid. |
Definition at line 384 of file HdaCodecInfo.c.
EFI_STATUS EFIAPI HdaCodecInfoGetAddress | ( | IN EFI_HDA_CODEC_INFO_PROTOCOL * | This, |
OUT UINT8 * | Address ) |
Definition at line 29 of file HdaCodecInfo.c.
EFI_STATUS EFIAPI HdaCodecInfoGetAudioFuncId | ( | IN EFI_HDA_CODEC_INFO_PROTOCOL * | This, |
OUT UINT8 * | AudioFuncId, | ||
OUT BOOLEAN * | UnsolCapable ) |
Gets the node ID of the codec's audio function.
[in] | This | A pointer to the EFI_HDA_CODEC_INFO_PROTOCOL instance. |
[out] | AudioFuncId | The node ID of the codec's audio function. |
EFI_SUCCESS | The node ID was retrieved. |
EFI_INVALID_PARAMETER | One or more parameters are invalid. |
Definition at line 152 of file HdaCodecInfo.c.
EFI_STATUS EFIAPI HdaCodecInfoGetCodecName | ( | IN EFI_HDA_CODEC_INFO_PROTOCOL * | This, |
OUT CONST CHAR16 ** | CodecName ) |
Gets the codec's name.
[in] | This | A pointer to the EFI_HDA_CODEC_INFO_PROTOCOL instance. |
[out] | CodecName | A pointer to the buffer to return the codec name. |
EFI_SUCCESS | The codec name was retrieved. |
EFI_INVALID_PARAMETER | One or more parameters are invalid. |
Definition at line 56 of file HdaCodecInfo.c.
EFI_STATUS EFIAPI HdaCodecInfoGetDefaultAmpCaps | ( | IN EFI_HDA_CODEC_INFO_PROTOCOL * | This, |
OUT UINT32 * | AmpInCaps, | ||
OUT UINT32 * | AmpOutCaps ) |
Gets the codec's default amp capabilities.
[in] | This | A pointer to the EFI_HDA_CODEC_INFO_PROTOCOL instance. |
[out] | AmpInCaps | The default input amp capabilities. |
[out] | AmpOutCaps | The default output amp capabilities. |
EFI_SUCCESS | The default amp capabilities were retrieved. |
EFI_INVALID_PARAMETER | One or more parameters are invalid. |
Definition at line 222 of file HdaCodecInfo.c.
EFI_STATUS EFIAPI HdaCodecInfoGetDefaultRatesFormats | ( | IN EFI_HDA_CODEC_INFO_PROTOCOL * | This, |
OUT UINT32 * | Rates, | ||
OUT UINT32 * | Formats ) |
Gets the codec's default supported stream rates and formats.
[in] | This | A pointer to the EFI_HDA_CODEC_INFO_PROTOCOL instance. |
[out] | Rates | The default supported rates. |
[out] | Formats | The default supported formats. |
EFI_SUCCESS | The stream rates and formats were retrieved. |
EFI_INVALID_PARAMETER | One or more parameters are invalid. |
Definition at line 187 of file HdaCodecInfo.c.
EFI_STATUS EFIAPI HdaCodecInfoGetRevisionId | ( | IN EFI_HDA_CODEC_INFO_PROTOCOL * | This, |
OUT UINT32 * | RevisionId ) |
Gets the codec's revision ID.
[in] | This | A pointer to the EFI_HDA_CODEC_INFO_PROTOCOL instance. |
[out] | RevisionId | The revision ID of the codec. |
EFI_SUCCESS | The revision ID was retrieved. |
EFI_INVALID_PARAMETER | One or more parameters are invalid. |
Definition at line 120 of file HdaCodecInfo.c.
EFI_STATUS EFIAPI HdaCodecInfoGetVendorId | ( | IN EFI_HDA_CODEC_INFO_PROTOCOL * | This, |
OUT UINT32 * | VendorId ) |
Gets the codec's vendor and device ID.
[in] | This | A pointer to the EFI_HDA_CODEC_INFO_PROTOCOL instance. |
[out] | VendorId | The vendor and device ID of the codec. |
EFI_SUCCESS | The vendor and device ID was retrieved. |
EFI_INVALID_PARAMETER | One or more parameters are invalid. |
Definition at line 88 of file HdaCodecInfo.c.
EFI_STATUS EFIAPI HdaCodecInfoGetWidgets | ( | IN EFI_HDA_CODEC_INFO_PROTOCOL * | This, |
OUT HDA_WIDGET ** | Widgets, | ||
OUT UINTN * | WidgetCount ) |
Gets the codec's widgets.
[in] | This | A pointer to the EFI_HDA_CODEC_INFO_PROTOCOL instance. |
[out] | Widgets | A pointer to the buffer to return the requested array of widgets. |
[out] | WidgetCount | The number of widgets returned in Widgets. |
EFI_SUCCESS | The widgets were retrieved. |
EFI_INVALID_PARAMETER | One or more parameters are invalid. |
EFI_OUT_OF_RESOURCES | A buffer couldn't be allocated. |
Definition at line 258 of file HdaCodecInfo.c.
EFI_STATUS EFIAPI HdaCodecPrintDefaults | ( | HDA_CODEC_DEV * | HdaCodecDev | ) |
EFI_STATUS EFIAPI HdaCodecWidgetRawGainToDecibels | ( | IN HDA_WIDGET_DEV * | HdaWidget, |
IN UINT8 | GainParam, | ||
OUT INT8 * | Gain ) |
Definition at line 1288 of file HdaCodec.c.
|
extern |
Definition at line 40 of file HdaCodec.c.
|
extern |
Definition at line 49 of file HdaCodec.c.
|
extern |
Definition at line 46 of file HdaCodec.c.
|
extern |
Definition at line 37 of file HdaCodec.c.
|
extern |
Definition at line 34 of file HdaCodec.c.
|
extern |
Definition at line 43 of file HdaCodec.c.