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

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.

This function returns the current state (on/off) of the microphone input channels.

Parameters:
handle Device handle from pmic_audio_open() call.
leftChannel The current left microphone input channel state.
rightChannel the current right microphone input channel state.
Return values:
PMIC_SUCCESS If the microphone input channel states were successfully retrieved.
PMIC_PARAMETER_ERROR If the handle was invalid.
PMIC_ERROR If the microphone input channel states could not be retrieved.

Definition at line 3581 of file pmic_audio.c.

References PMIC_AUDIO_VCODEC_STATE::handle, HANDLE_IN_USE, PMIC_AUDIO_VCODEC_STATE::handleState, PMIC_AUDIO_VCODEC_STATE::leftChannelMic, PMIC_MICROPHONE_STATE::micOnOff, and PMIC_AUDIO_VCODEC_STATE::rightChannelMic.

{
      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 == vCodec.handle) &&
          (vCodec.handleState == HANDLE_IN_USE) &&
          (leftChannel != (PMIC_AUDIO_INPUT_MIC_STATE *) NULL) &&
          (rightChannel != (PMIC_AUDIO_INPUT_MIC_STATE *) NULL)) {
            *leftChannel = vCodec.leftChannelMic.micOnOff;
            *rightChannel = vCodec.rightChannelMic.micOnOff;

            rc = PMIC_SUCCESS;
      }

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

      return rc;
}


Generated by  Doxygen 1.6.0   Back to index