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

PMIC_STATUS pmic_audio_output_disable_mixer ( const PMIC_AUDIO_HANDLE  handle  ) 

Disable the output mixer.

This function disables the output mixer for the audio stream that corresponds to the current handle (i.e., the Voice CODEC, Stereo DAC, or the external stereo inputs).

Parameters:
handle Device handle from pmic_audio_open() call.
Return values:
PMIC_SUCCESS If the mixer was successfully disabled.
PMIC_PARAMETER_ERROR If the handle was invalid.
PMIC_ERROR If the mixer could not be disabled.

Definition at line 4806 of file pmic_audio.c.

References 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, PMIC_AUDIO_STDAC_STATE::handleState, pmic_write_reg(), SET_BITS, VCODEC_DIRECT_OUT, and PMIC_AUDIO_AUDIO_OUTPUT_STATE::vCodecOut.

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

      unsigned int reg_mask_mix = 0;
      unsigned int reg_write_mix = 0;

      /* No critical section required here since we are not updating any
       * global data.
       */
      if (((handle == stDAC.handle) && (stDAC.handleState == HANDLE_IN_USE))) {
            /*reg_mask = SET_BITS(regAUDIO_RX_1, PGASTEN, 1);
               reg_write = SET_BITS(regAUDIO_RX_1, PGASTEN, 0); */

            reg_mask_mix = SET_BITS(regAUDIO_RX_0, ADDSTDC, 1);
            reg_write_mix = SET_BITS(regAUDIO_RX_0, ADDSTDC, 0);
      } else if ((handle == vCodec.handle) &&
               (vCodec.handleState == HANDLE_IN_USE)) {
            reg_mask = SET_BITS(regAUDIO_RX_1, PGARXEN, 1);
            reg_write = SET_BITS(regAUDIO_RX_1, PGARXEN, 0);
            audioOutput.vCodecOut = VCODEC_DIRECT_OUT;

            reg_mask_mix = SET_BITS(regAUDIO_RX_0, ADDCDC, 1);
            reg_write_mix = SET_BITS(regAUDIO_RX_0, ADDCDC, 0);
      } else if ((handle == extStereoIn.handle) &&
               (extStereoIn.handleState == HANDLE_IN_USE)) {
            /*reg_mask = SET_BITS(regAUDIO_RX_1, ARXINEN, 1);
               reg_write = SET_BITS(regAUDIO_RX_1, ARXINEN, 0); */

            reg_mask_mix = SET_BITS(regAUDIO_RX_0, ADDRXIN, 1);
            reg_write_mix = SET_BITS(regAUDIO_RX_0, ADDRXIN, 1);
      }

      if (reg_mask == 0) {

      } else {
            rc = pmic_write_reg(REG_AUDIO_RX_1, reg_write, reg_mask);

            if (rc == PMIC_SUCCESS) {

                  rc = pmic_write_reg(REG_AUDIO_RX_0,
                                  reg_write_mix, reg_mask_mix);
                  if (rc == PMIC_SUCCESS) {
                        pr_debug("Output PGA mixers disabled\n");
                  }
            }
      }
      return rc;
}


Generated by  Doxygen 1.6.0   Back to index