Hi Anish,<br><br><div class="gmail_quote">On Sat, Oct 20, 2012 at 9:38 AM, anish kumar <span dir="ltr"><<a href="mailto:anish198519851985@gmail.com" target="_blank">anish198519851985@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On Fri, 2012-10-19 at 10:34 +0530, Arun KS wrote:<br>
> Hi Anish,<br>
><br>
> On Mon, May 28, 2012 at 9:16 AM, anish singh<br>
> <<a href="mailto:anish198519851985@gmail.com">anish198519851985@gmail.com</a>> wrote:<br>
> On Mon, May 28, 2012 at 2:57 AM, richard -rw- weinberger<br>
> <<a href="mailto:richard.weinberger@gmail.com">richard.weinberger@gmail.com</a>> wrote:<br>
> > On Sun, May 27, 2012 at 2:02 AM, Mark Farnell<br>
> <<a href="mailto:mark.farnell@gmail.com">mark.farnell@gmail.com</a>> wrote:<br>
> >> In the kernel, how can I find out the interrupt vector<br>
> number of a<br>
> >> given IRQ (for example, IRQ7)?<br>
> >><br>
> >> Within the kernel module, I would like to manually set the<br>
> IRQ using<br>
> >> the assembly code:<br>
> >><br>
> >> asm("int $<irq vector>");<br>
> >><br>
> >> and let the IRQ handler installed by a different module<br>
> catch that interrupt.<br>
> >><br>
> >> Is this possible?<br>
> ><br>
> > No really because not all IRQ have an interrupt line to the<br>
> CPU.<br>
> > Linux can multiplex and emulate them. Think of GPIO drivers<br>
> with<br>
> > interrupt support.<br>
><br>
> Can you please describe this in detail?It would really help a<br>
> lot of<br>
> people like me.Does multiplex mean that all numbers starting<br>
> from<br>
> 0,1,2,3,...... TOTAL-interrupt will have interrupt lines<br>
> associated with it<br>
> eventhough all interrupt numbers are not linear?<br>
><br>
> GPIOs are grouped as banks. Let’s say 32 gpios are in a bank.<br>
> There will be only single interrupt line to interrupt controller for a<br>
> bank.<br>
><br>
><br>
> Consider that you have configured gpio1 and gpio16 as interrupts.<br>
> Even if interrupt happens on gpio 1 or gpio 16, the same interrupt<br>
> line will be triggered to<br>
><br>
> Interrupt controller.<br>
><br>
><br>
> Now the gpio driver has to figure out reading the Interrupt status<br>
><br>
> Register of GPIO to find which interrupt (gpio1 or gpio16) has really<br>
> fired.<br>
</div></div>And this is done by this way:<br>
Suppose we have a chip(mfd-multi-funcion-driver) driver which is<br>
connected to processor using a gpio - this gpio line acts as interrupt<br>
line from the processor<br></blockquote><div> </div><div>Interrupt lines are to the interrupt controllor(IC) and only two interrupts lines fom IC(irq and fiq in case of ARM) goes to processor.<br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
++++++++++++ ++++++++++<br>
+ Processor+ + Chip +---->USB interrupt handler<br>
+ +gpio--------->+ MFD +---->dock interrupt handler<br>
++++++++++++ + +---->UART interrupt handler<br>
++++++++++---->Factory cable interrupt handler<br>
<br>
So the code will be as follows:<br>
<br>
handler_function()<br>
{<br>
/* find out which interrupt is triggered */<br>
/* it can be usb,dock,uart or factory cable */<br>
ret_irq = read_mfd_register();<br>
/*<br>
* ok we found out the interrupt line, get a corresponding<br>
* software linux irq number by calling<br>
* irq_domain_add_linear<br>
* irq_create_mapping<br>
* you would have made this calls in the probe probably<br>
*/<br>
handle_nested_irq(ret_irq);<br>
}<br>
<br>
handle_nested_irq inturn will call all the irq_handlers in the system<br>
for your UART,usb and dock driver.<br>
<br>
mfd_driver()<br>
{<br>
request_irq(gpio_to_irq(gpio), handler_function);<br>
}<br>
<br></blockquote><div>Yes. This is another example of interrupt multipexing...<br>Here you have two levels of multiplexing. One for the mfd devices functions and other for gpio.<br><br>Thanks,<br>Arun <br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Hope I have not missed anything.<br>
<div class="HOEnZb"><div class="h5">><br>
> So in this case a single interrupt line is multiplex for 32 gpio<br>
> interrupts.<br>
><br>
><br>
> HTH.<br>
><br>
> Thanks,<br>
> Arun<br>
><br>
> > Anyway, why to you think you need to trigger the raw IRQ<br>
> manually?<br>
> > This sounds really odd...<br>
> ><br>
> ><br>
> > --<br>
> > Thanks,<br>
> > //richard<br>
> ><br>
> > _______________________________________________<br>
> > Kernelnewbies mailing list<br>
> > <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
> ><br>
> <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
><br>
> _______________________________________________<br>
> Kernelnewbies mailing list<br>
> <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
> <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
><br>
><br>
<br>
<br>
</div></div></blockquote></div><br>