Message ID | 20210616132512.634123-1-detegr@rbx.email (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | iio: adis: set GPIO reset pin direction | expand |
diff --git a/drivers/iio/imu/adis.c b/drivers/iio/imu/adis.c index 319b64b2fd88..7f13b3763732 100644 --- a/drivers/iio/imu/adis.c +++ b/drivers/iio/imu/adis.c @@ -415,7 +415,7 @@ int __adis_initial_startup(struct adis *adis) int ret; /* check if the device has rst pin low */ - gpio = devm_gpiod_get_optional(&adis->spi->dev, "reset", GPIOD_ASIS); + gpio = devm_gpiod_get_optional(&adis->spi->dev, "reset", GPIOD_OUT_LOW); if (IS_ERR(gpio)) return PTR_ERR(gpio);
Use GPIOD_OUT_LOW instead of GPIOD_ASIS as the reset pin needs to be an active low output pin. Suggested-by: Hannu Hartikainen <hannu@hrtk.in> Signed-off-by: Antti Keränen <detegr@rbx.email> --- The documentation of GPIO consumer interface states: Be aware that there is no default direction for GPIOs. Therefore, **using a GPIO without setting its direction first is illegal and will result in undefined behavior!** Therefore the direction of the reset GPIO pin should be set as output. drivers/iio/imu/adis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)