> I don't know where to look in I2C driver, there are so many files about I2C in linux kernel.
You have to realize that there are two classes of I2C drivers: for the master devices (in drivers/i2c/busses
) and for the target devices (such as EEPROMs, RTCs and your codec). The error messages would probably be generated by the buss driver. Since this is on an Atmel AT91 SoC, the driver to look at is i2c-at91.c
. Maybe that source file was complied into your kernel, so there would also be an object file called i2c-at91.o
) in that directory. If there are any other object files in that directory besides built-in.o
, then you might be doing something wrong.
Check your board module in arch/arm/mach-at91
. You might find code like:
* Prefer the GPIO code since the TWI controller isn't robust
* (gets overruns and underruns under load) and can only issue
* repeated STARTs in one scenario (the driver doesn't yet handle them).
#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
#elif defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE)
Which configuration choice did you make, the GPIO version or the AT91 version that uses the TWI controller?