October 2017
Intermediate to advanced
586 pages
14h 8m
English
This consists of fetching the IRQ number from a DT, and mapping it into Linux IRQ, thus registering a function callback for it. The driver code to do this is quite simple:
int irq = platform_get_irq(pdev, 0); ret = request_irq(irq, imx_rxint, 0, dev_name(&pdev->dev), sport);
The platform_get_irq() call will return the irq number; this number is usable by devm_request_irq() (irq is then visible in /proc/interrupts ). The second argument, 0, says that we need the first interrupt specified in the device node. If there is more than one interrupt, we can change this index according to the interrupt we need, or just use the named resource.
In our preceding example, the device node contains an interrupt specifier, which looks ...