alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] ASoC: tegra_alc5632: Use card DAPM context to access widgets
@ 2015-04-03 11:04 Lars-Peter Clausen
  2015-04-03 11:04 ` [PATCH 2/4] ASoC: tegra_rt5677: " Lars-Peter Clausen
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Lars-Peter Clausen @ 2015-04-03 11:04 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: alsa-devel, Lars-Peter Clausen, Lucas Stach, Anatol Pomozov,
	Stephen Warren

The dapm field of the snd_soc_codec struct will eventually be removed
(replaced with the DAPM context from the component embedded inside the
CODEC). Replace its usage with the card's DAPM context. The idea is that
DAPM is hierarchical and with the card at the root it is possible to access
widgets from other contexts through the card context.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 sound/soc/tegra/tegra_alc5632.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/sound/soc/tegra/tegra_alc5632.c b/sound/soc/tegra/tegra_alc5632.c
index 6dcd06a..ba272e2 100644
--- a/sound/soc/tegra/tegra_alc5632.c
+++ b/sound/soc/tegra/tegra_alc5632.c
@@ -101,9 +101,6 @@ static const struct snd_kcontrol_new tegra_alc5632_controls[] = {
 
 static int tegra_alc5632_asoc_init(struct snd_soc_pcm_runtime *rtd)
 {
-	struct snd_soc_dai *codec_dai = rtd->codec_dai;
-	struct snd_soc_codec *codec = codec_dai->codec;
-	struct snd_soc_dapm_context *dapm = &codec->dapm;
 	struct tegra_alc5632 *machine = snd_soc_card_get_drvdata(rtd->card);
 
 	snd_soc_card_jack_new(rtd->card, "Headset Jack", SND_JACK_HEADSET,
@@ -118,7 +115,7 @@ static int tegra_alc5632_asoc_init(struct snd_soc_pcm_runtime *rtd)
 						&tegra_alc5632_hp_jack_gpio);
 	}
 
-	snd_soc_dapm_force_enable_pin(dapm, "MICBIAS1");
+	snd_soc_dapm_force_enable_pin(&rtd->card->dapm, "MICBIAS1");
 
 	return 0;
 }
-- 
1.8.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/4] ASoC: tegra_rt5677: Use card DAPM context to access widgets
  2015-04-03 11:04 [PATCH 1/4] ASoC: tegra_alc5632: Use card DAPM context to access widgets Lars-Peter Clausen
@ 2015-04-03 11:04 ` Lars-Peter Clausen
  2015-04-03 11:04 ` [PATCH 3/4] ASoC: tegra_wm8903: " Lars-Peter Clausen
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Lars-Peter Clausen @ 2015-04-03 11:04 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: alsa-devel, Lars-Peter Clausen, Lucas Stach, Anatol Pomozov,
	Stephen Warren

The dapm field of the snd_soc_codec struct will eventually be removed
(replaced with the DAPM context from the component embedded inside the
CODEC). Replace its usage with the card's DAPM context. The idea is that
DAPM is hierarchical and with the card at the root it is possible to access
widgets from other contexts through the card context.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 sound/soc/tegra/tegra_rt5677.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/sound/soc/tegra/tegra_rt5677.c b/sound/soc/tegra/tegra_rt5677.c
index d082882..1470873 100644
--- a/sound/soc/tegra/tegra_rt5677.c
+++ b/sound/soc/tegra/tegra_rt5677.c
@@ -141,9 +141,6 @@ static const struct snd_kcontrol_new tegra_rt5677_controls[] = {
 
 static int tegra_rt5677_asoc_init(struct snd_soc_pcm_runtime *rtd)
 {
-	struct snd_soc_dai *codec_dai = rtd->codec_dai;
-	struct snd_soc_codec *codec = codec_dai->codec;
-	struct snd_soc_dapm_context *dapm = &codec->dapm;
 	struct tegra_rt5677 *machine = snd_soc_card_get_drvdata(rtd->card);
 
 	snd_soc_card_jack_new(rtd->card, "Headphone Jack", SND_JACK_HEADPHONE,
@@ -167,7 +164,7 @@ static int tegra_rt5677_asoc_init(struct snd_soc_pcm_runtime *rtd)
 				&tegra_rt5677_mic_jack_gpio);
 	}
 
-	snd_soc_dapm_force_enable_pin(dapm, "MICBIAS1");
+	snd_soc_dapm_force_enable_pin(&rtd->card->dapm, "MICBIAS1");
 
 	return 0;
 }
-- 
1.8.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/4] ASoC: tegra_wm8903: Use card DAPM context to access widgets
  2015-04-03 11:04 [PATCH 1/4] ASoC: tegra_alc5632: Use card DAPM context to access widgets Lars-Peter Clausen
  2015-04-03 11:04 ` [PATCH 2/4] ASoC: tegra_rt5677: " Lars-Peter Clausen
@ 2015-04-03 11:04 ` Lars-Peter Clausen
  2015-04-03 11:04 ` [PATCH 4/4] ASoC: tegra_wm9712: " Lars-Peter Clausen
  2015-04-08 20:10 ` [PATCH 1/4] ASoC: tegra_alc5632: " Mark Brown
  3 siblings, 0 replies; 5+ messages in thread
From: Lars-Peter Clausen @ 2015-04-03 11:04 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: alsa-devel, Lars-Peter Clausen, Lucas Stach, Anatol Pomozov,
	Stephen Warren

The dapm field of the snd_soc_codec struct will eventually be removed
(replaced with the DAPM context from the component embedded inside the
CODEC). Replace its usage with the card's DAPM context. The idea is that
DAPM is hierarchical and with the card at the root it is possible to access
widgets from other contexts through the card context.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 sound/soc/tegra/tegra_wm8903.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sound/soc/tegra/tegra_wm8903.c b/sound/soc/tegra/tegra_wm8903.c
index 4a95b70..2160400 100644
--- a/sound/soc/tegra/tegra_wm8903.c
+++ b/sound/soc/tegra/tegra_wm8903.c
@@ -171,7 +171,6 @@ static int tegra_wm8903_init(struct snd_soc_pcm_runtime *rtd)
 {
 	struct snd_soc_dai *codec_dai = rtd->codec_dai;
 	struct snd_soc_codec *codec = codec_dai->codec;
-	struct snd_soc_dapm_context *dapm = &codec->dapm;
 	struct snd_soc_card *card = rtd->card;
 	struct tegra_wm8903 *machine = snd_soc_card_get_drvdata(card);
 
@@ -193,7 +192,7 @@ static int tegra_wm8903_init(struct snd_soc_pcm_runtime *rtd)
 	wm8903_mic_detect(codec, &tegra_wm8903_mic_jack, SND_JACK_MICROPHONE,
 				0);
 
-	snd_soc_dapm_force_enable_pin(dapm, "MICBIAS");
+	snd_soc_dapm_force_enable_pin(&card->dapm, "MICBIAS");
 
 	return 0;
 }
-- 
1.8.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 4/4] ASoC: tegra_wm9712: Use card DAPM context to access widgets
  2015-04-03 11:04 [PATCH 1/4] ASoC: tegra_alc5632: Use card DAPM context to access widgets Lars-Peter Clausen
  2015-04-03 11:04 ` [PATCH 2/4] ASoC: tegra_rt5677: " Lars-Peter Clausen
  2015-04-03 11:04 ` [PATCH 3/4] ASoC: tegra_wm8903: " Lars-Peter Clausen
@ 2015-04-03 11:04 ` Lars-Peter Clausen
  2015-04-08 20:10 ` [PATCH 1/4] ASoC: tegra_alc5632: " Mark Brown
  3 siblings, 0 replies; 5+ messages in thread
From: Lars-Peter Clausen @ 2015-04-03 11:04 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: alsa-devel, Lars-Peter Clausen, Lucas Stach, Anatol Pomozov,
	Stephen Warren

The dapm field of the snd_soc_codec struct will eventually be removed
(replaced with the DAPM context from the component embedded inside the
CODEC). Replace its usage with the card's DAPM context. The idea is that
DAPM is hierarchical and with the card at the root it is possible to access
widgets from other contexts through the card context.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 sound/soc/tegra/tegra_wm9712.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/sound/soc/tegra/tegra_wm9712.c b/sound/soc/tegra/tegra_wm9712.c
index 2868b48..6492f81 100644
--- a/sound/soc/tegra/tegra_wm9712.c
+++ b/sound/soc/tegra/tegra_wm9712.c
@@ -46,11 +46,7 @@ static const struct snd_soc_dapm_widget tegra_wm9712_dapm_widgets[] = {
 
 static int tegra_wm9712_init(struct snd_soc_pcm_runtime *rtd)
 {
-	struct snd_soc_dai *codec_dai = rtd->codec_dai;
-	struct snd_soc_codec *codec = codec_dai->codec;
-	struct snd_soc_dapm_context *dapm = &codec->dapm;
-
-	return snd_soc_dapm_force_enable_pin(dapm, "Mic Bias");
+	return snd_soc_dapm_force_enable_pin(&rtd->card->dapm, "Mic Bias");
 }
 
 static struct snd_soc_dai_link tegra_wm9712_dai = {
-- 
1.8.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/4] ASoC: tegra_alc5632: Use card DAPM context to access widgets
  2015-04-03 11:04 [PATCH 1/4] ASoC: tegra_alc5632: Use card DAPM context to access widgets Lars-Peter Clausen
                   ` (2 preceding siblings ...)
  2015-04-03 11:04 ` [PATCH 4/4] ASoC: tegra_wm9712: " Lars-Peter Clausen
@ 2015-04-08 20:10 ` Mark Brown
  3 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2015-04-08 20:10 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: alsa-devel, Lucas Stach, Liam Girdwood, Anatol Pomozov, Stephen Warren


[-- Attachment #1.1: Type: text/plain, Size: 444 bytes --]

On Fri, Apr 03, 2015 at 01:04:05PM +0200, Lars-Peter Clausen wrote:
> The dapm field of the snd_soc_codec struct will eventually be removed
> (replaced with the DAPM context from the component embedded inside the
> CODEC). Replace its usage with the card's DAPM context. The idea is that
> DAPM is hierarchical and with the card at the root it is possible to access
> widgets from other contexts through the card context.

Applied all, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-04-08 20:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-03 11:04 [PATCH 1/4] ASoC: tegra_alc5632: Use card DAPM context to access widgets Lars-Peter Clausen
2015-04-03 11:04 ` [PATCH 2/4] ASoC: tegra_rt5677: " Lars-Peter Clausen
2015-04-03 11:04 ` [PATCH 3/4] ASoC: tegra_wm8903: " Lars-Peter Clausen
2015-04-03 11:04 ` [PATCH 4/4] ASoC: tegra_wm9712: " Lars-Peter Clausen
2015-04-08 20:10 ` [PATCH 1/4] ASoC: tegra_alc5632: " Mark Brown

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).