linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: delicious quinoa <delicious.quinoa@gmail.com>
To: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Cc: Jamie Iles <jamie@jamieiles.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-gpio@vger.kernel.org,
	Linus Walleij <linus.walleij@stericsson.com>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	Grant Likely <grant.likely@secretlab.ca>,
	Rob Herring <rob.herring@calxeda.com>,
	Steffen Trumtrar <s.trumtrar@pengutronix.de>,
	Heiko Stuebner <heiko@sntech.de>, Alan Tull <atull@altera.com>,
	Dinh Nguyen <dinguyen@altera.com>,
	Yves Vandervennet <rocket.yvanderv@gmail.com>
Subject: Re: [PATCH 1/1] gpio: add a driver for the Synopsys DesignWare APB GPIO block
Date: Thu, 7 Nov 2013 15:06:04 -0600	[thread overview]
Message-ID: <CANk1AXQSoZPpMFu3qWqHW9HurGA868RLTFei8cdxuS9wCnWTbg@mail.gmail.com> (raw)
In-Reply-To: <527AD477.9080704@gmail.com>

On Wed, Nov 6, 2013 at 5:44 PM, Sebastian Hesselbarth
<sebastian.hesselbarth@gmail.com> wrote:
>>> +struct dwapb_gpio {
>>> +       struct  device          *dev;
>>> +       void __iomem            *regs;
>>> +       struct dwapb_gpio_port  *ports;
>>> +       unsigned int            nr_ports;
>>> +       struct irq_domain       *domain;
>>> +       int                     hwirq;
>>
>>
>> I'm not sure I fully understand what hwirq is in this context - is it
>> the IRQ line from the Synopsys block to the system interrupt controller?
>> If so I don't think this covers all configurations - the Picochip
>> devices for instance have each GPIO in port A as an individual IRQ going
>> to the VIC.
>
>
> Usually, hwirq is the interrupt as seen from this very device, i.e. in
> this case it is 0 up to 32 referencing the portA gpio line that
> triggered an interrupt. In this drivers context 'hwirq' above is
> actually the virtual irq number Linux made up to identify an interrupt
> coming from this IP block.
>
> Therefore, above should really be irq instead of hwirq - but with a
> more detailed review, I think it can be removed completely.
>
>> It looks here like hwirq is used for all of the interrupt registers so
>> only one GPIO interrupt is supported?
>
>
> Looking in _probe, currently only one upstream interrupt is requested.
> Jamie is right, that you should grab all interrupts - but you can forget
> their virtual number after registering the handler. There are helper
> functions to get it back in irq handler.
>

The IP configuration I have has only one irq line going to the gic,
(that is the "hwirq" here) so I had one hwirq (the gic) for each IP
instance.  The domain maps a Linux IRQ number for each gpio line.

I will need to rework this to also support both this (one irq per IP
block) and the picochip (one irq per gpio line coming out of the IP
block).

>>> +static void __exit dwapb_gpio_exit(void)
>>> +{
>>> +       platform_driver_unregister(&dwapb_gpio_driver);
>>> +}
>>> +module_exit(dwapb_gpio_exit);
>>
>>
>> We can replace the registration and unregistration with
>> module_platform_driver() now.
>
>
> +1 (again)

OK

Alan

>
> Sebastian
>

  reply	other threads:[~2013-11-07 21:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-06 22:49 [PATCH 0/1] gpio: add a driver for the Synopsys DesignWare APB GPIO Alan Tull
2013-11-06 22:49 ` [PATCH 1/1] gpio: add a driver for the Synopsys DesignWare APB GPIO block Alan Tull
2013-11-06 23:09   ` Fabio Estevam
2013-11-06 23:18     ` delicious quinoa
     [not found]       ` <CANk1AXTys8B-jW0bATu19pOauVqe=aMc7v=SxXPm7npWb2y7eA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-11-06 23:29         ` Sebastian Hesselbarth
2013-11-06 23:34   ` Jamie Iles
2013-11-06 23:44     ` Sebastian Hesselbarth
2013-11-07 21:06       ` delicious quinoa [this message]
2013-11-07 12:33   ` Sebastian Hesselbarth
2013-11-20 21:47     ` delicious quinoa
2013-11-20 23:40       ` Rob Herring
2013-11-20 23:46         ` Sebastian Hesselbarth

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=CANk1AXQSoZPpMFu3qWqHW9HurGA868RLTFei8cdxuS9wCnWTbg@mail.gmail.com \
    --to=delicious.quinoa@gmail.com \
    --cc=atull@altera.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dinguyen@altera.com \
    --cc=grant.likely@secretlab.ca \
    --cc=heiko@sntech.de \
    --cc=jamie@jamieiles.com \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rob.herring@calxeda.com \
    --cc=rocket.yvanderv@gmail.com \
    --cc=s.trumtrar@pengutronix.de \
    --cc=sebastian.hesselbarth@gmail.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).