MPC880: i2cer register says tx is done but tx buf descriptor is still ready
DI BACCO ANTONIO - technolabs
Antonio.DiBacco at technolabs.it
Sun Nov 18 22:12:57 EST 2007
A porting of the driver included in kernel 2.4.
Here is an excerpt of the method to send bytes over the i2c bus:
________________________________________________________________________
i2c->i2c_i2cmr = 0x00; /* Disable I2C interupts */
i2c->i2c_i2cer = 0xff;
i2c->i2c_i2mod |= 1; /* Enable */
i2c->i2c_i2com |= 0x80; /* Begin transmission */
tmo = jiffies + 1*HZ;
/* Busy wait, with a timeout */
while(!(i2c->i2c_i2cer & 0x12 || time_after(jiffies, tmo)));
if (signal_pending(current) || !tmo){
force_close(algo_8xx_data);
if (!tmo)
printk("IIC write: timeout!\n");
return -EIO;
}
if ((tbdf[0]->cbd_sc | tbdf[1]->cbd_sc) & BD_SC_NAK) {
printk(KERN_INFO "IIC write; no ack\n");
if (cpm_debug > 0)
printk("tx0 sc %04x, tx1 sc %04x\n", tbdf[0]->cbd_sc,tbdf[1]->cbd_sc);
return 0;
}
if ((tbdf[0]->cbd_sc | tbdf[1]->cbd_sc) & BD_SC_READY) {
printk(KERN_INFO "IIC write; complete but tbuf ready\n");
if (cpm_debug > 0)
printk("tx0 sc %04x, tx1 sc %04x\n", tbdf[0]->cbd_sc,tbdf[1]->cbd_sc);
return 0;
}
-----Original Message-----
From: Jochen Friedrich [mailto:jochen at scram.de]
Sent: Sat 17/11/2007 19.32
To: DI BACCO ANTONIO - technolabs
Cc: linuxppc-embedded at ozlabs.org
Subject: Re: MPC880: i2cer register says tx is done but tx buf descriptor is still ready
Hi Antonio,
> How could it be possible? It happens during the first i2c transactions
> and then no more.
>
What linux version? Which driver?
Thanks,
Jochen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ozlabs.org/pipermail/linuxppc-embedded/attachments/20071118/82da2fcb/attachment.htm
More information about the Linuxppc-embedded
mailing list