[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <PH0PR03MB6366DFDA5446CDC0D57AB3A199199@PH0PR03MB6366.namprd03.prod.outlook.com>
Date: Thu, 8 Jul 2021 10:05:40 +0000
From: "Sa, Nuno" <Nuno.Sa@...log.com>
To: Antti Keränen <detegr@....email>,
"linux-iio@...r.kernel.org" <linux-iio@...r.kernel.org>
CC: Hannu Hartikainen <hannu@...k.in>,
Lars-Peter Clausen <lars@...afoo.de>,
"Hennerich, Michael" <Michael.Hennerich@...log.com>,
Jonathan Cameron <jic23@...nel.org>,
open list <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v2] iio: adis: set GPIO reset pin direction
> -----Original Message-----
> From: Antti Keränen <detegr@....email>
> Sent: Thursday, July 8, 2021 11:54 AM
> To: linux-iio@...r.kernel.org
> Cc: Antti Keränen <detegr@....email>; Hannu Hartikainen
> <hannu@...k.in>; Lars-Peter Clausen <lars@...afoo.de>; Hennerich,
> Michael <Michael.Hennerich@...log.com>; Sa, Nuno
> <Nuno.Sa@...log.com>; Jonathan Cameron <jic23@...nel.org>;
> open list <linux-kernel@...r.kernel.org>
> Subject: [PATCH v2] iio: adis: set GPIO reset pin direction
>
> Set reset pin direction to output as the reset pin needs to be an active
> low output pin.
>
> Co-developed-by: Hannu Hartikainen <hannu@...k.in>
> Signed-off-by: Hannu Hartikainen <hannu@...k.in>
> Signed-off-by: Antti Keränen <detegr@....email>
> ---
> Removed unnecessary toggling of the pin as requested by Lars-Peter. I
> missed out on the conversation, but I agree this is better.
>
> drivers/iio/imu/adis.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/iio/imu/adis.c b/drivers/iio/imu/adis.c
> index 319b64b2fd88..f8b7837d8b8f 100644
> --- a/drivers/iio/imu/adis.c
> +++ b/drivers/iio/imu/adis.c
> @@ -415,12 +415,11 @@ 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_HIGH);
> if (IS_ERR(gpio))
> return PTR_ERR(gpio);
>
> if (gpio) {
> - gpiod_set_value_cansleep(gpio, 1);
> msleep(10);
> /* bring device out of reset */
> gpiod_set_value_cansleep(gpio, 0);
> --
Reviewed-by: Nuno Sá <nuno.sa@...log.com>
Thanks!
- Nuno Sá
Powered by blists - more mailing lists