diff options
author | Oliver Endriss <o.endriss@gmx.de> | 2007-08-09 07:41:16 +0200 |
---|---|---|
committer | Oliver Endriss <o.endriss@gmx.de> | 2007-08-09 07:41:16 +0200 |
commit | 61b21f2d72bc70d0ce269eeee3a556fffac23178 (patch) | |
tree | 73fb5deb2e17784faf99d950c25977dbb4164728 /linux/drivers/media/common/saa7146_i2c.c | |
parent | 782bca9e899a3bdddef5c9707925f45df810e268 (diff) | |
download | mediapointer-dvb-s2-61b21f2d72bc70d0ce269eeee3a556fffac23178.tar.gz mediapointer-dvb-s2-61b21f2d72bc70d0ce269eeee3a556fffac23178.tar.bz2 |
saa7146: clean-up irq processing
From: Oliver Endriss <o.endriss@gmx.de>
Interrupt processing fixed: First handle interrupt, then acknowledge it.
Otherwise the same interrupt might occur twice.
Cleaned-up i2c interrupt handler and i2c error messages.
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Diffstat (limited to 'linux/drivers/media/common/saa7146_i2c.c')
-rw-r--r-- | linux/drivers/media/common/saa7146_i2c.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/linux/drivers/media/common/saa7146_i2c.c b/linux/drivers/media/common/saa7146_i2c.c index 55e0598a0..40527fa6c 100644 --- a/linux/drivers/media/common/saa7146_i2c.c +++ b/linux/drivers/media/common/saa7146_i2c.c @@ -203,7 +203,8 @@ static int saa7146_i2c_writeout(struct saa7146_dev *dev, u32* dword, int short_d /* a signal arrived */ return -ERESTARTSYS; - printk(KERN_WARNING "saa7146_i2c_writeout: timed out waiting for end of xfer\n"); + printk(KERN_WARNING "%s %s [irq]: timed out waiting for end of xfer\n", + dev->name, __FUNCTION__); return -EIO; } status = saa7146_read(dev, I2C_STATUS); @@ -220,7 +221,8 @@ static int saa7146_i2c_writeout(struct saa7146_dev *dev, u32* dword, int short_d break; } if (time_after(jiffies,timeout)) { - printk(KERN_WARNING "saa7146_i2c_writeout: timed out waiting for MC2\n"); + printk(KERN_WARNING "%s %s: timed out waiting for MC2\n", + dev->name, __FUNCTION__); return -EIO; } } @@ -236,7 +238,8 @@ static int saa7146_i2c_writeout(struct saa7146_dev *dev, u32* dword, int short_d /* this is normal when probing the bus * (no answer from nonexisistant device...) */ - DEB_I2C(("saa7146_i2c_writeout: timed out waiting for end of xfer\n")); + printk(KERN_WARNING "%s %s [poll]: timed out waiting for end of xfer\n", + dev->name, __FUNCTION__); return -EIO; } if (++trial < 50 && short_delay) @@ -247,8 +250,16 @@ static int saa7146_i2c_writeout(struct saa7146_dev *dev, u32* dword, int short_d } /* give a detailed status report */ - if ( 0 != (status & SAA7146_I2C_ERR)) { - + if ( 0 != (status & (SAA7146_I2C_SPERR | SAA7146_I2C_APERR | + SAA7146_I2C_DTERR | SAA7146_I2C_DRERR | + SAA7146_I2C_AL | SAA7146_I2C_ERR | + SAA7146_I2C_BUSY)) ) { + + if ( 0 == (status & SAA7146_I2C_ERR) || + 0 == (status & SAA7146_I2C_BUSY) ) { + /* it may take some time until ERR goes high - ignore */ + DEB_I2C(("unexpected i2c status %04x\n", status)); + } if( 0 != (status & SAA7146_I2C_SPERR) ) { DEB_I2C(("error due to invalid start/stop condition.\n")); } |