summaryrefslogtreecommitdiff
path: root/driver/accelgyro_bmi_common.c
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-20 19:23:45 +0000
commit28fe21716cdacac0ecc025407b727eaf5a99b720 (patch)
tree7e85f09e0f9723e1aa0120b921eed0572a72b63a /driver/accelgyro_bmi_common.c
parent2877fc81e86c9370487153532a62464ad11ef3b4 (diff)
downloadchrome-ec-28fe21716cdacac0ecc025407b727eaf5a99b720.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. Change-Id: I5fd06c9cd6a79ee6cc7f92c448e18fb71a906184 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2483357 Reviewed-by: Ching-Kang Yen <chingkang@chromium.org>
Diffstat (limited to 'driver/accelgyro_bmi_common.c')
-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 2d8cfa2c45..30093258f9 100644
--- a/driver/accelgyro_bmi_common.c
+++ b/driver/accelgyro_bmi_common.c
@@ -198,13 +198,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;
}
@@ -231,34 +224,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,
@@ -320,13 +285,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;
}
/*