[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANk1AXQSoZPpMFu3qWqHW9HurGA868RLTFei8cdxuS9wCnWTbg@mail.gmail.com>
Date: Thu, 7 Nov 2013 15:06:04 -0600
From: delicious quinoa <delicious.quinoa@...il.com>
To: Sebastian Hesselbarth <sebastian.hesselbarth@...il.com>
Cc: Jamie Iles <jamie@...ieiles.com>,
linux-kernel <linux-kernel@...r.kernel.org>,
linux-gpio@...r.kernel.org,
Linus Walleij <linus.walleij@...ricsson.com>,
"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
Grant Likely <grant.likely@...retlab.ca>,
Rob Herring <rob.herring@...xeda.com>,
Steffen Trumtrar <s.trumtrar@...gutronix.de>,
Heiko Stuebner <heiko@...ech.de>, Alan Tull <atull@...era.com>,
Dinh Nguyen <dinguyen@...era.com>,
Yves Vandervennet <rocket.yvanderv@...il.com>
Subject: Re: [PATCH 1/1] gpio: add a driver for the Synopsys DesignWare APB
GPIO block
On Wed, Nov 6, 2013 at 5:44 PM, Sebastian Hesselbarth
<sebastian.hesselbarth@...il.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
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists