All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: spear_pcm: Update to new pcm_new() API
@ 2013-03-18 17:57 Lars-Peter Clausen
  2013-03-18 17:57 ` [PATCH 2/2] ASoC: spear_pcm: Staticize non-exported structs Lars-Peter Clausen
  2013-03-20 10:03 ` [PATCH 1/2] ASoC: spear_pcm: Update to new pcm_new() API Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Lars-Peter Clausen @ 2013-03-18 17:57 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: alsa-devel, Rajeev Kumar, Lars-Peter Clausen

Commit 552d1ef6 ("ASoC: core - Optimise and refactor pcm_new() to pass only
rtd") updated the pcm_new() callback to take the rtd as the only parameter. The
spear PCM driver (which was merged much later) still uses the old API. This
patch updates the driver to the new API.

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

---

Btw. where are the Kconfig and Makefile files for spear?
---
 sound/soc/spear/spear_pcm.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/sound/soc/spear/spear_pcm.c b/sound/soc/spear/spear_pcm.c
index 9b76cc5..5e7aebe 100644
--- a/sound/soc/spear/spear_pcm.c
+++ b/sound/soc/spear/spear_pcm.c
@@ -149,9 +149,9 @@ static void spear_pcm_free(struct snd_pcm *pcm)
 
 static u64 spear_pcm_dmamask = DMA_BIT_MASK(32);
 
-static int spear_pcm_new(struct snd_card *card,
-		struct snd_soc_dai *dai, struct snd_pcm *pcm)
+static int spear_pcm_new(struct snd_soc_pcm_runtime *rtd)
 {
+	struct snd_card *card = rtd->card->snd_card;
 	int ret;
 
 	if (!card->dev->dma_mask)
@@ -159,16 +159,16 @@ static int spear_pcm_new(struct snd_card *card,
 	if (!card->dev->coherent_dma_mask)
 		card->dev->coherent_dma_mask = DMA_BIT_MASK(32);
 
-	if (dai->driver->playback.channels_min) {
-		ret = spear_pcm_preallocate_dma_buffer(pcm,
+	if (rtd->cpu_dai->driver->playback.channels_min) {
+		ret = spear_pcm_preallocate_dma_buffer(rtd->pcm,
 				SNDRV_PCM_STREAM_PLAYBACK,
 				spear_pcm_hardware.buffer_bytes_max);
 		if (ret)
 			return ret;
 	}
 
-	if (dai->driver->capture.channels_min) {
-		ret = spear_pcm_preallocate_dma_buffer(pcm,
+	if (rtd->cpu_dai->driver->capture.channels_min) {
+		ret = spear_pcm_preallocate_dma_buffer(rtd->pcm,
 				SNDRV_PCM_STREAM_CAPTURE,
 				spear_pcm_hardware.buffer_bytes_max);
 		if (ret)
-- 
1.8.0

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

* [PATCH 2/2] ASoC: spear_pcm: Staticize non-exported structs
  2013-03-18 17:57 [PATCH 1/2] ASoC: spear_pcm: Update to new pcm_new() API Lars-Peter Clausen
@ 2013-03-18 17:57 ` Lars-Peter Clausen
  2013-03-19  3:33   ` Rajeev kumar
  2013-03-20 10:03 ` [PATCH 1/2] ASoC: spear_pcm: Update to new pcm_new() API Mark Brown
  1 sibling, 1 reply; 4+ messages in thread
From: Lars-Peter Clausen @ 2013-03-18 17:57 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: alsa-devel, Rajeev Kumar, Lars-Peter Clausen

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 sound/soc/spear/spear_pcm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/spear/spear_pcm.c b/sound/soc/spear/spear_pcm.c
index 5e7aebe..dd71167 100644
--- a/sound/soc/spear/spear_pcm.c
+++ b/sound/soc/spear/spear_pcm.c
@@ -25,7 +25,7 @@
 #include <sound/soc.h>
 #include <sound/spear_dma.h>
 
-struct snd_pcm_hardware spear_pcm_hardware = {
+static struct snd_pcm_hardware spear_pcm_hardware = {
 	.info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
 		 SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID |
 		 SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME),
@@ -178,7 +178,7 @@ static int spear_pcm_new(struct snd_soc_pcm_runtime *rtd)
 	return 0;
 }
 
-struct snd_soc_platform_driver spear_soc_platform = {
+static struct snd_soc_platform_driver spear_soc_platform = {
 	.ops		=	&spear_pcm_ops,
 	.pcm_new	=	spear_pcm_new,
 	.pcm_free	=	spear_pcm_free,
-- 
1.8.0

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

* Re: [PATCH 2/2] ASoC: spear_pcm: Staticize non-exported structs
  2013-03-18 17:57 ` [PATCH 2/2] ASoC: spear_pcm: Staticize non-exported structs Lars-Peter Clausen
@ 2013-03-19  3:33   ` Rajeev kumar
  0 siblings, 0 replies; 4+ messages in thread
From: Rajeev kumar @ 2013-03-19  3:33 UTC (permalink / raw)
  To: Lars-Peter Clausen; +Cc: alsa-devel@alsa-project.org, Mark Brown, Liam Girdwood

On 3/18/2013 11:27 PM, Lars-Peter Clausen wrote:
> Signed-off-by: Lars-Peter Clausen<lars@metafoo.de>
> ---
>   sound/soc/spear/spear_pcm.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/sound/soc/spear/spear_pcm.c b/sound/soc/spear/spear_pcm.c
> index 5e7aebe..dd71167 100644
> --- a/sound/soc/spear/spear_pcm.c
> +++ b/sound/soc/spear/spear_pcm.c
> @@ -25,7 +25,7 @@
>   #include<sound/soc.h>
>   #include<sound/spear_dma.h>
>
> -struct snd_pcm_hardware spear_pcm_hardware = {
> +static struct snd_pcm_hardware spear_pcm_hardware = {
>   	.info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
>   		 SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID |
>   		 SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME),
> @@ -178,7 +178,7 @@ static int spear_pcm_new(struct snd_soc_pcm_runtime *rtd)
>   	return 0;
>   }
>
> -struct snd_soc_platform_driver spear_soc_platform = {
> +static struct snd_soc_platform_driver spear_soc_platform = {
>   	.ops		=	&spear_pcm_ops,
>   	.pcm_new	=	spear_pcm_new,
>   	.pcm_free	=	spear_pcm_free,

Acked-by: Rajeev Kumar <rajeev-dlh.kumar@st.com>
	

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

* Re: [PATCH 1/2] ASoC: spear_pcm: Update to new pcm_new() API
  2013-03-18 17:57 [PATCH 1/2] ASoC: spear_pcm: Update to new pcm_new() API Lars-Peter Clausen
  2013-03-18 17:57 ` [PATCH 2/2] ASoC: spear_pcm: Staticize non-exported structs Lars-Peter Clausen
@ 2013-03-20 10:03 ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2013-03-20 10:03 UTC (permalink / raw)
  To: Lars-Peter Clausen; +Cc: alsa-devel, Rajeev Kumar, Liam Girdwood


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

On Mon, Mar 18, 2013 at 06:57:23PM +0100, Lars-Peter Clausen wrote:
> Commit 552d1ef6 ("ASoC: core - Optimise and refactor pcm_new() to pass only
> rtd") updated the pcm_new() callback to take the rtd as the only parameter. The

Applied both, 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] 4+ messages in thread

end of thread, other threads:[~2013-03-20 10:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-18 17:57 [PATCH 1/2] ASoC: spear_pcm: Update to new pcm_new() API Lars-Peter Clausen
2013-03-18 17:57 ` [PATCH 2/2] ASoC: spear_pcm: Staticize non-exported structs Lars-Peter Clausen
2013-03-19  3:33   ` Rajeev kumar
2013-03-20 10:03 ` [PATCH 1/2] ASoC: spear_pcm: Update to new pcm_new() API Mark Brown

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.