Could some one elaborate irq_create_mapping, irq_find_mapping, to use request_irq

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Could some one elaborate irq_create_mapping, irq_find_mapping, to use request_irq

2,589件の閲覧回数
ramakrishnakatt
Contributor II

Could some one elaborate irq_create_mapping, irq_find_mapping, to use request_irq

Thanks

Rama

1 返信

1,527件の閲覧回数
scottwood
NXP Employee
NXP Employee

Linux IRQ numbers, as used by request_irq() and similar functions, are arbitrary software tokens rather than hardware IRQ numbers.  To obtain such a token (called a virtual IRQ number, or virq) you need to create a mapping.  The most common way to do that is to either use irq_of_parse_and_map(), or get the virq from a bus-specific structure (e.g. struct pci_dev or struct platform_device).

irq_create_mapping() is the low-level function used by the above methods of translation.  It's possible to use it directly, but you normally shouldn't have to.  If you find yourself wanting to use it, it probably means that you have hardware that should be described in the device tree but isn't.

irq_find_mapping() is one method used by interrupt controller drivers to turn a hardware interrupt number into a virq using an existing mapping.  If you're not writing an interrupt controller driver or something similar, you don't need this.