summaryrefslogtreecommitdiff
path: root/drivers/iio/pressure/bmp280-i2c.c
diff options
context:
space:
mode:
authorAngel Iglesias <ang.iglesiasg@gmail.com>2022-09-13 02:52:13 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2022-09-21 20:42:54 +0300
commit8d329309184d5824e44c6426bf878c5f1e1156e5 (patch)
treead7ca0d16313a3340251a46580f8fc889bbc7bdb /drivers/iio/pressure/bmp280-i2c.c
parent18d1bb377023cad76e01b598da3da53da9fc36b7 (diff)
downloadlinux-8d329309184d5824e44c6426bf878c5f1e1156e5.tar.xz
iio: pressure: bmp280: Add support for BMP380 sensor family
Adds compatibility with the new generation of this sensor, the BMP380. Includes basic sensor initialization to do pressure and temp measurements and allows tuning oversampling settings for each channel. The compensation algorithms are adapted from the device datasheet and the repository https://github.com/BoschSensortec/BMP3-Sensor-API. Signed-off-by: Angel Iglesias <ang.iglesiasg@gmail.com> Link: https://lore.kernel.org/r/f1da2a2f1bc5bb083f318335c23b4f3d9bb8e536.1663025017.git.ang.iglesiasg@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/pressure/bmp280-i2c.c')
-rw-r--r--drivers/iio/pressure/bmp280-i2c.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/iio/pressure/bmp280-i2c.c b/drivers/iio/pressure/bmp280-i2c.c
index 5b51ebfc6f2b..0c27211f3ea0 100644
--- a/drivers/iio/pressure/bmp280-i2c.c
+++ b/drivers/iio/pressure/bmp280-i2c.c
@@ -19,6 +19,9 @@ static int bmp280_i2c_probe(struct i2c_client *client,
case BME280_CHIP_ID:
regmap_config = &bmp280_regmap_config;
break;
+ case BMP380_CHIP_ID:
+ regmap_config = &bmp380_regmap_config;
+ break;
default:
return -EINVAL;
}
@@ -41,6 +44,7 @@ static const struct of_device_id bmp280_of_i2c_match[] = {
{ .compatible = "bosch,bmp180", .data = (void *)BMP180_CHIP_ID },
{ .compatible = "bosch,bmp280", .data = (void *)BMP280_CHIP_ID },
{ .compatible = "bosch,bme280", .data = (void *)BME280_CHIP_ID },
+ { .compatible = "bosch,bmp380", .data = (void *)BMP380_CHIP_ID },
{ },
};
MODULE_DEVICE_TABLE(of, bmp280_of_i2c_match);
@@ -50,6 +54,7 @@ static const struct i2c_device_id bmp280_i2c_id[] = {
{"bmp180", BMP180_CHIP_ID },
{"bmp280", BMP280_CHIP_ID },
{"bme280", BME280_CHIP_ID },
+ {"bmp380", BMP380_CHIP_ID },
{ },
};
MODULE_DEVICE_TABLE(i2c, bmp280_i2c_id);