From: Lars-Peter Clausen <lars@metafoo.de>
To: Mark Brown <broonie@kernel.org>, Liam Girdwood <lgirdwood@gmail.com>
Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>,
alsa-devel@alsa-project.org, Lars-Peter Clausen <lars@metafoo.de>,
Jarkko Nikula <jarkko.nikula@bitmer.com>
Subject: [PATCH 2/3] ASoC: omap-twl4030: Use snd_soc_runtime_set_dai_fmt()
Date: Tue, 6 Jan 2015 15:17:21 +0100 [thread overview]
Message-ID: <1420553842-17335-2-git-send-email-lars@metafoo.de> (raw)
In-Reply-To: <1420553842-17335-1-git-send-email-lars@metafoo.de>
Use snd_soc_runtime_set_dai_fmt() to configure the format for the DAI link
rather than configuring each DAI individually.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
sound/soc/omap/omap-twl4030.c | 20 +-------------------
1 file changed, 1 insertion(+), 19 deletions(-)
diff --git a/sound/soc/omap/omap-twl4030.c b/sound/soc/omap/omap-twl4030.c
index 5e551c7..fb1f6bb 100644
--- a/sound/soc/omap/omap-twl4030.c
+++ b/sound/soc/omap/omap-twl4030.c
@@ -53,11 +53,7 @@ static int omap_twl4030_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{
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;
- int ret;
switch (params_channels(params)) {
case 2: /* Stereo I2S mode */
@@ -74,21 +70,7 @@ static int omap_twl4030_hw_params(struct snd_pcm_substream *substream,
return -EINVAL;
}
- /* Set codec DAI configuration */
- 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;
+ return snd_soc_runtime_set_dai_fmt(rtd, fmt);
}
static struct snd_soc_ops omap_twl4030_ops = {
--
1.8.0
next prev parent reply other threads:[~2015-01-06 14:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-06 14:17 [PATCH 1/3] ASoC: Add helper function for changing the DAI link format Lars-Peter Clausen
2015-01-06 14:17 ` Lars-Peter Clausen [this message]
2015-01-07 12:23 ` [PATCH 2/3] ASoC: omap-twl4030: Use snd_soc_runtime_set_dai_fmt() Peter Ujfalusi
2015-01-06 14:17 ` [PATCH 3/3] ASoC: mop500_ab8500: " Lars-Peter Clausen
2015-01-07 18:04 ` [PATCH 1/3] ASoC: Add helper function for changing the DAI link format Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1420553842-17335-2-git-send-email-lars@metafoo.de \
--to=lars@metafoo.de \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=jarkko.nikula@bitmer.com \
--cc=lgirdwood@gmail.com \
--cc=peter.ujfalusi@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).