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.

detect i2c address

Guru 20755 points
Other Parts Discussed in Thread: TVP5150AM1, TVP5150

Hello,

I have some general question.

I'm connecting the board to external video decoder (tvp5150AM1), and wanted to rd/wr the decoder (by using i2c_rdwr.out utility).

How do I know the address of the new coonected decoder (this is required as 1st parameter of  i2c_rdwr) ? 

Do I need to make changes in kernel for using this device, do I need to add it into ti814x_i2c_boardinfo struct in kernel board-ti8148evm.c file   ?

Thanks,

Ran

  • Hi,

         I2c address need to derived from the hardware configuration of the decoder and the datasheet. To access the device you don't need to add anything in the kernel if the i2c bus connected is the default bus for i2_rdwr. Or else you need to recompile the utility as well as the kernel.

    Faizel

  • Hi Faizel,

    Thanks,

    But why do I see in kernel ti814x_i2c_boardinfo struct, list of devices (though I don't find the internal video decoder listed here), don't I need to add the external decoder here ?

    static struct i2c_board_info __initdata ti814x_i2c_boardinfo[] = {
    {
    ....
    {
    I2C_BOARD_INFO("tlv320aic3x", 0x18),
    },
    {......

    Anyway, when I run "i2cdetect -r 1" for detecting the external video decoder on i2c1, I get the same info as without connecting the video decoding physically. Can I assume from this that there might be problem with hardware connectivity ? 

    0 1 2 3 4 5 6 7 8 9 a b c d e f
    00: -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
    20: UU UU -- -- -- 25 -- -- -- -- -- -- -- UU -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: 40 41 -- -- -- -- -- -- 48 -- UU -- -- -- -- --
    50: 50 51 -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --
    root@dm814x:~#

    Thanks,

    Ran

  • Hi,

          We are not using the i2c board info struct for using the i2c read/write utility. You can ignore that point. I am not sure about the i2cdetect command. I have not used it.  Its not wise to assume hardware connectivity issues as we have faced many issues related with omap i2c. Please try the procedure in order

    • Find out the i2c address of the device?
    • Find out the i2c bus number where the device is connected to?
    • Make sure that the utility is using the same device bus to access the specified address?
    • Make sure that in the kernel we have enabled that i2c bus to get access from linux?
    • After cross checking all try a read and write.

    Faizel

  • Hi Faizel,

    Device address is 0xb8 (We are connecting DM814X to TI's TVP5150AM EVM).

    I2C bus in use is #1 (i2c1).

    I can read using TI's utility which is supplied as part of RDK, i2c_rdwr.out different devices on bus #1, but not from tvp5150 device.

    By the way, i2c_rdwr.out utility had to be compiled again to use bus 1, because by default for DM814X is uses bus 2 or 3 (I wander why it is compoilation and not argument)

    I still can't read from the device, but I suspect it is a matter of hardware connectivity. We will check this suspicion first before we can go on.

    Thanks very much for guidance,

    Ran

  • Ok Ran. Please check the bus support in the kernel also. 

    In your board file make sure that we have initialized appropriate bus. You can see code like below

    omap_register_i2c_bus(3, 400, ti810x_i2c_boardinfo,
    ARRAY_SIZE(ti810x_i2c_boardinfo)); 

    Change the parameters to your specific case

    Faizel