Thread (22 messages) 22 messages, 5 authors, 2014-09-22

Re: [PATCH 1/3 v2] GPIO: gpio-dwapb: Enable platform driver binding to MFD driver

From: Shevchenko, Andriy <hidden>
Date: 2014-09-09 09:03:27
Also in: linux-gpio, lkml

On Tue, 2014-09-09 at 01:50 +0000, Chen, Alvin wrote:
quoted
On Friday 05 September 2014 12:02:01 Shevchenko, Andriy wrote:
quoted
quoted
irq = irq_of_parse_and_map(node, 0); If (!irq) {
pp->irq = -1;
return;
} else {
pp->irq = irq;
}
Then the code looks strange.

How do you think?
If I understood correctly you messed up with hwirq vs. virq.
Otherwise you have mention that you are using virq everywhere (I guess
you may rename the field in the structure), but in this case the field
in the platform_data looks a bit strange.
The field in platform_data should be the mapped virtual irq number, it makes no
sense to use the hwirq unless you also add a pointer to the domain in which
that hwirq exists.

Also the output of irq_of_parse_and_map() is a mapped irq, as the name
suggests.
I agree with Arnd. Here, the 'irq' is 'virq'.
Andriy, you may be confused by the code like 'irq_create_mapping'. For Quark case, it has 8 GPIO pins, and each pin can trigger
interrupt, but all these interrupts are triggered by PCI irq which is shared. The 'irq' in pdata is PCI irq. As all GPIO interrupts connect to the PCI
irq, once the GPIO interrupt is triggered, and the PCI irq handler will be called 'dwapb_irq_handler_mfd'. And in 'dwapb_do_irq', it will read the
interrupt register to see the interrupt is triggered by which GPIO pin, and 'irq_create_mapping' is for this case.
Thanks for clarification. I take back my initial comment then.

-- 
Andy Shevchenko [off-list ref]
Intel Finland Oy
---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki 
Business Identity Code: 0357606 - 4 
Domiciled in Helsinki 

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help