Tool/software: Linux
Hello,
I have an i2c device that could be one of two addresses (0x4a or 0x4b). There are no other hardware means to determine what the address is. I need to be able to determine in the linux board file which address is the correct one before calling omap_register_i2c_bus, but I am lost as to how to do this.
Is there a method to probe these addresses before calling the omap_register_i2c_bus function? I have read the following documentation, but it seems so far removed from what the TI81XX porting guide is saying to do to initialize i2c devices:
Additionally, I have tried to arrange my code as follows, but it seems to only work with one device or the other depending on which address comes first in the array:
static struct i2c_board_info __initdata my_i2c_boardinfo[] = {
{
I2C_BOARD_INFO("my_i2c_dev", 0x4a),
.flags = I2C_CLIENT_WAKE,
.irq = OMAP_GPIO_IRQ(118),
.platform_data = &my_data,
},
{
I2C_BOARD_INFO("my_i2c_dev", 0x4b),
.flags = I2C_CLIENT_WAKE,
.irq = OMAP_GPIO_IRQ(118),
.platform_data = &my_data,
},
};
...
omap_register_i2c_bus(2, 400, my_i2c_boardinfo,ARRAY_SIZE(my_i2c_boardinfo));
Any assistance is greatly appreciated.
Thanks,
Will Bates