[alsa-devel] [RFC PATCH 1/2] ASoC: simple-card: add support for bclk_ratio
Kuninori Morimoto
kuninori.morimoto.gx at renesas.com
Tue Feb 26 01:35:47 CET 2019
Hi Sven
Thank you for your patch
> In some situations, codec configuration will depend on the
> bclk_ratio generated by the cpu dai. The tda998x hdmi transmitter
> is an example of this.
>
> Allow simple-card to set the bclk_ratio via the 'bclk-slot-ratio'
> devicetree property, which describes the bclk to slot rate ratio.
>
> This value is converted to the bclk to sample ratio before being
> passed into set_bclk_ratio().
>
> Signed-off-by: Sven Van Asbroeck <TheSven73 at gmail.com>
> ---
Please update Documentation, too
> @@ -97,7 +98,7 @@ static int asoc_simple_card_hw_params(struct snd_pcm_substream *substream,
> struct simple_card_data *priv = snd_soc_card_get_drvdata(rtd->card);
> struct simple_dai_props *dai_props =
> simple_priv_to_props(priv, rtd->num);
> - unsigned int mclk, mclk_fs = 0;
> + unsigned int mclk, bclk_ratio, mclk_fs = 0, bclk_slot_ratio = 0;
> int ret = 0;
>
> if (dai_props->mclk_fs)
(snip)
> + if (bclk_slot_ratio) {
> + /* FIXME do we need to care about TDM slots here ? */
> + bclk_ratio = snd_soc_calc_frame_size(bclk_slot_ratio,
> + params_channels(params), 1);
> +
> + ret = snd_soc_dai_set_bclk_ratio(codec_dai, bclk_ratio);
> + if (ret && ret != -ENOTSUPP)
> + goto err;
> +
> + ret = snd_soc_dai_set_bclk_ratio(cpu_dai, bclk_ratio);
> + if (ret && ret != -ENOTSUPP)
> + goto err;
> + }
Not a big deal, but "bclk_ratio" is used only here.
We can define it here
More information about the Alsa-devel
mailing list