aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/s3c24xx
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-09-17 16:21:52 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-17 16:21:52 -0400
commitb938fb6f491113880ebaabfa06c6446723c702fd (patch)
treed19c6487b64b4002b31446160f2670394ab4ef1b /sound/soc/s3c24xx
parentde55a8958f6e3ef5ce5f0971b80bd44bfcac7cf1 (diff)
parent87bfa1dbfb22aab2bb6c1085c1fe7d56cdd2f044 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: ALSA: hda - Fix MSI GX620 mixer ASoC: remove unused #include <linux/version.h> ASoC: S3C lrsync function made to work with IRQs disabled. ALSA: hda - Fix Dell S14 pin setup ALSA: hda - Fix IDT92HD83* codec setup ASoC: Fix display of stream name in DAPM debugfs ALSA: hda - Add support for HP dv6 ALSA: hda - Fix HP/line-out initialization with IDT/STAC codecs ALSA: hda - Set default GPIO for IDT92HD71bxx ALSA: hda - Set default GPIO for STAC/IDT codecs ASoC: Clean up error handling in MPC5200 DMA setup ALSA: hda - Add missing model=auto entry for ALC269
Diffstat (limited to 'sound/soc/s3c24xx')
-rw-r--r--sound/soc/s3c24xx/s3c-i2s-v2.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/sound/soc/s3c24xx/s3c-i2s-v2.c b/sound/soc/s3c24xx/s3c-i2s-v2.c
index aa7af0b8d421..9bc4aa35caab 100644
--- a/sound/soc/s3c24xx/s3c-i2s-v2.c
+++ b/sound/soc/s3c24xx/s3c-i2s-v2.c
@@ -230,6 +230,8 @@ static void s3c2412_snd_rxctrl(struct s3c_i2sv2_info *i2s, int on)
230 pr_debug("%s: IIS: CON=%x MOD=%x FIC=%x\n", __func__, con, mod, fic); 230 pr_debug("%s: IIS: CON=%x MOD=%x FIC=%x\n", __func__, con, mod, fic);
231} 231}
232 232
233#define msecs_to_loops(t) (loops_per_jiffy / 1000 * HZ * t)
234
233/* 235/*
234 * Wait for the LR signal to allow synchronisation to the L/R clock 236 * Wait for the LR signal to allow synchronisation to the L/R clock
235 * from the codec. May only be needed for slave mode. 237 * from the codec. May only be needed for slave mode.
@@ -237,19 +239,21 @@ static void s3c2412_snd_rxctrl(struct s3c_i2sv2_info *i2s, int on)
237static int s3c2412_snd_lrsync(struct s3c_i2sv2_info *i2s) 239static int s3c2412_snd_lrsync(struct s3c_i2sv2_info *i2s)
238{ 240{
239 u32 iiscon; 241 u32 iiscon;
240 unsigned long timeout = jiffies + msecs_to_jiffies(5); 242 unsigned long loops = msecs_to_loops(5);
241 243
242 pr_debug("Entered %s\n", __func__); 244 pr_debug("Entered %s\n", __func__);
243 245
244 while (1) { 246 while (--loops) {
245 iiscon = readl(i2s->regs + S3C2412_IISCON); 247 iiscon = readl(i2s->regs + S3C2412_IISCON);
246 if (iiscon & S3C2412_IISCON_LRINDEX) 248 if (iiscon & S3C2412_IISCON_LRINDEX)
247 break; 249 break;
248 250
249 if (timeout < jiffies) { 251 cpu_relax();
250 printk(KERN_ERR "%s: timeout\n", __func__); 252 }
251 return -ETIMEDOUT; 253
252 } 254 if (!loops) {
255 printk(KERN_ERR "%s: timeout\n", __func__);
256 return -ETIMEDOUT;
253 } 257 }
254 258
255 return 0; 259 return 0;