From 37144c1ffa6d72acaea2acf167d27b1beb98e4f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Cab=C3=A9?= Date: Sat, 14 Jun 2025 21:32:54 +0200 Subject: [PATCH] drivers: sensor: icm42605: fix turn_off_sensor logic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While it would likely not directly cause issues with the current implementation, the logic of turning off the sensor should be to actually reset the flags, not to toggle them. Signed-off-by: Benjamin Cabé --- drivers/sensor/tdk/icm42605/icm42605_setup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/sensor/tdk/icm42605/icm42605_setup.c b/drivers/sensor/tdk/icm42605/icm42605_setup.c index 3ea2c5e6bcb..c502be4f8cb 100644 --- a/drivers/sensor/tdk/icm42605/icm42605_setup.c +++ b/drivers/sensor/tdk/icm42605/icm42605_setup.c @@ -431,8 +431,8 @@ int icm42605_turn_off_sensor(const struct device *dev) result = inv_spi_read(&cfg->spi, REG_PWR_MGMT0, &v, 1); - v ^= BIT_ACCEL_MODE_LNM; - v ^= BIT_GYRO_MODE_LNM; + v &= ~BIT_ACCEL_MODE_LNM; + v &= ~BIT_GYRO_MODE_LNM; result = inv_spi_single_write(&cfg->spi, REG_PWR_MGMT0, &v); if (result) {