From: Mark Brown <broonie@kernel.org>
To: Daniel Mack <zonque@gmail.com>, Liam Girdwood <lgirdwood@gmail.com>
Cc: alsa-devel@alsa-project.org, linaro-kernel@lists.linaro.org,
Mark Brown <broonie@linaro.org>
Subject: [PATCH 2/2] ASoC: ak4104: Manage TXE using DAPM
Date: Wed, 7 Aug 2013 19:07:19 +0100 [thread overview]
Message-ID: <1375898839-15992-2-git-send-email-broonie@kernel.org> (raw)
In-Reply-To: <1375898839-15992-1-git-send-email-broonie@kernel.org>
From: Mark Brown <broonie@linaro.org>
Saves some code. We should also be able to manage the power up and reset
registers using DAPM but it's probably more trouble than it's worth in
mains powered systems.
Signed-off-by: Mark Brown <broonie@linaro.org>
---
sound/soc/codecs/ak4104.c | 23 ++++-------------------
1 file changed, 4 insertions(+), 19 deletions(-)
diff --git a/sound/soc/codecs/ak4104.c b/sound/soc/codecs/ak4104.c
index 9a7c89b..71059c0 100644
--- a/sound/soc/codecs/ak4104.c
+++ b/sound/soc/codecs/ak4104.c
@@ -52,11 +52,14 @@ struct ak4104_private {
};
static const struct snd_soc_dapm_widget ak4104_dapm_widgets[] = {
+SND_SOC_DAPM_PGA("TXE", AK4104_REG_TX, AK4104_TX_TXE, 0, NULL, 0),
+
SND_SOC_DAPM_OUTPUT("TX"),
};
static const struct snd_soc_dapm_route ak4104_dapm_routes[] = {
- { "TX", NULL, "Playback" },
+ { "TXE", NULL, "Playback" },
+ { "TX", NULL, "TXE" },
};
static int ak4104_set_dai_fmt(struct snd_soc_dai *codec_dai,
@@ -146,29 +149,11 @@ static int ak4104_hw_params(struct snd_pcm_substream *substream,
if (ret < 0)
return ret;
- /* enable transmitter */
- ret = regmap_update_bits(ak4104->regmap, AK4104_REG_TX,
- AK4104_TX_TXE, AK4104_TX_TXE);
- if (ret < 0)
- return ret;
-
return 0;
}
-static int ak4104_hw_free(struct snd_pcm_substream *substream,
- struct snd_soc_dai *dai)
-{
- struct snd_soc_codec *codec = dai->codec;
- struct ak4104_private *ak4104 = snd_soc_codec_get_drvdata(codec);
-
- /* disable transmitter */
- return regmap_update_bits(ak4104->regmap, AK4104_REG_TX,
- AK4104_TX_TXE, 0);
-}
-
static const struct snd_soc_dai_ops ak4101_dai_ops = {
.hw_params = ak4104_hw_params,
- .hw_free = ak4104_hw_free,
.set_fmt = ak4104_set_dai_fmt,
};
--
1.8.4.rc1
prev parent reply other threads:[~2013-08-07 18:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-07 18:07 [PATCH 1/2] ASoC: ak4104: Add stub DAPM support Mark Brown
2013-08-07 18:07 ` Mark Brown [this message]
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=1375898839-15992-2-git-send-email-broonie@kernel.org \
--to=broonie@kernel.org \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linaro-kernel@lists.linaro.org \
--cc=zonque@gmail.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).