linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: jamie@jamieiles.com (Jamie Iles)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/4 v4] drivers: create a pin control subsystem
Date: Mon, 22 Aug 2011 13:54:08 +0100	[thread overview]
Message-ID: <20110822125408.GC2796@pulham.picochip.com> (raw)
In-Reply-To: <CACRpkdbB0A6y2vFRV58vvU2DY+zMV+DjS16d71+bajBegTuRdQ@mail.gmail.com>

On Mon, Aug 22, 2011 at 02:38:16PM +0200, Linus Walleij wrote:
> On Sun, Aug 21, 2011 at 4:24 PM, Jamie Iles <jamie@jamieiles.com> wrote:
> 
> > for device tree, when the gpio
> > controllers are registered, the base is typically dynamically assigned. ?I
> > suspect that this can be solved in the device tree binding for the controller
> > that references the bindings of the pinctrl, but this would require
> > registering the gpio_ranges at runtime (or at least the bases).
> 
> Oh registering ranges at runtime ... crap. But possible I think.
> 
> > So perhaps if we had:
> >
> > struct pinctrl_gpio_range {
> > ? ?unsigned int pinctrl_base;
> > ? ?struct gpio_chip *chip;
> > }
> >
> > and then gpio_request_enable was:
> >
> > int (*gpio_request_enable)(struct pinctrl_dev *pctldev,
> > ? ? ? ? ? ? ? ? ? ? ? ? ? struct gpio_chip *gc,
> > ? ? ? ? ? ? ? ? ? ? ? ? ? unsigned offset)
> >
> > Then have pinctrl_register_gpio_chip()?
> 
> I'm not following - the struct gpio_chip is opaque outside the gpio
> subsystem, I've proposed patches to make it public but they have
> been NAK:ed.
> 
> Which means pinctrl has no use of that pointer.
> 
> What is the intended purpose of sending that thing in?

Well even though the gpio_chip is opaque to pinctrl, the pointer can 
still be used for searching, which means that gpio_request() doesn't 
need to know the integer instance number (which would presumably be 
passed with platform_data for non-DT?).

> Right now my range struct looks like this:
> 
> /**
>  * struct pinctrl_gpio_range - each pin controller can provide subranges of
>  * the GPIO number space to be handled by the controller
>  * @name: a name for the chip in this range
>  * @id: an ID number for the chip in this range
>  * @base: base offset of the GPIO range
>  * @npins: number of pins in the GPIO range, including the base number
>  */
> struct pinctrl_gpio_range {
>         const char name[16];
>         unsigned int id;
>         unsigned int base;
>         unsigned int npins;
> };
> 
> > For the static devices case then we can require gc->base must match the
> > pinctrl gpio base.?For the device tree case we could do some matching of
> > device_nodes from the gpio_chip to the pinctrl definitions?
> 
> Can't do that since we can't look into struct gpio_chip intrinsics...
> 
> But we can register ranges at runtime, I'll just make the pin controller keep
> a list of GPIO ranges, simple.

OK, I do think it would be nice to use a gpio_chip based request, but I 
don't want to create too many obstacles for getting this code merged!

Jamie

  reply	other threads:[~2011-08-22 12:54 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-19  9:53 [PATCH 1/4 v4] drivers: create a pin control subsystem Linus Walleij
2011-08-19 10:48 ` Jamie Iles
2011-08-19 14:04   ` Linus Walleij
2011-08-19 14:26     ` Jamie Iles
2011-08-21 14:24       ` Jamie Iles
2011-08-22 12:38         ` Linus Walleij
2011-08-22 12:54           ` Jamie Iles [this message]
2011-08-19 14:36     ` Arnd Bergmann
2011-08-19 16:52       ` Greg KH
2011-08-22 12:29         ` Linus Walleij
2011-08-21 14:53 ` Barry Song
2011-08-24  6:24 ` Barry Song
2011-08-24  7:41   ` Linus Walleij
2011-08-24 18:29 ` Stephen Warren
2011-08-25 10:12   ` Linus Walleij
2011-08-25 11:04     ` Sascha Hauer
2011-08-25 11:58       ` Linus Walleij
2011-08-25 12:07         ` Sascha Hauer
2011-08-25 15:12     ` David Brown
2011-08-25 18:14       ` Gregory Bean
2011-08-25 19:13     ` Stephen Warren
2011-08-26  8:35       ` Linus Walleij
2011-08-26 17:33         ` Stephen Warren
2011-08-29  8:40           ` Linus Walleij
2011-08-26  3:12 ` Barry Song
2011-08-26  8:36   ` Linus Walleij
2011-09-02  7:02 ` Stijn Devriendt
2011-09-02  7:57   ` Linus Walleij

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=20110822125408.GC2796@pulham.picochip.com \
    --to=jamie@jamieiles.com \
    --cc=linux-arm-kernel@lists.infradead.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).