On Wed, May 26, 2021 at 11:44 AM Stephan Gerhold <stephan@xxxxxxxxxxx> 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@xxxxxxxxxx> > Cc: Linus Walleij <linus.walleij@xxxxxxxxxx> > Fixes: 2017cff24cc0 ("iio:bma180: Add BMA250 chip support") > Signed-off-by: Stephan Gerhold <stephan@xxxxxxxxxxx> Good catch! Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx> > 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