Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 44115
b: refs/heads/master
c: 35e5525
h: refs/heads/master
i:
  44113: 298cefe
  44111: 8463ca8
v: v3
  • Loading branch information
Hartmut Birr authored and Mauro Carvalho Chehab committed Dec 10, 2006
1 parent f01fdcf commit 0589fec
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 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: 88bbdf74fcfa7ed1fd1a3c825ee5575752344326
refs/heads/master: 35e55255bbe1775c3cdb5d9cff494d72d5a49bf3
16 changes: 12 additions & 4 deletions trunk/drivers/media/common/saa7146_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,21 @@ static int saa7146_i2c_writeout(struct saa7146_dev *dev, u32* dword, int short_d
saa7146_write(dev, I2C_TRANSFER, *dword);

dev->i2c_op = 1;
SAA7146_ISR_CLEAR(dev, MASK_16|MASK_17);
SAA7146_IER_ENABLE(dev, MASK_16|MASK_17);
saa7146_write(dev, MC2, (MASK_00 | MASK_16));

wait_event_interruptible(dev->i2c_wq, dev->i2c_op == 0);
if (signal_pending (current)) {
/* a signal arrived */
return -ERESTARTSYS;
timeout = HZ/100 + 1; /* 10ms */
timeout = wait_event_interruptible_timeout(dev->i2c_wq, dev->i2c_op == 0, timeout);
if (timeout == -ERESTARTSYS || dev->i2c_op) {
SAA7146_IER_DISABLE(dev, MASK_16|MASK_17);
SAA7146_ISR_CLEAR(dev, MASK_16|MASK_17);
if (timeout == -ERESTARTSYS)
/* a signal arrived */
return -ERESTARTSYS;

printk(KERN_WARNING "saa7146_i2c_writeout: timed out waiting for end of xfer\n");
return -EIO;
}
status = saa7146_read(dev, I2C_STATUS);
} else {
Expand Down

0 comments on commit 0589fec

Please sign in to comment.