FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: [SOLVED] AT91SAM9260, I2C, TLV320AIC23B
PostPosted: Mon Jan 23, 2012 6:52 pm 
Offline

Joined: Mon Jan 23, 2012 6:43 pm
Posts: 7
Hello, I'm trying to use this audio codec with my AT91SAM9260 on OpenWRT Linux, but there is a problem:

When I'm trying to use codec, I get this:

Code:
[ 794.700000] tlv320aic23_write cannot write 07f to register R8
[ 794.700000] i2c i2c-0: sendbytes: NAK bailout.
[ 794.710000] tlv320aic23_write cannot write 042 to register R7
[ 794.720000] i2c i2c-0: sendbytes: NAK bailout.
[ 794.720000] tlv320aic23_write cannot write 001 to register R9
[ 794.730000] i2c i2c-0: sendbytes: NAK bailout.
[ 794.730000] tlv320aic23_write cannot write 047 to register R6


Last edited by jacakk on Mon Jan 30, 2012 5:56 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: AT91SAM9260, I2C, TLV320AIC23B
PostPosted: Tue Jan 24, 2012 1:48 am 
Offline

Joined: Thu Apr 19, 2007 10:15 pm
Posts: 330
Location: USA
Hi there

You need to look at the I2C driver.
What version of the Linux kernel are you using?
Back in the days of versions 2.6.2x, the TWI/I2C Atmel driver and hardware on 926x were known to be broken, and the workaround was to use a bit-bang method.

Also check the errata sheets for AT91SAM9260.

Regards


Top
 Profile  
 
 Post subject: Re: AT91SAM9260, I2C, TLV320AIC23B
PostPosted: Tue Jan 24, 2012 11:55 pm 
Offline

Joined: Mon Jan 23, 2012 6:43 pm
Posts: 7
I know... but I don't know where to look in I2C driver, there are so many files about I2C in linux kernel.
I was using 2.6.29.3, and now I'm using 2.6.36.4. On both I got the same issue.


Top
 Profile  
 
 Post subject: Re: AT91SAM9260, I2C, TLV320AIC23B
PostPosted: Wed Jan 25, 2012 4:12 am 
Offline

Joined: Thu Apr 19, 2007 10:15 pm
Posts: 330
Location: USA
> 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 (or i2c-gpio.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:
Code:
/*
 * 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)
...
#else
...
#endif


Which configuration choice did you make, the GPIO version or the AT91 version that uses the TWI controller?

Regards


Top
 Profile  
 
 Post subject: Re: AT91SAM9260, I2C, TLV320AIC23B
PostPosted: Wed Jan 25, 2012 1:22 pm 
Offline

Joined: Mon Jan 23, 2012 6:43 pm
Posts: 7
i2c-at91 is marked as BROKEN in kernel, I'm using i2c-gpio.

Now, I'm checking files in arch/arm/mach-at91, which are connected with at91sam9260.
If I find something interesting, I will let you know.

Regards.


Top
 Profile  
 
 Post subject: Re: AT91SAM9260, I2C, TLV320AIC23B
PostPosted: Mon Jan 30, 2012 5:56 pm 
Offline

Joined: Mon Jan 23, 2012 6:43 pm
Posts: 7
It's working!
Putting one pull-up resistor (10k) on SDIN line and one pull-up resistor (also 10k) on SCLK line was the solution!

Code:
http://www.at91.com/forum/viewtopic.php/f,12/t,20613/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: