kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* How kernel derive irq number for particular irq line
@ 2018-06-24 18:47 Abhinav Misra
  2018-06-25  0:50 ` Greg KH
  2018-06-25  9:03 ` priyaranjan
  0 siblings, 2 replies; 3+ messages in thread
From: Abhinav Misra @ 2018-06-24 18:47 UTC (permalink / raw)
  To: kernelnewbies

Hi Guys,

I want to know how the irq number is derived in linux kernel.
In kernel we are using below function for registering ISR.

int *request_threaded_irq*(unsigned int irq, irq_handler_t handler,
irq_handler_t thread_fn, unsigned long irqflags, const char *devname,
void *dev_id)

1st arg is irq number. Now suppose for an i2c device, want to
configure an interrupt then we can enable interrupt by configuring the
particular register
but from where we will get the irq number details.

Do we as a programmer need to map it ?

Please provide your views.

BR,Abhinav
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20180625/59a92caf/attachment.html>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* How kernel derive irq number for particular irq line
  2018-06-24 18:47 How kernel derive irq number for particular irq line Abhinav Misra
@ 2018-06-25  0:50 ` Greg KH
  2018-06-25  9:03 ` priyaranjan
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2018-06-25  0:50 UTC (permalink / raw)
  To: kernelnewbies

On Mon, Jun 25, 2018 at 12:17:06AM +0530, Abhinav Misra wrote:
> Hi Guys,
> 
> I want to know how the irq number is derived in linux kernel.

It all depends on your platform.  It either comes from the firmware/bios
or it is in the device tree information.  The kernel itself doesn't know
this information, it has to be told that from an external source.

Hope this helps,

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

* How kernel derive irq number for particular irq line
  2018-06-24 18:47 How kernel derive irq number for particular irq line Abhinav Misra
  2018-06-25  0:50 ` Greg KH
@ 2018-06-25  9:03 ` priyaranjan
  1 sibling, 0 replies; 3+ messages in thread
From: priyaranjan @ 2018-06-25  9:03 UTC (permalink / raw)
  To: kernelnewbies

Hi Abhinav,

On Mon, Jun 25, 2018 at 12:17 AM, Abhinav Misra
<abhitheextremeeng@gmail.com> wrote:
> Hi Guys,
>
> I want to know how the irq number is derived in linux kernel.
> In kernel we are using below function for registering ISR.
>

For platform drivers, usually this information comes from the device tree entry.
which you get originally from the System On chip HW interface documents or
from specification sheets.

> int request_threaded_irq(unsigned int irq, irq_handler_t handler,
> irq_handler_t thread_fn, unsigned long irqflags, const char *devname, void
> *dev_id)
>
> 1st arg is irq number. Now suppose for an i2c device, want to configure an
> interrupt then we can enable interrupt by configuring the particular
> register
> but from where we will get the irq number details.

In kernel drivers, DT entries of that driver are read
by some APIs and then used by request_irq

>
> Do we as a programmer need to map it ?
>
> Please provide your views.
>
> BR,Abhinav
>
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-06-25  9:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-24 18:47 How kernel derive irq number for particular irq line Abhinav Misra
2018-06-25  0:50 ` Greg KH
2018-06-25  9:03 ` priyaranjan

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).