All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benoit Parrot <bparrot@ti.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: "linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: Re: [RFC Patch] gpio: add GPIO hogging mechanism
Date: Mon, 3 Nov 2014 18:38:27 -0600	[thread overview]
Message-ID: <20141104003827.GA24005@ti.com> (raw)
In-Reply-To: <CACRpkdak3EACNpgEznN85d7gPHsMOBW+Ondwx23XhLaVEdjo8Q@mail.gmail.com>

Linus,

Thanks for the feedback.

To summarize the hog feature should be local to gpiolib-of.c, correct?

I also also need some clarifications, see below.


Linus Walleij <linus.walleij@linaro.org> wrote on Mon [2014-Nov-03 10:59:53 +0100]:
> On Tue, Oct 21, 2014 at 10:09 PM, Benoit Parrot <bparrot@ti.com> wrote:
> 
> >         qe_pio_a: gpio-controller@1400 {
> > @@ -110,6 +130,19 @@ Example of two SOC GPIO banks defined as gpio-controller nodes:
> >                 reg = <0x1400 0x18>;
> >                 gpio-controller;
> >                 #gpio-cells = <2>;
> > +               gpio-hogs = <&line_b>;
> > +
> > +               /* line_a hog is defined but not enabled in this example*/
> > +               line_a: line_a {
> > +                       gpios = <5 0>;
> > +                       input;
> > +               };
> > +
> > +               line_b: line_b {
> > +                       gpios = <6 0>;
> > +                       output-low;
> > +                       line-name = "foo-bar-gpio";
> > +               };
> 
> 
> I don't see the point of having unused hogs and enabling them using
> phandles.
> 
> Just let the core walk over all children nodes of a GPIO controller
> and hog them. Put in a bool property saying it's a hog.
> 
> +               line_b: line_b {
> +                       gpio-hog;
> +                       gpios = <6 0>;
> +                       output-low;
> +                       line-name = "foo-bar-gpio";
> +               };
> 
> I don't quite see the point with input hogs that noone can use
> but whatever.
> 
> I am thinking that maybe the line name should be compulsory
> so as to improbe readability. I mean there is always a reason
> why you're hogging a pin and the name should say it.

Ok, so as an alternative I had presented something like this in my reply
to Alexandre Courbot's review comments:

  I did consider a "pinmux" flavored format (not sure how hard to parse it would be).
  It would allow grouping if nothing else.

  	/* Line syntax: line_name <gpio# flags> direction-value [export] */
	gpio-hogs = <&group_y>;

	group_y: group_y {
		gpio-hogs-group = <
			line_x <15 0> output-low
			line_y <16 0> output-high export
			line_z <17 0> input
		>;
	};

Now based on your comment would something like this work?

     qe_pio_a: gpio-controller@1400 {
	reg = <0x1400 0x18>;
	gpio-controller;
	#gpio-cells = <2>;

  	/* Line syntax: line_name <gpio# flags> direction-value [export] */
	gpio-hogs: {
		gpio-hogs-group = <
			foo-bar-gpio <15 0> output-low
			bar-foo-gpio <16 0> output-high export
		>;
	};
     };

This would group all hogs for one controller under a single child node.
Again I am not sure how feasible or easy to implement the DT parsing would be. 

I guess for completeness if you could also comment on my reply to Alexandre from Oct 29th,
that would be great, before I head in the wrong directions. 

Regards,
Benoit

  reply	other threads:[~2014-11-04  0:38 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-21 20:09 [RFC Patch] gpio: add GPIO hogging mechanism Benoit Parrot
2014-10-21 20:09 ` Benoit Parrot
2014-10-29  7:09 ` Alexandre Courbot
2014-10-29  7:09   ` Alexandre Courbot
2014-10-29 16:21   ` Benoit Parrot
2014-10-29 16:21     ` Benoit Parrot
2014-10-30  0:29     ` Alexandre Courbot
2014-11-14  9:19   ` Linus Walleij
2014-11-14 10:22     ` Maxime Ripard
2014-10-29  8:53 ` Pantelis Antoniou
2014-10-29  8:53   ` Pantelis Antoniou
2014-10-29 16:34   ` Benoit Parrot
2014-10-29 16:34     ` Benoit Parrot
2014-10-29 16:42     ` Pantelis Antoniou
2014-10-29 19:36       ` Benoit Parrot
2014-10-29 19:36         ` Benoit Parrot
2014-10-30  0:31       ` Alexandre Courbot
2014-10-30  0:31         ` Alexandre Courbot
2014-11-03  9:43   ` Linus Walleij
2014-11-03  9:43     ` Linus Walleij
2014-10-29 10:45 ` Maxime Ripard
2014-10-29 16:41   ` Benoit Parrot
2014-10-29 16:41     ` Benoit Parrot
2014-10-29 16:47     ` Maxime Ripard
2014-10-29 23:09       ` Benoit Parrot
2014-10-29 23:09         ` Benoit Parrot
2014-10-30 17:16         ` Maxime Ripard
2014-11-03  9:59 ` Linus Walleij
2014-11-04  0:38   ` Benoit Parrot [this message]
     [not found]     ` <20141104003827.GA24005-l0cyMroinI0@public.gmane.org>
2014-11-14  9:16       ` Linus Walleij
2014-11-14  9:16         ` Linus Walleij
  -- strict thread matches above, loose matches on Subject: below --
2014-10-06 11:58 [GIT PULL] bulk pin control changes for v3.18 Linus Walleij
2014-10-06 15:37 ` [RFC PATCH] gpio: add GPIO hogging mechanism Benoit Parrot
2014-10-06 15:37   ` Benoit Parrot
2014-10-21 10:55   ` Linus Walleij
2013-12-19 14:34 Boris BREZILLON
     [not found] ` <1387463671-1164-1-git-send-email-b.brezillon-ZNYIgs0QAGpBDgjK7y7TUQ@public.gmane.org>
2013-12-19 14:34   ` Boris BREZILLON
2013-12-19 14:34     ` Boris BREZILLON
2013-12-19 16:41     ` Greg Kroah-Hartman
2013-12-19 16:47       ` Felipe Balbi
2013-12-19 16:47         ` Felipe Balbi
2013-12-19 17:18         ` boris brezillon
2013-12-19 18:22           ` Felipe Balbi
2013-12-19 18:22             ` Felipe Balbi
2013-12-30  9:48             ` boris brezillon
2014-01-08  9:45               ` Linus Walleij
     [not found]       ` <20131219164109.GB27409-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2013-12-19 17:13         ` boris brezillon
2013-12-19 17:13           ` boris brezillon
2014-09-20 21:37       ` Ben Gamari
2014-09-20 22:26         ` Ben Gamari
2014-01-08  9:37     ` Linus Walleij
2014-01-08 10:18       ` boris brezillon
2014-01-14 10:27         ` Linus Walleij
2014-10-02 15:47           ` Benoit Parrot

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=20141104003827.GA24005@ti.com \
    --to=bparrot@ti.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.