Linux IIO development
 help / color / mirror / Atom feed
* [PATCH] iio: imu: bno555: Fix reset pin operation
@ 2026-12-03 10:49 Jochen Henneberg
  2026-12-03 14:26 ` Andy Shevchenko
  2026-12-03 14:45 ` Arnav Kapoor
  0 siblings, 2 replies; 6+ messages in thread
From: Jochen Henneberg @ 2026-12-03 10:49 UTC (permalink / raw)
  To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
	Maoyi Xie, Jochen Henneberg, linux-iio

The reset input is low-active and this is how the dt bindinds example
configures it. However, the driver code treats it as high-active
because the gpio functions set the logical state not the physical
state.

Signed-off-by: Jochen Henneberg <jh@henneberg-systemdesign.com>
---
 drivers/iio/imu/bno055/bno055.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/imu/bno055/bno055.c b/drivers/iio/imu/bno055/bno055.c
index c64c155db4f5..3791fe718b16 100644
--- a/drivers/iio/imu/bno055/bno055.c
+++ b/drivers/iio/imu/bno055/bno055.c
@@ -355,9 +355,9 @@ static int bno055_system_reset(struct bno055_priv *priv)
 	int ret;
 
 	if (priv->reset_gpio) {
-		gpiod_set_value_cansleep(priv->reset_gpio, 0);
-		usleep_range(5000, 10000);
 		gpiod_set_value_cansleep(priv->reset_gpio, 1);
+		usleep_range(5000, 10000);
+		gpiod_set_value_cansleep(priv->reset_gpio, 0);
 	} else if (priv->sw_reset) {
 		ret = regmap_write(priv->regmap, BNO055_SYS_TRIGGER_REG,
 				   BNO055_SYS_TRIGGER_RST_SYS);
@@ -1603,7 +1603,7 @@ int bno055_probe(struct device *dev, struct regmap *regmap,
 	priv->xfer_burst_break_thr = xfer_burst_break_thr;
 	priv->sw_reset = sw_reset;
 
-	priv->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
+	priv->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
 	if (IS_ERR(priv->reset_gpio))
 		return dev_err_probe(dev, PTR_ERR(priv->reset_gpio), "Failed to get reset GPIO\n");
 
@@ -1613,7 +1613,7 @@ int bno055_probe(struct device *dev, struct regmap *regmap,
 
 	if (priv->reset_gpio) {
 		usleep_range(5000, 10000);
-		gpiod_set_value_cansleep(priv->reset_gpio, 1);
+		gpiod_set_value_cansleep(priv->reset_gpio, 0);
 		usleep_range(650000, 750000);
 	} else if (!sw_reset) {
 		dev_warn(dev, "No usable reset method; IMU may be unreliable\n");
-- 
2.56.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-12-04 16:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03 10:49 [PATCH] iio: imu: bno555: Fix reset pin operation Jochen Henneberg
2026-12-03 14:26 ` Andy Shevchenko
2026-12-04  9:02   ` Jochen Henneberg
2026-12-04  9:25     ` Arnav Kapoor
2026-12-04 16:34     ` Andy Shevchenko
2026-12-03 14:45 ` Arnav Kapoor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox