Re: [PATCH v4 6/6] iio: accel: fxls8962af: fix errata bug E3 - I2C burst reads

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 29, 2021 at 3:28 PM Sean Nyekjaer <sean@xxxxxxxxxx> wrote:
>
> When flushing the hw fifo there is a bug in the I2C that prevents burst
> reads of more than one sample pair.

...

> -       ret = regmap_raw_read(data->regmap, FXLS8962AF_BUF_X_LSB, buffer,
> -                             total_length);
> +       if (i2c_verify_client(dev)) {
> +               /*
> +                * Due to errata bug:
> +                * E3: FIFO burst read operation error using I2C interface
> +                * We have to avoid burst reads on I2C..
> +                */
> +               for (i = 0; i < samples; i++) {
> +                       ret = regmap_raw_read(data->regmap, FXLS8962AF_BUF_X_LSB,
> +                                             &buffer[i],
> +                                             sample_length);
> +                       if (ret < 0)
> +                               goto out;
> +               }

Can you rather create a separate function called
fxls8962af_i2c_raw_read_errata3() and use it here by simply

  if (i2c)
    ret = fxls8962af_i2c_raw_read_errata3();
  else
    ret = regmap_raw_read();

?

> +       } else {
> +               ret = regmap_raw_read(data->regmap, FXLS8962AF_BUF_X_LSB, buffer,
> +                                     total_length);
> +       }


-- 
With Best Regards,
Andy Shevchenko



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux