aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/s3c24xx
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/s3c24xx
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/s3c24xx')
-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
5 files changed, 82 insertions, 117 deletions
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;