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.

Problem accessing I2C from userspace (EREMOTEIO)

Other Parts Discussed in Thread: AM3352

Hi folks,

I'm seeing some strange behavior when using I2C on an AM3352. My application is that I've got a digital potentiometer which is i2c connected. Due to some time constraints I can't write a kernel driver for it, and one doesn't seem to exist, so I was accessing it in user space using the i2ctools package.

In u-boot, accesses work, but in Linux I see some strange behavior when it goes to write to the bus. I see three ioctls happening:

I2C_FUNCS

I2C_SLAVE or I2C_SLAVE_FORCE (they perform identical functionality in kernel 3.2.2)

I2C_SMBUS

The first two work, but the I2C_SMBUS returns -EREMOTEIO. Our first thought was that the chip was NAKing us, but examining the bus with a scope, we found that there's no data being put on the bus at all. After double-checking our pin muxing, we followed the kernel code down to the i2c-omap bus driver, where it appears to do quite a lot of memory writes to reserved addresses in the 0xF9E0B0xx range. I do see that the I2C_SMBUS ioctl falls back to emulating SMBus with i2c, which is good because there's not a native SMBUS interface on this chip as far as I know.

I was wondering if anyone else had tried accessing i2c from userspace, and if so if you had any success using some other method? If not, has anyone else had this sort of problem?