[PATCH 4/5] ASoC: amd: add Machine driver for Jadeite platform

Mark Brown broonie at kernel.org
Thu Jun 30 13:10:35 CEST 2022


On Thu, Jun 30, 2022 at 08:47:54AM +0530, Vijendar Mukunda wrote:

> +static int st_es8336_hw_params(struct snd_pcm_substream *substream,
> +			       struct snd_pcm_hw_params *params)
> +{
> +	int ret = 0;
> +	struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
> +	struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
> +
> +	ret = snd_soc_dai_set_sysclk(codec_dai, 0, params_rate(params) * 256, SND_SOC_CLOCK_IN);
> +	if (ret < 0) {
> +		dev_err(rtd->dev, "can't set codec sysclk: %d\n", ret);
> +		return ret;
> +	}
> +	return ret;
> +}

> +static const unsigned int st_channels[] = {
> +	DUAL_CHANNEL,
> +};
> +
> +static const unsigned int st_rates[] = {
> +	48000,
> +};

If the clock rate is fixed why not just set the sysclk once at startup
too?
-------------- 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/20220630/cd73c19f/attachment.sig>


More information about the Alsa-devel mailing list