[alsa-devel] [PATCH 1/5] ASoC: lowland: Use card DAPM context to access widgets
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/samsung/lowland.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/samsung/lowland.c b/sound/soc/samsung/lowland.c index 5f15609..0d0f582 100644 --- a/sound/soc/samsung/lowland.c +++ b/sound/soc/samsung/lowland.c @@ -72,7 +72,7 @@ static int lowland_wm9081_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_codec *codec = rtd->codec;
- snd_soc_dapm_nc_pin(&codec->dapm, "LINEOUT"); + snd_soc_dapm_nc_pin(&rtd->card->dapm, "LINEOUT");
/* At any time the WM9081 is active it will have this clock */ return snd_soc_codec_set_sysclk(codec, WM9081_SYSCLK_MCLK, 0,
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/samsung/smdk_wm8994.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/soc/samsung/smdk_wm8994.c b/sound/soc/samsung/smdk_wm8994.c index d38595f..ff57b19 100644 --- a/sound/soc/samsung/smdk_wm8994.c +++ b/sound/soc/samsung/smdk_wm8994.c @@ -86,8 +86,7 @@ static struct snd_soc_ops smdk_ops = {
static int smdk_wm8994_init_paiftx(struct snd_soc_pcm_runtime *rtd) { - struct snd_soc_codec *codec = rtd->codec; - struct snd_soc_dapm_context *dapm = &codec->dapm; + struct snd_soc_dapm_context *dapm = &rtd->card->dapm;
/* Other pins NC */ snd_soc_dapm_nc_pin(dapm, "HPOUT2P");
The "Headphone Jack" widget is managed by the jack detection layer, there is no need to manually disable.
Signed-off-by: Lars-Peter Clausen lars@metafoo.de --- sound/soc/samsung/smartq_wm8987.c | 3 --- 1 file changed, 3 deletions(-)
diff --git a/sound/soc/samsung/smartq_wm8987.c b/sound/soc/samsung/smartq_wm8987.c index dfbe2db..c75f98d 100644 --- a/sound/soc/samsung/smartq_wm8987.c +++ b/sound/soc/samsung/smartq_wm8987.c @@ -147,9 +147,6 @@ static int smartq_wm8987_init(struct snd_soc_pcm_runtime *rtd) snd_soc_dapm_nc_pin(dapm, "OUT3"); snd_soc_dapm_nc_pin(dapm, "ROUT1");
- /* set endpoints to default off mode */ - snd_soc_dapm_disable_pin(dapm, "Headphone Jack"); - /* Headphone jack detection */ err = snd_soc_card_jack_new(rtd->card, "Headphone Jack", SND_JACK_HEADPHONE, &smartq_jack,
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/samsung/smartq_wm8987.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/soc/samsung/smartq_wm8987.c b/sound/soc/samsung/smartq_wm8987.c index c75f98d..a0fe37f 100644 --- a/sound/soc/samsung/smartq_wm8987.c +++ b/sound/soc/samsung/smartq_wm8987.c @@ -137,8 +137,7 @@ static const struct snd_soc_dapm_route audio_map[] = {
static int smartq_wm8987_init(struct snd_soc_pcm_runtime *rtd) { - struct snd_soc_codec *codec = rtd->codec; - struct snd_soc_dapm_context *dapm = &codec->dapm; + struct snd_soc_dapm_context *dapm = &rtd->card->dapm; int err = 0;
/* set endpoints to not connected */
The dapm field of the snd_soc_codec struct is eventually going to be removed. Replace direct access to it with snd_soc_codec_get_dapm(), which will return the DAPM context for the CODEC.
Signed-off-by: Lars-Peter Clausen lars@metafoo.de --- Depends on topic/dapm --- sound/soc/samsung/speyside.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/samsung/speyside.c b/sound/soc/samsung/speyside.c index 2dcb988..d1ae21c 100644 --- a/sound/soc/samsung/speyside.c +++ b/sound/soc/samsung/speyside.c @@ -123,7 +123,7 @@ static void speyside_set_polarity(struct snd_soc_codec *codec, gpio_direction_output(WM8996_HPSEL_GPIO, speyside_jack_polarity);
/* Re-run DAPM to make sure we're using the correct mic bias */ - snd_soc_dapm_sync(&codec->dapm); + snd_soc_dapm_sync(snd_soc_codec_get_dapm(codec)); }
static int speyside_wm0010_init(struct snd_soc_pcm_runtime *rtd)
On Sun, May 03, 2015 at 07:27:10PM +0200, Lars-Peter Clausen wrote:
The dapm field of the snd_soc_codec struct is eventually going to be removed. Replace direct access to it with snd_soc_codec_get_dapm(), which will return the DAPM context for the CODEC.
Signed-off-by: Lars-Peter Clausen lars@metafoo.de
Acked-by: Charles Keepax ckeepax@opensource.wolfsonmicro.com
Thanks, Charles
On Sun, May 03, 2015 at 07:27:06PM +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.
Signed-off-by: Lars-Peter Clausen lars@metafoo.de
Acked-by: Charles Keepax ckeepax@opensource.wolfsonmicro.com
Thanks, Charles
On Sun, May 03, 2015 at 07:27:06PM +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. Whenever the headers were reorganized to remove references to the mach headers these dependencies should have been updated.
participants (3)
-
Charles Keepax
-
Lars-Peter Clausen
-
Mark Brown