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

PMIC_STATUS pmic_audio_vcodec_disable_micbias ( const PMIC_AUDIO_HANDLE  handle,
const PMIC_AUDIO_MIC_BIAS  biasCircuit 
)

Disable a microphone bias circuit.

This function disables one of the available microphone bias circuits.

Parameters:
handle Device handle from pmic_audio_open() call.
biasCircuit The microphone bias circuit to be disabled.
Return values:
PMIC_SUCCESS If the microphone bias circuit was successfully disabled.
PMIC_PARAMETER_ERROR If the handle or selected microphone bias circuit was invalid.
PMIC_ERROR If the microphone bias circuit could not be disabled.

Definition at line 3861 of file pmic_audio.c.

References PMIC_AUDIO_VCODEC_STATE::handle, HANDLE_IN_USE, PMIC_AUDIO_VCODEC_STATE::handleState, pmic_write_reg(), and SET_BITS.

Referenced by set_mixer_input_device().

{
      PMIC_STATUS rc = PMIC_PARAMETER_ERROR;
      unsigned int reg_write = 0;
      unsigned int reg_mask = 0;

      /* No critical section required here since we are not updating any
       * global data.
       */

      if ((handle == vCodec.handle) && (vCodec.handleState == HANDLE_IN_USE)) {
            if (biasCircuit & MIC_BIAS1) {
                  reg_mask = SET_BITS(regAUDIO_TX, MC1BEN, 1);
            }

            if (biasCircuit & MIC_BIAS2) {
                  reg_mask |= SET_BITS(regAUDIO_TX, MC2BEN, 1);
            }

            if (reg_mask != 0) {
                  rc = pmic_write_reg(REG_AUDIO_TX, reg_write, reg_mask);
            }
      }

      return rc;
}


Generated by  Doxygen 1.6.0   Back to index