From: Lars-Peter Clausen <lars@metafoo.de>
To: Mark Brown <broonie@kernel.org>, Liam Girdwood <lgirdwood@gmail.com>
Cc: Brian Austin <brian.austin@cirrus.com>,
alsa-devel@alsa-project.org,
Charles Keepax <ckeepax@opensource.wolfsonmicro.com>,
Paul Handrigan <Paul.Handrigan@cirrus.com>,
Lars-Peter Clausen <lars@metafoo.de>
Subject: [PATCH 05/47] ASoC: arizona: Replace direct snd_soc_codec dapm field access
Date: Mon, 1 Jun 2015 10:10:24 +0200 [thread overview]
Message-ID: <1433146266-1599-5-git-send-email-lars@metafoo.de> (raw)
In-Reply-To: <1433146266-1599-1-git-send-email-lars@metafoo.de>
The dapm field of the snd_soc_codec struct is eventually going to be
removed, in preparation for this replace all manual access to codec->dapm
with snd_soc_codec_get_dapm().
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
sound/soc/codecs/arizona.c | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
diff --git a/sound/soc/codecs/arizona.c b/sound/soc/codecs/arizona.c
index eff4b4d..0cb2962 100644
--- a/sound/soc/codecs/arizona.c
+++ b/sound/soc/codecs/arizona.c
@@ -208,11 +208,12 @@ static const struct snd_soc_dapm_widget arizona_spkr =
int arizona_init_spk(struct snd_soc_codec *codec)
{
+ struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec);
struct arizona *arizona = priv->arizona;
int ret;
- ret = snd_soc_dapm_new_controls(&codec->dapm, &arizona_spkl, 1);
+ ret = snd_soc_dapm_new_controls(dapm, &arizona_spkl, 1);
if (ret != 0)
return ret;
@@ -220,8 +221,7 @@ int arizona_init_spk(struct snd_soc_codec *codec)
case WM8997:
break;
default:
- ret = snd_soc_dapm_new_controls(&codec->dapm,
- &arizona_spkr, 1);
+ ret = snd_soc_dapm_new_controls(dapm, &arizona_spkr, 1);
if (ret != 0)
return ret;
break;
@@ -258,13 +258,14 @@ static const struct snd_soc_dapm_route arizona_mono_routes[] = {
int arizona_init_mono(struct snd_soc_codec *codec)
{
+ struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec);
struct arizona *arizona = priv->arizona;
int i;
for (i = 0; i < ARIZONA_MAX_OUTPUT; ++i) {
if (arizona->pdata.out_mono[i])
- snd_soc_dapm_add_routes(&codec->dapm,
+ snd_soc_dapm_add_routes(dapm,
&arizona_mono_routes[i], 1);
}
@@ -274,6 +275,7 @@ EXPORT_SYMBOL_GPL(arizona_init_mono);
int arizona_init_gpio(struct snd_soc_codec *codec)
{
+ struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec);
struct arizona *arizona = priv->arizona;
int i;
@@ -281,23 +283,21 @@ int arizona_init_gpio(struct snd_soc_codec *codec)
switch (arizona->type) {
case WM5110:
case WM8280:
- snd_soc_dapm_disable_pin(&codec->dapm, "DRC2 Signal Activity");
+ snd_soc_dapm_disable_pin(dapm, "DRC2 Signal Activity");
break;
default:
break;
}
- snd_soc_dapm_disable_pin(&codec->dapm, "DRC1 Signal Activity");
+ snd_soc_dapm_disable_pin(dapm, "DRC1 Signal Activity");
for (i = 0; i < ARRAY_SIZE(arizona->pdata.gpio_defaults); i++) {
switch (arizona->pdata.gpio_defaults[i] & ARIZONA_GPN_FN_MASK) {
case ARIZONA_GP_FN_DRC1_SIGNAL_DETECT:
- snd_soc_dapm_enable_pin(&codec->dapm,
- "DRC1 Signal Activity");
+ snd_soc_dapm_enable_pin(dapm, "DRC1 Signal Activity");
break;
case ARIZONA_GP_FN_DRC2_SIGNAL_DETECT:
- snd_soc_dapm_enable_pin(&codec->dapm,
- "DRC2 Signal Activity");
+ snd_soc_dapm_enable_pin(dapm, "DRC2 Signal Activity");
break;
default:
break;
@@ -1474,6 +1474,7 @@ static int arizona_dai_set_sysclk(struct snd_soc_dai *dai,
int clk_id, unsigned int freq, int dir)
{
struct snd_soc_codec *codec = dai->codec;
+ struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec);
struct arizona_dai_priv *dai_priv = &priv->dai[dai->id - 1];
struct snd_soc_dapm_route routes[2];
@@ -1504,15 +1505,15 @@ static int arizona_dai_set_sysclk(struct snd_soc_dai *dai,
routes[0].source = arizona_dai_clk_str(dai_priv->clk);
routes[1].source = arizona_dai_clk_str(dai_priv->clk);
- snd_soc_dapm_del_routes(&codec->dapm, routes, ARRAY_SIZE(routes));
+ snd_soc_dapm_del_routes(dapm, routes, ARRAY_SIZE(routes));
routes[0].source = arizona_dai_clk_str(clk_id);
routes[1].source = arizona_dai_clk_str(clk_id);
- snd_soc_dapm_add_routes(&codec->dapm, routes, ARRAY_SIZE(routes));
+ snd_soc_dapm_add_routes(dapm, routes, ARRAY_SIZE(routes));
dai_priv->clk = clk_id;
- return snd_soc_dapm_sync(&codec->dapm);
+ return snd_soc_dapm_sync(dapm);
}
static int arizona_set_tristate(struct snd_soc_dai *dai, int tristate)
--
2.1.4
next prev parent reply other threads:[~2015-06-01 8:11 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-01 8:10 [PATCH 01/47] ASoC: cs42l52: Replace direct snd_soc_codec dapm field access Lars-Peter Clausen
2015-06-01 8:10 ` [PATCH 02/47] ASoC: cs42l56: " Lars-Peter Clausen
2015-06-01 8:10 ` [PATCH 03/47] ASoC: cs42l73: " Lars-Peter Clausen
2015-06-01 12:12 ` Brian Austin
2015-06-01 8:10 ` [PATCH 04/47] ASoC: cs42xx8: " Lars-Peter Clausen
2015-06-01 8:10 ` Lars-Peter Clausen [this message]
2015-06-01 8:10 ` [PATCH 06/47] ASoC: wm0010: " Lars-Peter Clausen
2015-06-01 8:10 ` [PATCH 07/47] ASoC: wm5100: " Lars-Peter Clausen
2015-06-01 8:10 ` [PATCH 08/47] ASoC: wm5102: " Lars-Peter Clausen
2015-06-01 8:10 ` [PATCH 09/47] ASoC: wm5110: " Lars-Peter Clausen
2015-06-01 8:10 ` [PATCH 10/47] ASoC: wm8350: " Lars-Peter Clausen
2015-06-01 8:10 ` [PATCH 11/47] ASoC: wm8400: " Lars-Peter Clausen
2015-06-01 8:10 ` [PATCH 12/47] ASoC: wm8510: " Lars-Peter Clausen
2015-06-01 8:10 ` [PATCH 13/47] ASoC: wm8523: " Lars-Peter Clausen
2015-06-01 8:10 ` [PATCH 14/47] ASoC: wm8580: " Lars-Peter Clausen
2015-06-01 8:10 ` [PATCH 15/47] ASoC: wm8711: " Lars-Peter Clausen
2015-06-01 8:10 ` [PATCH 16/47] ASoC: wm8728: " Lars-Peter Clausen
2015-06-01 8:10 ` [PATCH 17/47] ASoC: wm8731: " Lars-Peter Clausen
2015-06-01 8:10 ` [PATCH 18/47] ASoC: wm8737: " Lars-Peter Clausen
2015-06-01 8:10 ` [PATCH 19/47] ASoC: wm8750: " Lars-Peter Clausen
2015-06-01 8:10 ` [PATCH 20/47] ASoC: wm8753: " Lars-Peter Clausen
2015-06-01 8:10 ` [PATCH 21/47] ASoC: wm8770: " Lars-Peter Clausen
2015-06-01 8:10 ` [PATCH 22/47] ASoC: wm8776: " Lars-Peter Clausen
2015-06-01 8:10 ` [PATCH 23/47] ASoC: wm8804: " Lars-Peter Clausen
2015-06-01 8:10 ` [PATCH 24/47] ASoC: wm8900: " Lars-Peter Clausen
2015-06-01 8:10 ` [PATCH 25/47] ASoC: wm8903: " Lars-Peter Clausen
2015-06-01 8:10 ` [PATCH 26/47] ASoC: wm8904: " Lars-Peter Clausen
2015-06-01 8:10 ` [PATCH 27/47] ASoC: wm8940: " Lars-Peter Clausen
2015-06-01 8:10 ` [PATCH 28/47] ASoC: wm8955: " Lars-Peter Clausen
2015-06-01 8:10 ` [PATCH 29/47] ASoC: wm8960: " Lars-Peter Clausen
2015-06-01 8:10 ` [PATCH 30/47] ASoC: wm8961: " Lars-Peter Clausen
2015-06-01 8:10 ` [PATCH 31/47] ASoC: wm8962: " Lars-Peter Clausen
2015-06-01 8:10 ` [PATCH 32/47] ASoC: wm8971: " Lars-Peter Clausen
2015-06-01 8:10 ` [PATCH 33/47] ASoC: wm8974: " Lars-Peter Clausen
2015-06-01 8:10 ` [PATCH 34/47] ASoC: wm8978: " Lars-Peter Clausen
2015-06-01 8:10 ` [PATCH 35/47] ASoC: wm8983: " Lars-Peter Clausen
2015-06-01 8:10 ` [PATCH 36/47] ASoC: wm8985: " Lars-Peter Clausen
2015-06-01 8:10 ` [PATCH 37/47] ASoC: wm8988: " Lars-Peter Clausen
2015-06-01 8:10 ` [PATCH 38/47] ASoC: wm8990: " Lars-Peter Clausen
2015-06-01 8:10 ` [PATCH 39/47] ASoC: wm8991: " Lars-Peter Clausen
2015-06-01 8:10 ` [PATCH 40/47] ASoC: wm8993: " Lars-Peter Clausen
2015-06-01 8:11 ` [PATCH 41/47] ASoC: wm8994: " Lars-Peter Clausen
2015-06-01 8:11 ` [PATCH 42/47] ASoC: wm8995: " Lars-Peter Clausen
2015-06-01 8:11 ` [PATCH 43/47] ASoC: wm8996: " Lars-Peter Clausen
2015-06-01 8:11 ` [PATCH 44/47] ASoC: wm8997: " Lars-Peter Clausen
2015-06-01 8:11 ` [PATCH 45/47] ASoC: wm9081: " Lars-Peter Clausen
2015-06-01 8:11 ` [PATCH 46/47] ASoC: wm9090: " Lars-Peter Clausen
2015-06-01 8:11 ` [PATCH 47/47] ASoC: wm_hubs: " Lars-Peter Clausen
2015-06-01 9:13 ` Charles Keepax
2015-06-01 15:46 ` [PATCH 01/47] ASoC: cs42l52: " 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=1433146266-1599-5-git-send-email-lars@metafoo.de \
--to=lars@metafoo.de \
--cc=Paul.Handrigan@cirrus.com \
--cc=alsa-devel@alsa-project.org \
--cc=brian.austin@cirrus.com \
--cc=broonie@kernel.org \
--cc=ckeepax@opensource.wolfsonmicro.com \
--cc=lgirdwood@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).