Logo Search packages:      
Sourcecode: linux-fsl-imx51 version File versions  Download package

pmic_audio.c File Reference


Detailed Description

Implementation of the PMIC(mc13783) Audio driver APIs.

The PMIC Audio driver and this API were developed to support the audio playback, recording, and mixing capabilities of the power management ICs that are available from Freescale Semiconductor, Inc.

The following operating modes are supported:

       Operating Mode               mc13783
       ---------------------------- -------
       Stereo DAC Playback           Yes
       Stereo DAC Input Mixing       Yes
       Voice CODEC Playback          Yes
       Voice CODEC Input Mixing      Yes
       Voice CODEC Mono Recording    Yes
       Voice CODEC Stereo Recording  Yes
       Microphone Bias Control       Yes
       Output Amplifier Control      Yes
       Output Mixing Control         Yes
       Input Amplifier Control       Yes
       Master/Slave Mode Select      Yes
       Anti Pop Bias Circuit Control Yes
   

Note that the Voice CODEC may also be referred to as the Telephone CODEC in the PMIC DTS documentation. Also note that, while the power management ICs do provide similar audio capabilities, each PMIC may support additional configuration settings and features. Therefore, it is highly recommended that the appropriate power management IC DTS documents be used in conjunction with this API interface.

Definition in file pmic_audio.c.

#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/init.h>
#include <linux/spinlock.h>
#include <linux/pmic_adc.h>
#include <linux/pmic_status.h>
#include <mach/pmic_audio.h>

Go to the source code of this file.

Classes

struct  PMIC_AUDIO_AUDIO_OUTPUT_STATE
 This maintains the current state of the Audio Output Section. More...
struct  PMIC_AUDIO_EVENT_STATE
 This maintains the current state of the callback & Eventmask. More...
struct  PMIC_AUDIO_EXT_STEREO_IN_STATE
 This maintains the current state of the External Stereo Input. More...
struct  PMIC_AUDIO_STDAC_STATE
 This structure maintains the current state of the Stereo DAC. More...
struct  PMIC_AUDIO_VCODEC_STATE
 This structure maintains the current state of the Voice CODEC. More...
struct  PMIC_MICROPHONE_STATE
 This structure is used to track the state of a microphone input. More...
struct  REGFIELD
 This structure is used to define a specific hardware register field. More...
struct  REGISTER_AUD_CODEC
 This structure lists all fields of the AUD_CODEC hardware register. More...
struct  REGISTER_AUDIO_RX_0
 This structure lists all fields of the AUDIO_RX_0 hardware register. More...
struct  REGISTER_AUDIO_RX_1
 This structure lists all fields of the AUDIO_RX_1 hardware register. More...
struct  REGISTER_AUDIO_TX
 This structure lists all fields of the AUDIO_TX hardware register. More...
struct  REGISTER_SSI_NETWORK
 This structure lists all of the fields in the SSI_NETWORK hardware register. More...
struct  REGISTER_ST_DAC
 This structure lists all fields of the ST_DAC hardware register. More...

Defines

#define GET_BITS(reg, field, value)
#define SET_BITS(reg, field, value)

Enumerations

enum  HANDLE_STATE { HANDLE_FREE, HANDLE_IN_USE, HANDLE_FREE, HANDLE_IN_USE }
 Define the possible states for a device handle. More...
enum  HEADSET_STATUS { NO_HEADSET, HEADSET_ON }
 Tracks whether a headset is currently attached or not. More...
enum  PMIC_AUDIO_VCODEC_OUTPUT_PATH { VCODEC_DIRECT_OUT, VCODEC_MIXER_OUT }
 mc13783 only enum that indicates the path to output taken by the voice codec output More...
enum  PMIC_CORE_EVENT {
  CORE_EVENT_MC2BI, CORE_EVENT_HSDETI, CORE_EVENT_HSLI, CORE_EVENT_ALSPTHI,
  CORE_EVENT_AHSSHORTI, CORE_EVENT_4V4 = 1, CORE_EVENT_2V0 = 2, CORE_EVENT_0V8 = 4,
  CORE_EVENT_ABDET = 8
}
 Identifies the hardware interrupt source. More...

Functions

static DECLARE_MUTEX (mutex)
 This mutex is used to provide mutual exclusion.
 EXPORT_SYMBOL (pmic_audio_set_autodetect)
 EXPORT_SYMBOL (pmic_audio_output_disable_phantom_ground)
 EXPORT_SYMBOL (pmic_audio_output_enable_phantom_ground)
 EXPORT_SYMBOL (pmic_audio_output_get_config)
 EXPORT_SYMBOL (pmic_audio_output_clear_config)
 EXPORT_SYMBOL (pmic_audio_output_set_config)
 EXPORT_SYMBOL (pmic_audio_output_get_mono_adder_gain)
 EXPORT_SYMBOL (pmic_audio_output_set_mono_adder_gain)
 EXPORT_SYMBOL (pmic_audio_output_disable_mono_adder)
 EXPORT_SYMBOL (pmic_audio_output_enable_mono_adder)
 EXPORT_SYMBOL (pmic_audio_output_get_balance)
 EXPORT_SYMBOL (pmic_audio_output_set_balance)
 EXPORT_SYMBOL (pmic_audio_output_disable_mixer)
 EXPORT_SYMBOL (pmic_audio_output_enable_mixer)
 EXPORT_SYMBOL (pmic_audio_output_get_pgaGain)
 EXPORT_SYMBOL (pmic_audio_output_set_pgaGain)
 EXPORT_SYMBOL (pmic_audio_output_get_stereo_in_gain)
 EXPORT_SYMBOL (pmic_audio_output_set_stereo_in_gain)
 EXPORT_SYMBOL (pmic_audio_output_clear_port)
 EXPORT_SYMBOL (pmic_audio_output_get_port)
 EXPORT_SYMBOL (pmic_audio_output_set_port)
 EXPORT_SYMBOL (pmic_audio_stdac_disable_mixer)
 EXPORT_SYMBOL (pmic_audio_stdac_enable_mixer)
 EXPORT_SYMBOL (pmic_audio_vcodec_disable_mixer)
 EXPORT_SYMBOL (pmic_audio_vcodec_enable_mixer)
 EXPORT_SYMBOL (pmic_audio_vcodec_disable_micbias)
 EXPORT_SYMBOL (pmic_audio_vcodec_enable_micbias)
 EXPORT_SYMBOL (pmic_audio_vcodec_get_record_gain)
 EXPORT_SYMBOL (pmic_audio_vcodec_set_record_gain)
 EXPORT_SYMBOL (pmic_audio_vcodec_get_mic_on_off)
 EXPORT_SYMBOL (pmic_audio_vcodec_set_mic_on_off)
 EXPORT_SYMBOL (pmic_audio_vcodec_get_mic)
 EXPORT_SYMBOL (pmic_audio_vcodec_set_mic)
 EXPORT_SYMBOL (pmic_audio_input_get_config)
 EXPORT_SYMBOL (pmic_audio_input_clear_config)
 EXPORT_SYMBOL (pmic_audio_input_set_config)
 EXPORT_SYMBOL (pmic_audio_stdac_get_config)
 EXPORT_SYMBOL (pmic_audio_stdac_clear_config)
 EXPORT_SYMBOL (pmic_audio_stdac_set_config)
 EXPORT_SYMBOL (pmic_audio_stdac_get_rxtx_timeslot)
 EXPORT_SYMBOL (pmic_audio_stdac_set_rxtx_timeslot)
 EXPORT_SYMBOL (pmic_audio_stdac_get_clock)
 EXPORT_SYMBOL (pmic_audio_stdac_set_clock)
 EXPORT_SYMBOL (pmic_audio_vcodec_disable_bypass)
 EXPORT_SYMBOL (pmic_audio_vcodec_enable_bypass)
 EXPORT_SYMBOL (pmic_audio_vcodec_get_config)
 EXPORT_SYMBOL (pmic_audio_vcodec_clear_config)
 EXPORT_SYMBOL (pmic_audio_vcodec_set_config)
 EXPORT_SYMBOL (pmic_audio_vcodec_get_secondary_txslot)
 EXPORT_SYMBOL (pmic_audio_vcodec_set_secondary_txslot)
 EXPORT_SYMBOL (pmic_audio_vcodec_get_rxtx_timeslot)
 EXPORT_SYMBOL (pmic_audio_vcodec_set_rxtx_timeslot)
 EXPORT_SYMBOL (pmic_audio_vcodec_get_clock)
 EXPORT_SYMBOL (pmic_audio_vcodec_set_clock)
 EXPORT_SYMBOL (pmic_audio_digital_filter_reset)
 EXPORT_SYMBOL (pmic_audio_antipop_disable)
 EXPORT_SYMBOL (pmic_audio_antipop_enable)
 EXPORT_SYMBOL (pmic_audio_get_callback)
 EXPORT_SYMBOL (pmic_audio_clear_callback)
 EXPORT_SYMBOL (pmic_audio_set_callback)
 EXPORT_SYMBOL (pmic_audio_reset_all)
 EXPORT_SYMBOL (pmic_audio_reset)
 EXPORT_SYMBOL (pmic_audio_disable)
 EXPORT_SYMBOL (pmic_audio_enable)
 EXPORT_SYMBOL (pmic_audio_get_protocol)
 EXPORT_SYMBOL (pmic_audio_set_protocol)
 EXPORT_SYMBOL (pmic_audio_close)
 EXPORT_SYMBOL (pmic_audio_open)
 EXPORT_SYMBOL (MAX_STDAC_SAMPLING_RATE_HZ)
 EXPORT_SYMBOL (MIN_STDAC_SAMPLING_RATE_HZ)
 MODULE_AUTHOR ("Freescale Semiconductor, Inc.")
 MODULE_DESCRIPTION ("PMIC - mc13783 ADC driver")
 module_exit (mc13783_pmic_audio_exit)
 module_init (mc13783_pmic_audio_init)
 MODULE_LICENSE ("GPL")
Audio Driver Loading/Unloading Functions
These non-exported internal functions are used to support the audio device driver initialization and de-initialization operations.

static void __exit mc13783_pmic_audio_exit (void)
 This is the audio device driver de-initialization function.
static int __init mc13783_pmic_audio_init (void)
 This is the audio device driver initialization function.
General Setup and Configuration APIs
Functions for general setup and configuration of the PMIC Audio hardware.

PMIC_STATUS pmic_audio_antipop_disable (void)
 Disable the anti-pop circuitry.
PMIC_STATUS pmic_audio_antipop_enable (const PMIC_AUDIO_ANTI_POP_RAMP_SPEED rampSpeed)
 Enable the anti-pop circuitry to avoid extra noise when inserting or removing a external device (e.g., a headset).
PMIC_STATUS pmic_audio_clear_callback (void)
 Deregisters the existing audio callback function.
PMIC_STATUS pmic_audio_close (const PMIC_AUDIO_HANDLE handle)
 Terminate further access to the PMIC audio hardware.
PMIC_STATUS pmic_audio_digital_filter_reset (const PMIC_AUDIO_HANDLE handle)
 Performs a reset of the Voice CODEC/Stereo DAC digital filter.
PMIC_STATUS pmic_audio_disable (const PMIC_AUDIO_HANDLE handle)
 Disable the Stereo DAC or the Voice CODEC.
PMIC_STATUS pmic_audio_enable (const PMIC_AUDIO_HANDLE handle)
 Enable the Stereo DAC or the Voice CODEC.
PMIC_STATUS pmic_audio_get_callback (PMIC_AUDIO_CALLBACK *const func, PMIC_AUDIO_EVENTS *const eventMask)
 Get the current audio callback function settings.
PMIC_STATUS pmic_audio_get_protocol (const PMIC_AUDIO_HANDLE handle, PMIC_AUDIO_DATA_BUS *const busID, PMIC_AUDIO_BUS_PROTOCOL *const protocol, PMIC_AUDIO_BUS_MODE *const masterSlave, PMIC_AUDIO_NUMSLOTS *const numSlots)
 Retrieve the current data bus protocol configuration.
PMIC_STATUS pmic_audio_get_ptt_button_level (unsigned int *const level)
 Get the most recent PTT button voltage reading.
PMIC_STATUS pmic_audio_open (PMIC_AUDIO_HANDLE *const handle, const PMIC_AUDIO_SOURCE device)
 Request exclusive access to the PMIC Audio hardware.
PMIC_STATUS pmic_audio_reset (const PMIC_AUDIO_HANDLE handle)
 Reset the selected audio hardware control registers to their power on state.
PMIC_STATUS pmic_audio_reset_all (void)
 Reset all audio hardware control registers to their power on state.
PMIC_STATUS pmic_audio_set_autodetect (int val)
PMIC_STATUS pmic_audio_set_callback (void *func, const PMIC_AUDIO_EVENTS eventMask, PMIC_HS_STATE *hs_state)
 Set the Audio callback function.
PMIC_STATUS pmic_audio_set_protocol (const PMIC_AUDIO_HANDLE handle, const PMIC_AUDIO_DATA_BUS busID, const PMIC_AUDIO_BUS_PROTOCOL protocol, const PMIC_AUDIO_BUS_MODE masterSlave, const PMIC_AUDIO_NUMSLOTS numSlots)
 Configure the data bus protocol to be used.
Audio Driver Internal Support Functions
These non-exported internal functions are used to support the functionality of the exported audio APIs.

static PMIC_STATUS pmic_audio_close_handle (const PMIC_AUDIO_HANDLE handle)
 Global variable to track currently active interrupt events.
static PMIC_STATUS pmic_audio_deregister (void *callback, PMIC_AUDIO_EVENTS *const eventMask)
 Deregister the callback function and event mask currently associated with an audio device handle.
PMIC_STATUS pmic_audio_fm_output_enable (bool enable)
 enable/disable fm output.
static PMIC_STATUS pmic_audio_reset_device (const PMIC_AUDIO_HANDLE handle)
 Reset the selected audio hardware control registers to their power on state.
Audio Input Setup and Configuration APIs
Functions for general setup and configuration of the PMIC audio input hardware.

PMIC_STATUS pmic_audio_input_clear_config (const PMIC_AUDIO_HANDLE handle, const PMIC_AUDIO_INPUT_CONFIG config)
 Clear/Disable the audio input section options.
PMIC_STATUS pmic_audio_input_get_config (const PMIC_AUDIO_HANDLE handle, PMIC_AUDIO_INPUT_CONFIG *const config)
 Get the current audio input section options.
PMIC_STATUS pmic_audio_input_set_config (const PMIC_AUDIO_HANDLE handle, const PMIC_AUDIO_INPUT_CONFIG config)
 Set/Enable the audio input section options.
Audio Output Section Setup and Configuration APIs
Functions for general setup and configuration of the PMIC audio output section to support playback.

PMIC_STATUS pmic_audio_output_clear_config (const PMIC_AUDIO_HANDLE handle, const PMIC_AUDIO_OUTPUT_CONFIG config)
 Clear various audio output section options.
PMIC_STATUS pmic_audio_output_clear_port (const PMIC_AUDIO_HANDLE handle, const PMIC_AUDIO_OUTPUT_PORT port)
 Deselect/disable the audio output ports.
PMIC_STATUS pmic_audio_output_disable_mixer (const PMIC_AUDIO_HANDLE handle)
 Disable the output mixer.
PMIC_STATUS pmic_audio_output_disable_mono_adder (const PMIC_AUDIO_HANDLE handle)
 Disable the output mono adder.
PMIC_STATUS pmic_audio_output_disable_phantom_ground ()
 Disable the phantom ground circuit that is used to help identify the type of headset that has been inserted.
PMIC_STATUS pmic_audio_output_enable_mixer (const PMIC_AUDIO_HANDLE handle)
 Enable the output mixer.
PMIC_STATUS pmic_audio_output_enable_mono_adder (const PMIC_AUDIO_HANDLE handle, const PMIC_AUDIO_MONO_ADDER_MODE mode)
 Configure and enable the output mono adder.
PMIC_STATUS pmic_audio_output_enable_phantom_ground ()
 Enable the phantom ground circuit that is used to help identify the type of headset that has been inserted.
PMIC_STATUS pmic_audio_output_get_balance (const PMIC_AUDIO_HANDLE handle, PMIC_AUDIO_OUTPUT_BALANCE_GAIN *const leftGain, PMIC_AUDIO_OUTPUT_BALANCE_GAIN *const rightGain)
 Get the current output balance amplifier gain levels.
PMIC_STATUS pmic_audio_output_get_config (const PMIC_AUDIO_HANDLE handle, PMIC_AUDIO_OUTPUT_CONFIG *const config)
 Get the current audio output section options.
PMIC_STATUS pmic_audio_output_get_mono_adder_gain (const PMIC_AUDIO_HANDLE handle, PMIC_AUDIO_MONO_ADDER_OUTPUT_GAIN *const gain)
 Get the current mono adder output gain level.
PMIC_STATUS pmic_audio_output_get_pgaGain (const PMIC_AUDIO_HANDLE handle, PMIC_AUDIO_OUTPUT_PGA_GAIN *const gain)
 Get the output PGA gain level.
PMIC_STATUS pmic_audio_output_get_port (const PMIC_AUDIO_HANDLE handle, PMIC_AUDIO_OUTPUT_PORT *const port)
 Get the current audio output ports.
PMIC_STATUS pmic_audio_output_get_stereo_in_gain (const PMIC_AUDIO_HANDLE handle, PMIC_AUDIO_STEREO_IN_GAIN *const gain)
 Get the current gain level for the external stereo inputs.
PMIC_STATUS pmic_audio_output_set_balance (const PMIC_AUDIO_HANDLE handle, const PMIC_AUDIO_OUTPUT_BALANCE_GAIN leftGain, const PMIC_AUDIO_OUTPUT_BALANCE_GAIN rightGain)
 Configure and enable the output balance amplifiers.
PMIC_STATUS pmic_audio_output_set_config (const PMIC_AUDIO_HANDLE handle, const PMIC_AUDIO_OUTPUT_CONFIG config)
 Set various audio output section options.
PMIC_STATUS pmic_audio_output_set_mono_adder_gain (const PMIC_AUDIO_HANDLE handle, const PMIC_AUDIO_MONO_ADDER_OUTPUT_GAIN gain)
 Configure the mono adder output gain level.
PMIC_STATUS pmic_audio_output_set_pgaGain (const PMIC_AUDIO_HANDLE handle, const PMIC_AUDIO_OUTPUT_PGA_GAIN gain)
 Set the output PGA gain level.
PMIC_STATUS pmic_audio_output_set_port (const PMIC_AUDIO_HANDLE handle, const PMIC_AUDIO_OUTPUT_PORT port)
 Select the audio output ports.
PMIC_STATUS pmic_audio_output_set_stereo_in_gain (const PMIC_AUDIO_HANDLE handle, const PMIC_AUDIO_STEREO_IN_GAIN gain)
 Set the gain level for the external stereo inputs.
General Stereo DAC Setup and Configuration APIs
Functions for general setup and configuration of the PMIC Stereo DAC hardware.

PMIC_STATUS pmic_audio_stdac_clear_config (const PMIC_AUDIO_HANDLE handle, const PMIC_AUDIO_STDAC_CONFIG config)
 Clear/Disable the Stereo DAC options.
PMIC_STATUS pmic_audio_stdac_get_clock (const PMIC_AUDIO_HANDLE handle, PMIC_AUDIO_CLOCK_IN_SOURCE *const clockIn, PMIC_AUDIO_STDAC_SAMPLING_RATE *const samplingRate, PMIC_AUDIO_STDAC_CLOCK_IN_FREQ *const clockFreq, PMIC_AUDIO_CLOCK_INVERT *const invert)
 Get the Stereo DAC clock source and operating characteristics.
PMIC_STATUS pmic_audio_stdac_get_config (const PMIC_AUDIO_HANDLE handle, PMIC_AUDIO_STDAC_CONFIG *const config)
 Get the current Stereo DAC options.
PMIC_STATUS pmic_audio_stdac_get_rxtx_timeslot (const PMIC_AUDIO_HANDLE handle, PMIC_AUDIO_STDAC_TIMESLOTS *const timeslot)
 Get the current Stereo DAC primary audio channel timeslot.
PMIC_STATUS pmic_audio_stdac_set_clock (const PMIC_AUDIO_HANDLE handle, const PMIC_AUDIO_CLOCK_IN_SOURCE clockIn, const PMIC_AUDIO_STDAC_CLOCK_IN_FREQ clockFreq, const PMIC_AUDIO_STDAC_SAMPLING_RATE samplingRate, const PMIC_AUDIO_CLOCK_INVERT invert)
 Set the Stereo DAC clock source and operating characteristics.
PMIC_STATUS pmic_audio_stdac_set_config (const PMIC_AUDIO_HANDLE handle, const PMIC_AUDIO_STDAC_CONFIG config)
 Set/Enable the Stereo DAC options.
PMIC_STATUS pmic_audio_stdac_set_rxtx_timeslot (const PMIC_AUDIO_HANDLE handle, const PMIC_AUDIO_STDAC_TIMESLOTS timeslot)
 Set the Stereo DAC primary audio channel timeslot.
Audio Playback Using the Stereo DAC Setup and Configuration APIs
Functions for general setup and configuration of the PMIC Stereo DAC to perform audio playback.

PMIC_STATUS pmic_audio_stdac_disable_mixer (const PMIC_AUDIO_HANDLE handle)
 Disable the Stereo DAC mixer.
PMIC_STATUS pmic_audio_stdac_enable_mixer (const PMIC_AUDIO_HANDLE handle, const PMIC_AUDIO_STDAC_TIMESLOTS rxSecondaryTimeslot, const PMIC_AUDIO_STDAC_MIX_IN_GAIN gainIn, const PMIC_AUDIO_STDAC_MIX_OUT_GAIN gainOut)
 Configure and enable the Stereo DAC mixer.
General Voice CODEC Setup and Configuration APIs
Functions for general setup and configuration of the PMIC Voice CODEC hardware.

PMIC_STATUS pmic_audio_vcodec_clear_config (const PMIC_AUDIO_HANDLE handle, const PMIC_AUDIO_VCODEC_CONFIG config)
 Clear/Disable the Voice CODEC options.
PMIC_STATUS pmic_audio_vcodec_disable_bypass (const PMIC_AUDIO_HANDLE handle)
 Disable the Voice CODEC bypass audio pathway.
PMIC_STATUS pmic_audio_vcodec_enable_bypass (const PMIC_AUDIO_HANDLE handle)
 Enable the Voice CODEC bypass audio pathway.
PMIC_STATUS pmic_audio_vcodec_get_clock (const PMIC_AUDIO_HANDLE handle, PMIC_AUDIO_CLOCK_IN_SOURCE *const clockIn, PMIC_AUDIO_VCODEC_CLOCK_IN_FREQ *const clockFreq, PMIC_AUDIO_VCODEC_SAMPLING_RATE *const samplingRate, PMIC_AUDIO_CLOCK_INVERT *const invert)
 Get the Voice CODEC clock source and operating characteristics.
PMIC_STATUS pmic_audio_vcodec_get_config (const PMIC_AUDIO_HANDLE handle, PMIC_AUDIO_VCODEC_CONFIG *const config)
 Get the current Voice CODEC options.
PMIC_STATUS pmic_audio_vcodec_get_rxtx_timeslot (const PMIC_AUDIO_HANDLE handle, PMIC_AUDIO_VCODEC_TIMESLOT *const timeslot)
 Get the current Voice CODEC primary audio channel timeslot.
PMIC_STATUS pmic_audio_vcodec_get_secondary_txslot (const PMIC_AUDIO_HANDLE handle, PMIC_AUDIO_VCODEC_TIMESLOT *const timeslot)
 Get the Voice CODEC secondary recording audio channel timeslot.
PMIC_STATUS pmic_audio_vcodec_set_clock (const PMIC_AUDIO_HANDLE handle, const PMIC_AUDIO_CLOCK_IN_SOURCE clockIn, const PMIC_AUDIO_VCODEC_CLOCK_IN_FREQ clockFreq, const PMIC_AUDIO_VCODEC_SAMPLING_RATE samplingRate, const PMIC_AUDIO_CLOCK_INVERT invert)
 Set the Voice CODEC clock source and operating characteristics.
PMIC_STATUS pmic_audio_vcodec_set_config (const PMIC_AUDIO_HANDLE handle, const PMIC_AUDIO_VCODEC_CONFIG config)
 Set/Enable the Voice CODEC options.
PMIC_STATUS pmic_audio_vcodec_set_rxtx_timeslot (const PMIC_AUDIO_HANDLE handle, const PMIC_AUDIO_VCODEC_TIMESLOT timeslot)
 Set the Voice CODEC primary audio channel timeslot.
PMIC_STATUS pmic_audio_vcodec_set_secondary_txslot (const PMIC_AUDIO_HANDLE handle, const PMIC_AUDIO_VCODEC_TIMESLOT timeslot)
 Set the Voice CODEC secondary recording audio channel timeslot.
Audio Recording Using the Voice CODEC Setup and Configuration APIs
Functions for general setup and configuration of the PMIC Voice CODEC to perform audio recording.

PMIC_STATUS pmic_audio_vcodec_disable_micbias (const PMIC_AUDIO_HANDLE handle, const PMIC_AUDIO_MIC_BIAS biasCircuit)
 Disable a microphone bias circuit.
PMIC_STATUS pmic_audio_vcodec_enable_micbias (const PMIC_AUDIO_HANDLE handle, const PMIC_AUDIO_MIC_BIAS biasCircuit)
 Enable a microphone bias circuit.
PMIC_STATUS pmic_audio_vcodec_get_mic (const PMIC_AUDIO_HANDLE handle, PMIC_AUDIO_INPUT_PORT *const leftChannel, PMIC_AUDIO_INPUT_PORT *const rightChannel)
 Get the current microphone inputs being used for Voice CODEC recording.
PMIC_STATUS pmic_audio_vcodec_get_mic_on_off (const PMIC_AUDIO_HANDLE handle, PMIC_AUDIO_INPUT_MIC_STATE *const leftChannel, PMIC_AUDIO_INPUT_MIC_STATE *const rightChannel)
 Return the current state of the microphone inputs.
PMIC_STATUS pmic_audio_vcodec_get_record_gain (const PMIC_AUDIO_HANDLE handle, PMIC_AUDIO_MIC_AMP_MODE *const leftChannelMode, PMIC_AUDIO_MIC_GAIN *const leftChannelGain, PMIC_AUDIO_MIC_AMP_MODE *const rightChannelMode, PMIC_AUDIO_MIC_GAIN *const rightChannelGain)
 Get the current microphone input amplifier mode and gain level.
PMIC_STATUS pmic_audio_vcodec_set_mic (const PMIC_AUDIO_HANDLE handle, const PMIC_AUDIO_INPUT_PORT leftChannel, const PMIC_AUDIO_INPUT_PORT rightChannel)
 Select the microphone inputs to be used for Voice CODEC recording.
PMIC_STATUS pmic_audio_vcodec_set_mic_on_off (const PMIC_AUDIO_HANDLE handle, const PMIC_AUDIO_INPUT_MIC_STATE leftChannel, const PMIC_AUDIO_INPUT_MIC_STATE rightChannel)
 Enable/disable the microphone input.
PMIC_STATUS pmic_audio_vcodec_set_record_gain (const PMIC_AUDIO_HANDLE handle, const PMIC_AUDIO_MIC_AMP_MODE leftChannelMode, const PMIC_AUDIO_MIC_GAIN leftChannelGain, const PMIC_AUDIO_MIC_AMP_MODE rightChannelMode, const PMIC_AUDIO_MIC_GAIN rightChannelGain)
 Set the microphone input amplifier mode and gain level.
Audio Playback Using the Voice CODEC Setup and Configuration APIs
Functions for general setup and configuration of the PMIC Voice CODEC to perform audio playback.

PMIC_STATUS pmic_audio_vcodec_disable_mixer (const PMIC_AUDIO_HANDLE handle)
 Disable the Voice CODEC mixer.
PMIC_STATUS pmic_audio_vcodec_enable_mixer (const PMIC_AUDIO_HANDLE handle, const PMIC_AUDIO_VCODEC_TIMESLOT rxSecondaryTimeslot, const PMIC_AUDIO_VCODEC_MIX_IN_GAIN gainIn, const PMIC_AUDIO_VCODEC_MIX_OUT_GAIN gainOut)
 Configure and enable the Voice CODEC mixer.

Variables

static const PMIC_AUDIO_HANDLE AUDIO_HANDLE_NULL = (PMIC_AUDIO_HANDLE) NULL
static
PMIC_AUDIO_AUDIO_OUTPUT_STATE 
audioOutput
 This variable maintains the current state of the Audio Output Section.
static const unsigned long delay_1ms = (HZ / 1000)
static PMIC_AUDIO_EVENT_STATE event_state
static
PMIC_AUDIO_EXT_STEREO_IN_STATE 
extStereoIn
 This maintains the current state of the External Stereo Input.
static HEADSET_STATUS headsetState = NO_HEADSET
static spinlock_t lock = SPIN_LOCK_UNLOCKED
 This spinlock is used to provide mutual exclusion.
const unsigned MAX_STDAC_SAMPLING_RATE_HZ = 96000
const unsigned MIN_STDAC_SAMPLING_RATE_HZ = 8000
static const unsigned int REG_FULLMASK = 0xffffff
static const unsigned int REG_SSI_STDAC_MASK = 0xfff000
static const unsigned int REG_SSI_VCODEC_MASK = 0x000fff
static const REGISTER_AUD_CODEC regAUD_CODEC
 This variable is used to access the AUD_CODEC hardware register.
static const REGISTER_AUDIO_RX_0 regAUDIO_RX_0
 This variable is used to access the AUDIO_RX_0 hardware register.
static const REGISTER_AUDIO_RX_1 regAUDIO_RX_1
 This variable is used to access the AUDIO_RX_1 hardware register.
static const REGISTER_AUDIO_TX regAUDIO_TX
 This variable is used to access the AUDIO_TX hardware register.
static const REGISTER_SSI_NETWORK regSSI_NETWORK
 This variable is used to access the SSI_NETWORK hardware register.
static const REGISTER_ST_DAC regST_DAC
 This variable is used to access the ST_DAC hardware register.
static const unsigned int RESET_AUD_CODEC = 0x180027
static const unsigned int RESET_AUDIO_RX_0 = 0x001000
static const unsigned int RESET_AUDIO_RX_1 = 0x00D35A
static const unsigned int RESET_AUDIO_TX = 0x420000
static const unsigned int RESET_SSI_NETWORK = 0x013060
static const unsigned int RESET_ST_DAC = 0x0E0004
static PMIC_AUDIO_STDAC_STATE stDAC
 This variable maintains the current state of the Stereo DAC.
static PMIC_AUDIO_VCODEC_STATE vCodec
 This variable maintains the current state of the Voice CODEC.


Generated by  Doxygen 1.6.0   Back to index