public inbox for alsa-devel@alsa-project.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org, alsa-devel@alsa-project.org,
	Lars-Peter Clausen <lars@metafoo.de>
Subject: [PATCH 3/6] ASoC: qi_lb60: Set .dai_fmt instead of calling snd_soc_set_dai_fmt()
Date: Tue, 22 Apr 2014 22:46:33 +0200	[thread overview]
Message-ID: <1398199596-23649-3-git-send-email-lars@metafoo.de> (raw)
In-Reply-To: <1398199596-23649-1-git-send-email-lars@metafoo.de>

Rather than calling snd_soc_set_dai_fmt(), just set the dai_fmt field in the
dai_link struct. Both have the same effect, but the later is a bit shorter and
also allows us to remove the now unused init callback.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 sound/soc/jz4740/qi_lb60.c | 23 ++---------------------
 1 file changed, 2 insertions(+), 21 deletions(-)

diff --git a/sound/soc/jz4740/qi_lb60.c b/sound/soc/jz4740/qi_lb60.c
index 8dd3568..72ce103 100644
--- a/sound/soc/jz4740/qi_lb60.c
+++ b/sound/soc/jz4740/qi_lb60.c
@@ -46,26 +46,6 @@ static const struct snd_soc_dapm_route qi_lb60_routes[] = {
 	{"Speaker", NULL, "ROUT"},
 };
 
-#define QI_LB60_DAIFMT (SND_SOC_DAIFMT_I2S | \
-			SND_SOC_DAIFMT_NB_NF | \
-			SND_SOC_DAIFMT_CBM_CFM)
-
-static int qi_lb60_codec_init(struct snd_soc_pcm_runtime *rtd)
-{
-	struct snd_soc_codec *codec = rtd->codec;
-	struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
-	struct snd_soc_dapm_context *dapm = &codec->dapm;
-	int ret;
-
-	ret = snd_soc_dai_set_fmt(cpu_dai, QI_LB60_DAIFMT);
-	if (ret < 0) {
-		dev_err(codec->dev, "Failed to set cpu dai format: %d\n", ret);
-		return ret;
-	}
-
-	return 0;
-}
-
 static struct snd_soc_dai_link qi_lb60_dai = {
 	.name = "jz4740",
 	.stream_name = "jz4740",
@@ -73,7 +53,8 @@ static struct snd_soc_dai_link qi_lb60_dai = {
 	.platform_name = "jz4740-i2s",
 	.codec_dai_name = "jz4740-hifi",
 	.codec_name = "jz4740-codec",
-	.init = qi_lb60_codec_init,
+	.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
+		SND_SOC_DAIFMT_CBM_CFM,
 };
 
 static struct snd_soc_card qi_lb60 = {
-- 
1.8.0

  parent reply	other threads:[~2014-04-22 20:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-22 20:46 [PATCH 1/6] ASoC: jz4740: Remove Makefile entry for removed file Lars-Peter Clausen
2014-04-22 20:46 ` [PATCH 2/6] ASoC: qi_lb60: Set fully_routed flag Lars-Peter Clausen
2014-04-22 20:46 ` Lars-Peter Clausen [this message]
2014-04-22 20:46 ` [PATCH 4/6] ASoC: qi_lb60: Use devm_snd_soc_register_card() Lars-Peter Clausen
2014-04-22 20:54   ` Mark Brown
2014-04-22 22:06     ` Ralf Baechle
2014-04-22 20:46 ` [PATCH 5/6] ASoC: qi_lb60: Use GPIO descriptor API Lars-Peter Clausen
2014-04-23 11:19   ` Mark Brown
2014-04-22 20:46 ` [PATCH 6/6] ASoC: jz4740: Improve build test coverage Lars-Peter Clausen
2014-04-23 11:19   ` Mark Brown
2015-03-27 10:51 ` [PATCH 1/6] ASoC: jz4740: Remove Makefile entry for removed file Markos Chandras
2015-04-03 18:25   ` Greg Kroah-Hartman

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=1398199596-23649-3-git-send-email-lars@metafoo.de \
    --to=lars@metafoo.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    /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