Search code examples
linux-kernellinux-device-driveri2c

I2C Driver in Linux


I am aware of I2C in a very basic level which relies inside linux kernel, but no clue to implement a basic I2C driver.

Trying to moving for a start in I2C device driver. could you please suggest any beginner tutorial with source code mapping !!


Solution

  • linux-source/Documentation/i2c/ has lot of the information you'd need. .../writing-clients.txt is a good place to start.

    Have a look at the online version:

    https://www.kernel.org/doc/Documentation/i2c/writing-clients

    There is an okay sort of a tutorial at:

    http://renjucnair.blogspot.ca/2012/01/writing-i2c-client-driver.html

    Here is a good commentary on someone writing an i2c driver and has a tutorial feel to it:

    http://www.embedded-bits.co.uk/2009/i2c-in-the-2632-linux-kernel/

    Here is some sample code:

    http://code.google.com/p/ldd-templates/source/browse/drivers/i2c/sample-i2c-client.c