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>
This commit is contained in:
Linus Walleij 2020-11-15 21:57:44 +01:00 committed by Jonathan Cameron
parent 6259551cf1
commit a1a210bf29
4 changed files with 22 additions and 0 deletions

View File

@ -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,

View File

@ -5,6 +5,7 @@
* - BMI055
* - BMA255
* - BMA250E
* - BMA222
* - BMA222E
* - BMA280
*
@ -54,6 +55,7 @@ static const struct acpi_device_id bmc150_accel_acpi_match[] = {
{"BMI055A", bmi055},
{"BMA0255", bma255},
{"BMA250E", bma250e},
{"BMA222", bma222},
{"BMA222E", bma222e},
{"BMA0280", bma280},
{"BOSC0200"},
@ -66,6 +68,7 @@ static const struct i2c_device_id bmc150_accel_id[] = {
{"bmi055_accel", bmi055},
{"bma255", bma255},
{"bma250e", bma250e},
{"bma222", bma222},
{"bma222e", bma222e},
{"bma280", bma280},
{}
@ -78,6 +81,7 @@ static const struct of_device_id bmc150_accel_of_match[] = {
{ .compatible = "bosch,bmi055_accel" },
{ .compatible = "bosch,bma255" },
{ .compatible = "bosch,bma250e" },
{ .compatible = "bosch,bma222" },
{ .compatible = "bosch,bma222e" },
{ .compatible = "bosch,bma280" },
{ },

View File

@ -39,6 +39,7 @@ static const struct acpi_device_id bmc150_accel_acpi_match[] = {
{"BMI055A", bmi055},
{"BMA0255", bma255},
{"BMA250E", bma250e},
{"BMA222", bma222},
{"BMA222E", bma222e},
{"BMA0280", bma280},
{ },
@ -50,6 +51,7 @@ static const struct spi_device_id bmc150_accel_id[] = {
{"bmi055_accel", bmi055},
{"bma255", bma255},
{"bma250e", bma250e},
{"bma222", bma222},
{"bma222e", bma222e},
{"bma280", bma280},
{}

View File

@ -9,6 +9,7 @@ enum {
bmi055,
bma255,
bma250e,
bma222,
bma222e,
bma280,
};