diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-09-18 10:09:44 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-09-18 10:09:44 -0400 |
commit | 9f072b7b2260a588bfb5fb43418c3358104e7c13 (patch) | |
tree | 055f1082093bb63a34c7bfe43c845567685d4675 /sound/soc/s3c24xx | |
parent | b1cd6b9ec7c749ddfad628c8c12659591ae195e6 (diff) | |
parent | 0c31cf3e4af79ea18bbd365b07ef0de207673894 (diff) |
Merge branch 'for-2.6.32' into for-2.6.33
Diffstat (limited to 'sound/soc/s3c24xx')
-rw-r--r-- | sound/soc/s3c24xx/s3c-i2s-v2.c | 16 |
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 819c3c086d69..11c45a37c631 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) | |||
237 | static int s3c2412_snd_lrsync(struct s3c_i2sv2_info *i2s) | 239 | static 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; |