Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 463 → Rev 464

/shark/trunk/drivers/bttv/bttv-cards.c
3032,6 → 3032,8
#define TEA_STATUS_TUNED 0
#define TEA_STATUS_SEARCHING 1
 
extern unsigned long read_time(void);
 
/* Low-level stuff */
static int tea5757_read(struct bttv *btv)
{
3056,11 → 3058,10
bus_low(btv,btv->mbox_clk);
udelay(10);
timeout= jiffies + HZ;
timeout= read_time() + 1000000;
 
// wait for DATA line to go low; error if it doesn't
while (bus_in(btv,btv->mbox_data) && time_before(jiffies, timeout))
schedule();
while (bus_in(btv,btv->mbox_data) && timeout > read_time());
if (bus_in(btv,btv->mbox_data)) {
printk(KERN_WARNING "bttv%d: tea5757: read timeout\n",btv->nr);
return -1;
/shark/trunk/drivers/bttv/bttv-if.c
245,6 → 245,8
return I2C_FUNC_SMBUS_EMUL;
}
 
extern unsigned long read_time(void);
 
static int
bttv_i2c_wait_done(struct bttv *btv)
{
251,12 → 253,12
u32 stat;
unsigned long timeout;
 
timeout = jiffies + HZ/100 + 1; /* 10ms */
timeout = read_time() + 10000; /* 10ms */
for (;;) {
stat = btread(BT848_INT_STAT);
if (stat & BT848_INT_I2CDONE)
break;
if (time_after(jiffies,timeout))
if (timeout > read_time())
return -EIO;
udelay(10);
}