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: [PATCHv2 1/2] gpio: add a driver for the Synopsys DesignWare APB GPIO block
Date: Tue, 20 Dec 2011 15:54:45 +0000	[thread overview]
Message-ID: <20111220155445.GA19585@totoro> (raw)
In-Reply-To: <4EF0AD6A.7070309@gmail.com>

On Tue, Dec 20, 2011 at 09:44:42AM -0600, Rob Herring wrote:
> Jamie,
> 
> On 12/19/2011 07:43 PM, Jamie Iles wrote:
> > The Synopsys DesignWare block is used in some ARM devices (picoxcell)
> > and can be configured to provide multiple banks of GPIO pins.  The first
> > bank (A) can also provide IRQ capabilities.
> > 
> > v2:	- use Rob Herring's irqdomain in generic irq chip patches
> > 	- use reg property to indicate bank index
> > 	- support irqs on both edges based on LinusW's u300 driver
> > 
> > Cc: Grant Likely <grant.likely@secretlab.ca>
> > Cc: Linus Walleij <linus.walleij@stericsson.com>
> > Cc: Rob Herring <rob.herring@calxeda.com>
> > Signed-off-by: Jamie Iles <jamie@jamieiles.com>
> > ---
[...]
> > +++ b/Documentation/devicetree/bindings/gpio/snps-dwapb-gpio.txt
> > @@ -0,0 +1,63 @@
> > +* Synopsys DesignWare APB GPIO controller
> > +
> > +Required properties:
> > +- compatible : Should be "snps,dw-apb-gpio"
> > +- reg : Address and length of the register set for the device
> > +
> > +The GPIO controller has a configurable number of banks, each of which are
> > +represented as child nodes with the following properties:
> > +
> > +Required properties:
> > +- compatible : "snps,dw-apb-gpio-bank"
> > +- gpio-controller : Marks the device node as a gpio controller.
> > +- #gpio-cells : Should be two.  The first cell is the pin number and
> > +  the second cell is used to specify optional parameters (currently
> > +  unused).
> > +- reg : The integer bank index of the bank, a single cell.
> > +- nr-gpio : The number of pins in the bank, a single cell.
[...]
> > +gpio: gpio at 20000 {
> > +	compatible = "snps,dw-apb-gpio";
> > +	reg = <0x20000 0x1000>;
> > +	#address-cells = <1>;
> > +	#size-cells = <0>;
> > +
> > +	banka: gpio-controller at 0 {
> > +		compatible = "snps,dw-apb-gpio-bank";
> > +		gpio-controller;
> > +		#gpio-cells = <2>;
> > +		nr-gpio = <8>;
> > +		reg = <0>;
> 
> Actually, what I meant was to use the bank addresses here. Sorry that
> wasn't clear. Then you don't need a calculation of bank offsets.

Unfortunately the hardware doesn't have a nice register map where the 
registers for each bank are grouped together and they're all interleaved 
so it's a bit of a mess really. 

Some of the picoxcell devices have configurations like 8 pins on bank A, 
16 on bank B then 20 or so on bank D, so I do think it makes sense to 
define the banks as individual nodes and it fits in with the 
programming model.

Jamie

  reply	other threads:[~2011-12-20 15:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-20  1:43 [PATCHv2 1/2] gpio: add a driver for the Synopsys DesignWare APB GPIO block Jamie Iles
2011-12-20  1:43 ` [PATCHv2 2/2] ARM: picoxcell: use new Synopsys Designware GPIO binding Jamie Iles
2011-12-20 15:44 ` [PATCHv2 1/2] gpio: add a driver for the Synopsys DesignWare APB GPIO block Rob Herring
2011-12-20 15:54   ` Jamie Iles [this message]
2011-12-20 16:04     ` Rob Herring
2011-12-30 19:59 ` Jamie Iles
2011-12-30 20:25   ` Rob Herring
2011-12-31  1:03     ` Jamie Iles
2012-01-02 12:14     ` Mark Brown
2012-01-02 12:24       ` Jamie Iles
2012-01-02 12:27         ` 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=20111220155445.GA19585@totoro \
    --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).