diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2020-11-15 21:57:44 +0100 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2020-12-03 19:32:41 +0000 |
commit | a1a210bf29a1a232a37c69588aff9690e671a5b3 (patch) | |
tree | 8f9b1ff94540c0e1387ade39c4f215c9892b2429 /drivers/iio/accel/bmc150-accel-core.c | |
parent | 6259551cf19bffebbae75923e025f0398c7c889c (diff) |
iio: accel: bmc150-accel: Add support for BMA222
This adds support for the BMA222 version of this sensor,
found in for example the Samsung GT-I9070 mobile phone.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20201115205745.618455-2-linus.walleij@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/accel/bmc150-accel-core.c')
-rw-r--r-- | drivers/iio/accel/bmc150-accel-core.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc150-accel-core.c index c641ee552038..1c9e44f8bc3e 100644 --- a/drivers/iio/accel/bmc150-accel-core.c +++ b/drivers/iio/accel/bmc150-accel-core.c @@ -5,6 +5,7 @@ * - BMI055 * - BMA255 * - BMA250E + * - BMA222 * - BMA222E * - BMA280 * @@ -1063,6 +1064,20 @@ static const struct bmc150_accel_chip_info bmc150_accel_chip_info_tbl[] = { {153277, BMC150_ACCEL_DEF_RANGE_8G}, {306457, BMC150_ACCEL_DEF_RANGE_16G} }, }, + [bma222] = { + .name = "BMA222", + .chip_id = 0x03, + .channels = bma222e_accel_channels, + .num_channels = ARRAY_SIZE(bma222e_accel_channels), + /* + * The datasheet page 17 says: + * 15.6, 31.3, 62.5 and 125 mg per LSB. + */ + .scale_table = { {156000, BMC150_ACCEL_DEF_RANGE_2G}, + {313000, BMC150_ACCEL_DEF_RANGE_4G}, + {625000, BMC150_ACCEL_DEF_RANGE_8G}, + {1250000, BMC150_ACCEL_DEF_RANGE_16G} }, + }, [bma222e] = { .name = "BMA222E", .chip_id = 0xF8, |