Re: [PATCH] ASoC: codecs: Add support for AK4458 DAC driver

From: Cosmin Samoila
Date: Tue Feb 13 2018 - 04:22:38 EST


Hi Mark,

> >
> > +static int ak4458_hw_params(struct snd_pcm_substream *substream,
> > + ÂÂÂÂstruct snd_pcm_hw_params *params,
> > + ÂÂÂÂstruct snd_soc_dai *dai)
> > +{
> > + struct snd_soc_codec *codec = dai->codec;
> > + struct ak4458_priv *ak4458 =
> > snd_soc_codec_get_drvdata(codec);
> > + u8 format;
> > + int pcm_width = max(params_physical_width(params), ak4458-
> > >slot_width);
> > +
> > +#ifdef AK4458_ACKS_USE_MANUAL_MODE
> > + u8 dfs1, dfs2;
> > +#endif
> What's this and why is it a compile time option?

This is used to set the codec in Manual Setting Mode, meaning that
the default sampling speed is set based on DFS0 and DFS1 bits. In
Auto Setting Mode, the MCLK frequency is detected automatically and
DFS bits are ignored.
This compile time option is used to know when to set the ACKS bit in
init_reg function that switches between modes.
At this moment we are only using Auto Mode and I can remove it if
you think is not necessary.

Thank you,
Cosmin