Audio Codec 97 (AC97)

DLL name
Pass "ac97" as the mixer_dll argument to ado_mixer_dll().
Header file
<mixer/ac97_dll.h>
Parameter structure
This structure holds pointers to the callback functions that you need to provide for the mixer DLL to call:
typedef
struct  ado_mixer_dll_params_ac97
{
  HW_CONTEXT_T  *hw_context;
  uint16_t      (*read) (HW_CONTEXT_T *hw_context,
                         uint16_t reg);
  void          (*write) (HW_CONTEXT_T *hw_context,
                          uint16_t reg, uint16_t val);
  int32_t       (*init) (HW_CONTEXT_T *hw_context);
  void          (*destroy) (HW_CONTEXT_T *hw_context);
} ado_mixer_dll_params_ac97_t;

The members include:

hw_context
A pointer to a structure that you can use for any context-sensitive data that your driver needs. It's used only as an argument for the function calls.
read()
Read the given ac97 register.
write()
Write the given value into the given ac97 register.
init()
The upper layer of the driver calls this function after the codec has been initialized. Use this callback to make any last-minute adjustments.
destroy()
The upper layer of the driver calls this function just before the DLL terminates. In general, you should use it to undo anything init() did.

Pass a pointer to a ado_mixer_dll_params_ac97_t structure as the params argument to ado_mixer_dll().

Supported device controls
This structure holds pointers to the callback functions, provided by the mixer DLL, that your Audio HW DLL can call to control the device:
enum ac97_SRC
{
  AC97_FRONT_DAC_SRC,
  AC97_SURR_DAC_SRC,
  AC97_LFE_DAC_SRC,
  AC97_LR_ADC_SRC,
};

typedef
struct  ado_mixer_dll_callbacks_ac97
{
  MIXER_CONTEXT_T  *mix_context;
  int32_t          (*SRC_test) (MIXER_CONTEXT_T * mix_context,
                                enum ac97_SRC src,
                                ado_pcm_cap_t * caps);
  int32_t          (*SRC_set) (MIXER_CONTEXT_T * mix_context,
                               enum ac97_SRC src,
                               uint32_t * rate);
}
ado_mixer_dll_callbacks_ac97_t;

The members include:

mix_context
A pointer to a structure that the codec uses for any context-sensitive data that it needs. Use it only as an argument for the function calls defined in this structure.
SRC_test
Checks which sample rates are supported for the src sample rate converter and updates the information in the given ado_pcm_cap_t structure.
SRC_set
Sets the sample rate for the src sample rate converter.

Pass a pointer to a ado_mixer_dll_callbacks_ac97_t structure as the callbacks argument to ado_mixer_dll().

References