summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2020-10-16 16:03:58 -0700
committerCommit Bot <commit-bot@chromium.org>2020-10-29 17:14:11 +0000
commit97a515a2cdc555a27d348537a2f443ecbdb53f0b (patch)
treec9dba0503e438de156b29e5685fbf93db7a613ec
parent546a4c0d6bcbeb526d2b83a1c9627a00a59cae11 (diff)
downloadchrome-ec-97a515a2cdc555a27d348537a2f443ecbdb53f0b.tar.gz
driver: bmi: remove unnecessary msleep()
1ms sleep after every write is not necessary. The only place it is is at init time and it is taken care of. Remove unused function. Remove sleep when ODR changes, it causes EC to stall. BUG=b:170155773 BRANCH=hatch, zork TEST=On volteer check hardware.SensorRing passes continuously. Conflicts: driver/accelgyro_bmi260.c: not present. Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2483357 Reviewed-by: Ching-Kang Yen <chingkang@chromium.org> Change-Id: I5fd06c9cd6a79ee6cc7f92c448e18fb71a906184 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2492533 Reviewed-by: Yuval Peress <peress@chromium.org>
-rw-r--r--driver/accelgyro_bmi_common.c42
1 files changed, 0 insertions, 42 deletions
diff --git a/driver/accelgyro_bmi_common.c b/driver/accelgyro_bmi_common.c
index 87ad203170..b1be325b4c 100644
--- a/driver/accelgyro_bmi_common.c
+++ b/driver/accelgyro_bmi_common.c
@@ -167,13 +167,6 @@ int bmi_write8(const int port, const uint16_t i2c_spi_addr_flags,
reg, data);
#endif
}
- /*
- * From Bosch: BMI needs a delay of 450us after each write if it
- * is in suspend mode, otherwise the operation may be ignored by
- * the sensor. Given we are only doing write during init, add
- * the delay unconditionally.
- */
- msleep(1);
return rv;
}
@@ -200,34 +193,6 @@ int bmi_read16(const int port, const uint16_t i2c_spi_addr_flags,
}
/**
- * Write 16bit register from accelerometer.
- */
-int bmi_write16(const int port, const uint16_t i2c_spi_addr_flags,
- const int reg, int data)
-{
- int rv = -EC_ERROR_PARAM1;
-
- if (SLAVE_IS_SPI(i2c_spi_addr_flags)) {
-#ifdef CONFIG_SPI_ACCEL_PORT
- CPRINTS("%s() spi part is not implemented", __func__);
-#endif
- } else {
-#ifdef I2C_PORT_ACCEL
- rv = i2c_write16(port, i2c_spi_addr_flags,
- reg, data);
-#endif
- }
- /*
- * From Bosch: BMI needs a delay of 450us after each write if it
- * is in suspend mode, otherwise the operation may be ignored by
- * the sensor. Given we are only doing write during init, add
- * the delay unconditionally.
- */
- msleep(1);
- return rv;
-}
-
-/**
* Read 32bit register from accelerometer.
*/
int bmi_read32(const int port, const uint16_t i2c_spi_addr_flags,
@@ -289,13 +254,6 @@ int bmi_write_n(const int port, const uint16_t i2c_spi_addr_flags,
reg, data_ptr, len);
#endif
}
- /*
- * From Bosch: BMI needs a delay of 450us after each write if it
- * is in suspend mode, otherwise the operation may be ignored by
- * the sensor. Given we are only doing write during init, add
- * the delay unconditionally.
- */
- msleep(1);
return rv;
}
/*