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.

AM3517 board definitions for i2c temp sensor

Other Parts Discussed in Thread: AM3517

Hi,

Could someone suggest an example of how to define i2c LM75 sensors at /arch/arm/mach-omap2/board-am3517evm.c ?

I have added I2C INFO on the devices but I think I'm missing some definitions. Couldn't spot them in the driver. Here is what I've got so far:

static struct at24_platform_data m24c02 = {
.byte_len = SZ_2K / 8,
.page_size = 16,
};

static struct i2c_board_info __initdata am3517evm_i2c3_boardinfo[] = {
{ /* EEPROM on mainboard */
I2C_BOARD_INFO("24c02", 0x52),
.platform_data = &m24c02,
},
{ /* Temperature sensor #1 */
I2C_BOARD_INFO("lm75", 0x4B),
},
{ /* Temperature sensor #2 */
I2C_BOARD_INFO("lm75", 0x4C),
},

};

1. As an opposite to the EEPROM definition shown here, I don't know what to pass to .platform_data ?

2. Please also advice if using two "lm75" strings for different ICs is valid.

3. Is there any other configuration required besides that one?

Thanks ahead,

Yakir

  • Yakir:

    After adding i2c chip name and i2c address in board file,

    In  this function  ====> omap3_evm_i2c_init

    call that i2c information:

    Which bus and speed you are using for that i2c sensor chip?

    Regards,

    santosh vastrad

  • Thanks

    I have already had the following definitions in my kernel:

    static int __init am3517_evm_i2c_init(void)
    {
    omap_register_i2c_bus(1, 400, NULL, 0);
    omap_register_i2c_bus(2, 400, am3517evm_i2c2_boardinfo,
    ARRAY_SIZE(am3517evm_i2c2_boardinfo));
    omap_register_i2c_bus(3, 400, am3517evm_i2c3_boardinfo,
    ARRAY_SIZE(am3517evm_i2c3_boardinfo));

    return 0;
    }

    I have no problem using 400K and picked up bus #3, it seemed the most convenient to use. The board definitions are under the am3517evm_i2c3_boardinfo.

    I have named the sensors on 0x4B and 0x4C with "lm75" same name. Is that a problem ?

  • Yakir:

    I think we have to give different names,

    because, That two slaves will be having two different driver codes,

    according to driver name we need to match that name to board file information name.

    Regards,

    santosh vastrad