• S
    iio: accel: bma180/bmc150: Move BMA254 to bmc150-accel driver · a7ba1c24
    Stephan Gerhold 提交于
    Commit c1d1c4a6 ("iio: accel: bma180: BMA254 support") added
    BMA254 support to the bma180 driver and changed some naming to BMA25x
    to make it easier to add support for BMA253 and BMA255.
    
    Unfortunately, there is quite some overlap between the bma180 driver
    and the bmc150-accel driver. Back when the commit was made, the
    bmc150-accel driver actually already had support for BMA255, and
    adding support for BMA254 would have been as simple as adding a new
    compatible to bmc150-accel.
    
    The bmc150-accel driver is a bit better for BMA254 since it also
    supports the motion trigger/interrupt functionality. Fortunately,
    moving BMA254 support over to bmc150-accel is fairly simple because
    the drivers have compatible device tree bindings.
    
    Revert most of the changes for BMA254 support in bma180 and move
    BMA254 over to bmc150-accel. This has the following advantages:
    
      - Support for motion trigger/interrupt
      - Fix incorrect scale values (BMA254 currently uses the same as
        BMA250 but actually they're different because of 10 vs 12 bits
        data size)
      - Less code than before :)
    
    BMA250 could be potentially also moved but it's more complicated
    because its chip_id conflicts with the one for BMA222 in bmc150-accel.
    Perhaps there are also other register differences, I did not investigate
    further yet (and I have no way to test it).
    
    Cc: Peter Meerwald <pmeerw@pmeerw.net>
    Reviewed-by: NLinus Walleij <linus.walleij@linaro.org>
    Reviewed-by: NHans de Goede <hdegoede@redhat.com>
    Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com>
    Signed-off-by: NStephan Gerhold <stephan@gerhold.net>
    Link: https://lore.kernel.org/r/20210611080903.14384-11-stephan@gerhold.netSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
    a7ba1c24
bmc150-accel-core.c 47.1 KB