i.MX28 Linux BSP I2C source codes bug

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.MX28 Linux BSP I2C source codes bug

2,419 Views
jackyliu
NXP Employee
NXP Employee

in drivers/i2c/busses/i2c-mxs.c, mxs_i2c_xfer_msg() function:
below codes are not correct:
 err = wait_for_completion_interruptible_timeout(&dev->cmd_complete,
       msecs_to_jiffies(1000)
     );
 if (err <= 0) {
  mxs_i2c_reset(dev);
  dev_dbg(dev->dev, "controller is timed out\n");
  return -ETIMEDOUT;
 }

Labels (1)
0 Kudos
5 Replies

1,057 Views
jackyliu
NXP Employee
NXP Employee

It should be changed as belows:
err = wait_for_completion_interruptible_timeout(&dev->cmd_complete, msecs_to_jiffies(1000));
      if (err == 0) {
              mxs_i2c_reset(dev);
              printk("I2C timeout\n");
              return -ETIMEDOUT;
      }
      else if (err==(-ERESTARTSYS)) {
              printk("I2C ERESTARTSYS\n");
          for (i = 0; i < _NSIG_WORDS ; i++) printk("I2C signal:%d\n",current->pending.signal.sig[i]);              
              return -ETIMEDOUT;
      }
      else if (err<0){
              printk("I2C unknown err:%d\n",err);
              return -ETIMEDOUT;
      }

0 Kudos

1,057 Views
samuelsalas
Contributor III

Hi Jacky,

Have you got a last version of "i2c-mxs.c" I could use to solve my two issues :

I2C frequency on 2 buses

Conflict on 2 I2C buses

Regards,

Sam.

0 Kudos

1,057 Views
ArtyomKamshilin
Contributor II

Sam,

> Have you got a last version of "i2c-mxs.c"

I also have issues with I2C - where can I get this latest version? I've got all patches applied. Thanks in advance!

Arty

0 Kudos

1,057 Views
samuelsalas
Contributor III

Hi Artem,

there is no last version of "i2c-mxs.c" for the kernel 2.6.35, but there is a new version with kernel 3.7. That's what we are doing now, passing to 3.7 in order to benefit from the new kernel.

Samuel

0 Kudos

1,057 Views
ArtyomKamshilin
Contributor II

Thanks, I look forward for the update!

0 Kudos