2 problems with the i2c-mpc.c driver

Joakim Tjernlund joakim.tjernlund at transmode.se
Tue Nov 7 11:20:18 EST 2006


1) Master I2C address
  Can't find how/where the controllers master I2C address is set.
  Seems like it is inherited from whatever the boot(u-boot in this case)
  was using. Seems a bit fragile to me.

2) Disturbance disables the I2C controller.
  Noticed that a disturbance on the I2C bus sometimes disables the
  the controller, will only recover after a reboot.
  Adding the following seems to cure the problem: 
 static void mpc_i2c_start(struct mpc_i2c *i2c)
{
        /* Clear arbitration */
        writeb(0, i2c->base + MPC_I2C_SR);
+       writeccr(i2c, 0);
+       udelay(5);
        /* Start with MEN */
        writeccr(i2c, CCR_MEN);
}
 I don't this this is the right fix, since it introduces an delay of 5 us.
 Any ideas?

 Jocke




More information about the Linuxppc-dev mailing list