Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1433451

Re: [PATCH 1/1] gpio: max77620: get gpio value based on direction

From Alexandre Courbot <gnurou@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/1] gpio: max77620: get gpio value based on direction
Date 2016-06-29 07:20 +0200
Message-ID <rPg4O-8s8-11@gated-at.bofh.it> (permalink)
References <rOCqJ-7A9-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Jun 27, 2016 at 7:56 PM, Venkat Reddy Talla
<vreddytalla@nvidia.com> wrote:
> Gpio direction is determined by DIRx bit of GPIO
> configuration register, return max77620 gpio value
> based on direction in or out.
>
> Signed-off-by: Venkat Reddy Talla <vreddytalla@nvidia.com>
> ---
>  drivers/gpio/gpio-max77620.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-max77620.c b/drivers/gpio/gpio-max77620.c
> index 8658c32..b46b436 100644
> --- a/drivers/gpio/gpio-max77620.c
> +++ b/drivers/gpio/gpio-max77620.c
> @@ -123,7 +123,10 @@ static int max77620_gpio_get(struct gpio_chip *gc, unsigned int offset)
>                 return ret;
>         }
>
> -       return !!(val & MAX77620_CNFG_GPIO_INPUT_VAL_MASK);
> +       if  (val & MAX77620_CNFG_GPIO_DIR_MASK)
> +               return !!(val & MAX77620_CNFG_GPIO_INPUT_VAL_MASK);
> +       else
> +               return !!(val & MAX77620_CNFG_GPIO_OUTPUT_VAL_MASK);

Looks sensible!

Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/1] gpio: max77620: get gpio value based on direction Venkat Reddy Talla <vreddytalla@nvidia.com> - 2016-06-27 13:00 +0200
  Re: [PATCH 1/1] gpio: max77620: get gpio value based on direction Alexandre Courbot <gnurou@gmail.com> - 2016-06-29 07:20 +0200
  Re: [PATCH 1/1] gpio: max77620: get gpio value based on direction Linus Walleij <linus.walleij@linaro.org> - 2016-07-04 11:50 +0200

csiph-web