All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Sean Nyekjaer <sean@geanix.com>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
	linux-iio <linux-iio@vger.kernel.org>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"Nuno Sá" <Nuno.Sa@analog.com>,
	"Rob Herring" <robh+dt@kernel.org>,
	devicetree <devicetree@vger.kernel.org>
Subject: Re: [PATCH v4 6/6] iio: accel: fxls8962af: fix errata bug E3 - I2C burst reads
Date: Fri, 30 Apr 2021 12:14:58 +0300	[thread overview]
Message-ID: <CAHp75VcLusrQ0+4DcXf4o0sS=Jc031LDJT4ReMOhVt0U0-jMWQ@mail.gmail.com> (raw)
In-Reply-To: <20210429122806.3814330-6-sean@geanix.com>

On Thu, Apr 29, 2021 at 3:28 PM Sean Nyekjaer <sean@geanix.com> 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

  reply	other threads:[~2021-04-30  9:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-29 12:28 [PATCH v4 1/6] iio: accel: add support for FXLS8962AF/FXLS8964AF accelerometers Sean Nyekjaer
2021-04-29 12:28 ` [PATCH v4 2/6] dt-bindings: iio: accel: fxls8962af: add bindings Sean Nyekjaer
2021-04-29 15:25   ` Rob Herring
2021-04-29 12:28 ` [PATCH v4 3/6] iio: accel: fxls8962af: add set/get of samplerate Sean Nyekjaer
2021-04-29 12:28 ` [PATCH v4 4/6] iio: accel: fxls8962af: add interrupt support Sean Nyekjaer
2021-04-30  9:02   ` Andy Shevchenko
2021-05-03 11:19     ` Sean Nyekjaer
2021-04-29 12:28 ` [PATCH v4 5/6] iio: accel: fxls8962af: add hw buffered sampling Sean Nyekjaer
2021-04-30  9:10   ` Andy Shevchenko
2021-04-29 12:28 ` [PATCH v4 6/6] iio: accel: fxls8962af: fix errata bug E3 - I2C burst reads Sean Nyekjaer
2021-04-30  9:14   ` Andy Shevchenko [this message]
2021-04-30  9:25 ` [PATCH v4 1/6] iio: accel: add support for FXLS8962AF/FXLS8964AF accelerometers Tomas Melin
2021-05-02 17:46   ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHp75VcLusrQ0+4DcXf4o0sS=Jc031LDJT4ReMOhVt0U0-jMWQ@mail.gmail.com' \
    --to=andy.shevchenko@gmail.com \
    --cc=Nuno.Sa@analog.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=sean@geanix.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.