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

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.

This function retrieves the current output balance amplifier gain levels.

Parameters:
handle Device handle from pmic_audio_open() call.
leftGain The current left channel gain level.
rightGain The current right channel gain level.
Return values:
PMIC_SUCCESS If the output balance amplifier gain levels were successfully retrieved.
PMIC_PARAMETER_ERROR If the handle was invalid.
PMIC_ERROR If the output balance amplifier gain levels could be retrieved.

Definition at line 4979 of file pmic_audio.c.

References PMIC_AUDIO_AUDIO_OUTPUT_STATE::balanceLeftGain, PMIC_AUDIO_AUDIO_OUTPUT_STATE::balanceRightGain, PMIC_AUDIO_EXT_STEREO_IN_STATE::handle, PMIC_AUDIO_VCODEC_STATE::handle, PMIC_AUDIO_STDAC_STATE::handle, HANDLE_IN_USE, PMIC_AUDIO_EXT_STEREO_IN_STATE::handleState, PMIC_AUDIO_VCODEC_STATE::handleState, and PMIC_AUDIO_STDAC_STATE::handleState.

{
      PMIC_STATUS rc = PMIC_PARAMETER_ERROR;

      /* Use a critical section to ensure a consistent hardware state. */
      if (down_interruptible(&mutex))
            return PMIC_SYSTEM_ERROR_EINTR;

      if ((((handle == stDAC.handle) &&
            (stDAC.handleState == HANDLE_IN_USE)) ||
           ((handle == vCodec.handle) &&
            (vCodec.handleState == HANDLE_IN_USE)) ||
           ((handle == extStereoIn.handle) &&
            (extStereoIn.handleState == HANDLE_IN_USE))) &&
          ((leftGain != (PMIC_AUDIO_OUTPUT_BALANCE_GAIN *) NULL) &&
           (rightGain != (PMIC_AUDIO_OUTPUT_BALANCE_GAIN *) NULL))) {
            *leftGain = audioOutput.balanceLeftGain;
            *rightGain = audioOutput.balanceRightGain;

            rc = PMIC_SUCCESS;
      }

      /* Exit the critical section. */
      up(&mutex);

      return rc;
}


Generated by  Doxygen 1.6.0   Back to index