mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/3] iio: adc: ti-ads7924: Allow sleepable GPIO for reset
@ 2026-12-03 13:39 Rickard Andersson
  2026-12-03 13:39 ` [PATCH 2/3] iio: adc: ti-ads7924: Wait after hardware reset Rickard Andersson
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Rickard Andersson @ 2026-12-03 13:39 UTC (permalink / raw)
  To: hvilleneuve, jic23, dlechner, nuno.sa, andy, linux-iio, linux-kernel
  Cc: rickard.andersson, kernel

From: Rickard x Andersson <rickard.andersson@axis.com>

The reset GPIO may be provided by a controller that can sleep, such
as an I2C GPIO expander. On some systems this triggers a
WARN_ON(can_sleep) stacktrace in gpiolib.

Use gpiod_set_value_cansleep instead. ads7924_reset is only called
from probe function, so sleeping is allowed.

Fixes: 4d82b2f98a25 ("iio: adc: ti-ads7924: add Texas Instruments ADS7924 driver")
Signed-off-by: Rickard x Andersson <rickard.andersson@axis.com>
---
 drivers/iio/adc/ti-ads7924.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/adc/ti-ads7924.c b/drivers/iio/adc/ti-ads7924.c
index ff30a52d2850..b357f131018c 100644
--- a/drivers/iio/adc/ti-ads7924.c
+++ b/drivers/iio/adc/ti-ads7924.c
@@ -323,10 +323,10 @@ static int ads7924_reset(struct iio_dev *indio_dev)
 	struct ads7924_data *data = iio_priv(indio_dev);
 
 	if (data->reset_gpio) {
-		gpiod_set_value(data->reset_gpio, 1); /* Assert. */
+		gpiod_set_value_cansleep(data->reset_gpio, 1); /* Assert. */
 		/* Educated guess: assert time not specified in datasheet... */
 		mdelay(100);
-		gpiod_set_value(data->reset_gpio, 0); /* Deassert. */
+		gpiod_set_value_cansleep(data->reset_gpio, 0); /* Deassert. */
 		return 0;
 	}
 
-- 
2.43.0


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

end of thread, other threads:[~2026-12-03 14:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-12-03 13:39 [PATCH 1/3] iio: adc: ti-ads7924: Allow sleepable GPIO for reset Rickard Andersson
2026-12-03 13:39 ` [PATCH 2/3] iio: adc: ti-ads7924: Wait after hardware reset Rickard Andersson
2026-12-03 14:40   ` Joshua Crofts
2026-12-03 13:39 ` [PATCH 3/3] iio: adc: ti-ads7924: Use fsleep for reset pulse Rickard Andersson
2026-12-03 14:22   ` Andy Shevchenko
2026-12-03 14:20 ` [PATCH 1/3] iio: adc: ti-ads7924: Allow sleepable GPIO for reset Andy Shevchenko

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

all inboxes | Powered by JetHome®