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?
Attachment:
signature.asc
Description: PGP signature