Alexander Vasiliev wrote:
Hi, Dirk.

You wrote

b) While scanning for the first non-existing ID the error exit path of
I2C driver (the "if (dev->cmd_err & DAVINCI_I2C_STR_NACK)" path)
doesn't exits cleanly. Then, I2C HW is in an intermediate state not
able to execute the next scan with (correct) I2C address properly.

I tend to (b). If anybody would confirm that with using only
TLV320AIC23ID2 and not scanning for TLV320AIC23ID1 audio works fine,
this would be a proof for (b) (?)


It seemes to be (b) case. When scanning for second address only, it boots fine.

Do you like to test

http://linux.omap.com/pipermail/davinci-linux-open-source/2008-March/005834.html

?

Many thanks

Dirk

Another interesting thing i found is that if in the function
i2c_davinci_xfer_msg (in i2c-davinci.c) some dummy function [like
printk(KERN_INFO"just message\n");] will be inserted between
        davinci_i2c_write_reg(dev, DAVINCI_I2C_MDR_REG, flag);
        and
        r = wait_for_completion_interruptible_timeout(&dev->cmd_complete,
DAVINCI_I2C_TIMEOUT);
Davinci also boots fine.

So without this dummy function events come this way:
1) We send message for first address;
2) Transmit-data-ready interrupt happens and we push byte in the data
transmit register;
3) NACK-interrupt happens;
4) ARDY interrupt happens;
5) Stop condition interrupt happens;
6) We send message for second address;
7) Stop condition interrupt happens;

With this dummy function  events come this way:
1) We send message for first address;
2) NACK-interrupt happens;
3) ARDY interrupt happens;
4) Stop condition interrupt happens;
5) We send message for second address;
6) Transmit-data-ready interrupt happens and we push byte in the data
transmit register;
7) Stop condition interrupt happens;

It seems like the i2c controller in Davinci works this way:
1) It sends slave address;
2) It doesn't wait for the slave address to be completely sent and
asks for data to be sent.
3) If NACK happens during sending of the slave address, it aborts
transmission. But data transmit register may already be filled! This
can be the reason for the next message to break.

It will be nice, if someone from TI comments the behavior of the i2c
controller in such case.


_______________________________________________
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to