I2C Demo for Colibri imx6

Is there any I2C Demo for Colibri imx6 I can learn from it?
I want to learn how to use I2C of this module, but the source is limited.

Is there any I2C Demo for Colibri imx6 I can learn from it? I want to learn how to use I2C of this module, but the source is limited.

I’m not sue what you mean by ‘the source is limited’. Programming I2C in Linux is really not module specific at all and you may find lots of information at various places e.g.

  1. Developer website article about the Linux I2C thematic.
  2. Kernel documentation with resp. sample code given.

Please do let us know if anything is still unclear about this.

Hi,
I really appreciate your answer and I’m working on the example you give.
However, when I was trying to use i2c_smbus_read_word_data(), there is an error saying cannot find this definition. I have included both and but it did not work. Is there anything I missed?

Thanks

I just found out the file I got is different from the one I found from here
http://lxr.free-electrons.com/source/include/linux/i2c.h?v=2.4.37
Mine is much shorter and doesn’t contain any function definition, can I just simply override mine with this one? I think this can fix my problem but I am not sure it would cause new issue.