aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-03-09 07:05:21 -0400
committerTakashi Iwai <tiwai@suse.de>2009-03-09 07:05:21 -0400
commit0a4e1c9069b3cc2a9e5b57898ac9be94314e8efa (patch)
treee0f3184596d3940ffc7d0434f85067920df1b596 /sound/soc
parentf271fa28fbaf947d9c79f188dd149176da727dd5 (diff)
parenta381934e5f9c0c3c292d780d61f5be9c22b2ef54 (diff)
Merge branch 'for-2.6.30' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6 into topic/asoc
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/codecs/Kconfig4
-rw-r--r--sound/soc/codecs/Makefile2
-rw-r--r--sound/soc/codecs/ak4104.c363
-rw-r--r--sound/soc/codecs/ak4104.h7
-rw-r--r--sound/soc/codecs/cs4270.c15
-rw-r--r--sound/soc/codecs/wm8753.c5
-rw-r--r--sound/soc/davinci/Kconfig2
-rw-r--r--sound/soc/fsl/fsl_dma.c3
-rw-r--r--sound/soc/fsl/fsl_ssi.c23
-rw-r--r--sound/soc/s3c24xx/neo1973_wm8753.c44
-rw-r--r--sound/soc/s3c24xx/s3c-i2s-v2.c49
-rw-r--r--sound/soc/s3c24xx/s3c2412-i2s.c12
-rw-r--r--sound/soc/s3c24xx/s3c24xx-i2s.c49
-rw-r--r--sound/soc/s3c24xx/s3c24xx-pcm.c45
14 files changed, 482 insertions, 141 deletions
diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index 628a591c728f..a1af311e7f06 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -14,6 +14,7 @@ config SND_SOC_ALL_CODECS
14 select SND_SOC_AC97_CODEC if SND_SOC_AC97_BUS 14 select SND_SOC_AC97_CODEC if SND_SOC_AC97_BUS
15 select SND_SOC_AD1980 if SND_SOC_AC97_BUS 15 select SND_SOC_AD1980 if SND_SOC_AC97_BUS
16 select SND_SOC_AD73311 if I2C 16 select SND_SOC_AD73311 if I2C
17 select SND_SOC_AK4104 if SPI_MASTER
17 select SND_SOC_AK4535 if I2C 18 select SND_SOC_AK4535 if I2C
18 select SND_SOC_CS4270 if I2C 19 select SND_SOC_CS4270 if I2C
19 select SND_SOC_PCM3008 20 select SND_SOC_PCM3008
@@ -60,6 +61,9 @@ config SND_SOC_AD1980
60config SND_SOC_AD73311 61config SND_SOC_AD73311
61 tristate 62 tristate
62 63
64config SND_SOC_AK4104
65 tristate
66
63config SND_SOC_AK4535 67config SND_SOC_AK4535
64 tristate 68 tristate
65 69
diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile
index 3664cdc300b2..4717c3c99040 100644
--- a/sound/soc/codecs/Makefile
+++ b/sound/soc/codecs/Makefile
@@ -1,6 +1,7 @@
1snd-soc-ac97-objs := ac97.o 1snd-soc-ac97-objs := ac97.o
2snd-soc-ad1980-objs := ad1980.o 2snd-soc-ad1980-objs := ad1980.o
3snd-soc-ad73311-objs := ad73311.o 3snd-soc-ad73311-objs := ad73311.o
4snd-soc-ak4104-objs := ak4104.o
4snd-soc-ak4535-objs := ak4535.o 5snd-soc-ak4535-objs := ak4535.o
5snd-soc-cs4270-objs := cs4270.o 6snd-soc-cs4270-objs := cs4270.o
6snd-soc-l3-objs := l3.o 7snd-soc-l3-objs := l3.o
@@ -30,6 +31,7 @@ snd-soc-wm9713-objs := wm9713.o
30obj-$(CONFIG_SND_SOC_AC97_CODEC) += snd-soc-ac97.o 31obj-$(CONFIG_SND_SOC_AC97_CODEC) += snd-soc-ac97.o
31obj-$(CONFIG_SND_SOC_AD1980) += snd-soc-ad1980.o 32obj-$(CONFIG_SND_SOC_AD1980) += snd-soc-ad1980.o
32obj-$(CONFIG_SND_SOC_AD73311) += snd-soc-ad73311.o 33obj-$(CONFIG_SND_SOC_AD73311) += snd-soc-ad73311.o
34obj-$(CONFIG_SND_SOC_AK4104) += snd-soc-ak4104.o
33obj-$(CONFIG_SND_SOC_AK4535) += snd-soc-ak4535.o 35obj-$(CONFIG_SND_SOC_AK4535) += snd-soc-ak4535.o
34obj-$(CONFIG_SND_SOC_CS4270) += snd-soc-cs4270.o 36obj-$(CONFIG_SND_SOC_CS4270) += snd-soc-cs4270.o
35obj-$(CONFIG_SND_SOC_L3) += snd-soc-l3.o 37obj-$(CONFIG_SND_SOC_L3) += snd-soc-l3.o
diff --git a/sound/soc/codecs/ak4104.c b/sound/soc/codecs/ak4104.c
new file mode 100644
index 000000000000..338381f4fe1e
--- /dev/null
+++ b/sound/soc/codecs/ak4104.c
@@ -0,0 +1,363 @@
1/*
2 * AK4104 ALSA SoC (ASoC) driver
3 *
4 * Copyright (c) 2009 Daniel Mack <daniel@caiaq.de>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 */
11
12#include <linux/module.h>
13#include <sound/core.h>
14#include <sound/soc.h>
15#include <sound/initval.h>
16#include <linux/spi/spi.h>
17#include <sound/asoundef.h>
18
19#include "ak4104.h"
20
21/* AK4104 registers addresses */
22#define AK4104_REG_CONTROL1 0x00
23#define AK4104_REG_RESERVED 0x01
24#define AK4104_REG_CONTROL2 0x02
25#define AK4104_REG_TX 0x03
26#define AK4104_REG_CHN_STATUS(x) ((x) + 0x04)
27#define AK4104_NUM_REGS 10
28
29#define AK4104_REG_MASK 0x1f
30#define AK4104_READ 0xc0
31#define AK4104_WRITE 0xe0
32#define AK4104_RESERVED_VAL 0x5b
33
34/* Bit masks for AK4104 registers */
35#define AK4104_CONTROL1_RSTN (1 << 0)
36#define AK4104_CONTROL1_PW (1 << 1)
37#define AK4104_CONTROL1_DIF0 (1 << 2)
38#define AK4104_CONTROL1_DIF1 (1 << 3)
39
40#define AK4104_CONTROL2_SEL0 (1 << 0)
41#define AK4104_CONTROL2_SEL1 (1 << 1)
42#define AK4104_CONTROL2_MODE (1 << 2)
43
44#define AK4104_TX_TXE (1 << 0)
45#define AK4104_TX_V (1 << 1)
46
47#define DRV_NAME "ak4104"
48
49struct ak4104_private {
50 struct snd_soc_codec codec;
51 u8 reg_cache[AK4104_NUM_REGS];
52};
53
54static int ak4104_fill_cache(struct snd_soc_codec *codec)
55{
56 int i;
57 u8 *reg_cache = codec->reg_cache;
58 struct spi_device *spi = codec->control_data;
59
60 for (i = 0; i < codec->reg_cache_size; i++) {
61 int ret = spi_w8r8(spi, i | AK4104_READ);
62 if (ret < 0) {
63 dev_err(&spi->dev, "SPI write failure\n");
64 return ret;
65 }
66
67 reg_cache[i] = ret;
68 }
69
70 return 0;
71}
72
73static unsigned int ak4104_read_reg_cache(struct snd_soc_codec *codec,
74 unsigned int reg)
75{
76 u8 *reg_cache = codec->reg_cache;
77
78 if (reg >= codec->reg_cache_size)
79 return -EINVAL;
80
81 return reg_cache[reg];
82}
83
84static int ak4104_spi_write(struct snd_soc_codec *codec, unsigned int reg,
85 unsigned int value)
86{
87 u8 *cache = codec->reg_cache;
88 struct spi_device *spi = codec->control_data;
89
90 if (reg >= codec->reg_cache_size)
91 return -EINVAL;
92
93 reg &= AK4104_REG_MASK;
94 reg |= AK4104_WRITE;
95
96 /* only write to the hardware if value has changed */
97 if (cache[reg] != value) {
98 u8 tmp[2] = { reg, value };
99 if (spi_write(spi, tmp, sizeof(tmp))) {
100 dev_err(&spi->dev, "SPI write failed\n");
101 return -EIO;
102 }
103
104 cache[reg] = value;
105 }
106
107 return 0;
108}
109
110static int ak4104_set_dai_fmt(struct snd_soc_dai *codec_dai,
111 unsigned int format)
112{
113 struct snd_soc_codec *codec = codec_dai->codec;
114 int val = 0;
115
116 val = ak4104_read_reg_cache(codec, AK4104_REG_CONTROL1);
117 if (val < 0)
118 return val;
119
120 val &= ~(AK4104_CONTROL1_DIF0 | AK4104_CONTROL1_DIF1);
121
122 /* set DAI format */
123 switch (format & SND_SOC_DAIFMT_FORMAT_MASK) {
124 case SND_SOC_DAIFMT_RIGHT_J:
125 break;
126 case SND_SOC_DAIFMT_LEFT_J:
127 val |= AK4104_CONTROL1_DIF0;
128 break;
129 case SND_SOC_DAIFMT_I2S:
130 val |= AK4104_CONTROL1_DIF0 | AK4104_CONTROL1_DIF1;
131 break;
132 default:
133 dev_err(codec->dev, "invalid dai format\n");
134 return -EINVAL;
135 }
136
137 /* This device can only be slave */
138 if ((format & SND_SOC_DAIFMT_MASTER_MASK) != SND_SOC_DAIFMT_CBS_CFS)
139 return -EINVAL;
140
141 return ak4104_spi_write(codec, AK4104_REG_CONTROL1, val);
142}
143
144static int ak4104_hw_params(struct snd_pcm_substream *substream,
145 struct snd_pcm_hw_params *params,
146 struct snd_soc_dai *dai)
147{
148 struct snd_soc_pcm_runtime *rtd = substream->private_data;
149 struct snd_soc_device *socdev = rtd->socdev;
150 struct snd_soc_codec *codec = socdev->card->codec;
151 int val = 0;
152
153 /* set the IEC958 bits: consumer mode, no copyright bit */
154 val |= IEC958_AES0_CON_NOT_COPYRIGHT;
155 ak4104_spi_write(codec, AK4104_REG_CHN_STATUS(0), val);
156
157 val = 0;
158
159 switch (params_rate(params)) {
160 case 44100:
161 val |= IEC958_AES3_CON_FS_44100;
162 break;
163 case 48000:
164 val |= IEC958_AES3_CON_FS_48000;
165 break;
166 case 32000:
167 val |= IEC958_AES3_CON_FS_32000;
168 break;
169 default:
170 dev_err(codec->dev, "unsupported sampling rate\n");
171 return -EINVAL;
172 }
173
174 return ak4104_spi_write(codec, AK4104_REG_CHN_STATUS(3), val);
175}
176
177struct snd_soc_dai ak4104_dai = {
178 .name = DRV_NAME,
179 .playback = {
180 .stream_name = "Playback",
181 .channels_min = 2,
182 .channels_max = 2,
183 .rates = SNDRV_PCM_RATE_44100 |
184 SNDRV_PCM_RATE_48000 |
185 SNDRV_PCM_RATE_32000,
186 .formats = SNDRV_PCM_FMTBIT_S16_LE |
187 SNDRV_PCM_FMTBIT_S24_3LE |
188 SNDRV_PCM_FMTBIT_S24_LE
189 },
190 .ops = {
191 .hw_params = ak4104_hw_params,
192 .set_fmt = ak4104_set_dai_fmt,
193 }
194};
195
196static struct snd_soc_codec *ak4104_codec;
197
198static int ak4104_spi_probe(struct spi_device *spi)
199{
200 struct snd_soc_codec *codec;
201 struct ak4104_private *ak4104;
202 int ret, val;
203
204 spi->bits_per_word = 8;
205 spi->mode = SPI_MODE_0;
206 ret = spi_setup(spi);
207 if (ret < 0)
208 return ret;
209
210 ak4104 = kzalloc(sizeof(struct ak4104_private), GFP_KERNEL);
211 if (!ak4104) {
212 dev_err(&spi->dev, "could not allocate codec\n");
213 return -ENOMEM;
214 }
215
216 codec = &ak4104->codec;
217 mutex_init(&codec->mutex);
218 INIT_LIST_HEAD(&codec->dapm_widgets);
219 INIT_LIST_HEAD(&codec->dapm_paths);
220
221 codec->dev = &spi->dev;
222 codec->name = DRV_NAME;
223 codec->owner = THIS_MODULE;
224 codec->dai = &ak4104_dai;
225 codec->num_dai = 1;
226 codec->private_data = ak4104;
227 codec->control_data = spi;
228 codec->reg_cache = ak4104->reg_cache;
229 codec->reg_cache_size = AK4104_NUM_REGS;
230
231 /* read all regs and fill the cache */
232 ret = ak4104_fill_cache(codec);
233 if (ret < 0) {
234 dev_err(&spi->dev, "failed to fill register cache\n");
235 return ret;
236 }
237
238 /* read the 'reserved' register - according to the datasheet, it
239 * should contain 0x5b. Not a good way to verify the presence of
240 * the device, but there is no hardware ID register. */
241 if (ak4104_read_reg_cache(codec, AK4104_REG_RESERVED) !=
242 AK4104_RESERVED_VAL) {
243 ret = -ENODEV;
244 goto error_free_codec;
245 }
246
247 /* set power-up and non-reset bits */
248 val = ak4104_read_reg_cache(codec, AK4104_REG_CONTROL1);
249 val |= AK4104_CONTROL1_PW | AK4104_CONTROL1_RSTN;
250 ret = ak4104_spi_write(codec, AK4104_REG_CONTROL1, val);
251 if (ret < 0)
252 goto error_free_codec;
253
254 /* enable transmitter */
255 val = ak4104_read_reg_cache(codec, AK4104_REG_TX);
256 val |= AK4104_TX_TXE;
257 ret = ak4104_spi_write(codec, AK4104_REG_TX, val);
258 if (ret < 0)
259 goto error_free_codec;
260
261 ak4104_codec = codec;
262 ret = snd_soc_register_dai(&ak4104_dai);
263 if (ret < 0) {
264 dev_err(&spi->dev, "failed to register DAI\n");
265 goto error_free_codec;
266 }
267
268 spi_set_drvdata(spi, ak4104);
269 dev_info(&spi->dev, "SPI device initialized\n");
270 return 0;
271
272error_free_codec:
273 kfree(ak4104);
274 ak4104_dai.dev = NULL;
275 return ret;
276}
277
278static int __devexit ak4104_spi_remove(struct spi_device *spi)
279{
280 int ret, val;
281 struct ak4104_private *ak4104 = spi_get_drvdata(spi);
282
283 val = ak4104_read_reg_cache(&ak4104->codec, AK4104_REG_CONTROL1);
284 if (val < 0)
285 return val;
286
287 /* clear power-up and non-reset bits */
288 val &= ~(AK4104_CONTROL1_PW | AK4104_CONTROL1_RSTN);
289 ret = ak4104_spi_write(&ak4104->codec, AK4104_REG_CONTROL1, val);
290 if (ret < 0)
291 return ret;
292
293 ak4104_codec = NULL;
294 kfree(ak4104);
295 return 0;
296}
297
298static int ak4104_probe(struct platform_device *pdev)
299{
300 struct snd_soc_device *socdev = platform_get_drvdata(pdev);
301 struct snd_soc_codec *codec = ak4104_codec;
302 int ret;
303
304 /* Connect the codec to the socdev. snd_soc_new_pcms() needs this. */
305 socdev->card->codec = codec;
306
307 /* Register PCMs */
308 ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1);
309 if (ret < 0) {
310 dev_err(codec->dev, "failed to create pcms\n");
311 return ret;
312 }
313
314 /* Register the socdev */
315 ret = snd_soc_init_card(socdev);
316 if (ret < 0) {
317 dev_err(codec->dev, "failed to register card\n");
318 snd_soc_free_pcms(socdev);
319 return ret;
320 }
321
322 return 0;
323}
324
325static int ak4104_remove(struct platform_device *pdev)
326{
327 struct snd_soc_device *socdev = platform_get_drvdata(pdev);
328 snd_soc_free_pcms(socdev);
329 return 0;
330};
331
332struct snd_soc_codec_device soc_codec_device_ak4104 = {
333 .probe = ak4104_probe,
334 .remove = ak4104_remove
335};
336EXPORT_SYMBOL_GPL(soc_codec_device_ak4104);
337
338static struct spi_driver ak4104_spi_driver = {
339 .driver = {
340 .name = DRV_NAME,
341 .owner = THIS_MODULE,
342 },
343 .probe = ak4104_spi_probe,
344 .remove = __devexit_p(ak4104_spi_remove),
345};
346
347static int __init ak4104_init(void)
348{
349 pr_info("Asahi Kasei AK4104 ALSA SoC Codec Driver\n");
350 return spi_register_driver(&ak4104_spi_driver);
351}
352module_init(ak4104_init);
353
354static void __exit ak4104_exit(void)
355{
356 spi_unregister_driver(&ak4104_spi_driver);
357}
358module_exit(ak4104_exit);
359
360MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>");
361MODULE_DESCRIPTION("Asahi Kasei AK4104 ALSA SoC driver");
362MODULE_LICENSE("GPL");
363
diff --git a/sound/soc/codecs/ak4104.h b/sound/soc/codecs/ak4104.h
new file mode 100644
index 000000000000..eb88fe7e4def
--- /dev/null
+++ b/sound/soc/codecs/ak4104.h
@@ -0,0 +1,7 @@
1#ifndef _AK4104_H
2#define _AK4104_H
3
4extern struct snd_soc_dai ak4104_dai;
5extern struct snd_soc_codec_device soc_codec_device_ak4104;
6
7#endif
diff --git a/sound/soc/codecs/cs4270.c b/sound/soc/codecs/cs4270.c
index f86f33cc1798..0e0c23ee6afc 100644
--- a/sound/soc/codecs/cs4270.c
+++ b/sound/soc/codecs/cs4270.c
@@ -12,14 +12,13 @@
12 * 12 *
13 * Current features/limitations: 13 * Current features/limitations:
14 * 14 *
15 * 1) Software mode is supported. Stand-alone mode is not supported. 15 * - Software mode is supported. Stand-alone mode is not supported.
16 * 2) Only I2C is supported, not SPI 16 * - Only I2C is supported, not SPI
17 * 3) Only Master mode is supported, not Slave. 17 * - Support for master and slave mode
18 * 4) The machine driver's 'startup' function must call 18 * - The machine driver's 'startup' function must call
19 * cs4270_set_dai_sysclk() with the value of MCLK. 19 * cs4270_set_dai_sysclk() with the value of MCLK.
20 * 5) Only I2S and left-justified modes are supported 20 * - Only I2S and left-justified modes are supported
21 * 6) Power management is not supported 21 * - Power management is not supported
22 * 7) The only supported control is volume and hardware mute (if enabled)
23 */ 22 */
24 23
25#include <linux/module.h> 24#include <linux/module.h>
diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c
index 7f353e935d71..1d5eca89de60 100644
--- a/sound/soc/codecs/wm8753.c
+++ b/sound/soc/codecs/wm8753.c
@@ -51,11 +51,6 @@
51 51
52#include "wm8753.h" 52#include "wm8753.h"
53 53
54#ifdef CONFIG_SPI_MASTER
55static struct spi_driver wm8753_spi_driver;
56static int wm8753_spi_write(struct spi_device *spi, const char *data, int len);
57#endif
58
59static int caps_charge = 2000; 54static int caps_charge = 2000;
60module_param(caps_charge, int, 0); 55module_param(caps_charge, int, 0);
61MODULE_PARM_DESC(caps_charge, "WM8753 cap charge time (msecs)"); 56MODULE_PARM_DESC(caps_charge, "WM8753 cap charge time (msecs)");
diff --git a/sound/soc/davinci/Kconfig b/sound/soc/davinci/Kconfig
index b502741692d6..bd7392c9657e 100644
--- a/sound/soc/davinci/Kconfig
+++ b/sound/soc/davinci/Kconfig
@@ -20,7 +20,7 @@ config SND_DAVINCI_SOC_EVM
20 20
21config SND_DAVINCI_SOC_SFFSDR 21config SND_DAVINCI_SOC_SFFSDR
22 tristate "SoC Audio support for SFFSDR" 22 tristate "SoC Audio support for SFFSDR"
23 depends on SND_DAVINCI_SOC && MACH_DAVINCI_SFFSDR 23 depends on SND_DAVINCI_SOC && MACH_SFFSDR
24 select SND_DAVINCI_SOC_I2S 24 select SND_DAVINCI_SOC_I2S
25 select SND_SOC_PCM3008 25 select SND_SOC_PCM3008
26 select SFFSDR_FPGA 26 select SFFSDR_FPGA
diff --git a/sound/soc/fsl/fsl_dma.c b/sound/soc/fsl/fsl_dma.c
index 58a3fa497503..b3eb8570cd7b 100644
--- a/sound/soc/fsl/fsl_dma.c
+++ b/sound/soc/fsl/fsl_dma.c
@@ -142,7 +142,8 @@ static const struct snd_pcm_hardware fsl_dma_hardware = {
142 .info = SNDRV_PCM_INFO_INTERLEAVED | 142 .info = SNDRV_PCM_INFO_INTERLEAVED |
143 SNDRV_PCM_INFO_MMAP | 143 SNDRV_PCM_INFO_MMAP |
144 SNDRV_PCM_INFO_MMAP_VALID | 144 SNDRV_PCM_INFO_MMAP_VALID |
145 SNDRV_PCM_INFO_JOINT_DUPLEX, 145 SNDRV_PCM_INFO_JOINT_DUPLEX |
146 SNDRV_PCM_INFO_PAUSE,
146 .formats = FSLDMA_PCM_FORMATS, 147 .formats = FSLDMA_PCM_FORMATS,
147 .rates = FSLDMA_PCM_RATES, 148 .rates = FSLDMA_PCM_RATES,
148 .rate_min = 5512, 149 .rate_min = 5512,
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 8cb6bcf2c00f..b7733e6be192 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -464,28 +464,33 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd,
464 464
465 switch (cmd) { 465 switch (cmd) {
466 case SNDRV_PCM_TRIGGER_START: 466 case SNDRV_PCM_TRIGGER_START:
467 case SNDRV_PCM_TRIGGER_RESUME: 467 clrbits32(&ssi->scr, CCSR_SSI_SCR_SSIEN);
468 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 468 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
469 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { 469 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
470 clrbits32(&ssi->scr, CCSR_SSI_SCR_SSIEN);
471 setbits32(&ssi->scr, 470 setbits32(&ssi->scr,
472 CCSR_SSI_SCR_SSIEN | CCSR_SSI_SCR_TE); 471 CCSR_SSI_SCR_SSIEN | CCSR_SSI_SCR_TE);
473 } else { 472 } else {
474 clrbits32(&ssi->scr, CCSR_SSI_SCR_SSIEN); 473 long timeout = jiffies + 10;
474
475 setbits32(&ssi->scr, 475 setbits32(&ssi->scr,
476 CCSR_SSI_SCR_SSIEN | CCSR_SSI_SCR_RE); 476 CCSR_SSI_SCR_SSIEN | CCSR_SSI_SCR_RE);
477 477
478 /* 478 /* Wait until the SSI has filled its FIFO. Without this
479 * I think we need this delay to allow time for the SSI 479 * delay, ALSA complains about overruns. When the FIFO
480 * to put data into its FIFO. Without it, ALSA starts 480 * is full, the DMA controller initiates its first
481 * to complain about overruns. 481 * transfer. Until then, however, the DMA's DAR
482 * register is zero, which translates to an
483 * out-of-bounds pointer. This makes ALSA think an
484 * overrun has occurred.
482 */ 485 */
483 mdelay(1); 486 while (!(in_be32(&ssi->sisr) & CCSR_SSI_SISR_RFF0) &&
487 (jiffies < timeout));
488 if (!(in_be32(&ssi->sisr) & CCSR_SSI_SISR_RFF0))
489 return -EIO;
484 } 490 }
485 break; 491 break;
486 492
487 case SNDRV_PCM_TRIGGER_STOP: 493 case SNDRV_PCM_TRIGGER_STOP:
488 case SNDRV_PCM_TRIGGER_SUSPEND:
489 case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 494 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
490 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 495 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
491 clrbits32(&ssi->scr, CCSR_SSI_SCR_TE); 496 clrbits32(&ssi->scr, CCSR_SSI_SCR_TE);
diff --git a/sound/soc/s3c24xx/neo1973_wm8753.c b/sound/soc/s3c24xx/neo1973_wm8753.c
index 74573352718a..5f6aeec0437d 100644
--- a/sound/soc/s3c24xx/neo1973_wm8753.c
+++ b/sound/soc/s3c24xx/neo1973_wm8753.c
@@ -40,14 +40,6 @@
40#include "s3c24xx-pcm.h" 40#include "s3c24xx-pcm.h"
41#include "s3c24xx-i2s.h" 41#include "s3c24xx-i2s.h"
42 42
43/* Debugging stuff */
44#define S3C24XX_SOC_NEO1973_WM8753_DEBUG 0
45#if S3C24XX_SOC_NEO1973_WM8753_DEBUG
46#define DBG(x...) printk(KERN_DEBUG "s3c24xx-soc-neo1973-wm8753: " x)
47#else
48#define DBG(x...)
49#endif
50
51/* define the scenarios */ 43/* define the scenarios */
52#define NEO_AUDIO_OFF 0 44#define NEO_AUDIO_OFF 0
53#define NEO_GSM_CALL_AUDIO_HANDSET 1 45#define NEO_GSM_CALL_AUDIO_HANDSET 1
@@ -72,7 +64,7 @@ static int neo1973_hifi_hw_params(struct snd_pcm_substream *substream,
72 int ret = 0; 64 int ret = 0;
73 unsigned long iis_clkrate; 65 unsigned long iis_clkrate;
74 66
75 DBG("Entered %s\n", __func__); 67 pr_debug("Entered %s\n", __func__);
76 68
77 iis_clkrate = s3c24xx_i2s_get_clockrate(); 69 iis_clkrate = s3c24xx_i2s_get_clockrate();
78 70
@@ -158,7 +150,7 @@ static int neo1973_hifi_hw_free(struct snd_pcm_substream *substream)
158 struct snd_soc_pcm_runtime *rtd = substream->private_data; 150 struct snd_soc_pcm_runtime *rtd = substream->private_data;
159 struct snd_soc_dai *codec_dai = rtd->dai->codec_dai; 151 struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
160 152
161 DBG("Entered %s\n", __func__); 153 pr_debug("Entered %s\n", __func__);
162 154
163 /* disable the PLL */ 155 /* disable the PLL */
164 return snd_soc_dai_set_pll(codec_dai, WM8753_PLL1, 0, 0); 156 return snd_soc_dai_set_pll(codec_dai, WM8753_PLL1, 0, 0);
@@ -181,7 +173,7 @@ static int neo1973_voice_hw_params(struct snd_pcm_substream *substream,
181 int ret = 0; 173 int ret = 0;
182 unsigned long iis_clkrate; 174 unsigned long iis_clkrate;
183 175
184 DBG("Entered %s\n", __func__); 176 pr_debug("Entered %s\n", __func__);
185 177
186 iis_clkrate = s3c24xx_i2s_get_clockrate(); 178 iis_clkrate = s3c24xx_i2s_get_clockrate();
187 179
@@ -224,7 +216,7 @@ static int neo1973_voice_hw_free(struct snd_pcm_substream *substream)
224 struct snd_soc_pcm_runtime *rtd = substream->private_data; 216 struct snd_soc_pcm_runtime *rtd = substream->private_data;
225 struct snd_soc_dai *codec_dai = rtd->dai->codec_dai; 217 struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
226 218
227 DBG("Entered %s\n", __func__); 219 pr_debug("Entered %s\n", __func__);
228 220
229 /* disable the PLL */ 221 /* disable the PLL */
230 return snd_soc_dai_set_pll(codec_dai, WM8753_PLL2, 0, 0); 222 return snd_soc_dai_set_pll(codec_dai, WM8753_PLL2, 0, 0);
@@ -246,7 +238,7 @@ static int neo1973_get_scenario(struct snd_kcontrol *kcontrol,
246 238
247static int set_scenario_endpoints(struct snd_soc_codec *codec, int scenario) 239static int set_scenario_endpoints(struct snd_soc_codec *codec, int scenario)
248{ 240{
249 DBG("Entered %s\n", __func__); 241 pr_debug("Entered %s\n", __func__);
250 242
251 switch (neo1973_scenario) { 243 switch (neo1973_scenario) {
252 case NEO_AUDIO_OFF: 244 case NEO_AUDIO_OFF:
@@ -330,7 +322,7 @@ static int neo1973_set_scenario(struct snd_kcontrol *kcontrol,
330{ 322{
331 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 323 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
332 324
333 DBG("Entered %s\n", __func__); 325 pr_debug("Entered %s\n", __func__);
334 326
335 if (neo1973_scenario == ucontrol->value.integer.value[0]) 327 if (neo1973_scenario == ucontrol->value.integer.value[0])
336 return 0; 328 return 0;
@@ -344,7 +336,7 @@ static u8 lm4857_regs[4] = {0x00, 0x40, 0x80, 0xC0};
344 336
345static void lm4857_write_regs(void) 337static void lm4857_write_regs(void)
346{ 338{
347 DBG("Entered %s\n", __func__); 339 pr_debug("Entered %s\n", __func__);
348 340
349 if (i2c_master_send(i2c, lm4857_regs, 4) != 4) 341 if (i2c_master_send(i2c, lm4857_regs, 4) != 4)
350 printk(KERN_ERR "lm4857: i2c write failed\n"); 342 printk(KERN_ERR "lm4857: i2c write failed\n");
@@ -357,7 +349,7 @@ static int lm4857_get_reg(struct snd_kcontrol *kcontrol,
357 int shift = (kcontrol->private_value >> 8) & 0x0F; 349 int shift = (kcontrol->private_value >> 8) & 0x0F;
358 int mask = (kcontrol->private_value >> 16) & 0xFF; 350 int mask = (kcontrol->private_value >> 16) & 0xFF;
359 351
360 DBG("Entered %s\n", __func__); 352 pr_debug("Entered %s\n", __func__);
361 353
362 ucontrol->value.integer.value[0] = (lm4857_regs[reg] >> shift) & mask; 354 ucontrol->value.integer.value[0] = (lm4857_regs[reg] >> shift) & mask;
363 return 0; 355 return 0;
@@ -385,7 +377,7 @@ static int lm4857_get_mode(struct snd_kcontrol *kcontrol,
385{ 377{
386 u8 value = lm4857_regs[LM4857_CTRL] & 0x0F; 378 u8 value = lm4857_regs[LM4857_CTRL] & 0x0F;
387 379
388 DBG("Entered %s\n", __func__); 380 pr_debug("Entered %s\n", __func__);
389 381
390 if (value) 382 if (value)
391 value -= 5; 383 value -= 5;
@@ -399,7 +391,7 @@ static int lm4857_set_mode(struct snd_kcontrol *kcontrol,
399{ 391{
400 u8 value = ucontrol->value.integer.value[0]; 392 u8 value = ucontrol->value.integer.value[0];
401 393
402 DBG("Entered %s\n", __func__); 394 pr_debug("Entered %s\n", __func__);
403 395
404 if (value) 396 if (value)
405 value += 5; 397 value += 5;
@@ -508,7 +500,7 @@ static int neo1973_wm8753_init(struct snd_soc_codec *codec)
508{ 500{
509 int i, err; 501 int i, err;
510 502
511 DBG("Entered %s\n", __func__); 503 pr_debug("Entered %s\n", __func__);
512 504
513 /* set up NC codec pins */ 505 /* set up NC codec pins */
514 snd_soc_dapm_nc_pin(codec, "LOUT2"); 506 snd_soc_dapm_nc_pin(codec, "LOUT2");
@@ -593,7 +585,7 @@ static struct snd_soc_device neo1973_snd_devdata = {
593static int lm4857_i2c_probe(struct i2c_client *client, 585static int lm4857_i2c_probe(struct i2c_client *client,
594 const struct i2c_device_id *id) 586 const struct i2c_device_id *id)
595{ 587{
596 DBG("Entered %s\n", __func__); 588 pr_debug("Entered %s\n", __func__);
597 589
598 i2c = client; 590 i2c = client;
599 591
@@ -603,7 +595,7 @@ static int lm4857_i2c_probe(struct i2c_client *client,
603 595
604static int lm4857_i2c_remove(struct i2c_client *client) 596static int lm4857_i2c_remove(struct i2c_client *client)
605{ 597{
606 DBG("Entered %s\n", __func__); 598 pr_debug("Entered %s\n", __func__);
607 599
608 i2c = NULL; 600 i2c = NULL;
609 601
@@ -614,7 +606,7 @@ static u8 lm4857_state;
614 606
615static int lm4857_suspend(struct i2c_client *dev, pm_message_t state) 607static int lm4857_suspend(struct i2c_client *dev, pm_message_t state)
616{ 608{
617 DBG("Entered %s\n", __func__); 609 pr_debug("Entered %s\n", __func__);
618 610
619 dev_dbg(&dev->dev, "lm4857_suspend\n"); 611 dev_dbg(&dev->dev, "lm4857_suspend\n");
620 lm4857_state = lm4857_regs[LM4857_CTRL] & 0xf; 612 lm4857_state = lm4857_regs[LM4857_CTRL] & 0xf;
@@ -627,7 +619,7 @@ static int lm4857_suspend(struct i2c_client *dev, pm_message_t state)
627 619
628static int lm4857_resume(struct i2c_client *dev) 620static int lm4857_resume(struct i2c_client *dev)
629{ 621{
630 DBG("Entered %s\n", __func__); 622 pr_debug("Entered %s\n", __func__);
631 623
632 if (lm4857_state) { 624 if (lm4857_state) {
633 lm4857_regs[LM4857_CTRL] |= (lm4857_state & 0x0f); 625 lm4857_regs[LM4857_CTRL] |= (lm4857_state & 0x0f);
@@ -638,7 +630,7 @@ static int lm4857_resume(struct i2c_client *dev)
638 630
639static void lm4857_shutdown(struct i2c_client *dev) 631static void lm4857_shutdown(struct i2c_client *dev)
640{ 632{
641 DBG("Entered %s\n", __func__); 633 pr_debug("Entered %s\n", __func__);
642 634
643 dev_dbg(&dev->dev, "lm4857_shutdown\n"); 635 dev_dbg(&dev->dev, "lm4857_shutdown\n");
644 lm4857_regs[LM4857_CTRL] &= 0xf0; 636 lm4857_regs[LM4857_CTRL] &= 0xf0;
@@ -669,7 +661,7 @@ static int __init neo1973_init(void)
669{ 661{
670 int ret; 662 int ret;
671 663
672 DBG("Entered %s\n", __func__); 664 pr_debug("Entered %s\n", __func__);
673 665
674 if (!machine_is_neo1973_gta01()) { 666 if (!machine_is_neo1973_gta01()) {
675 printk(KERN_INFO 667 printk(KERN_INFO
@@ -700,7 +692,7 @@ static int __init neo1973_init(void)
700 692
701static void __exit neo1973_exit(void) 693static void __exit neo1973_exit(void)
702{ 694{
703 DBG("Entered %s\n", __func__); 695 pr_debug("Entered %s\n", __func__);
704 696
705 i2c_del_driver(&lm4857_i2c_driver); 697 i2c_del_driver(&lm4857_i2c_driver);
706 platform_device_unregister(neo1973_snd_device); 698 platform_device_unregister(neo1973_snd_device);
diff --git a/sound/soc/s3c24xx/s3c-i2s-v2.c b/sound/soc/s3c24xx/s3c-i2s-v2.c
index 43262e1e8f98..295a4c910262 100644
--- a/sound/soc/s3c24xx/s3c-i2s-v2.c
+++ b/sound/soc/s3c24xx/s3c-i2s-v2.c
@@ -38,13 +38,6 @@
38#include "s3c-i2s-v2.h" 38#include "s3c-i2s-v2.h"
39 39
40#define S3C2412_I2S_DEBUG_CON 0 40#define S3C2412_I2S_DEBUG_CON 0
41#define S3C2412_I2S_DEBUG 0
42
43#if S3C2412_I2S_DEBUG
44#define DBG(x...) printk(KERN_INFO x)
45#else
46#define DBG(x...) do { } while (0)
47#endif
48 41
49static inline struct s3c_i2sv2_info *to_info(struct snd_soc_dai *cpu_dai) 42static inline struct s3c_i2sv2_info *to_info(struct snd_soc_dai *cpu_dai)
50{ 43{
@@ -87,13 +80,13 @@ void s3c2412_snd_txctrl(struct s3c_i2sv2_info *i2s, int on)
87 void __iomem *regs = i2s->regs; 80 void __iomem *regs = i2s->regs;
88 u32 fic, con, mod; 81 u32 fic, con, mod;
89 82
90 DBG("%s(%d)\n", __func__, on); 83 pr_debug("%s(%d)\n", __func__, on);
91 84
92 fic = readl(regs + S3C2412_IISFIC); 85 fic = readl(regs + S3C2412_IISFIC);
93 con = readl(regs + S3C2412_IISCON); 86 con = readl(regs + S3C2412_IISCON);
94 mod = readl(regs + S3C2412_IISMOD); 87 mod = readl(regs + S3C2412_IISMOD);
95 88
96 DBG("%s: IIS: CON=%x MOD=%x FIC=%x\n", __func__, con, mod, fic); 89 pr_debug("%s: IIS: CON=%x MOD=%x FIC=%x\n", __func__, con, mod, fic);
97 90
98 if (on) { 91 if (on) {
99 con |= S3C2412_IISCON_TXDMA_ACTIVE | S3C2412_IISCON_IIS_ACTIVE; 92 con |= S3C2412_IISCON_TXDMA_ACTIVE | S3C2412_IISCON_IIS_ACTIVE;
@@ -148,7 +141,7 @@ void s3c2412_snd_txctrl(struct s3c_i2sv2_info *i2s, int on)
148 141
149 fic = readl(regs + S3C2412_IISFIC); 142 fic = readl(regs + S3C2412_IISFIC);
150 dbg_showcon(__func__, con); 143 dbg_showcon(__func__, con);
151 DBG("%s: IIS: CON=%x MOD=%x FIC=%x\n", __func__, con, mod, fic); 144 pr_debug("%s: IIS: CON=%x MOD=%x FIC=%x\n", __func__, con, mod, fic);
152} 145}
153EXPORT_SYMBOL_GPL(s3c2412_snd_txctrl); 146EXPORT_SYMBOL_GPL(s3c2412_snd_txctrl);
154 147
@@ -157,13 +150,13 @@ void s3c2412_snd_rxctrl(struct s3c_i2sv2_info *i2s, int on)
157 void __iomem *regs = i2s->regs; 150 void __iomem *regs = i2s->regs;
158 u32 fic, con, mod; 151 u32 fic, con, mod;
159 152
160 DBG("%s(%d)\n", __func__, on); 153 pr_debug("%s(%d)\n", __func__, on);
161 154
162 fic = readl(regs + S3C2412_IISFIC); 155 fic = readl(regs + S3C2412_IISFIC);
163 con = readl(regs + S3C2412_IISCON); 156 con = readl(regs + S3C2412_IISCON);
164 mod = readl(regs + S3C2412_IISMOD); 157 mod = readl(regs + S3C2412_IISMOD);
165 158
166 DBG("%s: IIS: CON=%x MOD=%x FIC=%x\n", __func__, con, mod, fic); 159 pr_debug("%s: IIS: CON=%x MOD=%x FIC=%x\n", __func__, con, mod, fic);
167 160
168 if (on) { 161 if (on) {
169 con |= S3C2412_IISCON_RXDMA_ACTIVE | S3C2412_IISCON_IIS_ACTIVE; 162 con |= S3C2412_IISCON_RXDMA_ACTIVE | S3C2412_IISCON_IIS_ACTIVE;
@@ -214,7 +207,7 @@ void s3c2412_snd_rxctrl(struct s3c_i2sv2_info *i2s, int on)
214 } 207 }
215 208
216 fic = readl(regs + S3C2412_IISFIC); 209 fic = readl(regs + S3C2412_IISFIC);
217 DBG("%s: IIS: CON=%x MOD=%x FIC=%x\n", __func__, con, mod, fic); 210 pr_debug("%s: IIS: CON=%x MOD=%x FIC=%x\n", __func__, con, mod, fic);
218} 211}
219EXPORT_SYMBOL_GPL(s3c2412_snd_rxctrl); 212EXPORT_SYMBOL_GPL(s3c2412_snd_rxctrl);
220 213
@@ -227,7 +220,7 @@ static int s3c2412_snd_lrsync(struct s3c_i2sv2_info *i2s)
227 u32 iiscon; 220 u32 iiscon;
228 unsigned long timeout = jiffies + msecs_to_jiffies(5); 221 unsigned long timeout = jiffies + msecs_to_jiffies(5);
229 222
230 DBG("Entered %s\n", __func__); 223 pr_debug("Entered %s\n", __func__);
231 224
232 while (1) { 225 while (1) {
233 iiscon = readl(i2s->regs + S3C2412_IISCON); 226 iiscon = readl(i2s->regs + S3C2412_IISCON);
@@ -252,10 +245,10 @@ static int s3c2412_i2s_set_fmt(struct snd_soc_dai *cpu_dai,
252 struct s3c_i2sv2_info *i2s = to_info(cpu_dai); 245 struct s3c_i2sv2_info *i2s = to_info(cpu_dai);
253 u32 iismod; 246 u32 iismod;
254 247
255 DBG("Entered %s\n", __func__); 248 pr_debug("Entered %s\n", __func__);
256 249
257 iismod = readl(i2s->regs + S3C2412_IISMOD); 250 iismod = readl(i2s->regs + S3C2412_IISMOD);
258 DBG("hw_params r: IISMOD: %x \n", iismod); 251 pr_debug("hw_params r: IISMOD: %x \n", iismod);
259 252
260#if defined(CONFIG_CPU_S3C2412) || defined(CONFIG_CPU_S3C2413) 253#if defined(CONFIG_CPU_S3C2412) || defined(CONFIG_CPU_S3C2413)
261#define IISMOD_MASTER_MASK S3C2412_IISMOD_MASTER_MASK 254#define IISMOD_MASTER_MASK S3C2412_IISMOD_MASTER_MASK
@@ -288,7 +281,7 @@ static int s3c2412_i2s_set_fmt(struct snd_soc_dai *cpu_dai,
288 iismod |= IISMOD_MASTER; 281 iismod |= IISMOD_MASTER;
289 break; 282 break;
290 default: 283 default:
291 DBG("unknwon master/slave format\n"); 284 pr_debug("unknwon master/slave format\n");
292 return -EINVAL; 285 return -EINVAL;
293 } 286 }
294 287
@@ -305,12 +298,12 @@ static int s3c2412_i2s_set_fmt(struct snd_soc_dai *cpu_dai,
305 iismod |= S3C2412_IISMOD_SDF_IIS; 298 iismod |= S3C2412_IISMOD_SDF_IIS;
306 break; 299 break;
307 default: 300 default:
308 DBG("Unknown data format\n"); 301 pr_debug("Unknown data format\n");
309 return -EINVAL; 302 return -EINVAL;
310 } 303 }
311 304
312 writel(iismod, i2s->regs + S3C2412_IISMOD); 305 writel(iismod, i2s->regs + S3C2412_IISMOD);
313 DBG("hw_params w: IISMOD: %x \n", iismod); 306 pr_debug("hw_params w: IISMOD: %x \n", iismod);
314 return 0; 307 return 0;
315} 308}
316 309
@@ -323,7 +316,7 @@ static int s3c2412_i2s_hw_params(struct snd_pcm_substream *substream,
323 struct s3c_i2sv2_info *i2s = to_info(dai->cpu_dai); 316 struct s3c_i2sv2_info *i2s = to_info(dai->cpu_dai);
324 u32 iismod; 317 u32 iismod;
325 318
326 DBG("Entered %s\n", __func__); 319 pr_debug("Entered %s\n", __func__);
327 320
328 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 321 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
329 dai->cpu_dai->dma_data = i2s->dma_playback; 322 dai->cpu_dai->dma_data = i2s->dma_playback;
@@ -332,7 +325,7 @@ static int s3c2412_i2s_hw_params(struct snd_pcm_substream *substream,
332 325
333 /* Working copies of register */ 326 /* Working copies of register */
334 iismod = readl(i2s->regs + S3C2412_IISMOD); 327 iismod = readl(i2s->regs + S3C2412_IISMOD);
335 DBG("%s: r: IISMOD: %x\n", __func__, iismod); 328 pr_debug("%s: r: IISMOD: %x\n", __func__, iismod);
336 329
337 switch (params_format(params)) { 330 switch (params_format(params)) {
338 case SNDRV_PCM_FORMAT_S8: 331 case SNDRV_PCM_FORMAT_S8:
@@ -344,7 +337,7 @@ static int s3c2412_i2s_hw_params(struct snd_pcm_substream *substream,
344 } 337 }
345 338
346 writel(iismod, i2s->regs + S3C2412_IISMOD); 339 writel(iismod, i2s->regs + S3C2412_IISMOD);
347 DBG("%s: w: IISMOD: %x\n", __func__, iismod); 340 pr_debug("%s: w: IISMOD: %x\n", __func__, iismod);
348 return 0; 341 return 0;
349} 342}
350 343
@@ -357,7 +350,7 @@ static int s3c2412_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
357 unsigned long irqs; 350 unsigned long irqs;
358 int ret = 0; 351 int ret = 0;
359 352
360 DBG("Entered %s\n", __func__); 353 pr_debug("Entered %s\n", __func__);
361 354
362 switch (cmd) { 355 switch (cmd) {
363 case SNDRV_PCM_TRIGGER_START: 356 case SNDRV_PCM_TRIGGER_START:
@@ -417,7 +410,7 @@ static int s3c2412_i2s_set_clkdiv(struct snd_soc_dai *cpu_dai,
417 struct s3c_i2sv2_info *i2s = to_info(cpu_dai); 410 struct s3c_i2sv2_info *i2s = to_info(cpu_dai);
418 u32 reg; 411 u32 reg;
419 412
420 DBG("%s(%p, %d, %d)\n", __func__, cpu_dai, div_id, div); 413 pr_debug("%s(%p, %d, %d)\n", __func__, cpu_dai, div_id, div);
421 414
422 switch (div_id) { 415 switch (div_id) {
423 case S3C_I2SV2_DIV_BCLK: 416 case S3C_I2SV2_DIV_BCLK:
@@ -425,7 +418,7 @@ static int s3c2412_i2s_set_clkdiv(struct snd_soc_dai *cpu_dai,
425 reg &= ~S3C2412_IISMOD_BCLK_MASK; 418 reg &= ~S3C2412_IISMOD_BCLK_MASK;
426 writel(reg | div, i2s->regs + S3C2412_IISMOD); 419 writel(reg | div, i2s->regs + S3C2412_IISMOD);
427 420
428 DBG("%s: MOD=%08x\n", __func__, readl(i2s->regs + S3C2412_IISMOD)); 421 pr_debug("%s: MOD=%08x\n", __func__, readl(i2s->regs + S3C2412_IISMOD));
429 break; 422 break;
430 423
431 case S3C_I2SV2_DIV_RCLK: 424 case S3C_I2SV2_DIV_RCLK:
@@ -457,7 +450,7 @@ static int s3c2412_i2s_set_clkdiv(struct snd_soc_dai *cpu_dai,
457 reg = readl(i2s->regs + S3C2412_IISMOD); 450 reg = readl(i2s->regs + S3C2412_IISMOD);
458 reg &= ~S3C2412_IISMOD_RCLK_MASK; 451 reg &= ~S3C2412_IISMOD_RCLK_MASK;
459 writel(reg | div, i2s->regs + S3C2412_IISMOD); 452 writel(reg | div, i2s->regs + S3C2412_IISMOD);
460 DBG("%s: MOD=%08x\n", __func__, readl(i2s->regs + S3C2412_IISMOD)); 453 pr_debug("%s: MOD=%08x\n", __func__, readl(i2s->regs + S3C2412_IISMOD));
461 break; 454 break;
462 455
463 case S3C_I2SV2_DIV_PRESCALER: 456 case S3C_I2SV2_DIV_PRESCALER:
@@ -467,7 +460,7 @@ static int s3c2412_i2s_set_clkdiv(struct snd_soc_dai *cpu_dai,
467 } else { 460 } else {
468 writel(0x0, i2s->regs + S3C2412_IISPSR); 461 writel(0x0, i2s->regs + S3C2412_IISPSR);
469 } 462 }
470 DBG("%s: PSR=%08x\n", __func__, readl(i2s->regs + S3C2412_IISPSR)); 463 pr_debug("%s: PSR=%08x\n", __func__, readl(i2s->regs + S3C2412_IISPSR));
471 break; 464 break;
472 465
473 default: 466 default:
@@ -560,7 +553,7 @@ int s3c_i2sv2_probe(struct platform_device *pdev,
560 553
561 i2s->iis_pclk = clk_get(dev, "iis"); 554 i2s->iis_pclk = clk_get(dev, "iis");
562 if (i2s->iis_pclk == NULL) { 555 if (i2s->iis_pclk == NULL) {
563 DBG("failed to get iis_clock\n"); 556 dev_err(dev, "failed to get iis_clock\n");
564 iounmap(i2s->regs); 557 iounmap(i2s->regs);
565 return -ENOENT; 558 return -ENOENT;
566 } 559 }
diff --git a/sound/soc/s3c24xx/s3c2412-i2s.c b/sound/soc/s3c24xx/s3c2412-i2s.c
index 5099d9396676..1ceae690d019 100644
--- a/sound/soc/s3c24xx/s3c2412-i2s.c
+++ b/sound/soc/s3c24xx/s3c2412-i2s.c
@@ -42,12 +42,6 @@
42 42
43#define S3C2412_I2S_DEBUG 0 43#define S3C2412_I2S_DEBUG 0
44 44
45#if S3C2412_I2S_DEBUG
46#define DBG(x...) printk(KERN_INFO x)
47#else
48#define DBG(x...) do { } while (0)
49#endif
50
51static struct s3c2410_dma_client s3c2412_dma_client_out = { 45static struct s3c2410_dma_client s3c2412_dma_client_out = {
52 .name = "I2S PCM Stereo out" 46 .name = "I2S PCM Stereo out"
53}; 47};
@@ -80,7 +74,7 @@ static int s3c2412_i2s_set_sysclk(struct snd_soc_dai *cpu_dai,
80{ 74{
81 u32 iismod = readl(s3c2412_i2s.regs + S3C2412_IISMOD); 75 u32 iismod = readl(s3c2412_i2s.regs + S3C2412_IISMOD);
82 76
83 DBG("%s(%p, %d, %u, %d)\n", __func__, cpu_dai, clk_id, 77 pr_debug("%s(%p, %d, %u, %d)\n", __func__, cpu_dai, clk_id,
84 freq, dir); 78 freq, dir);
85 79
86 switch (clk_id) { 80 switch (clk_id) {
@@ -115,7 +109,7 @@ static int s3c2412_i2s_probe(struct platform_device *pdev,
115{ 109{
116 int ret; 110 int ret;
117 111
118 DBG("Entered %s\n", __func__); 112 pr_debug("Entered %s\n", __func__);
119 113
120 ret = s3c_i2sv2_probe(pdev, dai, &s3c2412_i2s, S3C2410_PA_IIS); 114 ret = s3c_i2sv2_probe(pdev, dai, &s3c2412_i2s, S3C2410_PA_IIS);
121 if (ret) 115 if (ret)
@@ -126,7 +120,7 @@ static int s3c2412_i2s_probe(struct platform_device *pdev,
126 120
127 s3c2412_i2s.iis_cclk = clk_get(&pdev->dev, "i2sclk"); 121 s3c2412_i2s.iis_cclk = clk_get(&pdev->dev, "i2sclk");
128 if (s3c2412_i2s.iis_cclk == NULL) { 122 if (s3c2412_i2s.iis_cclk == NULL) {
129 DBG("failed to get i2sclk clock\n"); 123 pr_debug("failed to get i2sclk clock\n");
130 iounmap(s3c2412_i2s.regs); 124 iounmap(s3c2412_i2s.regs);
131 return -ENODEV; 125 return -ENODEV;
132 } 126 }
diff --git a/sound/soc/s3c24xx/s3c24xx-i2s.c b/sound/soc/s3c24xx/s3c24xx-i2s.c
index c0c6ec1536b7..580cfed71cc9 100644
--- a/sound/soc/s3c24xx/s3c24xx-i2s.c
+++ b/sound/soc/s3c24xx/s3c24xx-i2s.c
@@ -39,13 +39,6 @@
39#include "s3c24xx-pcm.h" 39#include "s3c24xx-pcm.h"
40#include "s3c24xx-i2s.h" 40#include "s3c24xx-i2s.h"
41 41
42#define S3C24XX_I2S_DEBUG 0
43#if S3C24XX_I2S_DEBUG
44#define DBG(x...) printk(KERN_DEBUG "s3c24xx-i2s: " x)
45#else
46#define DBG(x...)
47#endif
48
49static struct s3c2410_dma_client s3c24xx_dma_client_out = { 42static struct s3c2410_dma_client s3c24xx_dma_client_out = {
50 .name = "I2S PCM Stereo out" 43 .name = "I2S PCM Stereo out"
51}; 44};
@@ -84,13 +77,13 @@ static void s3c24xx_snd_txctrl(int on)
84 u32 iiscon; 77 u32 iiscon;
85 u32 iismod; 78 u32 iismod;
86 79
87 DBG("Entered %s\n", __func__); 80 pr_debug("Entered %s\n", __func__);
88 81
89 iisfcon = readl(s3c24xx_i2s.regs + S3C2410_IISFCON); 82 iisfcon = readl(s3c24xx_i2s.regs + S3C2410_IISFCON);
90 iiscon = readl(s3c24xx_i2s.regs + S3C2410_IISCON); 83 iiscon = readl(s3c24xx_i2s.regs + S3C2410_IISCON);
91 iismod = readl(s3c24xx_i2s.regs + S3C2410_IISMOD); 84 iismod = readl(s3c24xx_i2s.regs + S3C2410_IISMOD);
92 85
93 DBG("r: IISCON: %lx IISMOD: %lx IISFCON: %lx\n", iiscon, iismod, iisfcon); 86 pr_debug("r: IISCON: %lx IISMOD: %lx IISFCON: %lx\n", iiscon, iismod, iisfcon);
94 87
95 if (on) { 88 if (on) {
96 iisfcon |= S3C2410_IISFCON_TXDMA | S3C2410_IISFCON_TXENABLE; 89 iisfcon |= S3C2410_IISFCON_TXDMA | S3C2410_IISFCON_TXENABLE;
@@ -120,7 +113,7 @@ static void s3c24xx_snd_txctrl(int on)
120 writel(iismod, s3c24xx_i2s.regs + S3C2410_IISMOD); 113 writel(iismod, s3c24xx_i2s.regs + S3C2410_IISMOD);
121 } 114 }
122 115
123 DBG("w: IISCON: %lx IISMOD: %lx IISFCON: %lx\n", iiscon, iismod, iisfcon); 116 pr_debug("w: IISCON: %lx IISMOD: %lx IISFCON: %lx\n", iiscon, iismod, iisfcon);
124} 117}
125 118
126static void s3c24xx_snd_rxctrl(int on) 119static void s3c24xx_snd_rxctrl(int on)
@@ -129,13 +122,13 @@ static void s3c24xx_snd_rxctrl(int on)
129 u32 iiscon; 122 u32 iiscon;
130 u32 iismod; 123 u32 iismod;
131 124
132 DBG("Entered %s\n", __func__); 125 pr_debug("Entered %s\n", __func__);
133 126
134 iisfcon = readl(s3c24xx_i2s.regs + S3C2410_IISFCON); 127 iisfcon = readl(s3c24xx_i2s.regs + S3C2410_IISFCON);
135 iiscon = readl(s3c24xx_i2s.regs + S3C2410_IISCON); 128 iiscon = readl(s3c24xx_i2s.regs + S3C2410_IISCON);
136 iismod = readl(s3c24xx_i2s.regs + S3C2410_IISMOD); 129 iismod = readl(s3c24xx_i2s.regs + S3C2410_IISMOD);
137 130
138 DBG("r: IISCON: %lx IISMOD: %lx IISFCON: %lx\n", iiscon, iismod, iisfcon); 131 pr_debug("r: IISCON: %lx IISMOD: %lx IISFCON: %lx\n", iiscon, iismod, iisfcon);
139 132
140 if (on) { 133 if (on) {
141 iisfcon |= S3C2410_IISFCON_RXDMA | S3C2410_IISFCON_RXENABLE; 134 iisfcon |= S3C2410_IISFCON_RXDMA | S3C2410_IISFCON_RXENABLE;
@@ -165,7 +158,7 @@ static void s3c24xx_snd_rxctrl(int on)
165 writel(iismod, s3c24xx_i2s.regs + S3C2410_IISMOD); 158 writel(iismod, s3c24xx_i2s.regs + S3C2410_IISMOD);
166 } 159 }
167 160
168 DBG("w: IISCON: %lx IISMOD: %lx IISFCON: %lx\n", iiscon, iismod, iisfcon); 161 pr_debug("w: IISCON: %lx IISMOD: %lx IISFCON: %lx\n", iiscon, iismod, iisfcon);
169} 162}
170 163
171/* 164/*
@@ -177,7 +170,7 @@ static int s3c24xx_snd_lrsync(void)
177 u32 iiscon; 170 u32 iiscon;
178 int timeout = 50; /* 5ms */ 171 int timeout = 50; /* 5ms */
179 172
180 DBG("Entered %s\n", __func__); 173 pr_debug("Entered %s\n", __func__);
181 174
182 while (1) { 175 while (1) {
183 iiscon = readl(s3c24xx_i2s.regs + S3C2410_IISCON); 176 iiscon = readl(s3c24xx_i2s.regs + S3C2410_IISCON);
@@ -197,7 +190,7 @@ static int s3c24xx_snd_lrsync(void)
197 */ 190 */
198static inline int s3c24xx_snd_is_clkmaster(void) 191static inline int s3c24xx_snd_is_clkmaster(void)
199{ 192{
200 DBG("Entered %s\n", __func__); 193 pr_debug("Entered %s\n", __func__);
201 194
202 return (readl(s3c24xx_i2s.regs + S3C2410_IISMOD) & S3C2410_IISMOD_SLAVE) ? 0:1; 195 return (readl(s3c24xx_i2s.regs + S3C2410_IISMOD) & S3C2410_IISMOD_SLAVE) ? 0:1;
203} 196}
@@ -210,10 +203,10 @@ static int s3c24xx_i2s_set_fmt(struct snd_soc_dai *cpu_dai,
210{ 203{
211 u32 iismod; 204 u32 iismod;
212 205
213 DBG("Entered %s\n", __func__); 206 pr_debug("Entered %s\n", __func__);
214 207
215 iismod = readl(s3c24xx_i2s.regs + S3C2410_IISMOD); 208 iismod = readl(s3c24xx_i2s.regs + S3C2410_IISMOD);
216 DBG("hw_params r: IISMOD: %lx \n", iismod); 209 pr_debug("hw_params r: IISMOD: %lx \n", iismod);
217 210
218 switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { 211 switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
219 case SND_SOC_DAIFMT_CBM_CFM: 212 case SND_SOC_DAIFMT_CBM_CFM:
@@ -238,7 +231,7 @@ static int s3c24xx_i2s_set_fmt(struct snd_soc_dai *cpu_dai,
238 } 231 }
239 232
240 writel(iismod, s3c24xx_i2s.regs + S3C2410_IISMOD); 233 writel(iismod, s3c24xx_i2s.regs + S3C2410_IISMOD);
241 DBG("hw_params w: IISMOD: %lx \n", iismod); 234 pr_debug("hw_params w: IISMOD: %lx \n", iismod);
242 return 0; 235 return 0;
243} 236}
244 237
@@ -249,7 +242,7 @@ static int s3c24xx_i2s_hw_params(struct snd_pcm_substream *substream,
249 struct snd_soc_pcm_runtime *rtd = substream->private_data; 242 struct snd_soc_pcm_runtime *rtd = substream->private_data;
250 u32 iismod; 243 u32 iismod;
251 244
252 DBG("Entered %s\n", __func__); 245 pr_debug("Entered %s\n", __func__);
253 246
254 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 247 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
255 rtd->dai->cpu_dai->dma_data = &s3c24xx_i2s_pcm_stereo_out; 248 rtd->dai->cpu_dai->dma_data = &s3c24xx_i2s_pcm_stereo_out;
@@ -258,7 +251,7 @@ static int s3c24xx_i2s_hw_params(struct snd_pcm_substream *substream,
258 251
259 /* Working copies of register */ 252 /* Working copies of register */
260 iismod = readl(s3c24xx_i2s.regs + S3C2410_IISMOD); 253 iismod = readl(s3c24xx_i2s.regs + S3C2410_IISMOD);
261 DBG("hw_params r: IISMOD: %lx\n", iismod); 254 pr_debug("hw_params r: IISMOD: %lx\n", iismod);
262 255
263 switch (params_format(params)) { 256 switch (params_format(params)) {
264 case SNDRV_PCM_FORMAT_S8: 257 case SNDRV_PCM_FORMAT_S8:
@@ -276,7 +269,7 @@ static int s3c24xx_i2s_hw_params(struct snd_pcm_substream *substream,
276 } 269 }
277 270
278 writel(iismod, s3c24xx_i2s.regs + S3C2410_IISMOD); 271 writel(iismod, s3c24xx_i2s.regs + S3C2410_IISMOD);
279 DBG("hw_params w: IISMOD: %lx\n", iismod); 272 pr_debug("hw_params w: IISMOD: %lx\n", iismod);
280 return 0; 273 return 0;
281} 274}
282 275
@@ -285,7 +278,7 @@ static int s3c24xx_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
285{ 278{
286 int ret = 0; 279 int ret = 0;
287 280
288 DBG("Entered %s\n", __func__); 281 pr_debug("Entered %s\n", __func__);
289 282
290 switch (cmd) { 283 switch (cmd) {
291 case SNDRV_PCM_TRIGGER_START: 284 case SNDRV_PCM_TRIGGER_START:
@@ -327,7 +320,7 @@ static int s3c24xx_i2s_set_sysclk(struct snd_soc_dai *cpu_dai,
327{ 320{
328 u32 iismod = readl(s3c24xx_i2s.regs + S3C2410_IISMOD); 321 u32 iismod = readl(s3c24xx_i2s.regs + S3C2410_IISMOD);
329 322
330 DBG("Entered %s\n", __func__); 323 pr_debug("Entered %s\n", __func__);
331 324
332 iismod &= ~S3C2440_IISMOD_MPLL; 325 iismod &= ~S3C2440_IISMOD_MPLL;
333 326
@@ -353,7 +346,7 @@ static int s3c24xx_i2s_set_clkdiv(struct snd_soc_dai *cpu_dai,
353{ 346{
354 u32 reg; 347 u32 reg;
355 348
356 DBG("Entered %s\n", __func__); 349 pr_debug("Entered %s\n", __func__);
357 350
358 switch (div_id) { 351 switch (div_id) {
359 case S3C24XX_DIV_BCLK: 352 case S3C24XX_DIV_BCLK:
@@ -389,7 +382,7 @@ EXPORT_SYMBOL_GPL(s3c24xx_i2s_get_clockrate);
389static int s3c24xx_i2s_probe(struct platform_device *pdev, 382static int s3c24xx_i2s_probe(struct platform_device *pdev,
390 struct snd_soc_dai *dai) 383 struct snd_soc_dai *dai)
391{ 384{
392 DBG("Entered %s\n", __func__); 385 pr_debug("Entered %s\n", __func__);
393 386
394 s3c24xx_i2s.regs = ioremap(S3C2410_PA_IIS, 0x100); 387 s3c24xx_i2s.regs = ioremap(S3C2410_PA_IIS, 0x100);
395 if (s3c24xx_i2s.regs == NULL) 388 if (s3c24xx_i2s.regs == NULL)
@@ -397,7 +390,7 @@ static int s3c24xx_i2s_probe(struct platform_device *pdev,
397 390
398 s3c24xx_i2s.iis_clk = clk_get(&pdev->dev, "iis"); 391 s3c24xx_i2s.iis_clk = clk_get(&pdev->dev, "iis");
399 if (s3c24xx_i2s.iis_clk == NULL) { 392 if (s3c24xx_i2s.iis_clk == NULL) {
400 DBG("failed to get iis_clock\n"); 393 pr_err("failed to get iis_clock\n");
401 iounmap(s3c24xx_i2s.regs); 394 iounmap(s3c24xx_i2s.regs);
402 return -ENODEV; 395 return -ENODEV;
403 } 396 }
@@ -421,7 +414,7 @@ static int s3c24xx_i2s_probe(struct platform_device *pdev,
421#ifdef CONFIG_PM 414#ifdef CONFIG_PM
422static int s3c24xx_i2s_suspend(struct snd_soc_dai *cpu_dai) 415static int s3c24xx_i2s_suspend(struct snd_soc_dai *cpu_dai)
423{ 416{
424 DBG("Entered %s\n", __func__); 417 pr_debug("Entered %s\n", __func__);
425 418
426 s3c24xx_i2s.iiscon = readl(s3c24xx_i2s.regs + S3C2410_IISCON); 419 s3c24xx_i2s.iiscon = readl(s3c24xx_i2s.regs + S3C2410_IISCON);
427 s3c24xx_i2s.iismod = readl(s3c24xx_i2s.regs + S3C2410_IISMOD); 420 s3c24xx_i2s.iismod = readl(s3c24xx_i2s.regs + S3C2410_IISMOD);
@@ -435,7 +428,7 @@ static int s3c24xx_i2s_suspend(struct snd_soc_dai *cpu_dai)
435 428
436static int s3c24xx_i2s_resume(struct snd_soc_dai *cpu_dai) 429static int s3c24xx_i2s_resume(struct snd_soc_dai *cpu_dai)
437{ 430{
438 DBG("Entered %s\n", __func__); 431 pr_debug("Entered %s\n", __func__);
439 clk_enable(s3c24xx_i2s.iis_clk); 432 clk_enable(s3c24xx_i2s.iis_clk);
440 433
441 writel(s3c24xx_i2s.iiscon, s3c24xx_i2s.regs + S3C2410_IISCON); 434 writel(s3c24xx_i2s.iiscon, s3c24xx_i2s.regs + S3C2410_IISCON);
diff --git a/sound/soc/s3c24xx/s3c24xx-pcm.c b/sound/soc/s3c24xx/s3c24xx-pcm.c
index 5c96c1ed6299..a9d68fa2b34a 100644
--- a/sound/soc/s3c24xx/s3c24xx-pcm.c
+++ b/sound/soc/s3c24xx/s3c24xx-pcm.c
@@ -33,13 +33,6 @@
33 33
34#include "s3c24xx-pcm.h" 34#include "s3c24xx-pcm.h"
35 35
36#define S3C24XX_PCM_DEBUG 0
37#if S3C24XX_PCM_DEBUG
38#define DBG(x...) printk(KERN_DEBUG "s3c24xx-pcm: " x)
39#else
40#define DBG(x...)
41#endif
42
43static const struct snd_pcm_hardware s3c24xx_pcm_hardware = { 36static const struct snd_pcm_hardware s3c24xx_pcm_hardware = {
44 .info = SNDRV_PCM_INFO_INTERLEAVED | 37 .info = SNDRV_PCM_INFO_INTERLEAVED |
45 SNDRV_PCM_INFO_BLOCK_TRANSFER | 38 SNDRV_PCM_INFO_BLOCK_TRANSFER |
@@ -84,16 +77,16 @@ static void s3c24xx_pcm_enqueue(struct snd_pcm_substream *substream)
84 dma_addr_t pos = prtd->dma_pos; 77 dma_addr_t pos = prtd->dma_pos;
85 int ret; 78 int ret;
86 79
87 DBG("Entered %s\n", __func__); 80 pr_debug("Entered %s\n", __func__);
88 81
89 while (prtd->dma_loaded < prtd->dma_limit) { 82 while (prtd->dma_loaded < prtd->dma_limit) {
90 unsigned long len = prtd->dma_period; 83 unsigned long len = prtd->dma_period;
91 84
92 DBG("dma_loaded: %d\n", prtd->dma_loaded); 85 pr_debug("dma_loaded: %d\n", prtd->dma_loaded);
93 86
94 if ((pos + len) > prtd->dma_end) { 87 if ((pos + len) > prtd->dma_end) {
95 len = prtd->dma_end - pos; 88 len = prtd->dma_end - pos;
96 DBG(KERN_DEBUG "%s: corrected dma len %ld\n", 89 pr_debug(KERN_DEBUG "%s: corrected dma len %ld\n",
97 __func__, len); 90 __func__, len);
98 } 91 }
99 92
@@ -119,7 +112,7 @@ static void s3c24xx_audio_buffdone(struct s3c2410_dma_chan *channel,
119 struct snd_pcm_substream *substream = dev_id; 112 struct snd_pcm_substream *substream = dev_id;
120 struct s3c24xx_runtime_data *prtd; 113 struct s3c24xx_runtime_data *prtd;
121 114
122 DBG("Entered %s\n", __func__); 115 pr_debug("Entered %s\n", __func__);
123 116
124 if (result == S3C2410_RES_ABORT || result == S3C2410_RES_ERR) 117 if (result == S3C2410_RES_ABORT || result == S3C2410_RES_ERR)
125 return; 118 return;
@@ -148,7 +141,7 @@ static int s3c24xx_pcm_hw_params(struct snd_pcm_substream *substream,
148 unsigned long totbytes = params_buffer_bytes(params); 141 unsigned long totbytes = params_buffer_bytes(params);
149 int ret = 0; 142 int ret = 0;
150 143
151 DBG("Entered %s\n", __func__); 144 pr_debug("Entered %s\n", __func__);
152 145
153 /* return if this is a bufferless transfer e.g. 146 /* return if this is a bufferless transfer e.g.
154 * codec <--> BT codec or GSM modem -- lg FIXME */ 147 * codec <--> BT codec or GSM modem -- lg FIXME */
@@ -161,14 +154,14 @@ static int s3c24xx_pcm_hw_params(struct snd_pcm_substream *substream,
161 /* prepare DMA */ 154 /* prepare DMA */
162 prtd->params = dma; 155 prtd->params = dma;
163 156
164 DBG("params %p, client %p, channel %d\n", prtd->params, 157 pr_debug("params %p, client %p, channel %d\n", prtd->params,
165 prtd->params->client, prtd->params->channel); 158 prtd->params->client, prtd->params->channel);
166 159
167 ret = s3c2410_dma_request(prtd->params->channel, 160 ret = s3c2410_dma_request(prtd->params->channel,
168 prtd->params->client, NULL); 161 prtd->params->client, NULL);
169 162
170 if (ret < 0) { 163 if (ret < 0) {
171 DBG(KERN_ERR "failed to get dma channel\n"); 164 printk(KERN_ERR "failed to get dma channel\n");
172 return ret; 165 return ret;
173 } 166 }
174 } 167 }
@@ -196,7 +189,7 @@ static int s3c24xx_pcm_hw_free(struct snd_pcm_substream *substream)
196{ 189{
197 struct s3c24xx_runtime_data *prtd = substream->runtime->private_data; 190 struct s3c24xx_runtime_data *prtd = substream->runtime->private_data;
198 191
199 DBG("Entered %s\n", __func__); 192 pr_debug("Entered %s\n", __func__);
200 193
201 /* TODO - do we need to ensure DMA flushed */ 194 /* TODO - do we need to ensure DMA flushed */
202 snd_pcm_set_runtime_buffer(substream, NULL); 195 snd_pcm_set_runtime_buffer(substream, NULL);
@@ -214,7 +207,7 @@ static int s3c24xx_pcm_prepare(struct snd_pcm_substream *substream)
214 struct s3c24xx_runtime_data *prtd = substream->runtime->private_data; 207 struct s3c24xx_runtime_data *prtd = substream->runtime->private_data;
215 int ret = 0; 208 int ret = 0;
216 209
217 DBG("Entered %s\n", __func__); 210 pr_debug("Entered %s\n", __func__);
218 211
219 /* return if this is a bufferless transfer e.g. 212 /* return if this is a bufferless transfer e.g.
220 * codec <--> BT codec or GSM modem -- lg FIXME */ 213 * codec <--> BT codec or GSM modem -- lg FIXME */
@@ -259,7 +252,7 @@ static int s3c24xx_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
259 struct s3c24xx_runtime_data *prtd = substream->runtime->private_data; 252 struct s3c24xx_runtime_data *prtd = substream->runtime->private_data;
260 int ret = 0; 253 int ret = 0;
261 254
262 DBG("Entered %s\n", __func__); 255 pr_debug("Entered %s\n", __func__);
263 256
264 spin_lock(&prtd->lock); 257 spin_lock(&prtd->lock);
265 258
@@ -297,7 +290,7 @@ s3c24xx_pcm_pointer(struct snd_pcm_substream *substream)
297 unsigned long res; 290 unsigned long res;
298 dma_addr_t src, dst; 291 dma_addr_t src, dst;
299 292
300 DBG("Entered %s\n", __func__); 293 pr_debug("Entered %s\n", __func__);
301 294
302 spin_lock(&prtd->lock); 295 spin_lock(&prtd->lock);
303 s3c2410_dma_getposition(prtd->params->channel, &src, &dst); 296 s3c2410_dma_getposition(prtd->params->channel, &src, &dst);
@@ -309,7 +302,7 @@ s3c24xx_pcm_pointer(struct snd_pcm_substream *substream)
309 302
310 spin_unlock(&prtd->lock); 303 spin_unlock(&prtd->lock);
311 304
312 DBG("Pointer %x %x\n", src, dst); 305 pr_debug("Pointer %x %x\n", src, dst);
313 306
314 /* we seem to be getting the odd error from the pcm library due 307 /* we seem to be getting the odd error from the pcm library due
315 * to out-of-bounds pointers. this is maybe due to the dma engine 308 * to out-of-bounds pointers. this is maybe due to the dma engine
@@ -330,7 +323,7 @@ static int s3c24xx_pcm_open(struct snd_pcm_substream *substream)
330 struct snd_pcm_runtime *runtime = substream->runtime; 323 struct snd_pcm_runtime *runtime = substream->runtime;
331 struct s3c24xx_runtime_data *prtd; 324 struct s3c24xx_runtime_data *prtd;
332 325
333 DBG("Entered %s\n", __func__); 326 pr_debug("Entered %s\n", __func__);
334 327
335 snd_soc_set_runtime_hwparams(substream, &s3c24xx_pcm_hardware); 328 snd_soc_set_runtime_hwparams(substream, &s3c24xx_pcm_hardware);
336 329
@@ -349,10 +342,10 @@ static int s3c24xx_pcm_close(struct snd_pcm_substream *substream)
349 struct snd_pcm_runtime *runtime = substream->runtime; 342 struct snd_pcm_runtime *runtime = substream->runtime;
350 struct s3c24xx_runtime_data *prtd = runtime->private_data; 343 struct s3c24xx_runtime_data *prtd = runtime->private_data;
351 344
352 DBG("Entered %s\n", __func__); 345 pr_debug("Entered %s\n", __func__);
353 346
354 if (!prtd) 347 if (!prtd)
355 DBG("s3c24xx_pcm_close called with prtd == NULL\n"); 348 pr_debug("s3c24xx_pcm_close called with prtd == NULL\n");
356 349
357 kfree(prtd); 350 kfree(prtd);
358 351
@@ -364,7 +357,7 @@ static int s3c24xx_pcm_mmap(struct snd_pcm_substream *substream,
364{ 357{
365 struct snd_pcm_runtime *runtime = substream->runtime; 358 struct snd_pcm_runtime *runtime = substream->runtime;
366 359
367 DBG("Entered %s\n", __func__); 360 pr_debug("Entered %s\n", __func__);
368 361
369 return dma_mmap_writecombine(substream->pcm->card->dev, vma, 362 return dma_mmap_writecombine(substream->pcm->card->dev, vma,
370 runtime->dma_area, 363 runtime->dma_area,
@@ -390,7 +383,7 @@ static int s3c24xx_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream)
390 struct snd_dma_buffer *buf = &substream->dma_buffer; 383 struct snd_dma_buffer *buf = &substream->dma_buffer;
391 size_t size = s3c24xx_pcm_hardware.buffer_bytes_max; 384 size_t size = s3c24xx_pcm_hardware.buffer_bytes_max;
392 385
393 DBG("Entered %s\n", __func__); 386 pr_debug("Entered %s\n", __func__);
394 387
395 buf->dev.type = SNDRV_DMA_TYPE_DEV; 388 buf->dev.type = SNDRV_DMA_TYPE_DEV;
396 buf->dev.dev = pcm->card->dev; 389 buf->dev.dev = pcm->card->dev;
@@ -409,7 +402,7 @@ static void s3c24xx_pcm_free_dma_buffers(struct snd_pcm *pcm)
409 struct snd_dma_buffer *buf; 402 struct snd_dma_buffer *buf;
410 int stream; 403 int stream;
411 404
412 DBG("Entered %s\n", __func__); 405 pr_debug("Entered %s\n", __func__);
413 406
414 for (stream = 0; stream < 2; stream++) { 407 for (stream = 0; stream < 2; stream++) {
415 substream = pcm->streams[stream].substream; 408 substream = pcm->streams[stream].substream;
@@ -433,7 +426,7 @@ static int s3c24xx_pcm_new(struct snd_card *card,
433{ 426{
434 int ret = 0; 427 int ret = 0;
435 428
436 DBG("Entered %s\n", __func__); 429 pr_debug("Entered %s\n", __func__);
437 430
438 if (!card->dev->dma_mask) 431 if (!card->dev->dma_mask)
439 card->dev->dma_mask = &s3c24xx_pcm_dmamask; 432 card->dev->dma_mask = &s3c24xx_pcm_dmamask;