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.

Reset I2C bus using SCL and SDA pin that in new linux kernel I2C buss code

Hi

I want to reset I2C bus of DM6467  whenever there is timeout during i2c data transfer. in new kernel 3.9 there is support added using 

static void i2c_recover_bus(struct davinci_i2c_dev *dev)  function. in drivers/i2c/busses/i2c-davinci.c file

But when i am using this function for my DM6467 device at that time it is giving me error of sdl and scl pin number.

Here is some code snippet from kernel 3.9  

1 ) arch/arm/mach-davinci/board-dm646x-evm.c

     static struct davinci_i2c_platform_data i2c_pdata = {
          .bus_freq       = 100 /* kHz */,
          .bus_delay      = 0 /* usec */,
 };

2) arch/arm/mach-davinci/board-dm355-evm.c
  static struct davinci_i2c_platform_data i2c_pdata = {
     .bus_freq       = 20 /* kHz */,
     .bus_delay      = 100 /* usec */,
    .sda_pin        = 44,
    .scl_pin        = 43,
};

3) arch/arm/mach-davinci/board-dm355-evm.c

        static struct davinci_i2c_platform_data i2c_pdata = {
            .bus_freq = 400 /* kHz */,
            .bus_delay = 0 /* usec */,
           .sda_pin = 15,
           .scl_pin = 14,
    };

Here can any one give me some idea about sda_pin and scl_pin for DM646x processor , in kernel code there is already sda_pin and scl_pin for dm644x and dm355-evm board .

Please provide me some  information about sda_pin and scl_pin.

Thanks in Advanced,

-regards,

Dhvani Patel

  • Dhvani,

    Is there any particular reason for trying 3.9 kernel? Have you tried using the DVSDK package for DM6467?

  • Hi Thomas,

    I am using DVSDK_3_10_00_19 from TI. Can you provide me some mechanism for reset I2C of DM6467 by using SDL and SCL pin as they are provided in kernel 3.9 .

    -Dhvani Patel

  • Dhvani,

    You can reset the I2C by using the I2C controller register. Please check the I2C controller documentation for the same.

  • Thomas,

    Thanks and Yes that's fine. But some times my slave I2C goes into unstable state and if i tries to write on I2C bus and i get timeout every time even though i reset my master I2C by using controlled register But i cannot reset my slave I2C as my write continuously fail on I2C bus.

    So i want to reset my Slave I2C using SDL and SCL pin same as that was provided in kernel 3.9 for DM335-evm.

    So please can you provide me what is gpio of SDL and SCL pin for DM646x.

    -Dhvani

  • Dhvani,

    For the GPIO corresponding to the I2C SDA/SCL pins, you've to refer to the datasheet of DM646x. I am not sure about the support provided by 3.9 kernel, but I believe in hardware you can check for another option. You can see any reset or pwr line goes from DM646x to the I2C slave and toggle the power. 

    Reset might be a workaround for the issue that you are facing. Ideally there might be some issues in the bus because of which it is failing. Do you have any other I2C slave device on your board? If so, have you observed similar behavior there also?