public inbox for linux-sound@vger.kernel.org
 help / color / mirror / Atom feed
From: Bo Shen <voice.shen@atmel.com>
To: broonie@opensource.wolfsonmicro.com, plagnioj@jcrosoft.com,
	nicolas.ferre@atmel.com
Cc: linux-arm-kernel@lists.infradead.org,
	devicetree-discuss@lists.ozlabs.org, linux-sound@vger.kernel.org,
	alsa-devel@alsa-project.org, Bo Shen <voice.shen@atmel.com>
Subject: [Patch v6 3/4] ASoC: atmel-ssc-dai: match new method of dai and pcm register
Date: Wed, 14 Nov 2012 10:09:10 +0000	[thread overview]
Message-ID: <1352887751-21848-4-git-send-email-voice.shen@atmel.com> (raw)
In-Reply-To: <1352887751-21848-1-git-send-email-voice.shen@atmel.com>

Remove unneeded code with the new method of dai and pcm register

Signed-off-by: Bo Shen <voice.shen@atmel.com>
---
Change since v5
  - initial patch
  - split from the previous patch
---
 arch/arm/mach-at91/at91sam9260_devices.c |    9 ---------
 arch/arm/mach-at91/board-sam9g20ek.c     |    6 ------
 sound/soc/atmel/sam9g20_wm8731.c         |   12 ++++++++++--
 3 files changed, 10 insertions(+), 17 deletions(-)

diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c
index df7bebf..6959fd2 100644
--- a/arch/arm/mach-at91/at91sam9260_devices.c
+++ b/arch/arm/mach-at91/at91sam9260_devices.c
@@ -768,14 +768,6 @@ static inline void configure_ssc_pins(unsigned pins)
 		at91_set_A_periph(AT91_PIN_PB21, 1);
 }
 
-static struct platform_device at91sam9260_ssc_dai_device = {
-	.name	= "atmel-ssc-dai",
-	.id	= 0,
-	.dev	= {
-		.parent	= &(at91sam9260_ssc_device.dev),
-	},
-};
-
 /*
  * SSC controllers are accessed through library code, instead of any
  * kind of all-singing/all-dancing driver.  For example one could be
@@ -800,7 +792,6 @@ void __init at91_add_device_ssc(unsigned id, unsigned pins)
 	}
 
 	platform_device_register(pdev);
-	platform_device_register(&at91sam9260_ssc_dai_device);
 }
 
 #else
diff --git a/arch/arm/mach-at91/board-sam9g20ek.c b/arch/arm/mach-at91/board-sam9g20ek.c
index 5b6a6f9..ebdbf42 100644
--- a/arch/arm/mach-at91/board-sam9g20ek.c
+++ b/arch/arm/mach-at91/board-sam9g20ek.c
@@ -353,11 +353,6 @@ static struct i2c_board_info __initdata ek_i2c_devices[] = {
         },
 };
 
-static struct platform_device sam9g20ek_pcm_device = {
-	.name	= "atmel-pcm-audio",
-	.id = -1,
-};
-
 static struct platform_device sam9g20ek_audio_device = {
 	.name   = "at91sam9g20ek-audio",
 	.id     = -1,
@@ -365,7 +360,6 @@ static struct platform_device sam9g20ek_audio_device = {
 
 static void __init ek_add_device_audio(void)
 {
-	platform_device_register(&sam9g20ek_pcm_device);
 	platform_device_register(&sam9g20ek_audio_device);
 }
 
diff --git a/sound/soc/atmel/sam9g20_wm8731.c b/sound/soc/atmel/sam9g20_wm8731.c
index 228ca6a..4deba18 100644
--- a/sound/soc/atmel/sam9g20_wm8731.c
+++ b/sound/soc/atmel/sam9g20_wm8731.c
@@ -179,10 +179,10 @@ static int at91sam9g20ek_wm8731_init(struct snd_soc_pcm_runtime *rtd)
 static struct snd_soc_dai_link at91sam9g20ek_dai = {
 	.name = "WM8731",
 	.stream_name = "WM8731 PCM",
-	.cpu_dai_name = "atmel-ssc-dai.0",
+	.cpu_dai_name = "at91rm9200_ssc.0",
 	.codec_dai_name = "wm8731-hifi",
 	.init = at91sam9g20ek_wm8731_init,
-	.platform_name = "atmel-pcm-audio",
+	.platform_name = "at91rm9200_ssc.0",
 	.codec_name = "wm8731.0-001b",
 	.ops = &at91sam9g20ek_ops,
 };
@@ -204,6 +204,12 @@ static int __devinit at91sam9g20ek_audio_probe(struct platform_device *pdev)
 	if (!(machine_is_at91sam9g20ek() || machine_is_at91sam9g20ek_2mmc()))
 		return -ENODEV;
 
+	ret = atmel_ssc_set_audio(0);
+	if (ret) {
+		dev_err(&pdev->dev, "ssc channel is not valid\n");
+		return -EINVAL;
+	}
+
 	/*
 	 * Codec MCLK is supplied by PCK0 - set it up.
 	 */
@@ -241,6 +247,7 @@ err_mclk:
 	clk_put(mclk);
 	mclk = NULL;
 err:
+	atmel_ssc_put_audio(0);
 	return ret;
 }
 
@@ -248,6 +255,7 @@ static int __devexit at91sam9g20ek_audio_remove(struct platform_device *pdev)
 {
 	struct snd_soc_card *card = platform_get_drvdata(pdev);
 
+	atmel_ssc_put_audio(0);
 	snd_soc_unregister_card(card);
 	clk_put(mclk);
 	mclk = NULL;
-- 
1.7.9.5


  parent reply	other threads:[~2012-11-14 10:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-14 10:09 [Patch v6 0/4] ASoC: atmel-ssc: Add pinctrl support and change register method Bo Shen
2012-11-14 10:09 ` [Patch v6 1/4] ARM: at91: atmel-ssc: add pinctrl support Bo Shen
2012-11-16  1:03   ` Mark Brown
2012-11-16  2:43     ` Bo Shen
2012-11-16  4:48       ` Mark Brown
2012-11-14 10:09 ` [Patch v6 2/4] ASoC: atmel-ssc-dai: register dai and pcm directly Bo Shen
2012-11-16  1:25   ` Mark Brown
2012-11-14 10:09 ` Bo Shen [this message]
2012-11-16  1:26   ` [Patch v6 3/4] ASoC: atmel-ssc-dai: match new method of dai and pcm register Mark Brown
2012-11-14 10:09 ` [Patch v6 4/4] ASoC: at91sam9g20ek-wm8731: convert to dt support Bo Shen
2012-11-16  1:28   ` Mark Brown
     [not found]   ` <1352887751-21848-5-git-send-email-voice.shen-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
2012-11-26 21:23     ` Arnd Bergmann
2012-11-27  2:54       ` Bo Shen
2012-11-27  8:44         ` Arnd Bergmann
2012-11-27 10:01           ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1352887751-21848-4-git-send-email-voice.shen@atmel.com \
    --to=voice.shen@atmel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=nicolas.ferre@atmel.com \
    --cc=plagnioj@jcrosoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox