[alsa-devel] [PATCH 2/4] ASoC: rt5670: check if asrc is useable

Lars-Peter Clausen lars at metafoo.de
Wed Nov 12 20:42:38 CET 2014


On 11/12/2014 12:54 PM, bardliao at realtek.com wrote:
> From: Bard Liao <bardliao at realtek.com>
>
> To use ASRC, the sysclk should be faster than 384 times sample
> rate of I2S1.
>
> Signed-off-by: Bard Liao <bardliao at realtek.com>
> ---
>   sound/soc/codecs/rt5670.c | 15 +++++++++++++--
>   1 file changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/sound/soc/codecs/rt5670.c b/sound/soc/codecs/rt5670.c
> index 85dc210..898b17f 100644
> --- a/sound/soc/codecs/rt5670.c
> +++ b/sound/soc/codecs/rt5670.c
> @@ -575,6 +575,17 @@ static int is_using_asrc(struct snd_soc_dapm_widget *source,
>
>   }
>
> +static int can_use_asrc(struct snd_soc_dapm_widget *source,
> +			 struct snd_soc_dapm_widget *sink)
> +{
> +	struct rt5670_priv *rt5670 = snd_soc_codec_get_drvdata(source->codec);

Can you start using snd_soc_dapm_to_codec(source->dapm) instead of 
source->codec? The codec field will eventually be removed.

Bonus points for fixing up the existing w->codec users in rt drivers.

Thanks,
- Lars



More information about the Alsa-devel mailing list