diff options
author | Holger Waechtler <devnull@localhost> | 2003-06-14 20:06:03 +0000 |
---|---|---|
committer | Holger Waechtler <devnull@localhost> | 2003-06-14 20:06:03 +0000 |
commit | 6ab1b6d82dd4695f9640f7a34085057c7ab043c2 (patch) | |
tree | 3e984096b5f8c24cf180f1ba3580bcc2d0f3c73a /linux | |
parent | 07e4c27ee61a298e28ad61b55df67ba81b6a07e2 (diff) | |
download | mediapointer-dvb-s2-6ab1b6d82dd4695f9640f7a34085057c7ab043c2.tar.gz mediapointer-dvb-s2-6ab1b6d82dd4695f9640f7a34085057c7ab043c2.tar.bz2 |
i2c fixes and build fixes. Must have been brain-amputated yesterday...
Diffstat (limited to 'linux')
-rw-r--r-- | linux/drivers/media/common/saa7146_i2c.c | 13 | ||||
-rw-r--r-- | linux/drivers/media/dvb/ttpci/budget-core.c | 4 | ||||
-rw-r--r-- | linux/drivers/media/dvb/ttpci/ttpci-eeprom.c (renamed from linux/drivers/media/dvb/ttpci/ttpci_eeprom.c) | 0 | ||||
-rw-r--r-- | linux/drivers/media/dvb/ttpci/ttpci-eeprom.h (renamed from linux/drivers/media/dvb/ttpci/ttpci_eeprom.h) | 0 |
4 files changed, 12 insertions, 5 deletions
diff --git a/linux/drivers/media/common/saa7146_i2c.c b/linux/drivers/media/common/saa7146_i2c.c index 535cd55ba..b5d2745a0 100644 --- a/linux/drivers/media/common/saa7146_i2c.c +++ b/linux/drivers/media/common/saa7146_i2c.c @@ -190,6 +190,7 @@ static int saa7146_i2c_writeout(struct saa7146_dev *dev, u32* dword) { u32 status = 0, mc2 = 0; + int trial = 0; int timeout; /* write out i2c-command */ @@ -230,10 +231,13 @@ int saa7146_i2c_writeout(struct saa7146_dev *dev, u32* dword) /* wait until we get a transfer done or error */ timeout = jiffies + HZ/100 + 1; /* 10ms */ while(1) { + /** + * first read usually delivers bogus results... + */ + saa7146_i2c_status(dev); status = saa7146_i2c_status(dev); - if( (0x3 == (status & 0x3)) || (0 == (status & 0x1)) ) { + if ((status & 0x3) != 1) break; - } if (jiffies > timeout) { /* this is normal when probing the bus * (no answer from nonexisistant device...) @@ -241,7 +245,10 @@ int saa7146_i2c_writeout(struct saa7146_dev *dev, u32* dword) DEB_I2C(("saa7146_i2c_writeout: timed out waiting for end of xfer\n")); return -EIO; } - my_wait(dev,1); + if (++trial < 10) + udelay(10); + else + my_wait(dev,1); } } diff --git a/linux/drivers/media/dvb/ttpci/budget-core.c b/linux/drivers/media/dvb/ttpci/budget-core.c index a2227a94b..f0a5d3592 100644 --- a/linux/drivers/media/dvb/ttpci/budget-core.c +++ b/linux/drivers/media/dvb/ttpci/budget-core.c @@ -1,5 +1,5 @@ #include "budget.h" -#include "ttpci_eeprom.h" +#include "ttpci-eeprom.h" int budget_debug = 0; @@ -231,7 +231,7 @@ int ttpci_budget_init (struct budget *budget, get recognized before the main driver is loaded */ saa7146_write(dev, GPIO_CTRL, 0x500000); - saa7146_i2c_adapter_prepare(dev, NULL, SAA7146_I2C_BUS_BIT_RATE_3200); + saa7146_i2c_adapter_prepare(dev, NULL, SAA7146_I2C_BUS_BIT_RATE_120); budget->i2c_bus = dvb_register_i2c_bus (master_xfer, dev, budget->dvb_adapter, 0); diff --git a/linux/drivers/media/dvb/ttpci/ttpci_eeprom.c b/linux/drivers/media/dvb/ttpci/ttpci-eeprom.c index aa9c68f0b..aa9c68f0b 100644 --- a/linux/drivers/media/dvb/ttpci/ttpci_eeprom.c +++ b/linux/drivers/media/dvb/ttpci/ttpci-eeprom.c diff --git a/linux/drivers/media/dvb/ttpci/ttpci_eeprom.h b/linux/drivers/media/dvb/ttpci/ttpci-eeprom.h index 66cb85ced..66cb85ced 100644 --- a/linux/drivers/media/dvb/ttpci/ttpci_eeprom.h +++ b/linux/drivers/media/dvb/ttpci/ttpci-eeprom.h |