[PATCH 2/5] ASoC: xilinx: xlnx_formatter_pcm: Handle sysclk setting

Mark Brown broonie at kernel.org
Thu Jan 6 13:26:10 CET 2022


On Wed, Jan 05, 2022 at 04:51:43PM -0600, Robert Hancock wrote:

>  	struct clk *axi_clk;
> +	unsigned int last_sysclk;

Typically this would just be called sysclk - calling it last_sysclk
makes things a bit confusing.  It's being used as though it were the
current sysclk and that's what set_sysclk() is supposed to be for.

> +	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
> +	    adata->last_sysclk) {
> +		unsigned int mclk_fs = DIV_ROUND_CLOSEST(adata->last_sysclk, params_rate(params));
> +
> +		writel(mclk_fs, stream_data->mmio + XLNX_AUD_FS_MULTIPLIER);
> +	}
> +

Does the IP actually cope properly with inexact ratios, especially if
the actual clock rate is lower than mclk_fs would suggest?  It's more
common to be able to tolerate a higher clock than specified.

It's interesting that this is only for playback.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20220106/08b68a5f/attachment.sig>


More information about the Alsa-devel mailing list