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


Groups > linux.kernel > #1431921 > unrolled thread

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

Started byVenkat Reddy Talla <vreddytalla@nvidia.com>
First post2016-06-27 13:00 +0200
Last post2016-07-04 11:50 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [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

#1431921 — [PATCH 1/1] gpio: max77620: get gpio value based on direction

FromVenkat Reddy Talla <vreddytalla@nvidia.com>
Date2016-06-27 13:00 +0200
Subject[PATCH 1/1] gpio: max77620: get gpio value based on direction
Message-ID<rOCqJ-7A9-21@gated-at.bofh.it>
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);
 }
 
 static int max77620_gpio_dir_output(struct gpio_chip *gc, unsigned int offset,
-- 
2.1.4

[toc] | [next] | [standalone]


#1433451

FromAlexandre Courbot <gnurou@gmail.com>
Date2016-06-29 07:20 +0200
Message-ID<rPg4O-8s8-11@gated-at.bofh.it>
In reply to#1431921
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>

[toc] | [prev] | [next] | [standalone]


#1436159

FromLinus Walleij <linus.walleij@linaro.org>
Date2016-07-04 11:50 +0200
Message-ID<rR8FQ-3Xv-29@gated-at.bofh.it>
In reply to#1431921
On Mon, Jun 27, 2016 at 12: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>

Patch applied with Alex' ACK.

Yours,
Linus Walleij

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web