mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 19:29:37 +00:00
ASoC: neo1973_wm8753: Use static DAI format setup
Set the dai_fmt field in the dai_link struct instead of manually calling snd_soc_dai_fmt(). This makes the code cleaner and shorter. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
72303cafcb
commit
e16514d931
1 changed files with 4 additions and 21 deletions
|
@ -70,20 +70,6 @@ static int neo1973_hifi_hw_params(struct snd_pcm_substream *substream,
|
|||
break;
|
||||
}
|
||||
|
||||
/* set codec DAI configuration */
|
||||
ret = snd_soc_dai_set_fmt(codec_dai,
|
||||
SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
|
||||
SND_SOC_DAIFMT_CBM_CFM);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
/* set cpu DAI configuration */
|
||||
ret = snd_soc_dai_set_fmt(cpu_dai,
|
||||
SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
|
||||
SND_SOC_DAIFMT_CBM_CFM);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
/* set the codec system clock for DAC and ADC */
|
||||
ret = snd_soc_dai_set_sysclk(codec_dai, WM8753_MCLK, pll_out,
|
||||
SND_SOC_CLOCK_IN);
|
||||
|
@ -151,13 +137,6 @@ static int neo1973_voice_hw_params(struct snd_pcm_substream *substream,
|
|||
|
||||
pcmdiv = WM8753_PCM_DIV_6; /* 2.048 MHz */
|
||||
|
||||
/* todo: gg check mode (DSP_B) against CSR datasheet */
|
||||
/* set codec DAI configuration */
|
||||
ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_DSP_B |
|
||||
SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
/* set the codec system clock for DAC and ADC */
|
||||
ret = snd_soc_dai_set_sysclk(codec_dai, WM8753_PCMCLK, 12288000,
|
||||
SND_SOC_CLOCK_IN);
|
||||
|
@ -300,6 +279,8 @@ static struct snd_soc_dai_link neo1973_dai[] = {
|
|||
.cpu_dai_name = "s3c24xx-iis",
|
||||
.codec_dai_name = "wm8753-hifi",
|
||||
.codec_name = "wm8753.0-001a",
|
||||
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
|
||||
SND_SOC_DAIFMT_CBM_CFM,
|
||||
.init = neo1973_wm8753_init,
|
||||
.ops = &neo1973_hifi_ops,
|
||||
},
|
||||
|
@ -309,6 +290,8 @@ static struct snd_soc_dai_link neo1973_dai[] = {
|
|||
.cpu_dai_name = "bt-sco-pcm",
|
||||
.codec_dai_name = "wm8753-voice",
|
||||
.codec_name = "wm8753.0-001a",
|
||||
.dai_fmt = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_NB_NF |
|
||||
SND_SOC_DAIFMT_CBS_CFS,
|
||||
.ops = &neo1973_voice_ops,
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue