Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => iMX233 => Topic started by: xxcn on May 09, 2013, 11:40:01 AM

Title: HW I2C with 3.9-stable problems
Post by: xxcn on May 09, 2013, 11:40:01 AM
Hi all,

I got i2c working with kernels 3.7.2 (modified alarm build) and 3.8.11, but I'm having trouble doing the same with the stable 3.9 release. Levels on both SDA and SCL just don't move when using the bus.

I've rebased Fadil's patch (https://github.com/koliqi/imx23-olinuxino/blob/master/kernel/0001-MXS-imx23-olinuxino-Add-i2c-support.patch) on v3.9 and added a couple of other useful patches. The entire changeset onto v3.9 I'm using is here (http://sprunge.us/KcBT).

Anyone know why this is? Do you have it working for you? If so -- how? Thanks!
Title: Re: HW I2C with 3.9-stable problems
Post by: Niii on May 09, 2013, 01:03:03 PM
Take a look at https://www.olimex.com/forum/index.php?topic=283.25
Title: Re: HW I2C with 3.9-stable problems
Post by: xxcn on May 09, 2013, 01:22:27 PM
Hi Niii,

I did try those out, but they don't seem to make a difference. The thing is, with or without the timeout patch I can see the SCL line toggling and SDA moving when `i2cdetect -r 0` with kernels <=3.8.11, but not with 3.9. They just stay high.
Title: Re: HW I2C with 3.9-stable problems
Post by: Niii on May 09, 2013, 05:14:27 PM
It works for me on stable 3.9.1 with these two patchs :
https://www.dropbox.com/s/r6quykxgozuwiak/i2c_mxs-dts.patch
https://www.dropbox.com/s/5t5ewcvtsuh4oba/next20130218_i2c-mxs.c.patch


root@itx:~# uname -a
Linux itx 3.9.1 #1 Thu May 9 15:31:48 CEST 2013 armv5tejl GNU/Linux
root@itx:~# i2cdetect -l
i2c-0 i2c        MXS I2C adapter                  I2C adapter
root@itx:~# i2cdetect -r 0
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-0 using read byte commands.
I will probe address range 0x03-0x77.
Continue? [Y/n]
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- 49 -- -- -- -- -- --
50: -- ^C
root@itx:~# i2cget 0 0x49 0x00 w
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will read from device file /dev/i2c-0, chip address 0x49, data address
0x00, using read word data.
Continue? [Y/n]
0xc018