alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Jassi Brar <jassisinghbrar@gmail.com>
To: alsa-devel@alsa-project.org
Cc: kgene.kim@samsung.com, Jassi Brar <jassi.brar@samsung.com>,
	broonie@opensource.wolfsonmicro.com, ben-linux@fluff.org,
	june.bae@samsung.com, lrg@slimlogic.co.uk, sw.youn@samsung.com
Subject: [PATCH 18/25] ASoC: SMARTQ: Move to use new I2S driver
Date: Tue, 19 Oct 2010 16:07:59 +0900	[thread overview]
Message-ID: <1287472079-30982-1-git-send-email-jassisinghbrar@gmail.com> (raw)
In-Reply-To: <1P85Z9-0007a6-27>

From: Jassi Brar <jassi.brar@samsung.com>

Modify the smartq_wm8987.c to use new i2s controller driver.

Signed-off-by: Jassi Brar <jassi.brar@samsung.com>
---
 sound/soc/s3c24xx/Kconfig         |    2 +-
 sound/soc/s3c24xx/smartq_wm8987.c |   25 +++++++++++--------------
 2 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/sound/soc/s3c24xx/Kconfig b/sound/soc/s3c24xx/Kconfig
index 20fe288..e7fad53 100644
--- a/sound/soc/s3c24xx/Kconfig
+++ b/sound/soc/s3c24xx/Kconfig
@@ -144,7 +144,7 @@ config SND_SOC_SMDK_WM9713
 config SND_S3C64XX_SOC_SMARTQ
 	tristate "SoC I2S Audio support for SmartQ board"
 	depends on SND_S3C24XX_SOC && MACH_SMARTQ
-	select SND_S3C64XX_SOC_I2S
+	select SND_SAMSUNG_I2S
 	select SND_SOC_WM8750
 
 config SND_SOC_GONI_AQUILA_WM8994
diff --git a/sound/soc/s3c24xx/smartq_wm8987.c b/sound/soc/s3c24xx/smartq_wm8987.c
index 1d55312..5fcc420 100644
--- a/sound/soc/s3c24xx/smartq_wm8987.c
+++ b/sound/soc/s3c24xx/smartq_wm8987.c
@@ -25,7 +25,7 @@
 #include <asm/mach-types.h>
 
 #include "dma.h"
-#include "s3c64xx-i2s.h"
+#include "i2s.h"
 
 #include "../codecs/wm8750.h"
 
@@ -41,13 +41,9 @@ static int smartq_hifi_hw_params(struct snd_pcm_substream *substream,
 	struct snd_soc_pcm_runtime *rtd = substream->private_data;
 	struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
 	struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
-	struct s3c_i2sv2_rate_calc div;
 	unsigned int clk = 0;
 	int ret;
 
-	s3c_i2sv2_iis_calc_rate(&div, NULL, params_rate(params),
-				s3c_i2sv2_get_clock(cpu_dai));
-
 	switch (params_rate(params)) {
 	case 8000:
 	case 16000:
@@ -78,20 +74,21 @@ static int smartq_hifi_hw_params(struct snd_pcm_substream *substream,
 	if (ret < 0)
 		return ret;
 
-	/* set the codec system clock for DAC and ADC */
-	ret = snd_soc_dai_set_sysclk(codec_dai, WM8750_SYSCLK, clk,
-				     SND_SOC_CLOCK_IN);
+	/* Use PCLK for I2S signal generation */
+	ret = snd_soc_dai_set_sysclk(cpu_dai, SAMSUNG_I2S_RCLKSRC_0,
+					0, SND_SOC_CLOCK_IN);
 	if (ret < 0)
 		return ret;
 
-	/* set MCLK division for sample rate */
-	ret = snd_soc_dai_set_clkdiv(cpu_dai, S3C_I2SV2_DIV_RCLK, div.fs_div);
+	/* Gate the RCLK output on PAD */
+	ret = snd_soc_dai_set_sysclk(cpu_dai, SAMSUNG_I2S_CDCLK,
+					0, SND_SOC_CLOCK_IN);
 	if (ret < 0)
 		return ret;
 
-	/* set prescaler division for sample rate */
-	ret = snd_soc_dai_set_clkdiv(cpu_dai, S3C_I2SV2_DIV_PRESCALER,
-				     div.clk_div - 1);
+	/* set the codec system clock for DAC and ADC */
+	ret = snd_soc_dai_set_sysclk(codec_dai, WM8750_SYSCLK, clk,
+				     SND_SOC_CLOCK_IN);
 	if (ret < 0)
 		return ret;
 
@@ -211,7 +208,7 @@ static struct snd_soc_dai_link smartq_dai[] = {
 	{
 		.name		= "wm8987",
 		.stream_name	= "SmartQ Hi-Fi",
-		.cpu_dai_name	= "s3c64xx-i2s.0",
+		.cpu_dai_name	= "samsung-i2s.0",
 		.codec_dai_name	= "wm8750-hifi",
 		.platform_name	= "samsung-audio",
 		.codec_name	= "wm8750-codec.0-0x1a",
-- 
1.6.2.5

  parent reply	other threads:[~2010-10-19  7:17 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1P85Z9-0007a6-27>
2010-10-19  7:04 ` [PATCH 01/25] ASoC: WM8580: Remove useless assignment Jassi Brar
2010-10-19 10:02   ` Liam Girdwood
2010-10-19 10:21   ` Mark Brown
2010-10-19  7:05 ` [PATCH 02/25] ASoC: Samsung: Remove redundant AQUILA driver Jassi Brar
2010-10-19  7:05 ` [PATCH 03/25] ASoC: Samsung: Rename DMA device Jassi Brar
2010-10-19  7:05 ` [PATCH 04/25] ARM: Samsung: Define common audio-dma device Jassi Brar
2010-10-19  7:54   ` Vasily khoruzhick
2010-10-19  7:05 ` [PATCH 05/25] ASoC: Samsung: Rename ASoC DMA driver Jassi Brar
2010-10-19  7:05 ` [PATCH 06/25] ASoC: Samsung: Rename AC97 platform device Jassi Brar
2010-10-19  7:06 ` [PATCH 07/25] ASoC: Samsung: Rename AC97 driver Jassi Brar
2010-10-19  7:06 ` [PATCH 08/25] ASoC: Samsung: Rename PCM driver Jassi Brar
2010-10-19  7:06 ` [PATCH 09/25] ASoC: Samsung: Generalize DMA driver namespace Jassi Brar
2010-10-19  7:06 ` [PATCH 10/25] ASoC: Samsung: Rename s3c64xx I2S device Jassi Brar
2010-10-19  7:07 ` [PATCH 11/25] ASoC: Samsung: Add common I2S driver Jassi Brar
2010-10-19  9:35   ` Mark Brown
2010-10-20  2:22     ` Jassi Brar
2010-10-20  3:13       ` Mark Brown
2010-10-20  3:27         ` Jassi Brar
2010-10-20  4:01           ` Mark Brown
2010-10-22  7:39             ` Jassi Brar
2010-10-22 15:28               ` Mark Brown
2010-10-19  7:07 ` [PATCH 12/25] ARM: S3C64XX: I2S: Upgrade platform device Jassi Brar
2010-10-19  7:07 ` [PATCH 13/25] ARM: S5P6440: " Jassi Brar
2010-10-19  7:07 ` [PATCH 14/25] ARM: S5P6442: " Jassi Brar
2010-10-19  7:07 ` [PATCH 15/25] ARM: S5PC100: " Jassi Brar
2010-10-19  7:07 ` [PATCH 16/25] ARM: S5PV210: " Jassi Brar
2010-10-19  7:07 ` [PATCH 17/25] ARM: S5PV310: Add audio platform devices Jassi Brar
2010-10-19  7:07 ` Jassi Brar [this message]
2010-10-19  7:08 ` [PATCH 19/25] ASoC: GONI: Move to use new I2S driver Jassi Brar
2010-10-19  7:08 ` [PATCH 20/25] ASoC: SMDK64XX: " Jassi Brar
2010-10-19  7:08 ` [PATCH 21/25] ASoC: S3C64XX: Remove obsoleted I2S drivers Jassi Brar
2010-10-19  7:08 ` [PATCH 22/25] ASoC: SMDK64XX: Rename for other platforms Jassi Brar
2010-10-19  7:08 ` [PATCH 23/25] ASoC: SMDK_WM8580: Enable for SMDKC100 Jassi Brar
2010-10-19  7:09 ` [PATCH 24/25] ASoC: Samsung: Generalize Kconfig symbols Jassi Brar
2010-10-19  7:09 ` [PATCH 25/25] ASoC: Samsung: Rename from s3c24xx to samsung Jassi Brar
2010-10-19  8:16   ` Mark Brown
2010-10-19  8:34     ` Jassi Brar
2010-10-19  8:16 ` Jassi Brar

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=1287472079-30982-1-git-send-email-jassisinghbrar@gmail.com \
    --to=jassisinghbrar@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=ben-linux@fluff.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=jassi.brar@samsung.com \
    --cc=june.bae@samsung.com \
    --cc=kgene.kim@samsung.com \
    --cc=lrg@slimlogic.co.uk \
    --cc=sw.youn@samsung.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;
as well as URLs for NNTP newsgroup(s).