linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ludovic Desroches <ludovic.desroches@microchip.com>
To: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
Subject: [RFC PATCH 3/7] gpio: gpiolib: save GPIO flags in of_get_named_gpiod_flags
Date: Thu, 14 Dec 2017 15:21:34 +0100	[thread overview]
Message-ID: <20171214142138.23008-4-ludovic.desroches@microchip.com> (raw)
In-Reply-To: <20171214142138.23008-1-ludovic.desroches@microchip.com>

When we get a GPIO descriptor from the device device, the flags
are updated for the caller to know if the GPIO is active low or
high. After calling of_get_named_gpio_flags the next step is
usually calling gpiod_request which doesn't take flags as a
parameter.
Updating the flags of the GPIO descriptor will allow to configure
the GPIO when it will be requested.

Signed-off-by: Ludovic Desroches <ludovic.desroches@microchip.com>
---
 drivers/gpio/gpiolib-of.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index 4a2b8d3397c7..67b1a7ff1e97 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -97,6 +97,8 @@ struct gpio_desc *of_get_named_gpiod_flags(struct device_node *np,
 		 __func__, propname, np, index,
 		 PTR_ERR_OR_ZERO(desc));
 
+	gpiod_configure_flags(desc, propname, *flags, 0);
+
 out:
 	of_node_put(gpiospec.np);
 
-- 
2.12.2


  parent reply	other threads:[~2017-12-14 14:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-14 14:21 [RFC PATCH 0/7] gpiolib: add bias support Ludovic Desroches
2017-12-14 14:21 ` [RFC PATCH 1/7] gpio: of: use the BIT macro for of_gpio_flags Ludovic Desroches
2017-12-14 14:21 ` [RFC PATCH 2/7] gpio: gpiolib: split the gpiod_configure_flags function Ludovic Desroches
2017-12-15  9:26   ` Julien Thierry
2017-12-18  7:02     ` Ludovic Desroches
2017-12-14 14:21 ` Ludovic Desroches [this message]
2017-12-14 14:21 ` [RFC PATCH 4/7] gpio: gpiolib: add bias support Ludovic Desroches
2017-12-14 14:21 ` [RFC PATCH 5/7] pinctrl: at91-pio4: allow the gpiolib to set pin configuration Ludovic Desroches
2017-12-14 14:21 ` [RFC PATCH 6/7] pinctrl: at91-pio4: use strict mode if explicitly requested Ludovic Desroches
2017-12-14 14:21 ` [RFC PATCH 7/7] ARM: dts: at91-sama5d2_xplained: remove gpios from pinmux Ludovic Desroches
2017-12-14 16:06 ` [RFC PATCH 0/7] gpiolib: add bias support Andrew Lunn
2017-12-15  6:54   ` Ludovic Desroches
2017-12-19  9:40 ` [RFC PATCH v2] draft for gpio pinconf Ludovic Desroches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171214142138.23008-4-ludovic.desroches@microchip.com \
    --to=ludovic.desroches@microchip.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).