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, june.bae@samsung.com,
	lrg@slimlogic.co.uk, sw.youn@samsung.com
Subject: [PATCHv4 11/18] ASoC: SMARTQ: Move to use new I2S driver
Date: Mon, 22 Nov 2010 15:37:02 +0900	[thread overview]
Message-ID: <1290407822-29399-1-git-send-email-jassisinghbrar@gmail.com> (raw)
In-Reply-To: <1290407690-28917-1-git-send-email-jassisinghbrar@gmail.com>

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 ec870ba..3b9736b 100644
--- a/sound/soc/s3c24xx/Kconfig
+++ b/sound/soc/s3c24xx/Kconfig
@@ -145,7 +145,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 8191939..dde914a 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;
 
@@ -212,7 +209,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-11-22  6:51 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-26  1:30 [PATCHv3] ASoC: Overhaul Samsung drivers Jassi Brar
2010-10-26  1:31 ` [PATCH 01/18] ASoC: Samsung: Remove redundant AQUILA driver Jassi Brar
2010-10-26  1:32 ` [PATCH 02/18] ASoC: Samsung: Rename DMA device Jassi Brar
2010-10-26  1:33 ` [PATCH 05/18] ASoC: Samsung: Rename AC97 platform device Jassi Brar
2010-10-26  1:33 ` [PATCH 06/18] ASoC: Samsung: Rename AC97 driver Jassi Brar
2010-10-26  1:33 ` [PATCH 04/18] ASoC: Samsung: Rename ASoC DMA driver Jassi Brar
2010-10-26  1:33 ` [PATCH 03/18] ARM: Samsung: Define common audio-dma device Jassi Brar
2010-10-26  1:33 ` [PATCH 09/18] ASoC: Samsung: Rename s3c64xx I2S device Jassi Brar
2010-10-26  1:33 ` [PATCH 07/18] ASoC: Samsung: Rename PCM driver Jassi Brar
2010-10-26  1:33 ` [PATCH 08/18] ASoC: Samsung: Generalize DMA driver namespace Jassi Brar
2010-10-26  1:33 ` [PATCH 11/18] ASoC: SMARTQ: Move to use new I2S driver Jassi Brar
2010-10-26  1:33 ` [PATCH 13/18] ASoC: SMDK64XX: " Jassi Brar
2010-10-26  1:33 ` [PATCH 12/18] ASoC: GONI: " Jassi Brar
2010-10-26  1:33 ` [PATCH 10/18] ASoC: Samsung: Add common " Jassi Brar
2010-10-26  1:33 ` [PATCH 15/18] ASoC: SMDK64XX: Rename for other platforms Jassi Brar
2010-10-26  1:33 ` [PATCH 14/18] ASoC: S3C64XX: Remove obsoleted I2S drivers Jassi Brar
2010-10-26  1:33 ` [PATCH 16/18] ASoC: SMDK_WM8580: Enable for SMDKC100 Jassi Brar
2010-10-26  1:33 ` [PATCH 18/18] ASoC: Samsung: Rename from s3c24xx to samsung Jassi Brar
2010-10-26  1:33 ` [PATCH 17/18] ASoC: Samsung: Generalize Kconfig symbols Jassi Brar
2010-11-22  6:34 ` [PATCHv4] ASoC: Overhaul Samsung drivers Jassi Brar
2010-11-22  6:35   ` [PATCHv4 01/18] ASoC: Samsung: Remove redundant AQUILA driver Jassi Brar
2010-11-22  6:35   ` [PATCHv4 02/18] ASoC: Samsung: Rename DMA device Jassi Brar
2010-11-22  7:05     ` Kukjin Kim
2010-11-22  6:35   ` [PATCHv4 03/18] ARM: Samsung: Define common audio-dma device Jassi Brar
2010-11-22  7:07     ` Kukjin Kim
2010-11-22  6:35   ` [PATCHv4 04/18] ASoC: Samsung: Rename ASoC DMA driver Jassi Brar
2010-11-22  6:36   ` [PATCHv4 05/18] ASoC: Samsung: Rename AC97 platform device Jassi Brar
2010-11-22  7:09     ` Kukjin Kim
2010-11-22  6:36   ` [PATCHv4 06/18] ASoC: Samsung: Rename AC97 driver Jassi Brar
2010-11-22  6:36   ` [PATCHv4 07/18] ASoC: Samsung: Rename PCM driver Jassi Brar
2010-11-22  6:36   ` [PATCHv4 08/18] ASoC: Samsung: Generalize DMA driver namespace Jassi Brar
2010-11-22  6:36   ` [PATCHv4 09/18] ASoC: Samsung: Rename s3c64xx I2S device Jassi Brar
2010-11-22  6:36   ` [PATCHv4 10/18] ASoC: Samsung: Add common I2S driver Jassi Brar
2010-11-22  6:37   ` Jassi Brar [this message]
2010-11-22  6:37   ` [PATCHv4 12/18] ASoC: GONI: Move to use new " Jassi Brar
2010-11-22  6:37   ` [PATCHv4 13/18] ASoC: SMDK64XX: " Jassi Brar
2010-11-22  6:37   ` [PATCHv4 14/18] ASoC: S3C64XX: Remove obsoleted I2S drivers Jassi Brar
2010-11-22  6:37   ` [PATCHv4 15/18] ASoC: SMDK64XX: Rename for other platforms Jassi Brar
2010-11-22  6:37   ` [PATCHv4 16/18] ASoC: SMDK_WM8580: Enable for SMDKC100 Jassi Brar
2010-11-22  7:13     ` Kukjin Kim
2010-11-22  6:37   ` [PATCHv4 17/18] ASoC: Samsung: Generalize Kconfig symbols Jassi Brar
2010-11-23 14:12     ` Mark Brown
2010-11-23 14:16       ` Jassi Brar
2010-11-23 14:25         ` Mark Brown
2010-11-22  6:37   ` [PATCHv4 18/18] ASoC: Samsung: Rename from s3c24xx to samsung Jassi Brar
2010-11-23 14:23   ` [PATCHv4] ASoC: Overhaul Samsung drivers 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=1290407822-29399-1-git-send-email-jassisinghbrar@gmail.com \
    --to=jassisinghbrar@gmail.com \
    --cc=alsa-devel@alsa-project.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).