Commit dc1b36b2 authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Mark Brown

ASoC: omap-twl4030: Use snd_soc_runtime_set_dai_fmt()

Use snd_soc_runtime_set_dai_fmt() to configure the format for the DAI link
rather than configuring each DAI individually.
Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Acked-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent ce64c8b9
...@@ -53,11 +53,7 @@ static int omap_twl4030_hw_params(struct snd_pcm_substream *substream, ...@@ -53,11 +53,7 @@ static int omap_twl4030_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params) struct snd_pcm_hw_params *params)
{ {
struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_dai *codec_dai = rtd->codec_dai;
struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
struct snd_soc_card *card = rtd->card;
unsigned int fmt; unsigned int fmt;
int ret;
switch (params_channels(params)) { switch (params_channels(params)) {
case 2: /* Stereo I2S mode */ case 2: /* Stereo I2S mode */
...@@ -74,21 +70,7 @@ static int omap_twl4030_hw_params(struct snd_pcm_substream *substream, ...@@ -74,21 +70,7 @@ static int omap_twl4030_hw_params(struct snd_pcm_substream *substream,
return -EINVAL; return -EINVAL;
} }
/* Set codec DAI configuration */ return snd_soc_runtime_set_dai_fmt(rtd, fmt);
ret = snd_soc_dai_set_fmt(codec_dai, fmt);
if (ret < 0) {
dev_err(card->dev, "can't set codec DAI configuration\n");
return ret;
}
/* Set cpu DAI configuration */
ret = snd_soc_dai_set_fmt(cpu_dai, fmt);
if (ret < 0) {
dev_err(card->dev, "can't set cpu DAI configuration\n");
return ret;
}
return 0;
} }
static struct snd_soc_ops omap_twl4030_ops = { static struct snd_soc_ops omap_twl4030_ops = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment