예제 #1
0
//tas5707 DRC for channel L/R
static int tas5707_set_drc1(struct snd_soc_codec *codec)
{
	int i = 0, j = 0;
	u8 *p = NULL;
	struct tas57xx_platform_data *pdata = dev_get_platdata(codec->dev);

	//using user BSP defined drc1 config;
	if(pdata && pdata->custom_drc1_table && pdata->custom_drc1_table_len == 24){
		p = pdata->custom_drc1_table;
		CODEC_DEBUG("tas5707_set_drc1::using BSP defined drc1 config\n");
		for(i = 0;i < 3;i++){
			for(j = 0;j < 8;j++)
				TAS5707_drc1_table[i][j] = p[i*8 + j];

			snd_soc_bulk_write_raw(codec, DDX_DRC1_AE+i, TAS5707_drc1_table[i], 8);
		}
	}else{
		return -1;
	}

	if(pdata && pdata->custom_drc1_tko_table && pdata->custom_drc1_tko_table_len == 12){
		p = pdata->custom_drc1_tko_table;
		CODEC_DEBUG("tas5707_set_drc1::using BSP defined drc1 TKO config\n");
		for(i = 0;i < 3;i++){
			for(j = 0;j < 4;j++)
				tas5707_drc1_tko_table[i][j]= p[i*4 + j];

			snd_soc_bulk_write_raw(codec, DDX_DRC1_T+i, tas5707_drc1_tko_table[i], 4);
		}
	}else{
		return -1;
	}
	return 0;
}
//}}}
//{{{  FillOutDecodeCommand
////////////////////////////////////////////////////////////////////////////
///
/// Populate the AUDIO_DECODER's MME_TRANSFORM parameters for PCM audio.
///
CodecStatus_t   Codec_MmeAudioPcm_c::FillOutDecodeCommand(       void )
{
    PcmAudioCodecDecodeContext_t    *Context                            = (PcmAudioCodecDecodeContext_t *)DecodeContext;

    CODEC_DEBUG ("%s: Initializing decode params\n", __FUNCTION__);

    // Initialize the frame parameters
    memset (&Context->DecodeParameters, 0, sizeof(Context->DecodeParameters));
    Context->DecodeParameters.Restart           = RestartTransformer;

    RestartTransformer                          = ACC_MME_FALSE;

    // Zero the reply structure
    memset( &Context->DecodeStatus, 0, sizeof(Context->DecodeStatus) );

    // Fillout the actual command
    Context->BaseContext.MMECommand.CmdStatus.AdditionalInfoSize        = sizeof(Context->DecodeStatus);
    Context->BaseContext.MMECommand.CmdStatus.AdditionalInfo_p          = (MME_GenericParams_t)(&Context->DecodeStatus);
    Context->BaseContext.MMECommand.ParamSize                           = sizeof(Context->DecodeParameters);
    Context->BaseContext.MMECommand.Param_p                             = (MME_GenericParams_t)(&Context->DecodeParameters);

    CODEC_DEBUG("Restart                    %d\n", Context->DecodeParameters.Restart);
    CODEC_DEBUG("AdditionalInfoSize         %d\n", Context->BaseContext.MMECommand.CmdStatus.AdditionalInfoSize);

    return CodecNoError;
}
예제 #3
0
////////////////////////////////////////////////////////////////////////////
///
/// Validate the PCM processing extended status structures and squawk loudly if problems are found.
///
CodecStatus_t Codec_MmeAudio_c::ValidatePcmProcessingExtendedStatus(
	CodecBaseDecodeContext_t *Context,
	MME_PcmProcessingFrameExtStatus_t *PcmStatus)
{
	ParsedAudioParameters_t* AudioParameters;
	//
	// provide default values for parameters that may be influenced by the extended status
	//
	AudioParameters = BufferState[Context->BufferIndex].ParsedAudioParameters;
	AudioParameters->MixingMetadata.IsMixingMetadataPresent = false;
	//
	// Get ready to process the status messages (and perform a little bounds checking
	//
	int BytesLeft = PcmStatus->BytesUsed;
	MME_PcmProcessingStatusTemplate_t *SpecificStatus = &(PcmStatus->PcmStatus);
	if (BytesLeft > (int)(sizeof(MME_PcmProcessingFrameExtStatus_Concrete_t) - sizeof(PcmStatus->BytesUsed)))
	{
		CODEC_ERROR("BytesLeft is too large - BytesLeft %d\n", BytesLeft);
		return CodecError;
	}
	//
	// Iterate through the status messages processing each one
	//
	while (BytesLeft > 0)
	{
		// check for sanity
		if (SpecificStatus->StructSize < 8 ||
				SpecificStatus->StructSize > (unsigned) BytesLeft)
		{
			CODEC_ERROR("PCM extended status is too %s - Id %x  StructSize %d",
						(SpecificStatus->StructSize < 8 ? "small" : "large"),
						SpecificStatus->Id, SpecificStatus->StructSize);
			return CodecError;
		}
		// handle the status report
		switch (SpecificStatus->Id)
		{
			case ACC_PCMPROCESS_MAIN_MT << 8:
				CODEC_DEBUG("Found [Output 0 (MAIN)]\n");
				// do nothing with it
				break;
			case ACC_MIX_METADATA_ID:
				CODEC_DEBUG("Found ACC_MIX_METADATA_ID - Id %x  StructSize %d\n",
							SpecificStatus->Id, SpecificStatus->StructSize);
				HandleMixingMetadata(Context, SpecificStatus);
				break;
			default:
				CODEC_TRACE("Ignoring unexpected PCM extended status - Id %x  StructSize %d\n",
							SpecificStatus->Id, SpecificStatus->StructSize);
				// just ignore it... don't propagate the error
		}
		// move to the next status field. we checked for sanity above so we shouldn't need any bounds checks.
		BytesLeft -= SpecificStatus->StructSize;
		SpecificStatus = (MME_PcmProcessingStatusTemplate_t *)
						 (((char *) SpecificStatus) + SpecificStatus->StructSize);
	}
	return CodecNoError;
}
//}}}
//{{{  ValidateDecodeContext
////////////////////////////////////////////////////////////////////////////
///
/// Validate the ACC status structure and squawk loudly if problems are found.
/// 
/// \return CodecSuccess
///
CodecStatus_t   Codec_MmeAudioPcm_c::ValidateDecodeContext( CodecBaseDecodeContext_t *Context )
{
    PcmAudioCodecDecodeContext_t*       DecodeContext   = (PcmAudioCodecDecodeContext_t*)Context;
    MME_LxAudioDecoderFrameStatus_t    &Status          = DecodeContext->DecodeStatus;
    ParsedAudioParameters_t*            AudioParameters;


    //CODEC_TRACE ("%s: DecStatus %d\n", __FUNCTION__, Status.DecStatus);

    if (ENABLE_CODEC_DEBUG)
    {
        //DumpCommand(bufferIndex);
    }

    if (Status.DecStatus != ACC_HXR_OK)
    {
        CODEC_ERROR("PCM audio decode error (muted frame): %d\n", Status.DecStatus);
        //DumpCommand(bufferIndex);
        // don't report an error to the higher levels (because the frame is muted)
    }

    // SYSFS
    AudioDecoderStatus                          = Status;

    //
    // Attach any codec derived metadata to the output buffer (or verify the
    // frame analysis if the frame analyser already filled everything in for
    // us).
    //

    AudioParameters                             = BufferState[DecodeContext->BaseContext.BufferIndex].ParsedAudioParameters;

    AudioParameters->Source.BitsPerSample       = AudioOutputSurface->BitsPerSample;
    AudioParameters->Source.ChannelCount        = AudioOutputSurface->ChannelCount;
    AudioParameters->Organisation               = Status.AudioMode;

    AudioParameters->SampleCount                = Status.NbOutSamples;

    int SamplingFreqCode                        = Status.SamplingFreq;
    if (SamplingFreqCode < ACC_FS_reserved)
    {
        AudioParameters->Source.SampleRateHz    = ACC_SamplingFreqLUT[SamplingFreqCode];
    }
    else
    {
        AudioParameters->Source.SampleRateHz    = 0;
        CODEC_ERROR("PCM audio decode bad sampling freq returned: 0x%x\n", SamplingFreqCode);
    }

    CODEC_DEBUG("AudioParameters->Source.BitsPerSample         %d\n", AudioParameters->Source.BitsPerSample);
    CODEC_DEBUG("AudioParameters->Source.ChannelCount          %d\n", AudioParameters->Source.ChannelCount);
    CODEC_DEBUG("AudioParameters->Organisation                 %d\n", AudioParameters->Organisation);
    CODEC_DEBUG("AudioParameters->SampleCount                  %d\n", AudioParameters->SampleCount);
    CODEC_DEBUG("AudioParameters->Source.SampleRateHz          %d\n", AudioParameters->Source.SampleRateHz);

    return CodecNoError;
}
예제 #5
0
int ISIL_VENC_MJPG_GetChCfg(CODEC_CHANNEL *pChan, VENC_MJPG_CFG* stpVencMjpgCfg)
{
    int fd = 0;

    if(pChan == NULL){
        #ifdef VENC_MJPG_DEBUG
        CODEC_DEBUG(" point is null ");
        #endif
        return CODEC_ERR_INVAL;
    }

    if(pChan->u32Ch >= ENC_MAXCH)
    {
        #ifdef VENC_MJPG_DEBUG
        CODEC_DEBUG("input chann: %d > MaxCh: %d", pChan->u32Ch, ENC_MAXCH);
        #endif
        return CODEC_ERR_INVAL;
    }
	
    if(stpVencMjpgCfg == NULL)
    {
       #ifdef VENC_MJPG_DEBUG
       CODEC_DEBUG(" input parament is NULL");
       #endif
       return CODEC_ERR_INVAL;
    } 

    if(!VENC_MJPG_TABLE[pChan->u32ChipID][pChan->u32Ch].u8IsCreate)
    {
       #ifdef VENC_MJPG_DEBUG
       CODEC_DEBUG(" channel not create");
       #endif
       return CODEC_ERR_NOT_EXIST;
    } 

    //todo
    //ioctl,send cfg to driver, now unknown
    fd = VENC_MJPG_TABLE[pChan->u32ChipID][pChan->u32Ch].s32ChFd;
    if(ioctl(fd, ISIL_MJPEG_ENCODE_PARAM_GET, stpVencMjpgCfg) < 0) {
       #ifdef VENC_MJPG_DEBUG
       CODEC_DEBUG(" ioctl fail");
       perror("why: ");
       #endif
       return CODEC_ERR_FAIL;
    }

    fprintf(stderr, "mjpg level:%d,num:%d,str:%d,type:%d\n",
            stpVencMjpgCfg->e_image_level,
            stpVencMjpgCfg->i_capture_frame_number,
            stpVencMjpgCfg->i_capture_frame_stride,
            stpVencMjpgCfg->i_capture_type
            );

    return CODEC_ERR_OK;
}
예제 #6
0
static int tas5707_init(struct snd_soc_codec *codec)
{
	int ret = 0;
	unsigned char burst_data[][4]= {
		{0x00,0x01,0x77,0x72},
		{0x00,0x00,0x42,0x03},
		{0x01,0x02,0x13,0x45},
	};
	struct tas5707_priv *tas5707 = snd_soc_codec_get_drvdata(codec);

	CODEC_DEBUG("tas5707_init\n");
	snd_soc_write(codec, DDX_OSC_TRIM, 0x00);
	msleep(50);
	snd_soc_write(codec, DDX_CLOCK_CTL, 0x6c);//0x74 = 512fs; 0x6c = 256fs
	snd_soc_write(codec, DDX_SYS_CTL_1, 0xa0);
	snd_soc_write(codec, DDX_SERIAL_DATA_INTERFACE, 0x05);

/*	init_snd_soc_write(codec, DDX_IC_DELAY_CHANNEL_1, 0xac);
	init_snd_soc_write(codec, DDX_IC_DELAY_CHANNEL_2, 0x54);
	init_snd_soc_write(codec, DDX_IC_DELAY_CHANNEL_3, 0xac);
	init_snd_soc_write(codec, DDX_IC_DELAY_CHANNEL_4, 0x54);
*/
	snd_soc_write(codec, DDX_BKND_ERR, 0x02);

	snd_soc_bulk_write_raw(codec, DDX_INPUT_MUX, burst_data[0], 4);
	snd_soc_bulk_write_raw(codec, DDX_CH4_SOURCE_SELECT, burst_data[1], 4);
	snd_soc_bulk_write_raw(codec, DDX_PWM_MUX, burst_data[2], 4);

	//drc
	if((ret = tas5707_set_drc(codec)) < 0)
		CODEC_DEBUG("fail to set tas5707 drc\n");
	//eq
	if((ret = tas5707_set_eq(codec)) < 0)
		CODEC_DEBUG("fail to set tas5707 eq\n");
	//init
	if((ret = tas5707_customer_init(codec)) < 0)
		CODEC_DEBUG("fail to set tas5707 customer init\n");

	snd_soc_write(codec, DDX_VOLUME_CONFIG, 0xD1);
	snd_soc_write(codec, DDX_SYS_CTL_2, 0x84);
	snd_soc_write(codec, DDX_START_STOP_PERIOD, 0x95);
	snd_soc_write(codec, DDX_PWM_SHUTDOWN_GROUP, 0x30);
	snd_soc_write(codec, DDX_MODULATION_LIMIT, 0x02);
	//normal operation
	if((ret = tas5707_set_master_vol(codec)) < 0)
		CODEC_DEBUG("fail to set tas5707 master vol\n");

	snd_soc_write(codec, DDX_CHANNEL1_VOL, tas5707->Ch1_vol);
	snd_soc_write(codec, DDX_CHANNEL2_VOL, tas5707->Ch2_vol);
	snd_soc_write(codec, DDX_SOFT_MUTE, 0x00);

	return ret;
}
예제 #7
0
////////////////////////////////////////////////////////////////////////////
///
/// Validate the ACC status structure and squawk loudly if problems are found.
///
/// Dispite the squawking this method unconditionally returns success. This is
/// because the firmware will already have concealed the decode problems by
/// performing a soft mute.
///
/// \return CodecSuccess
///
CodecStatus_t Codec_MmeAudioAvs_c::ValidateDecodeContext(CodecBaseDecodeContext_t *Context)
{
	AvsAudioCodecDecodeContext_t *DecodeContext = (AvsAudioCodecDecodeContext_t *) Context;
	MME_LxAudioDecoderFrameStatus_t &Status = DecodeContext->DecodeStatus;
	ParsedAudioParameters_t *AudioParameters;
	CODEC_DEBUG(">><<\n");
	if (ENABLE_CODEC_DEBUG)
	{
		//DumpCommand(bufferIndex);
	}
	if (Status.DecStatus != ACC_AVS2_OK && Status.DecStatus != ACC_AVS_MC_CRC_ERROR)
	{
		CODEC_ERROR("AVS audio decode error (muted frame): %d\n", Status.DecStatus);
		//DumpCommand(bufferIndex);
		// don't report an error to the higher levels (because the frame is muted)
	}
	if (Status.NbOutSamples != 1152 && Status.NbOutSamples != 576) // TODO: manifest constant
	{
		// 288/144 aren't valid values (but testing showed that it was emited for some
		// of the AVS2 streams for example WrenTesting/AVS2_LIII/AVS2_LIII_80kbps_24khz_s.mp3)
		// so we continue to output a message if this is observed but only if diagnostics are
		// enabled.
		if (Status.NbOutSamples == 288 || Status.NbOutSamples == 144)
			CODEC_DEBUG("Unexpected number of output samples (%d)\n", Status.NbOutSamples);
		else
			CODEC_ERROR("Unexpected number of output samples (%d)\n", Status.NbOutSamples);
		//DumpCommand(bufferIndex);
	}
	// SYSFS
	AudioDecoderStatus = Status;
	//
	// Attach any codec derived metadata to the output buffer (or verify the
	// frame analysis if the frame analyser already filled everything in for
	// us).
	//
	AudioParameters = BufferState[DecodeContext->BaseContext.BufferIndex].ParsedAudioParameters;
	AudioParameters->Source.BitsPerSample = AudioOutputSurface->BitsPerSample;
	AudioParameters->Source.ChannelCount = AudioOutputSurface->ChannelCount;
	AudioParameters->Organisation = Status.AudioMode;
	AudioParameters->SampleCount = Status.NbOutSamples;
	int SamplingFreqCode = Status.SamplingFreq;
	if (SamplingFreqCode < ACC_FS_reserved)
	{
		AudioParameters->Source.SampleRateHz = ACC_SamplingFreqLUT[SamplingFreqCode];
	}
	else
	{
		AudioParameters->Source.SampleRateHz = 0;
		CODEC_ERROR("AVS audio decode bad sampling freq returned: 0x%x\n", SamplingFreqCode);
	}
	return CodecNoError;
}
예제 #8
0
/***********************************************************************************************
function: ISIL_VENC_MJPG_Enable
description:start mjpg encoding
paraments:
    input: unsigned char u8Ch : channel ID, form 0~(ENC_MAXCH-1)
    output:none
return:
    CODEC_ERR_OK : sucess 
    CODEC_ERR_NOT_EXIST : channel not create
    CODEC_ERR_EXIST: channel had enable
    CODEC_ERR_INVAL : input parament is invalid
*************************************************************************************************/
int ISIL_VENC_MJPG_Enable(CODEC_CHANNEL *pChan)//start encoding
{
    int fd = 0;

    printf("----enable mjpg------\n");

    if(pChan == NULL){
        #ifdef VENC_MJPG_DEBUG
        CODEC_DEBUG(" point is null ");
        #endif
        return CODEC_ERR_INVAL;
    }

    if(pChan->u32Ch >= ENC_MAXCH)
    {
        #ifdef VENC_MJPG_DEBUG
        CODEC_DEBUG("input chann: %d > MaxCh: %d", pChan->u32Ch, ENC_MAXCH);
        #endif
        return CODEC_ERR_INVAL;
    }

    if(!VENC_MJPG_TABLE[pChan->u32ChipID][pChan->u32Ch].u8IsCreate)
    {
       #ifdef VENC_MJPG_DEBUG
       CODEC_DEBUG(" channel %d not create", pChan->u32Ch);
       #endif
       return CODEC_ERR_NOT_EXIST;
    }

    if(VENC_MJPG_TABLE[pChan->u32ChipID][pChan->u32Ch].u8IsEnable)
    {
       #ifdef VENC_MJPG_DEBUG
       CODEC_DEBUG(" channel %d had enbale", pChan->u32Ch);
       #endif
       return CODEC_ERR_OK;
       //return CODEC_ERR_EXIST;
    }
    //todo
    //send command to driver
    fd = VENC_MJPG_TABLE[pChan->u32ChipID][pChan->u32Ch].s32ChFd;
    if(ioctl(fd, ISIL_LOGIC_CHAN_ENABLE_SET, NULL) < 0) {
        #ifdef VENC_MJPG_DEBUG
        CODEC_DEBUG("enable channel fail");
        #endif
        return CODEC_ERR_FAIL;
    }
    VENC_MJPG_TABLE[pChan->u32ChipID][pChan->u32Ch].u8IsEnable = 1;
    return CODEC_ERR_OK;
}
예제 #9
0
int ISIL_VENC_MJPG_StopCap(CODEC_CHANNEL *pEncChan, unsigned int u32Type)
{
    int s32Ret = 0;
	VENC_MJPG_CFG mjpg_cfg;

    if(pEncChan == NULL)
    {
      #ifdef VENC_MJPG_DEBUG
      CODEC_DEBUG(" point is null");
      #endif
      return CODEC_ERR_INVAL;
    }

	if(!VENC_MJPG_TABLE[pEncChan->u32ChipID][pEncChan->u32Ch].u8IsCreate)
    {
       #ifdef VENC_MJPG_DEBUG
       CODEC_DEBUG(" channel not create");
       #endif
       return CODEC_ERR_NOT_EXIST;
    } 

	memset(&mjpg_cfg, 0x00, sizeof(VENC_MJPG_CFG));

	s32Ret = ISIL_VENC_MJPG_GetChCfg(pEncChan, &mjpg_cfg);
	if(s32Ret < 0) {
	  #ifdef VENC_MJPG_DEBUG
      CODEC_DEBUG(" get mjpg cfg fail\n");
      #endif
      return CODEC_ERR_FAIL;
	}

	mjpg_cfg.i_capture_type |= u32Type;
	mjpg_cfg.change_mask_flag = ISIL_MJPEG_ENCODE_PARAM_ENABLE_CHANGE_CAPTURE_TYPE;

	s32Ret = ISIL_VENC_MJPG_SetChCfg(pEncChan, &mjpg_cfg);
	if(s32Ret < 0) {
	  #ifdef VENC_MJPG_DEBUG
      CODEC_DEBUG(" set mjpg cfg fail\n");
      #endif
      return CODEC_ERR_FAIL;
	}
	
	if(VENC_MJPG_TABLE[pEncChan->u32ChipID][pEncChan->u32Ch].u8IsEnable){
		s32Ret = ISIL_VENC_MJPG_Disable(pEncChan);
	}

    return s32Ret;
}
예제 #10
0
static int tas5707_set_eq_biquad(struct snd_soc_codec *codec)
{
	int i = 0, j = 0, k = 0;
	u8 *p = NULL;
	u8 addr;
	u8 tas5707_bq_table[20];
	struct tas5707_priv *tas5707 = snd_soc_codec_get_drvdata(codec);
	struct tas57xx_platform_data *pdata = tas5707->pdata;
	struct tas57xx_eq_cfg *cfg;

	if(!pdata)
		return 0;

	if(!(cfg = pdata->eq_cfgs))
		return 0;

	CODEC_DEBUG("tas5707_set_eq_biquad::using BSP defined EQ biquad config::%s\n",
										cfg[tas5707->eq_cfg].name);
	p = cfg[tas5707->eq_cfg].regs;

	for(i = 0;i < 2;i++){
		for(j = 0;j < 7;j++){
			addr = (DDX_CH1_BQ_0 + i*7 + j);
			for(k = 0;k < 20;k++){
				tas5707_bq_table[k]= p[i*7*20 + j*20 + k];
				printk(KERN_DEBUG "[%d]=%#x\n",k,tas5707_bq_table[k]);
			}
			printk(KERN_DEBUG "\n");
			snd_soc_bulk_write_raw(codec, addr, tas5707_bq_table, 20);
		}
	}
	return 0;
}
예제 #11
0
static int tas5707_set_dai_fmt(struct snd_soc_dai *codec_dai,
				  unsigned int fmt)
{
	//struct snd_soc_codec *codec = codec_dai->codec;
	CODEC_DEBUG("%s\n", __func__);

	switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
	case SND_SOC_DAIFMT_CBS_CFS:
		break;
	default:
		return -EINVAL;
	}

	switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
	case SND_SOC_DAIFMT_I2S:
	case SND_SOC_DAIFMT_RIGHT_J:
	case SND_SOC_DAIFMT_LEFT_J:
		break;
	default:
		return -EINVAL;
	}

	switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
	case SND_SOC_DAIFMT_NB_NF:
		break;
	case SND_SOC_DAIFMT_NB_IF:
		break;
	default:
		return -EINVAL;
	}

	return 0;
}
예제 #12
0
static int tas5707_hw_params(struct snd_pcm_substream *substream,
				struct snd_pcm_hw_params *params,
				struct snd_soc_dai *dai)
{
	//struct snd_soc_pcm_runtime *rtd = substream->private_data;
	//struct snd_soc_codec *codec = rtd->codec;
	unsigned int rate;
	CODEC_DEBUG("%s\n", __func__);

	rate = params_rate(params);
	pr_debug("rate: %u\n", rate);

	switch (params_format(params)) {
	case SNDRV_PCM_FORMAT_S24_LE:
	case SNDRV_PCM_FORMAT_S24_BE:
		pr_debug("24bit\n");
		/* fall through */
	case SNDRV_PCM_FORMAT_S32_LE:
	case SNDRV_PCM_FORMAT_S20_3LE:
	case SNDRV_PCM_FORMAT_S20_3BE:
		pr_debug("20bit\n");

		break;
	case SNDRV_PCM_FORMAT_S16_LE:
	case SNDRV_PCM_FORMAT_S16_BE:
		pr_debug("16bit\n");

		break;
	default:
		return -EINVAL;
	}
	return 0;
}
예제 #13
0
static int tas5707_set_master_vol(struct snd_soc_codec *codec)
{
	struct tas57xx_platform_data *pdata = dev_get_platdata(codec->dev);

	//using user BSP defined master vol config;
	if(pdata && pdata->custom_master_vol){
		CODEC_DEBUG("tas5707_set_master_vol::%d\n", pdata->custom_master_vol);
		snd_soc_write(codec, DDX_MASTER_VOLUME, (0xff - pdata->custom_master_vol));
	}
	else{
		CODEC_DEBUG("get dtd master_vol failed:using default setting\n");
		snd_soc_write(codec, DDX_MASTER_VOLUME, 0x30);
	}

	return 0;
}
예제 #14
0
/***********************************************************************************************
function: ISIL_VENC_MJPG_SetChCfg
description:set mjpg encoding config
paraments:
    input: unsigned char u8Ch : channel ID, form 0~(ENC_MAXCH-1)
           VENC_MJPEG_CFG* stpVencMjpgCfg:point to cfg data
    output:none
return:
    CODEC_ERR_OK : sucess 
    CODEC_ERR_INVAL: input parament is invalid
    CODEC_ERR_NOT_EXIST: channel not create
*************************************************************************************************/
int ISIL_VENC_MJPG_SetChCfg(CODEC_CHANNEL *pChan, VENC_MJPG_CFG* stpVencMjpgCfg)
{
    int fd = 0;
    if(pChan == NULL){
        #ifdef VENC_MJPG_DEBUG
        CODEC_DEBUG(" point is null ");
        #endif
        return CODEC_ERR_INVAL;
    }

    if(pChan->u32Ch >= ENC_MAXCH)
    {
        #ifdef VENC_MJPG_DEBUG
        CODEC_DEBUG("input chann: %d > MaxCh: %d", pChan->u32Ch, ENC_MAXCH);
        #endif
        return CODEC_ERR_INVAL;
    }

    if(stpVencMjpgCfg == NULL)
    {
       #ifdef VENC_MJPG_DEBUG
       CODEC_DEBUG(" input parament is NULL");
       #endif
       return CODEC_ERR_INVAL;
    } 

    if(!VENC_MJPG_TABLE[pChan->u32ChipID][pChan->u32Ch].u8IsCreate)
    {
       #ifdef VENC_MJPG_DEBUG
       CODEC_DEBUG(" channel not create");
       #endif
       return CODEC_ERR_NOT_EXIST;
    } 

    //todo
    //ioctl,send cfg to driver, now unknown

    fd = VENC_MJPG_TABLE[pChan->u32ChipID][pChan->u32Ch].s32ChFd;
    if(ioctl(fd, ISIL_MJPEG_ENCODE_PARAM_SET, stpVencMjpgCfg) < 0) {
       #ifdef VENC_MJPG_DEBUG
       CODEC_DEBUG(" ioctl fail");
       perror("why: ");
       #endif
       return CODEC_ERR_FAIL;
    }
    return CODEC_ERR_OK;
}
예제 #15
0
CodecStatus_t Codec_MmeVideoFlv1_c::DumpDecodeParameters(void *Parameters)
{
	FLV1_TransformParam_t *FrameParams;
	FrameParams = (FLV1_TransformParam_t *)Parameters;
	Flv1StaticPicture++;
	CODEC_DEBUG("********** Picture %d *********\n", Flv1StaticPicture - 1);
	return CodecNoError;
}
예제 #16
0
/***********************************************************************************************
function: ISIL_VENC_MJPG_Disable
description:stop mjpg encoding
paraments:
    input: unsigned char u8Ch : channel ID, form 0~(ENC_MAXCH-1)
    output:none
return:
    CODEC_ERR_OK : sucess 
    CODEC_ERR_NOT_EXIST : channel not create
    CODEC_ERR_EXIST: channel had disable
    CODEC_ERR_INVAL : input parament is invalid
*************************************************************************************************/
int ISIL_VENC_MJPG_Disable(CODEC_CHANNEL *pChan)
{
    int fd = 0;
    if(pChan == NULL){
        #ifdef VENC_MJPG_DEBUG
        CODEC_DEBUG(" point is null ");
        #endif
        return CODEC_ERR_INVAL;
    }

    if(pChan->u32Ch >= ENC_MAXCH)
    {
        #ifdef VENC_MJPG_DEBUG
        CODEC_DEBUG("input chann: %d > MaxCh: %d", pChan->u32Ch, ENC_MAXCH);
        #endif
        return CODEC_ERR_INVAL;
    }

    if(!VENC_MJPG_TABLE[pChan->u32ChipID][pChan->u32Ch].u8IsCreate)
    {
       #ifdef VENC_MJPG_DEBUG
       CODEC_DEBUG(" channel %d not create", pChan->u32Ch);
       #endif
       return CODEC_ERR_NOT_EXIST;
    }

    if(!VENC_MJPG_TABLE[pChan->u32ChipID][pChan->u32Ch].u8IsEnable)
    {
       #ifdef VENC_MJPG_DEBUG
       CODEC_DEBUG(" channel %d had release", pChan->u32Ch);
       #endif
       return CODEC_ERR_EXIST;
    }
    //todo
    //send command to driver
    fd = VENC_MJPG_TABLE[pChan->u32ChipID][pChan->u32Ch].s32ChFd;
    if(ioctl(fd, ISIL_LOGIC_CHAN_DISABLE_SET, NULL) < 0) {
        #ifdef VENC_MJPG_DEBUG
        CODEC_DEBUG("disable channel fail");
        #endif
        return CODEC_ERR_FAIL;
    }
    VENC_MJPG_TABLE[pChan->u32ChipID][pChan->u32Ch].u8IsEnable = 0;
    return CODEC_ERR_OK;
}
예제 #17
0
////////////////////////////////////////////////////////////////////////////
///
/// Examine the capability structure returned by the firmware.
///
/// In addition to some diagnostic output and some trivial error checking the
/// primary purpose of this function is to ensure that the firmware is capable
/// of performing the requested decode.
///
CodecStatus_t   Codec_MmeAudio_c::HandleCapabilities(void)
{
	// Locally rename the VeryLongMemberNamesUsedInTheSuperClass
	MME_LxAudioDecoderInfo_t &Capability = AudioDecoderTransformCapability;
	MME_LxAudioDecoderInfo_t &Mask = AudioDecoderTransformCapabilityMask;
	// Check for version skew
	if (Capability.StructSize != sizeof(MME_LxAudioDecoderInfo_t))
	{
		CODEC_ERROR("%s reports different sizeof MME_LxAudioDecoderInfo_t (version skew?)\n",
					Configuration.TransformName[SelectedTransformer]);
		return CodecError;
	}
	// Dump the transformer capability structure
	CODEC_DEBUG("Transformer Capability: %s\n", Configuration.TransformName[SelectedTransformer]);
	CODEC_DEBUG("\tDecoderCapabilityFlags = %x (requires %x)\n",
				Capability.DecoderCapabilityFlags, Mask.DecoderCapabilityFlags);
	CODEC_DEBUG("\tDecoderCapabilityExtFlags[0..1] = %x %x\n",
				Capability.DecoderCapabilityExtFlags[0],
				Capability.DecoderCapabilityExtFlags[1]);
	CODEC_DEBUG("\tPcmProcessorCapabilityFlags[0..1] = %x %x\n",
				Capability.PcmProcessorCapabilityFlags[0],
				Capability.PcmProcessorCapabilityFlags[1]);
	// Confirm that the transformer is sufficiently capable to support the required decoder
	if ((Mask.DecoderCapabilityFlags         !=
			(Mask.DecoderCapabilityFlags         & Capability.DecoderCapabilityFlags)) ||
			(Mask.DecoderCapabilityExtFlags[0]   !=
			 (Mask.DecoderCapabilityExtFlags[0]   & Capability.DecoderCapabilityExtFlags[0])) ||
			(Mask.DecoderCapabilityExtFlags[1]   !=
			 (Mask.DecoderCapabilityExtFlags[1]   & Capability.DecoderCapabilityExtFlags[1])) ||
			(Mask.PcmProcessorCapabilityFlags[0] !=
			 (Mask.PcmProcessorCapabilityFlags[0]   & Capability.PcmProcessorCapabilityFlags[0])) ||
			(Mask.PcmProcessorCapabilityFlags[1] !=
			 (Mask.PcmProcessorCapabilityFlags[1]   & Capability.PcmProcessorCapabilityFlags[1])))
	{
		CODEC_ERROR("%s is not capable of decoding %s\n",
					Configuration.TransformName[SelectedTransformer], Configuration.CodecName);
#ifdef __TDT__
		if (useoldaudiofw == 1)
			return CodecNoError;
#endif
		return CodecError;
	}
	return CodecNoError;
}
예제 #18
0
static int tas5707_remove(struct snd_soc_codec *codec)
{
	CODEC_DEBUG("%s \n", __func__);

#ifdef CONFIG_HAS_EARLYSUSPEND
    unregister_early_suspend(&early_suspend);
#endif

	return 0;
}
예제 #19
0
//}}}
//{{{  FillOutTransformerInitializationParameters
// /////////////////////////////////////////////////////////////////////////
//
//      Function to deal with the returned capabilities
//      structure for an Rmv mme transformer.
//
CodecStatus_t   Codec_MmeVideoRmv_c::FillOutTransformerInitializationParameters(void)
{
	unsigned int        i;
	// Fill out the actual command
	MMEInitializationParameters.TransformerInitParamsSize      = sizeof(RV89Dec_InitTransformerParam_t);
	MMEInitializationParameters.TransformerInitParams_p        = (MME_GenericParams_t)(&InitializationParameters);
	CODEC_TRACE("FillOutTransformerInitializationParameters\n");
	CODEC_TRACE("  MaxWidth              %6u\n", InitializationParameters.MaxWidth);
	CODEC_TRACE("  MaxHeight             %6u\n", InitializationParameters.MaxHeight);
	CODEC_TRACE("  FormatId              %6u\n", InitializationParameters.StreamFormatIdentifier);
	CODEC_TRACE("  isRV8                 %6u\n", InitializationParameters.isRV8);
	CODEC_TRACE("  NumRPRSizes           %6u\n", InitializationParameters.NumRPRSizes);
	for (i = 0; i < (InitializationParameters.NumRPRSizes * 2); i += 2)
	{
		CODEC_DEBUG("  RPRSize[%d]           %6u\n", i, InitializationParameters.RPRSize[i]);
		CODEC_DEBUG("  RPRSize[%d]           %6u\n", i + 1, InitializationParameters.RPRSize[i + 1]);
	}
	return CodecNoError;
}
////////////////////////////////////////////////////////////////////////////
///
/// Validate the ACC status structure and squawk loudly if problems are found.
/// 
/// Dispite the squawking this method unconditionally returns success. This is
/// because the firmware will already have concealed the decode problems by
/// performing a soft mute.
///
/// \return CodecSuccess
///
CodecStatus_t   Codec_MmeAudioLpcm_c::ValidateDecodeContext( CodecBaseDecodeContext_t *Context )
{
LpcmAudioCodecDecodeContext_t *DecodeContext = (LpcmAudioCodecDecodeContext_t *) Context;
MME_LxAudioDecoderFrameStatus_t &Status = DecodeContext->DecodeStatus;
ParsedAudioParameters_t *AudioParameters;


    CODEC_DEBUG(">><<\n");

    if (ENABLE_CODEC_DEBUG) 
      {
	//DumpCommand(bufferIndex);
      }

    if (Status.DecStatus) 
      {
	CODEC_ERROR("LPCM audio decode error (muted frame): %d\n", Status.DecStatus);
	//DumpCommand(bufferIndex);
	// don't report an error to the higher levels (because the frame is muted)
      }

    // SYSFS
    AudioDecoderStatus = Status;

    //
    // Attach any codec derived metadata to the output buffer (or verify the
    // frame analysis if the frame analyser already filled everything in for
    // us).
    //

    AudioParameters = BufferState[DecodeContext->BaseContext.BufferIndex].ParsedAudioParameters;

    // TODO: these values should be extracted from the codec's reply
    AudioParameters->Source.BitsPerSample = /* AudioOutputSurface->BitsPerSample;*/ ((AUDIODEC_GET_OUTPUT_WS((&AudioDecoderInitializationParameters))== ACC_WS32)?32:16);
    AudioParameters->Source.ChannelCount =  AudioOutputSurface->ChannelCount;/*Codec_MmeAudio_c::GetNumberOfChannelsFromAudioConfiguration((enum eAccAcMode) Status.AudioMode);*/
    AudioParameters->Organisation = Status.AudioMode;

    // lpcm can be resampled directly in the codec to avoid having them resampled by the mixer
    // so get the sampling frequency from the codec
    AudioParameters->SampleCount = Status.NbOutSamples;

    enum eAccFsCode SamplingFreqCode = (enum eAccFsCode) Status.SamplingFreq;
    if (SamplingFreqCode < ACC_FS_reserved)
      {
	AudioParameters->Source.SampleRateHz = Codec_MmeAudio_c::ConvertCodecSamplingFreq(SamplingFreqCode);
      }
    else
      {
	AudioParameters->Source.SampleRateHz = 0;
        CODEC_ERROR("LPCM audio decode bad sampling freq returned: 0x%x\n", SamplingFreqCode);
      }

    return CodecNoError;
}
static void MMECallbackStub(    MME_Event_t      Event,
                                MME_Command_t   *CallbackData,
                                void            *UserData )
{
Codec_MmeBase_c         *Self = (Codec_MmeBase_c *)UserData;

    CODEC_DEBUG("%s\n",__FUNCTION__);

    Self->CallbackFromMME( Event, CallbackData );
    return;
}
//}}}
//{{{  SendMMEStreamParameters
CodecStatus_t Codec_MmeVideoRmv_c::SendMMEStreamParameters (void)
{
    CodecStatus_t       CodecStatus     = CodecNoError;
    unsigned int        MMEStatus       = MME_SUCCESS;


    // There are no set stream parameters for Rmv decoder so the transformer is
    // terminated and restarted when required (i.e. if width or height change).

    if (RestartTransformer)
    {
        TerminateMMETransformer();

        memset (&MMEInitializationParameters, 0x00, sizeof(MME_TransformerInitParams_t));

        MMEInitializationParameters.Priority                    = MME_PRIORITY_NORMAL;
        MMEInitializationParameters.StructSize                  = sizeof(MME_TransformerInitParams_t);
        MMEInitializationParameters.Callback                    = &MMECallbackStub;
        MMEInitializationParameters.CallbackUserData            = this;

        FillOutTransformerInitializationParameters ();

        MMEStatus               = MME_InitTransformer (Configuration.TransformName[SelectedTransformer],
                                                       &MMEInitializationParameters, &MMEHandle);

        if (MMEStatus ==  MME_SUCCESS)
        {
            CODEC_DEBUG ("New Stream Params %dx%d\n", InitializationParameters.MaxWidth, InitializationParameters.MaxHeight);
            CodecStatus                                         = CodecNoError;
            RestartTransformer                                  = false;
            ParsedFrameParameters->NewStreamParameters          = false;

            MMEInitialized                                      = true;
        }
    }

    //
    // The base class has very helpfully acquired a stream 
    // parameters context for us which we must release.
    // But only if everything went well, otherwise the callers
    // will helpfully release it as well (Nick).
    //

    if (CodecStatus == CodecNoError)
        StreamParameterContextBuffer->DecrementReferenceCount ();

//

    return CodecStatus;


}
//}}}
//{{{  FillOutSetStreamParametersCommand
////////////////////////////////////////////////////////////////////////////
///
/// Populate the AUDIO_DECODER's MME_SET_GLOBAL_TRANSFORMER_PARAMS parameters for PCM audio.
///
CodecStatus_t   Codec_MmeAudioPcm_c::FillOutSetStreamParametersCommand( void )
{
    CodecStatus_t                               Status;
    PcmAudioCodecStreamParameterContext_t*      Context = (PcmAudioCodecStreamParameterContext_t *)StreamParameterContext;

    CODEC_TRACE("\n");
    // Fill out the structure
#if 0
    // There are no set stream parameters for Vp6 decoder so the transformer is
    // terminated and restarted when required (i.e. if width or height change).

    if (RestartTransformer)
    {
        TerminateMMETransformer();

        memset (&MMEInitializationParameters, 0x00, sizeof(MME_TransformerInitParams_t));

        MMEInitializationParameters.Priority                    = MME_PRIORITY_NORMAL;
        MMEInitializationParameters.StructSize                  = sizeof(MME_TransformerInitParams_t);
        MMEInitializationParameters.Callback                    = &MMECallbackStub;
        MMEInitializationParameters.CallbackUserData            = this;

        FillOutTransformerInitializationParameters ();

        MMEStatus               = MME_InitTransformer (Configuration.TransformName[SelectedTransformer],
                                                       &MMEInitializationParameters, &MMEHandle);

        if (MMEStatus ==  MME_SUCCESS)
        {
            CODEC_DEBUG ("New Stream Params %dx%d\n", DecodingWidth, DecodingHeight);
            CodecStatus                                         = CodecNoError;
            RestartTransformer                                  = eAccFalse;
            ParsedFrameParameters->NewStreamParameters          = false;

            MMEInitialized                                      = true;
        }
    }
#endif

    memset (&(Context->StreamParameters), 0, sizeof(Context->StreamParameters));
    Status              = FillOutTransformerGlobalParameters (&(Context->StreamParameters));
    if (Status != CodecNoError)
        return Status;

    // Fillout the actual command
    Context->BaseContext.MMECommand.CmdStatus.AdditionalInfoSize        = 0;
    Context->BaseContext.MMECommand.CmdStatus.AdditionalInfo_p          = NULL;
    Context->BaseContext.MMECommand.ParamSize                           = sizeof(Context->StreamParameters);
    Context->BaseContext.MMECommand.Param_p                             = (MME_GenericParams_t)(&Context->StreamParameters);

    return CodecNoError;
}
예제 #24
0
int ISIL_VENC_MJPG_Flush(CODEC_CHANNEL *pChan)
{
    int fd = 0;

    if(pChan == NULL){
        #ifdef VENC_MJPG_DEBUG
        CODEC_DEBUG(" point is null ");
        #endif
        return CODEC_ERR_INVAL;
    }

    if(pChan->u32Ch >= ENC_MAXCH){
        #ifdef VENC_MJPG_DEBUG
        CODEC_DEBUG("input chann: %d > MaxCh: %d", pChan->u32Ch, ENC_MAXCH);
        #endif
        return CODEC_ERR_INVAL;
    }

    if(!VENC_MJPG_TABLE[pChan->u32ChipID][pChan->u32Ch].u8IsCreate){
       #ifdef VENC_MJPG_DEBUG
       CODEC_DEBUG(" channel not create");
       #endif
       return CODEC_ERR_NOT_EXIST;
    }

    //todo
    //ioctl,send cfg to driver, now unknown
    fd = VENC_MJPG_TABLE[pChan->u32ChipID][pChan->u32Ch].s32ChFd;
    if(ioctl(fd, ISIL_CODEC_CHAN_FLUSH, NULL) < 0) {
       #ifdef VENC_MJPG_DEBUG
       CODEC_DEBUG(" ioctl fail");
       perror("why: ");
       #endif
       return CODEC_ERR_FAIL;
    }

    return CODEC_ERR_OK;
}
예제 #25
0
/***********************************************************************************************
function: ISIL_VENC_MJPG_GetChHandle
description:get mjpg channel fd
paraments:
    input: unsigned char u8Ch : channel ID, form 0~(ENC_MAXCH-1)
    CODEC_HANDLE *pHandle: fd
    output:none
return:
    CODEC_ERR_OK : sucess 
    CODEC_ERR_NOT_EXIST : channel not create
    CODEC_ERR_INVAL : input parament is invalid
*************************************************************************************************/
int ISIL_VENC_MJPG_GetChHandle(CODEC_CHANNEL *pChan, CODEC_HANDLE *pHandle)
{
    if(pChan == NULL){
        #ifdef VENC_MJPG_DEBUG
        CODEC_DEBUG(" point is null ");
        #endif
        return CODEC_ERR_INVAL;
    }

    if(pChan->u32Ch >= ENC_MAXCH)
    {
        #ifdef VENC_MJPG_DEBUG
        CODEC_DEBUG("input chann: %d > MaxCh: %d", pChan->u32Ch, ENC_MAXCH);
        #endif
        return CODEC_ERR_INVAL;
    }
	
	if(pHandle == NULL)
    {
       #ifdef VENC_MJPG_DEBUG
       CODEC_DEBUG(" input parament is NULL");
       #endif
       return CODEC_ERR_INVAL;
    } 

	
	if(!VENC_MJPG_TABLE[pChan->u32ChipID][pChan->u32Ch].u8IsCreate)
	{
	   #ifdef VENC_MJPG_DEBUG
	   CODEC_DEBUG(" channel not create ");
	   #endif
	   return CODEC_ERR_NOT_EXIST;
	} 
	
	*pHandle = VENC_MJPG_TABLE[pChan->u32ChipID][pChan->u32Ch].s32ChFd;
    return CODEC_ERR_OK;
}
예제 #26
0
//{{{  Constructor
////////////////////////////////////////////////////////////////////////////
///
/// Fill in the configuration parameters used by the super-class and reset everything.
///
Codec_MmeAudioWma_c::Codec_MmeAudioWma_c(void)
{
	CODEC_DEBUG("%s\n", __FUNCTION__);
	Configuration.CodecName                             = "WMA audio";
	Configuration.StreamParameterContextCount           = 1;
	Configuration.StreamParameterContextDescriptor      = &WmaAudioCodecStreamParameterContextDescriptor;
	Configuration.DecodeContextCount                    = SENDBUF_DECODE_CONTEXT_COUNT; //4;
	Configuration.DecodeContextDescriptor               = &WmaAudioCodecDecodeContextDescriptor;
	Configuration.MaximumSampleCount                    = 4096;
//
	AudioDecoderTransformCapabilityMask.DecoderCapabilityFlags = (1 << ACC_WMAPROLSL);
	DecoderId                                           = ACC_WMAPROLSL_ID;
	Reset();
	SendbufTriggerTransformCount                        = 1;
}
예제 #27
0
static void tas5707_early_suspend(struct early_suspend *h) {
    struct snd_soc_codec *codec = NULL;
    struct tas57xx_platform_data *pdata = NULL;

    CODEC_DEBUG("sound::tas5707_early_suspend\n");

    codec = (struct snd_soc_codec *)(h->param);
    pdata = dev_get_platdata(codec->dev);

    if (pdata && pdata->early_suspend_func) {
        pdata->early_suspend_func();
    }

    snd_soc_write(codec, DDX_MASTER_VOLUME, 0xFF);
}
예제 #28
0
static void tas5707_late_resume(struct early_suspend *h) {
    struct snd_soc_codec *codec = NULL;
    struct tas57xx_platform_data *pdata = NULL;

    CODEC_DEBUG("sound::tas5707_late_resume\n");

    codec = (struct snd_soc_codec *)(h->param);
    pdata = dev_get_platdata(codec->dev);

    if (pdata && pdata->late_resume_func) {
        pdata->late_resume_func();
    }

    tas5707_set_master_vol(codec);
}
예제 #29
0
/**
 * STA381xx_set_dai_sysclk - configure MCLK
 * @codec_dai: the codec DAI
 * @clk_id: the clock ID (ignored)
 * @freq: the MCLK input frequency
 * @dir: the clock direction (ignored)
 *
 * The value of MCLK is used to determine which sample rates are supported
 * by the STA381xx, based on the mclk_ratios table.
 *
 * This function must be called by the machine driver's 'startup' function,
 * otherwise the list of supported sample rates will not be available in
 * time for ALSA.
 *
 * For setups with variable MCLKs, pass 0 as 'freq' argument. This will cause
 * theoretically possible sample rates to be enabled. Call it again with a
 * proper value set one the external clock is set (most probably you would do
 * that from a machine's driver 'hw_param' hook.
 */
static int STA381xx_set_dai_sysclk(struct snd_soc_dai *codec_dai,
		int clk_id, unsigned int freq, int dir)
{
	struct snd_soc_codec *codec = codec_dai->codec;
	struct STA381xx_priv *STA381xx = snd_soc_codec_get_drvdata(codec);
	int i, j, ir, fs;
	unsigned int rates = 0;
	unsigned int rate_min = -1;
	unsigned int rate_max = 0;
CODEC_DEBUG("~~~~%s\n", __func__);

	pr_debug("mclk=%u\n", freq);
	STA381xx->mclk = freq;

	if (STA381xx->mclk) {
		for (i = 0; i < ARRAY_SIZE(interpolation_ratios); i++) {
			ir = interpolation_ratios[i].ir;
			fs = interpolation_ratios[i].fs;
			for (j = 0; mclk_ratios[ir][j].ratio; j++) {
				if (mclk_ratios[ir][j].ratio * fs == freq) {
					rates |= snd_pcm_rate_to_rate_bit(fs);
					if (fs < rate_min)
						rate_min = fs;
					if (fs > rate_max)
						rate_max = fs;
					break;
				}
			}
		}
		/* FIXME: soc should support a rate list */
		rates &= ~SNDRV_PCM_RATE_KNOT;

		if (!rates) {
			dev_err(codec->dev, "could not find a valid sample rate\n");
			return -EINVAL;
		}
	} else {
		/* enable all possible rates */
		rates = STA381xx_RATES;
		rate_min = 32000;
		rate_max = 192000;
	}

	codec_dai->driver->playback.rates = rates;
	codec_dai->driver->playback.rate_min = rate_min;
	codec_dai->driver->playback.rate_max = rate_max;
	return 0;
}
예제 #30
0
static int tas5707_resume(struct snd_soc_codec *codec) {
    struct tas5707_priv *tas5707 = snd_soc_codec_get_drvdata(codec);
    struct tas57xx_platform_data *pdata = dev_get_platdata(codec->dev);

    CODEC_DEBUG("sound::tas5707_resume\n");

    if (pdata && pdata->resume_func) {
        pdata->resume_func();
    }

    tas5707_init(codec);
    snd_soc_write(codec, DDX_CHANNEL1_VOL, tas5707->Ch1_vol);
    snd_soc_write(codec, DDX_CHANNEL2_VOL, tas5707->Ch2_vol);
    tas5707_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
    return 0;
}