From c45bc68e5c8f633fd637659fd0c330bdf1f170db Mon Sep 17 00:00:00 2001 From: Trent Piepho Date: Wed, 21 Dec 2022 05:20:30 -0800 Subject: [PATCH] drivers/sensor: lsm6dso: Remove busy wait on bank change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's not necessary to busy wait 150 µs after changing register banks. Nothing in the data sheet nor app note suggests this. ST's own HAL, which is used by this driver, does not delay when changing banks. It does a bank change around every function that accesses a non-user bank register (it's quite inefficient). So if it was necessary it would be broken now, as most of the bank changes have no delay. One of the few page changes that did have this delay are the those done before and after reading a sensor sample. Which is where the speed is significant and is limiting the update rate the driver is capable of. Signed-off-by: Trent Piepho --- drivers/sensor/lsm6dso/lsm6dso_shub.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/sensor/lsm6dso/lsm6dso_shub.c b/drivers/sensor/lsm6dso/lsm6dso_shub.c index 4226f694f38..91138e51d5c 100644 --- a/drivers/sensor/lsm6dso/lsm6dso_shub.c +++ b/drivers/sensor/lsm6dso/lsm6dso_shub.c @@ -446,8 +446,6 @@ static inline void lsm6dso_shub_embedded_en(stmdev_ctx_t *ctx, bool on) }; lsm6dso_write_reg(ctx, LSM6DSO_FUNC_CFG_ACCESS, (uint8_t *)®, 1); - - k_busy_wait(150); } static int lsm6dso_shub_read_embedded_regs(stmdev_ctx_t *ctx,