alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: ad1980: Provide stub DAPM support
@ 2013-08-06 22:51 Mark Brown
  2013-08-07  7:53 ` Lars-Peter Clausen
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Brown @ 2013-08-06 22:51 UTC (permalink / raw)
  To: Lars-Peter Clausen, Liam Girdwood; +Cc: alsa-devel, Mark Brown

From: Mark Brown <broonie@linaro.org>

Since non-DAPM devices are not going to be supported provide DAPM input
and output widgets and hook them up to the DAIs.

Signed-off-by: Mark Brown <broonie@linaro.org>
---
 sound/soc/codecs/ad1980.c | 43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/sound/soc/codecs/ad1980.c b/sound/soc/codecs/ad1980.c
index 89fcf7d..7257a88 100644
--- a/sound/soc/codecs/ad1980.c
+++ b/sound/soc/codecs/ad1980.c
@@ -96,6 +96,44 @@ SOC_ENUM("Capture Source", ad1980_cap_src),
 SOC_SINGLE("Mic Boost Switch", AC97_MIC, 6, 1, 0),
 };
 
+static const struct snd_soc_dapm_widget ad1980_dapm_widgets[] = {
+SND_SOC_DAPM_INPUT("MIC1"),
+SND_SOC_DAPM_INPUT("MIC2"),
+SND_SOC_DAPM_INPUT("CD_L"),
+SND_SOC_DAPM_INPUT("CD_R"),
+SND_SOC_DAPM_INPUT("AUX_L"),
+SND_SOC_DAPM_INPUT("AUX_R"),
+SND_SOC_DAPM_INPUT("LINE_IN_L"),
+SND_SOC_DAPM_INPUT("LINE_IN_R"),
+
+SND_SOC_DAPM_OUTPUT("LFE_OUT"),
+SND_SOC_DAPM_OUTPUT("CENTER_OUT"),
+SND_SOC_DAPM_OUTPUT("LINE_OUT_L"),
+SND_SOC_DAPM_OUTPUT("LINE_OUT_R"),
+SND_SOC_DAPM_OUTPUT("MONO_OUT"),
+SND_SOC_DAPM_OUTPUT("HP_OUT_L"),
+SND_SOC_DAPM_OUTPUT("HP_OUT_R"),
+};
+
+static const struct snd_soc_dapm_route ad1980_dapm_routes[] = {
+	{ "Capture", NULL, "MIC1" },
+	{ "Capture", NULL, "MIC2" },
+	{ "Capture", NULL, "CD_L" },
+	{ "Capture", NULL, "CD_R" },
+	{ "Capture", NULL, "AUX_L" },
+	{ "Capture", NULL, "AUX_R" },
+	{ "Capture", NULL, "LINE_IN_L" },
+	{ "Capture", NULL, "LINE_IN_R" },
+
+	{ "LFE_OUT", NULL, "Playback" },
+	{ "CENTER_OUT", NULL, "Playback" },
+	{ "LINE_OUT_L", NULL, "Playback" },
+	{ "LINE_OUT_R", NULL, "Playback" },
+	{ "MONO_OUT", NULL, "Playback" },
+	{ "HP_OUT_L", NULL, "Playback" },
+	{ "HP_OUT_R", NULL, "Playback" },
+};
+
 static unsigned int ac97_read(struct snd_soc_codec *codec,
 	unsigned int reg)
 {
@@ -253,6 +291,11 @@ static struct snd_soc_codec_driver soc_codec_dev_ad1980 = {
 	.reg_cache_step = 2,
 	.write = ac97_write,
 	.read = ac97_read,
+
+	.dapm_widgets = ad1980_dapm_widgets,
+	.num_dapm_widgets = ARRAY_SIZE(ad1980_dapm_widgets),
+	.dapm_routes = ad1980_dapm_routes,
+	.num_dapm_routes = ARRAY_SIZE(ad1980_dapm_routes),
 };
 
 static int ad1980_probe(struct platform_device *pdev)
-- 
1.8.4.rc1

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

* Re: [PATCH] ASoC: ad1980: Provide stub DAPM support
  2013-08-06 22:51 [PATCH] ASoC: ad1980: Provide stub DAPM support Mark Brown
@ 2013-08-07  7:53 ` Lars-Peter Clausen
  0 siblings, 0 replies; 2+ messages in thread
From: Lars-Peter Clausen @ 2013-08-07  7:53 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel, Liam Girdwood, Mark Brown

On 08/07/2013 12:51 AM, Mark Brown wrote:
> From: Mark Brown <broonie@linaro.org>
> 
> Since non-DAPM devices are not going to be supported provide DAPM input
> and output widgets and hook them up to the DAIs.
> 
> Signed-off-by: Mark Brown <broonie@linaro.org>

I unfortunately can't test this at the moment, but looks good, thanks.

Acked-by: Lars-Peter Clausen <lars@metafoo.de>

> ---
>  sound/soc/codecs/ad1980.c | 43 +++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 43 insertions(+)
> 
> diff --git a/sound/soc/codecs/ad1980.c b/sound/soc/codecs/ad1980.c
> index 89fcf7d..7257a88 100644
> --- a/sound/soc/codecs/ad1980.c
> +++ b/sound/soc/codecs/ad1980.c
> @@ -96,6 +96,44 @@ SOC_ENUM("Capture Source", ad1980_cap_src),
>  SOC_SINGLE("Mic Boost Switch", AC97_MIC, 6, 1, 0),
>  };
>  
> +static const struct snd_soc_dapm_widget ad1980_dapm_widgets[] = {
> +SND_SOC_DAPM_INPUT("MIC1"),
> +SND_SOC_DAPM_INPUT("MIC2"),
> +SND_SOC_DAPM_INPUT("CD_L"),
> +SND_SOC_DAPM_INPUT("CD_R"),
> +SND_SOC_DAPM_INPUT("AUX_L"),
> +SND_SOC_DAPM_INPUT("AUX_R"),
> +SND_SOC_DAPM_INPUT("LINE_IN_L"),
> +SND_SOC_DAPM_INPUT("LINE_IN_R"),
> +
> +SND_SOC_DAPM_OUTPUT("LFE_OUT"),
> +SND_SOC_DAPM_OUTPUT("CENTER_OUT"),
> +SND_SOC_DAPM_OUTPUT("LINE_OUT_L"),
> +SND_SOC_DAPM_OUTPUT("LINE_OUT_R"),
> +SND_SOC_DAPM_OUTPUT("MONO_OUT"),
> +SND_SOC_DAPM_OUTPUT("HP_OUT_L"),
> +SND_SOC_DAPM_OUTPUT("HP_OUT_R"),
> +};
> +
> +static const struct snd_soc_dapm_route ad1980_dapm_routes[] = {
> +	{ "Capture", NULL, "MIC1" },
> +	{ "Capture", NULL, "MIC2" },
> +	{ "Capture", NULL, "CD_L" },
> +	{ "Capture", NULL, "CD_R" },
> +	{ "Capture", NULL, "AUX_L" },
> +	{ "Capture", NULL, "AUX_R" },
> +	{ "Capture", NULL, "LINE_IN_L" },
> +	{ "Capture", NULL, "LINE_IN_R" },
> +
> +	{ "LFE_OUT", NULL, "Playback" },
> +	{ "CENTER_OUT", NULL, "Playback" },
> +	{ "LINE_OUT_L", NULL, "Playback" },
> +	{ "LINE_OUT_R", NULL, "Playback" },
> +	{ "MONO_OUT", NULL, "Playback" },
> +	{ "HP_OUT_L", NULL, "Playback" },
> +	{ "HP_OUT_R", NULL, "Playback" },
> +};
> +
>  static unsigned int ac97_read(struct snd_soc_codec *codec,
>  	unsigned int reg)
>  {
> @@ -253,6 +291,11 @@ static struct snd_soc_codec_driver soc_codec_dev_ad1980 = {
>  	.reg_cache_step = 2,
>  	.write = ac97_write,
>  	.read = ac97_read,
> +
> +	.dapm_widgets = ad1980_dapm_widgets,
> +	.num_dapm_widgets = ARRAY_SIZE(ad1980_dapm_widgets),
> +	.dapm_routes = ad1980_dapm_routes,
> +	.num_dapm_routes = ARRAY_SIZE(ad1980_dapm_routes),
>  };
>  
>  static int ad1980_probe(struct platform_device *pdev)
> 

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

end of thread, other threads:[~2013-08-07  7:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-06 22:51 [PATCH] ASoC: ad1980: Provide stub DAPM support Mark Brown
2013-08-07  7:53 ` Lars-Peter Clausen

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