ASoC: s3c24xx_simtec: 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:
Родитель
5f0acedddf
Коммит
d27e51dade
|
@ -169,24 +169,6 @@ static int simtec_hw_params(struct snd_pcm_substream *substream,
|
|||
struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
|
||||
int ret;
|
||||
|
||||
/* Set the CODEC as the bus clock master, I2S */
|
||||
ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S |
|
||||
SND_SOC_DAIFMT_NB_NF |
|
||||
SND_SOC_DAIFMT_CBM_CFM);
|
||||
if (ret) {
|
||||
pr_err("%s: failed set cpu dai format\n", __func__);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Set the CODEC as the bus clock master */
|
||||
ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S |
|
||||
SND_SOC_DAIFMT_NB_NF |
|
||||
SND_SOC_DAIFMT_CBM_CFM);
|
||||
if (ret) {
|
||||
pr_err("%s: failed set codec dai format\n", __func__);
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = snd_soc_dai_set_sysclk(codec_dai, 0,
|
||||
CODEC_CLOCK, SND_SOC_CLOCK_IN);
|
||||
if (ret) {
|
||||
|
@ -320,6 +302,8 @@ int simtec_audio_core_probe(struct platform_device *pdev,
|
|||
int ret;
|
||||
|
||||
card->dai_link->ops = &simtec_snd_ops;
|
||||
card->dai_link->dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
|
||||
SND_SOC_DAIFMT_CBM_CFM;
|
||||
|
||||
pdata = pdev->dev.platform_data;
|
||||
if (!pdata) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче