Tuesday, September 28, 2010

I2C frame work in Linux 2.6.32

following article from embeded-bits have nice descriptions on how to use new I2C frame work on linux 2.6.32 kernel.

http://www.embedded-bits.co.uk/?p=174

This describes how to use i2c driver via i2c_board_info in the board specific code.

for beagle board i2c device can be added by editing board-omap3beagle.c file located at kernel/arch/arm/mach-omap2.

for example a bq27200 fuel gauge added to I2C -2 by adding following code make sure probe function of bq27200 driver is called ;-).

static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = {
{
I2C_BOARD_INFO("bq27200", 0x55),
},
};

No comments: