Skip to content

Commit 901a293

Browse files
Lakshmi-yjic23
authored andcommitted
iio: pressure: dps310: Adjust Timeout Settings
The DPS310 sensor chip has been encountering intermittent errors while reading the sensor device across various system designs. This issue causes the chip to become "stuck," preventing the indication of "ready" status for pressure and temperature measurements in the MEAS_CFG register. To address this issue, this commit fixes the timeout settings to improve sensor stability: - After sending a reset command to the chip, the timeout has been extended from 2.5 ms to 15 ms, aligning with the DPS310 specification. - The read timeout value of the MEAS_CFG register has been adjusted from 20ms to 30ms to match the specification. Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com> Fixes: 7b4ab4a ("iio: pressure: dps310: Reset chip after timeout") Link: https://lore.kernel.org/r/20230829180222.3431926-2-lakshmiy@us.ibm.com Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent c9b9cfe commit 901a293

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/iio/pressure/dps310.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@
5757
#define DPS310_RESET_MAGIC 0x09
5858
#define DPS310_COEF_BASE 0x10
5959

60-
/* Make sure sleep time is <= 20ms for usleep_range */
61-
#define DPS310_POLL_SLEEP_US(t) min(20000, (t) / 8)
60+
/* Make sure sleep time is <= 30ms for usleep_range */
61+
#define DPS310_POLL_SLEEP_US(t) min(30000, (t) / 8)
6262
/* Silently handle error in rate value here */
6363
#define DPS310_POLL_TIMEOUT_US(rc) ((rc) <= 0 ? 1000000 : 1000000 / (rc))
6464

@@ -402,8 +402,8 @@ static int dps310_reset_wait(struct dps310_data *data)
402402
if (rc)
403403
return rc;
404404

405-
/* Wait for device chip access: 2.5ms in specification */
406-
usleep_range(2500, 12000);
405+
/* Wait for device chip access: 15ms in specification */
406+
usleep_range(15000, 55000);
407407
return 0;
408408
}
409409

0 commit comments

Comments
 (0)