All of lore.kernel.org
 help / color / mirror / Atom feed
From: robherring2@gmail.com (Rob Herring)
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 10:04:03 -0600	[thread overview]
Message-ID: <4EF0B1F3.8080804@gmail.com> (raw)
In-Reply-To: <20111220155445.GA19585@totoro>

On 12/20/2011 09:54 AM, Jamie Iles wrote:
> 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.
> 

Ah. I should have looked more closely at the register layout... From a
DT binding standpoint:

Acked-by: Rob Herring <rob.herring@calxeda.com>

Rob

WARNING: multiple messages have this Message-ID (diff)
From: Rob Herring <robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Jamie Iles <jamie-wmLquQDDieKakBO8gow8eQ@public.gmane.org>
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	Linus Walleij
	<linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCHv2 1/2] gpio: add a driver for the Synopsys DesignWare APB GPIO block
Date: Tue, 20 Dec 2011 10:04:03 -0600	[thread overview]
Message-ID: <4EF0B1F3.8080804@gmail.com> (raw)
In-Reply-To: <20111220155445.GA19585@totoro>

On 12/20/2011 09:54 AM, Jamie Iles wrote:
> 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-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
>>> Cc: Linus Walleij <linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>
>>> Cc: Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>
>>> Signed-off-by: Jamie Iles <jamie-wmLquQDDieKakBO8gow8eQ@public.gmane.org>
>>> ---
> [...]
>>> +++ 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@20000 {
>>> +	compatible = "snps,dw-apb-gpio";
>>> +	reg = <0x20000 0x1000>;
>>> +	#address-cells = <1>;
>>> +	#size-cells = <0>;
>>> +
>>> +	banka: gpio-controller@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.
> 

Ah. I should have looked more closely at the register layout... From a
DT binding standpoint:

Acked-by: Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>

Rob

  reply	other threads:[~2011-12-20 16:04 UTC|newest]

Thread overview: 22+ 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 ` Jamie Iles
2011-12-20  1:43 ` [PATCHv2 2/2] ARM: picoxcell: use new Synopsys Designware GPIO binding Jamie Iles
2011-12-20  1:43   ` 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:44   ` Rob Herring
2011-12-20 15:54   ` Jamie Iles
2011-12-20 15:54     ` Jamie Iles
2011-12-20 16:04     ` Rob Herring [this message]
2011-12-20 16:04       ` Rob Herring
2011-12-30 19:59 ` Jamie Iles
2011-12-30 19:59   ` Jamie Iles
2011-12-30 20:25   ` Rob Herring
2011-12-30 20:25     ` Rob Herring
2011-12-31  1:03     ` Jamie Iles
2011-12-31  1:03       ` Jamie Iles
2012-01-02 12:14     ` Mark Brown
2012-01-02 12:14       ` Mark Brown
2012-01-02 12:24       ` Jamie Iles
2012-01-02 12:24         ` Jamie Iles
2012-01-02 12:27         ` Mark Brown
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=4EF0B1F3.8080804@gmail.com \
    --to=robherring2@gmail.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 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.