aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJassi Brar <jassi.brar@samsung.com>2010-11-22 01:37:02 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-11-23 09:07:13 -0500
commitb9493d6c3308b6bd0867d7175df03b111cda1afc (patch)
tree463bc3c24f82f029122ed11ded08196387626416
parent1c7ac01807ac89dee5e2ebf8f43fbc4cbba24af6 (diff)
ASoC: SMARTQ: Move to use new I2S driver
Modify the smartq_wm8987.c to use new i2s controller driver. Signed-off-by: Jassi Brar <jassi.brar@samsung.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--sound/soc/s3c24xx/Kconfig2
-rw-r--r--sound/soc/s3c24xx/smartq_wm8987.c25
2 files changed, 12 insertions, 15 deletions
diff --git a/sound/soc/s3c24xx/Kconfig b/sound/soc/s3c24xx/Kconfig
index ec870baf6d7a..3b9736bd7a7e 100644
--- a/sound/soc/s3c24xx/Kconfig
+++ b/sound/soc/s3c24xx/Kconfig
@@ -145,7 +145,7 @@ config SND_SOC_SMDK_WM9713
145config SND_S3C64XX_SOC_SMARTQ 145config SND_S3C64XX_SOC_SMARTQ
146 tristate "SoC I2S Audio support for SmartQ board" 146 tristate "SoC I2S Audio support for SmartQ board"
147 depends on SND_S3C24XX_SOC && MACH_SMARTQ 147 depends on SND_S3C24XX_SOC && MACH_SMARTQ
148 select SND_S3C64XX_SOC_I2S 148 select SND_SAMSUNG_I2S
149 select SND_SOC_WM8750 149 select SND_SOC_WM8750
150 150
151config SND_SOC_GONI_AQUILA_WM8994 151config SND_SOC_GONI_AQUILA_WM8994
diff --git a/sound/soc/s3c24xx/smartq_wm8987.c b/sound/soc/s3c24xx/smartq_wm8987.c
index 968902e8e469..bcb69820f1cc 100644
--- a/sound/soc/s3c24xx/smartq_wm8987.c
+++ b/sound/soc/s3c24xx/smartq_wm8987.c
@@ -25,7 +25,7 @@
25#include <asm/mach-types.h> 25#include <asm/mach-types.h>
26 26
27#include "dma.h" 27#include "dma.h"
28#include "s3c64xx-i2s.h" 28#include "i2s.h"
29 29
30#include "../codecs/wm8750.h" 30#include "../codecs/wm8750.h"
31 31
@@ -41,13 +41,9 @@ static int smartq_hifi_hw_params(struct snd_pcm_substream *substream,
41 struct snd_soc_pcm_runtime *rtd = substream->private_data; 41 struct snd_soc_pcm_runtime *rtd = substream->private_data;
42 struct snd_soc_dai *codec_dai = rtd->dai->codec_dai; 42 struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
43 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; 43 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
44 struct s3c_i2sv2_rate_calc div;
45 unsigned int clk = 0; 44 unsigned int clk = 0;
46 int ret; 45 int ret;
47 46
48 s3c_i2sv2_iis_calc_rate(&div, NULL, params_rate(params),
49 s3c_i2sv2_get_clock(cpu_dai));
50
51 switch (params_rate(params)) { 47 switch (params_rate(params)) {
52 case 8000: 48 case 8000:
53 case 16000: 49 case 16000:
@@ -78,20 +74,21 @@ static int smartq_hifi_hw_params(struct snd_pcm_substream *substream,
78 if (ret < 0) 74 if (ret < 0)
79 return ret; 75 return ret;
80 76
81 /* set the codec system clock for DAC and ADC */ 77 /* Use PCLK for I2S signal generation */
82 ret = snd_soc_dai_set_sysclk(codec_dai, WM8750_SYSCLK, clk, 78 ret = snd_soc_dai_set_sysclk(cpu_dai, SAMSUNG_I2S_RCLKSRC_0,
83 SND_SOC_CLOCK_IN); 79 0, SND_SOC_CLOCK_IN);
84 if (ret < 0) 80 if (ret < 0)
85 return ret; 81 return ret;
86 82
87 /* set MCLK division for sample rate */ 83 /* Gate the RCLK output on PAD */
88 ret = snd_soc_dai_set_clkdiv(cpu_dai, S3C_I2SV2_DIV_RCLK, div.fs_div); 84 ret = snd_soc_dai_set_sysclk(cpu_dai, SAMSUNG_I2S_CDCLK,
85 0, SND_SOC_CLOCK_IN);
89 if (ret < 0) 86 if (ret < 0)
90 return ret; 87 return ret;
91 88
92 /* set prescaler division for sample rate */ 89 /* set the codec system clock for DAC and ADC */
93 ret = snd_soc_dai_set_clkdiv(cpu_dai, S3C_I2SV2_DIV_PRESCALER, 90 ret = snd_soc_dai_set_sysclk(codec_dai, WM8750_SYSCLK, clk,
94 div.clk_div - 1); 91 SND_SOC_CLOCK_IN);
95 if (ret < 0) 92 if (ret < 0)
96 return ret; 93 return ret;
97 94
@@ -212,7 +209,7 @@ static struct snd_soc_dai_link smartq_dai[] = {
212 { 209 {
213 .name = "wm8987", 210 .name = "wm8987",
214 .stream_name = "SmartQ Hi-Fi", 211 .stream_name = "SmartQ Hi-Fi",
215 .cpu_dai_name = "s3c64xx-i2s.0", 212 .cpu_dai_name = "samsung-i2s.0",
216 .codec_dai_name = "wm8750-hifi", 213 .codec_dai_name = "wm8750-hifi",
217 .platform_name = "samsung-audio", 214 .platform_name = "samsung-audio",
218 .codec_name = "wm8750-codec.0-0x1a", 215 .codec_name = "wm8750-codec.0-0x1a",