/* wait for DATA line to go low; error if it doesn't */ 
static int tea5757_read(struct bttv *btv){	unsigned long timeout;	int value = 0;	int i;	/* better safe than sorry */	gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we);	if (btv->mbox_ior) {		gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,			  btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);		udelay(5);	}	if (bttv_gpio)		bttv_gpio_tracking(btv,"tea5757 read");	bus_low(btv,btv->mbox_we);	bus_low(btv,btv->mbox_clk);	udelay(10);	timeout= jiffies + HZ;	// wait for DATA line to go low; error if it doesn't	while (bus_in(btv,btv->mbox_data) && time_before(jiffies, timeout))		schedule();	if (bus_in(btv,btv->mbox_data)) {		printk(KERN_WARNING "bttv%d: tea5757: read timeout\n",btv->c.nr);		return -1;	}	dprintk("bttv%d: tea5757:",btv->c.nr);	for(i = 0; i < 24; i++)	{		udelay(5);		bus_high(btv,btv->mbox_clk);		udelay(5);		dprintk("%c",(bus_in(btv,btv->mbox_most) == 0)?'T':'-');		bus_low(btv,btv->mbox_clk);		value <<= 1;		value |= (bus_in(btv,btv->mbox_data) == 0)?0:1;  /* MSB first */		dprintk("%c", (bus_in(btv,btv->mbox_most) == 0)?'S':'M');	}	dprintk("\nbttv%d: tea5757: read 0x%X\n", btv->c.nr, value);	return value;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/24a70fdce872d70171b1f49dcd1a7c3a4e8396b2/bttv-cards.c/buggy/drivers/media/video/bttv-cards.c