summaryrefslogtreecommitdiff
path: root/drivers/iio/accel/bmc150-accel-i2c.c
diff options
context:
space:
mode:
authorStephan Gerhold <stephan@gerhold.net>2021-06-11 11:09:03 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2021-06-13 19:00:18 +0300
commita7ba1c24da7b78f476d8f5523489a721a01c4243 (patch)
treef8181eae95a42e20f73bb153f9f877c6579ac666 /drivers/iio/accel/bmc150-accel-i2c.c
parent5640fed3035e88c3ce1361e6fc93f4e72468f307 (diff)
downloadlinux-a7ba1c24da7b78f476d8f5523489a721a01c4243.tar.xz
iio: accel: bma180/bmc150: Move BMA254 to bmc150-accel driver
Commit c1d1c4a62db5 ("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: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Stephan Gerhold <stephan@gerhold.net> Link: https://lore.kernel.org/r/20210611080903.14384-11-stephan@gerhold.net Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/accel/bmc150-accel-i2c.c')
-rw-r--r--drivers/iio/accel/bmc150-accel-i2c.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/iio/accel/bmc150-accel-i2c.c b/drivers/iio/accel/bmc150-accel-i2c.c
index 32ed07354a9a..999495f0669d 100644
--- a/drivers/iio/accel/bmc150-accel-i2c.c
+++ b/drivers/iio/accel/bmc150-accel-i2c.c
@@ -232,6 +232,7 @@ static const struct i2c_device_id bmc150_accel_id[] = {
{"bma222e"},
{"bma250e"},
{"bma253"},
+ {"bma254"},
{"bma255"},
{"bma280"},
{"bmc150_accel"},
@@ -246,6 +247,7 @@ static const struct of_device_id bmc150_accel_of_match[] = {
{ .compatible = "bosch,bma222e" },
{ .compatible = "bosch,bma250e" },
{ .compatible = "bosch,bma253" },
+ { .compatible = "bosch,bma254" },
{ .compatible = "bosch,bma255" },
{ .compatible = "bosch,bma280" },
{ .compatible = "bosch,bmc150_accel" },