Re: [PATCH] ASoC: codes: Add support for ES8316 producer mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>  	/* Validate supported sample rates that are autodetected from MCLK */
> @@ -477,19 +478,24 @@ static int es8316_pcm_hw_params(struct snd_pcm_substream *substream,
>  	}
>  	if (i == NR_SUPPORTED_MCLK_LRCK_RATIOS)
>  		return -EINVAL;
> -
> +	lrck_divider = es8316->sysclk/params_rate(params);
> +	bclk_divider = lrck_divider/4;
>  	switch (params_format(params)) {
>  	case SNDRV_PCM_FORMAT_S16_LE:
>  		wordlen = ES8316_SERDATA2_LEN_16;
> +		bclk_divider/=16;
>  		break;
>  	case SNDRV_PCM_FORMAT_S20_3LE:
>  		wordlen = ES8316_SERDATA2_LEN_20;
> +		bclk_divider/=32;

S20_3LE uses 3 bytes, is the 32 divider correct here?

>  		break;
>  	case SNDRV_PCM_FORMAT_S24_LE:
>  		wordlen = ES8316_SERDATA2_LEN_24;
> +		bclk_divider/=24;>  		break;
>  	case SNDRV_PCM_FORMAT_S32_LE:
>  		wordlen = ES8316_SERDATA2_LEN_32;
> +		bclk_divider/=32;
>  		break;
>  	default:
>  		return -EINVAL;



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux