All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: cs4271: Convert to table based control init
@ 2013-08-11 12:16 Mark Brown
  2013-08-11 12:16 ` [PATCH 2/2] ASoC: cs4271: Add DAPM support Mark Brown
  2013-08-11 12:33 ` [PATCH 1/2] ASoC: cs4271: Convert to table based control init Alexander Sverdlin
  0 siblings, 2 replies; 6+ messages in thread
From: Mark Brown @ 2013-08-11 12:16 UTC (permalink / raw)
  To: Alexander Sverdlin, Daniel Mack, Liam Girdwood
  Cc: alsa-devel, linaro-kernel, Mark Brown

From: Mark Brown <broonie@linaro.org>

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

diff --git a/sound/soc/codecs/cs4271.c b/sound/soc/codecs/cs4271.c
index 03036b3..65ad56c 100644
--- a/sound/soc/codecs/cs4271.c
+++ b/sound/soc/codecs/cs4271.c
@@ -576,8 +576,7 @@ static int cs4271_probe(struct snd_soc_codec *codec)
 				   CS4271_MODE2_MUTECAEQUB,
 				   CS4271_MODE2_MUTECAEQUB);
 
-	return snd_soc_add_codec_controls(codec, cs4271_snd_controls,
-		ARRAY_SIZE(cs4271_snd_controls));
+	return 0;
 }
 
 static int cs4271_remove(struct snd_soc_codec *codec)
@@ -596,6 +595,9 @@ static struct snd_soc_codec_driver soc_codec_dev_cs4271 = {
 	.remove			= cs4271_remove,
 	.suspend		= cs4271_soc_suspend,
 	.resume			= cs4271_soc_resume,
+
+	.controls		= cs4271_snd_controls,
+	.num_controls		= ARRAY_SIZE(cs4271_snd_controls),
 };
 
 #if defined(CONFIG_SPI_MASTER)
-- 
1.8.4.rc1

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

* [PATCH 2/2] ASoC: cs4271: Add DAPM support
  2013-08-11 12:16 [PATCH 1/2] ASoC: cs4271: Convert to table based control init Mark Brown
@ 2013-08-11 12:16 ` Mark Brown
  2013-08-11 12:34   ` Alexander Sverdlin
  2013-08-11 16:02   ` Daniel Mack
  2013-08-11 12:33 ` [PATCH 1/2] ASoC: cs4271: Convert to table based control init Alexander Sverdlin
  1 sibling, 2 replies; 6+ messages in thread
From: Mark Brown @ 2013-08-11 12:16 UTC (permalink / raw)
  To: Alexander Sverdlin, Daniel Mack, Liam Girdwood
  Cc: alsa-devel, linaro-kernel, Mark Brown

From: Mark Brown <broonie@linaro.org>

This makes it possible to hook the device into a more complex board and
ensures it will continue to work with non-DAPM support removed from the
core.

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

diff --git a/sound/soc/codecs/cs4271.c b/sound/soc/codecs/cs4271.c
index 65ad56c..35a6a67 100644
--- a/sound/soc/codecs/cs4271.c
+++ b/sound/soc/codecs/cs4271.c
@@ -173,6 +173,26 @@ struct cs4271_private {
 	bool				enable_soft_reset;
 };
 
+static const struct snd_soc_dapm_widget cs4271_dapm_widgets[] = {
+SND_SOC_DAPM_INPUT("AINA"),
+SND_SOC_DAPM_INPUT("AINB"),
+
+SND_SOC_DAPM_OUTPUT("AOUTA+"),
+SND_SOC_DAPM_OUTPUT("AOUTA-"),
+SND_SOC_DAPM_OUTPUT("AOUTB+"),
+SND_SOC_DAPM_OUTPUT("AOUTB-"),
+};
+
+static const struct snd_soc_dapm_route cs4271_dapm_routes[] = {
+	{ "Capture", NULL, "AINL" },
+	{ "Capture", NULL, "AINR" },
+
+	{ "AOUTA+", NULL, "Playback" },
+	{ "AOUTA-", NULL, "Playback" },
+	{ "AOUTB+", NULL, "Playback" },
+	{ "AOUTB-", NULL, "Playback" },
+};
+
 /*
  * @freq is the desired MCLK rate
  * MCLK rate should (c) be the sample rate, multiplied by one of the
@@ -598,6 +618,10 @@ static struct snd_soc_codec_driver soc_codec_dev_cs4271 = {
 
 	.controls		= cs4271_snd_controls,
 	.num_controls		= ARRAY_SIZE(cs4271_snd_controls),
+	.dapm_widgets		= cs4271_dapm_widgets,
+	.num_dapm_widgets	= ARRAY_SIZE(cs4271_dapm_widgets),
+	.dapm_routes		= cs4271_dapm_routes,
+	.num_dapm_routes	= ARRAY_SIZE(cs4271_dapm_routes),
 };
 
 #if defined(CONFIG_SPI_MASTER)
-- 
1.8.4.rc1

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

* Re: [PATCH 1/2] ASoC: cs4271: Convert to table based control init
  2013-08-11 12:16 [PATCH 1/2] ASoC: cs4271: Convert to table based control init Mark Brown
  2013-08-11 12:16 ` [PATCH 2/2] ASoC: cs4271: Add DAPM support Mark Brown
@ 2013-08-11 12:33 ` Alexander Sverdlin
  1 sibling, 0 replies; 6+ messages in thread
From: Alexander Sverdlin @ 2013-08-11 12:33 UTC (permalink / raw)
  To: Mark Brown
  Cc: alsa-devel, linaro-kernel, Mark Brown, Liam Girdwood, Daniel Mack

Hello!

On Sun, 2013-08-11 at 13:16 +0100, Mark Brown wrote: 
> From: Mark Brown <broonie@linaro.org>
> 
> Signed-off-by: Mark Brown <broonie@linaro.org>

Acked-by: Alexander Sverdlin <subaparts@yandex.ru>

> ---
>  sound/soc/codecs/cs4271.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/soc/codecs/cs4271.c b/sound/soc/codecs/cs4271.c
> index 03036b3..65ad56c 100644
> --- a/sound/soc/codecs/cs4271.c
> +++ b/sound/soc/codecs/cs4271.c
> @@ -576,8 +576,7 @@ static int cs4271_probe(struct snd_soc_codec *codec)
>  				   CS4271_MODE2_MUTECAEQUB,
>  				   CS4271_MODE2_MUTECAEQUB);
>  
> -	return snd_soc_add_codec_controls(codec, cs4271_snd_controls,
> -		ARRAY_SIZE(cs4271_snd_controls));
> +	return 0;
>  }
>  
>  static int cs4271_remove(struct snd_soc_codec *codec)
> @@ -596,6 +595,9 @@ static struct snd_soc_codec_driver soc_codec_dev_cs4271 = {
>  	.remove			= cs4271_remove,
>  	.suspend		= cs4271_soc_suspend,
>  	.resume			= cs4271_soc_resume,
> +
> +	.controls		= cs4271_snd_controls,
> +	.num_controls		= ARRAY_SIZE(cs4271_snd_controls),
>  };
>  
>  #if defined(CONFIG_SPI_MASTER)

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

* Re: [PATCH 2/2] ASoC: cs4271: Add DAPM support
  2013-08-11 12:16 ` [PATCH 2/2] ASoC: cs4271: Add DAPM support Mark Brown
@ 2013-08-11 12:34   ` Alexander Sverdlin
  2013-08-11 16:02   ` Daniel Mack
  1 sibling, 0 replies; 6+ messages in thread
From: Alexander Sverdlin @ 2013-08-11 12:34 UTC (permalink / raw)
  To: Mark Brown
  Cc: alsa-devel, linaro-kernel, Mark Brown, Liam Girdwood, Daniel Mack

Hello!

On Sun, 2013-08-11 at 13:16 +0100, Mark Brown wrote: 
> From: Mark Brown <broonie@linaro.org>
> 
> This makes it possible to hook the device into a more complex board and
> ensures it will continue to work with non-DAPM support removed from the
> core.
> 
> Signed-off-by: Mark Brown <broonie@linaro.org>

Acked-by: Alexander Sverdlin <subaparts@yandex.ru>

> ---
>  sound/soc/codecs/cs4271.c | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
> 
> diff --git a/sound/soc/codecs/cs4271.c b/sound/soc/codecs/cs4271.c
> index 65ad56c..35a6a67 100644
> --- a/sound/soc/codecs/cs4271.c
> +++ b/sound/soc/codecs/cs4271.c
> @@ -173,6 +173,26 @@ struct cs4271_private {
>  	bool				enable_soft_reset;
>  };
>  
> +static const struct snd_soc_dapm_widget cs4271_dapm_widgets[] = {
> +SND_SOC_DAPM_INPUT("AINA"),
> +SND_SOC_DAPM_INPUT("AINB"),
> +
> +SND_SOC_DAPM_OUTPUT("AOUTA+"),
> +SND_SOC_DAPM_OUTPUT("AOUTA-"),
> +SND_SOC_DAPM_OUTPUT("AOUTB+"),
> +SND_SOC_DAPM_OUTPUT("AOUTB-"),
> +};
> +
> +static const struct snd_soc_dapm_route cs4271_dapm_routes[] = {
> +	{ "Capture", NULL, "AINL" },
> +	{ "Capture", NULL, "AINR" },
> +
> +	{ "AOUTA+", NULL, "Playback" },
> +	{ "AOUTA-", NULL, "Playback" },
> +	{ "AOUTB+", NULL, "Playback" },
> +	{ "AOUTB-", NULL, "Playback" },
> +};
> +
>  /*
>   * @freq is the desired MCLK rate
>   * MCLK rate should (c) be the sample rate, multiplied by one of the
> @@ -598,6 +618,10 @@ static struct snd_soc_codec_driver soc_codec_dev_cs4271 = {
>  
>  	.controls		= cs4271_snd_controls,
>  	.num_controls		= ARRAY_SIZE(cs4271_snd_controls),
> +	.dapm_widgets		= cs4271_dapm_widgets,
> +	.num_dapm_widgets	= ARRAY_SIZE(cs4271_dapm_widgets),
> +	.dapm_routes		= cs4271_dapm_routes,
> +	.num_dapm_routes	= ARRAY_SIZE(cs4271_dapm_routes),
>  };
>  
>  #if defined(CONFIG_SPI_MASTER)

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

* Re: [PATCH 2/2] ASoC: cs4271: Add DAPM support
  2013-08-11 12:16 ` [PATCH 2/2] ASoC: cs4271: Add DAPM support Mark Brown
  2013-08-11 12:34   ` Alexander Sverdlin
@ 2013-08-11 16:02   ` Daniel Mack
  2013-08-11 17:41     ` Mark Brown
  1 sibling, 1 reply; 6+ messages in thread
From: Daniel Mack @ 2013-08-11 16:02 UTC (permalink / raw)
  To: Mark Brown
  Cc: alsa-devel, linaro-kernel, Alexander Sverdlin, Liam Girdwood,
	Mark Brown

On 11.08.2013 14:16, Mark Brown wrote:
> +static const struct snd_soc_dapm_widget cs4271_dapm_widgets[] = {
> +SND_SOC_DAPM_INPUT("AINA"),
> +SND_SOC_DAPM_INPUT("AINB"),
> +
> +SND_SOC_DAPM_OUTPUT("AOUTA+"),
> +SND_SOC_DAPM_OUTPUT("AOUTA-"),
> +SND_SOC_DAPM_OUTPUT("AOUTB+"),
> +SND_SOC_DAPM_OUTPUT("AOUTB-"),
> +};
> +
> +static const struct snd_soc_dapm_route cs4271_dapm_routes[] = {
> +	{ "Capture", NULL, "AINL" },
> +	{ "Capture", NULL, "AINR" },

Here you call the widgets "AINL"/"AINR", while above it's "AINA"/"AINB".
 According to the datasheet, the latter is
correct.


Daniel

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

* Re: [PATCH 2/2] ASoC: cs4271: Add DAPM support
  2013-08-11 16:02   ` Daniel Mack
@ 2013-08-11 17:41     ` Mark Brown
  0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2013-08-11 17:41 UTC (permalink / raw)
  To: Daniel Mack; +Cc: alsa-devel, linaro-kernel, Alexander Sverdlin, Liam Girdwood


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

On Sun, Aug 11, 2013 at 06:02:42PM +0200, Daniel Mack wrote:

> Here you call the widgets "AINL"/"AINR", while above it's "AINA"/"AINB".
>  According to the datasheet, the latter is
> correct.

Fixed, thanks.

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

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



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

end of thread, other threads:[~2013-08-11 17:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-11 12:16 [PATCH 1/2] ASoC: cs4271: Convert to table based control init Mark Brown
2013-08-11 12:16 ` [PATCH 2/2] ASoC: cs4271: Add DAPM support Mark Brown
2013-08-11 12:34   ` Alexander Sverdlin
2013-08-11 16:02   ` Daniel Mack
2013-08-11 17:41     ` Mark Brown
2013-08-11 12:33 ` [PATCH 1/2] ASoC: cs4271: Convert to table based control init Alexander Sverdlin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.