[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <90a8b355-8092-38c8-2f7d-a65f0e1ce746@ti.com>
Date: Tue, 5 Nov 2019 13:27:03 +0200
From: Grygorii Strashko <grygorii.strashko@...com>
To: Matti Vaittinen <matti.vaittinen@...rohmeurope.com>,
<mazziesaccount@...il.com>
CC: Santosh Shilimkar <ssantosh@...nel.org>,
Kevin Hilman <khilman@...nel.org>,
Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
<linux-omap@...r.kernel.org>, <linux-gpio@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 28/62] gpio: gpio-omap: Use new GPIO_LINE_DIRECTION
On 05/11/2019 12:25, Matti Vaittinen wrote:
> It's hard for occasional GPIO code reader/writer to know if values 0/1
> equal to IN or OUT. Use defined GPIO_LINE_DIRECTION_IN and
> GPIO_LINE_DIRECTION_OUT to help them out.
>
> Signed-off-by: Matti Vaittinen <matti.vaittinen@...rohmeurope.com>
> ---
> drivers/gpio/gpio-omap.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
> index d0f27084a942..3bd8adaeed9e 100644
> --- a/drivers/gpio/gpio-omap.c
> +++ b/drivers/gpio/gpio-omap.c
> @@ -805,8 +805,10 @@ static int omap_gpio_get_direction(struct gpio_chip *chip, unsigned offset)
> {
> struct gpio_bank *bank = gpiochip_get_data(chip);
>
> - return !!(readl_relaxed(bank->base + bank->regs->direction) &
> - BIT(offset));
> + if (readl_relaxed(bank->base + bank->regs->direction) & BIT(offset))
> + return GPIO_LINE_DIRECTION_IN;
> +
> + return GPIO_LINE_DIRECTION_OUT;
> }
>
> static int omap_gpio_input(struct gpio_chip *chip, unsigned offset)
>
Reviewed-by: Grygorii Strashko <grygorii.strashko@...com>
--
Best regards,
grygorii
Powered by blists - more mailing lists