devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: Kyle Moffett <Kyle.D.Moffett@boeing.com>
Cc: linux-kernel@vger.kernel.org,
	Linus Walleij <linus.walleij@linaro.org>,
	devicetree-discuss@lists.ozlabs.org,
	Rob Herring <rob.herring@calxeda.com>
Subject: Re: [REPOST RFC PATCH 2/3] of_gpio: Add new helpers for easily requesting lots of GPIOs
Date: Wed, 4 Jan 2012 11:49:43 -0700	[thread overview]
Message-ID: <20120104184943.GW15503@ponder.secretlab.ca> (raw)
In-Reply-To: <1323800614-12642-3-git-send-email-Kyle.D.Moffett@boeing.com>

On Tue, Dec 13, 2011 at 01:23:33PM -0500, Kyle Moffett wrote:
> Mirroring the new gpio_request_array() interface, we add several a few
> helper functions for operating on entire arrays of GPIOs.
> 
> Also, to make it easier to write various combinations of "of_get_gpio()"
> followed by "gpio_request()", add several other new inline wrappers.
> 
> Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
> ---
>  drivers/of/gpio.c       |   96 +++++++++++++++++++++++++++++
>  include/linux/of_gpio.h |  154 +++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 250 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/of/gpio.c b/drivers/of/gpio.c
> index f349aaf..4c04f2f 100644
> --- a/drivers/of/gpio.c
> +++ b/drivers/of/gpio.c
> @@ -83,6 +83,47 @@ err0:
>  EXPORT_SYMBOL(of_get_named_gpio_flags);
>  
>  /**
> + * of_get_gpio_array_flags() - Get array of gpios to use with GPIO API
> + * @np:		device node to get GPIOs from
> + * @of_gpios:	array of "struct of_gpio" to select which GPIOs to look up
> + * @of_flags:	array of "enum of_gpio_flags" to be filled in (may be NULL)
> + * @gpios:	array of "struct gpio" to be filled in
> + * @num:	the number of GPIOs to look up
> + *
> + * Takes a constant array of "struct of_gpio" and looks up each item in the
> + * indicated device-node.  The results are stored into the @gpios array,
> + * along with the optional GPIO "label" and "flags" values from the "of_gpio"
> + * structure.
> + *
> + * If an array of @of_flags is provided then any flags from the translate
> + * function will be stored into the corresponding element there.
> + */

That seems overly complex to me.  How many gpios are you expecting to
request?  If it is less than a handful, then I think letting the
driver call of_get_request() multiple times would still be simpler.

g.

  reply	other threads:[~2012-01-04 18:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-13 18:23 [REPOST RFC PATCH 0/3] New "gpio-poweroff" driver to turn off platform devices with GPIOs Kyle Moffett
2011-12-13 18:23 ` [REPOST RFC PATCH 1/3] of_gpio: Extend of_gpio_count() to support other property names Kyle Moffett
2011-12-13 18:23 ` [REPOST RFC PATCH 2/3] of_gpio: Add new helpers for easily requesting lots of GPIOs Kyle Moffett
2012-01-04 18:49   ` Grant Likely [this message]
2011-12-13 18:23 ` [REPOST RFC PATCH 3/3] New "gpio-poweroff" driver to turn off platform devices with GPIOs Kyle Moffett
2011-12-13 19:10 ` [REPOST RFC PATCH 0/3] " Rob Herring
2011-12-13 20:44   ` Moffett, Kyle D
2011-12-14 12:02     ` Mark Brown
     [not found]       ` <20111214120240.GC25088-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2011-12-14 20:34         ` Moffett, Kyle D
     [not found]           ` <E30C4693-0D31-4A9A-9E9D-0FC03C5F6B8A-X8CqP27nNzzQT0dZR+AlfA@public.gmane.org>
2011-12-17  9:20             ` Mark Brown
2011-12-19 16:56               ` Moffett, Kyle D
     [not found]                 ` <D482A908-020C-43E0-ADFC-33AE213D7257-X8CqP27nNzzQT0dZR+AlfA@public.gmane.org>
2011-12-20  1:38                   ` Mark Brown
     [not found]                     ` <20111220013819.GV2860-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2011-12-20  1:53                       ` Moffett, Kyle D
     [not found]                         ` <B187B965-8671-485E-9CAB-7CF3468D2ED6-X8CqP27nNzzQT0dZR+AlfA@public.gmane.org>
2011-12-20 14:38                           ` Mark Brown
2011-12-14 11:59 ` Mark Brown

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=20120104184943.GW15503@ponder.secretlab.ca \
    --to=grant.likely@secretlab.ca \
    --cc=Kyle.D.Moffett@boeing.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rob.herring@calxeda.com \
    /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).