summaryrefslogtreecommitdiff
path: root/drivers/iio
diff options
context:
space:
mode:
authorVasileios Amoiridis <vassilisamir@gmail.com>2024-07-11 23:15:50 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-10-10 11:58:05 +0200
commit736da424081503b1985e45f311520ef09b039e7c (patch)
tree8d57b8115d1d1af99e4f80b822d686fe70202d35 /drivers/iio
parentae6724f9f13e903c1e68ccb044bc3cdbfc194df6 (diff)
downloadlinux-736da424081503b1985e45f311520ef09b039e7c.tar.gz
linux-736da424081503b1985e45f311520ef09b039e7c.tar.bz2
linux-736da424081503b1985e45f311520ef09b039e7c.zip
iio: pressure: bmp280: Fix waiting time for BMP3xx configuration
[ Upstream commit 262a6634bcc4f0c1c53d13aa89882909f281a6aa ] According to the datasheet, both pressure and temperature can go up to oversampling x32. With this option, the maximum measurement time is not 80ms (this is for press x32 and temp x2), but it is 130ms nominal (calculated from table 3.9.2) and since most of the maximum values are around +15%, it is configured to 150ms. Fixes: 8d329309184d ("iio: pressure: bmp280: Add support for BMP380 sensor family") Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com> Link: https://patch.msgid.link/20240711211558.106327-3-vassilisamir@gmail.com Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/pressure/bmp280-core.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/iio/pressure/bmp280-core.c b/drivers/iio/pressure/bmp280-core.c
index 3ba718b11c46..84f6b333c919 100644
--- a/drivers/iio/pressure/bmp280-core.c
+++ b/drivers/iio/pressure/bmp280-core.c
@@ -1203,10 +1203,11 @@ static int bmp380_chip_config(struct bmp280_data *data)
}
/*
* Waits for measurement before checking configuration error
- * flag. Selected longest measure time indicated in
- * section 3.9.1 in the datasheet.
+ * flag. Selected longest measurement time, calculated from
+ * formula in datasheet section 3.9.2 with an offset of ~+15%
+ * as it seen as well in table 3.9.1.
*/
- msleep(80);
+ msleep(150);
/* Check config error flag */
ret = regmap_read(data->regmap, BMP380_REG_ERROR, &tmp);