diff options
author | Angel Iglesias <ang.iglesiasg@gmail.com> | 2022-09-13 02:52:13 +0300 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2022-09-21 20:42:54 +0300 |
commit | 8d329309184d5824e44c6426bf878c5f1e1156e5 (patch) | |
tree | ad7ca0d16313a3340251a46580f8fc889bbc7bdb /drivers/iio/pressure/bmp280-spi.c | |
parent | 18d1bb377023cad76e01b598da3da53da9fc36b7 (diff) | |
download | linux-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-spi.c')
-rw-r--r-- | drivers/iio/pressure/bmp280-spi.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/iio/pressure/bmp280-spi.c b/drivers/iio/pressure/bmp280-spi.c index 4cfaf3e869b8..011c68e07ebf 100644 --- a/drivers/iio/pressure/bmp280-spi.c +++ b/drivers/iio/pressure/bmp280-spi.c @@ -66,6 +66,9 @@ static int bmp280_spi_probe(struct spi_device *spi) case BME280_CHIP_ID: regmap_config = &bmp280_regmap_config; break; + case BMP380_CHIP_ID: + regmap_config = &bmp380_regmap_config; + break; default: return -EINVAL; } @@ -92,6 +95,7 @@ static const struct of_device_id bmp280_of_spi_match[] = { { .compatible = "bosch,bmp181", }, { .compatible = "bosch,bmp280", }, { .compatible = "bosch,bme280", }, + { .compatible = "bosch,bmp380", }, { }, }; MODULE_DEVICE_TABLE(of, bmp280_of_spi_match); @@ -101,6 +105,7 @@ static const struct spi_device_id bmp280_spi_id[] = { { "bmp181", BMP180_CHIP_ID }, { "bmp280", BMP280_CHIP_ID }, { "bme280", BME280_CHIP_ID }, + { "bmp380", BMP380_CHIP_ID }, { } }; MODULE_DEVICE_TABLE(spi, bmp280_spi_id); |