Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 162795
b: refs/heads/master
c: fa68e00
h: refs/heads/master
i:
  162793: 5aef378
  162791: 81498d7
v: v3
  • Loading branch information
Jassi authored and Mark Brown committed Sep 15, 2009
1 parent 5772562 commit 351a332
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3eef08ba522775360cc59fe0a6b1bca6ecc8da4e
refs/heads/master: fa68e0025d4184ba917621a9c977d4243d0a013e
16 changes: 10 additions & 6 deletions trunk/sound/soc/s3c24xx/s3c-i2s-v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,26 +230,30 @@ static void s3c2412_snd_rxctrl(struct s3c_i2sv2_info *i2s, int on)
pr_debug("%s: IIS: CON=%x MOD=%x FIC=%x\n", __func__, con, mod, fic);
}

#define msecs_to_loops(t) (loops_per_jiffy / 1000 * HZ * t)

/*
* Wait for the LR signal to allow synchronisation to the L/R clock
* from the codec. May only be needed for slave mode.
*/
static int s3c2412_snd_lrsync(struct s3c_i2sv2_info *i2s)
{
u32 iiscon;
unsigned long timeout = jiffies + msecs_to_jiffies(5);
unsigned long loops = msecs_to_loops(5);

pr_debug("Entered %s\n", __func__);

while (1) {
while (--loops) {
iiscon = readl(i2s->regs + S3C2412_IISCON);
if (iiscon & S3C2412_IISCON_LRINDEX)
break;

if (timeout < jiffies) {
printk(KERN_ERR "%s: timeout\n", __func__);
return -ETIMEDOUT;
}
cpu_relax();
}

if (!loops) {
printk(KERN_ERR "%s: timeout\n", __func__);
return -ETIMEDOUT;
}

return 0;
Expand Down

0 comments on commit 351a332

Please sign in to comment.