[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-iio
Subject:    Re: [PATCH 1/2] iio: accel: bma180: Fix BMA25x bandwidth register values
From:       Linus Walleij <linus.walleij () linaro ! org>
Date:       2021-05-26 12:12:02
Message-ID: CACRpkdZweO5kCdSky8Nc+QmKWRuGLKX4QEct5LmH4RTPirRLhg () mail ! gmail ! com
[Download RAW message or body]

On Wed, May 26, 2021 at 11:44 AM Stephan Gerhold <stephan@gerhold.net> wrote:

> According to the BMA253 datasheet [1] and BMA250 datasheet [2] the
> bandwidth value for BMA25x should be set as 01xxx:
>
>   "Settings 00xxx result in a bandwidth of 7.81 Hz; [...]
>    It is recommended [...] to use the range from  ´01000b ´ to  ´01111b ´
>    only in order to be compatible with future products."
>
> However, at the moment the drivers sets bandwidth values from 0 to 6,
> which is not recommended and always results into 7.81 Hz bandwidth
> according to the datasheet.
>
> Fix this by introducing a bw_offset = 8 = 01000b for BMA25x,
> so the additional bit is always set for BMA25x.
>
> [1]: https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bma253-ds000.pdf
> [2]: https://datasheet.octopart.com/BMA250-Bosch-datasheet-15540103.pdf
>
> Cc: Peter Meerwald <pmeerw@pmeerw.net>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Fixes: 2017cff24cc0 ("iio:bma180: Add BMA250 chip support")
> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>

Good catch!
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

> After spending some more time with the driver I noticed that BMA253/BMA254
> would actually be better supported by the bmc150-accel driver (which
> doesn't have this problem and also supports the motion trigger/interrupt).
>
> I'm preparing a separate patch set to move BMA254 to bmc150-accel at least,
> but I'm not sure about BMA250 so this patch is relevant anyway. And I had
> it almost done already, so I thought it's better to send it. :)

I looked at the preliminary patches and this looks really good
too.

Yours,
Linus Walleij
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic