This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

I2C Communication with TLV320aic3204 on omap3

Other Parts Discussed in Thread: TLV320AIC3204

Hello,

I have a problem to communicate with the audio codec TLV320aic3204. I use the codec in an application with the AM335X Processor running a 3.2 kernel.
My Problem is that I can't read registers from the codec. I think the problem is, that the i2c driver can't perform a real repeated start condion. I have compared the communication with the EVM for the Codec. The next picture shows a read request on the EVM.

On the next picture you can see the read request performed by the AM335X.

Here I didn't get the right value of the register.

In the code below is my code for the read request on the AM335x

static inline int aic32x4_read_reg(struct i2c_client *client, u8 address)
{
	struct i2c_msg xfer[2];
	int ret;
	u8 r_buf[1];

	xfer[0].addr = client->addr;
	xfer[0].flags = 0;
	xfer[0].len = 1;
	xfer[0].buf = &address;

	xfer[1].addr = client->addr;
	xfer[1].flags = I2C_M_RD;
	xfer[1].len = ARRAY_SIZE(r_buf);
	xfer[1].buf = r_buf;

	ret = i2c_transfer(client->adapter, xfer, ARRAY_SIZE(xfer));
	
	if(ret != ARRAY_SIZE(xfer)) {
		dev_err(&client->dev, "Cannot read from register address %i\n", address);
		ret = -EIO;
	} 		

	ret = r_buf[0];
	
	return ret;
}

Is there a flag which I need to set to perform a repeated start condition?

Thanks in advance.