diff mbox series

[v1,02/10] iio: pressure: bmp280: Fix waiting time for BMP3xx configuration

Message ID 20240711211558.106327-3-vassilisamir@gmail.com (mailing list archive)
State Accepted
Headers show
Series BMP280: Minor cleanup and interrupt support | expand

Commit Message

Vasileios Amoiridis July 11, 2024, 9:15 p.m. UTC
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>
---
 drivers/iio/pressure/bmp280-core.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Jonathan Cameron July 20, 2024, 11:06 a.m. UTC | #1
On Thu, 11 Jul 2024 23:15:50 +0200
Vasileios Amoiridis <vassilisamir@gmail.com> wrote:

> 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>
Applied to what will be the togreg branch of iio.git and marked for stable.

If it needs to move quicker as we have reports of problems from users
let me know.

Jonathan

> ---
>  drivers/iio/pressure/bmp280-core.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/pressure/bmp280-core.c b/drivers/iio/pressure/bmp280-core.c
> index cc8553177977..3deaa57bb3f5 100644
> --- a/drivers/iio/pressure/bmp280-core.c
> +++ b/drivers/iio/pressure/bmp280-core.c
> @@ -1581,10 +1581,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);
Vasileios Amoiridis July 21, 2024, 7:53 p.m. UTC | #2
On Sat, Jul 20, 2024 at 12:06:36PM +0100, Jonathan Cameron wrote:
> On Thu, 11 Jul 2024 23:15:50 +0200
> Vasileios Amoiridis <vassilisamir@gmail.com> wrote:
> 
> > 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>
> Applied to what will be the togreg branch of iio.git and marked for stable.
> 
> If it needs to move quicker as we have reports of problems from users
> let me know.
> 
> Jonathan
> 

Hi Jonathan,

Probably no one had this configuration up to now so I don't think there is a need
to rush it :)

Cheers,
Vasilis
diff mbox series

Patch

diff --git a/drivers/iio/pressure/bmp280-core.c b/drivers/iio/pressure/bmp280-core.c
index cc8553177977..3deaa57bb3f5 100644
--- a/drivers/iio/pressure/bmp280-core.c
+++ b/drivers/iio/pressure/bmp280-core.c
@@ -1581,10 +1581,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);