dm: irq: Add support for requesting interrupts
authorSimon Glass <sjg@chromium.org>
Thu, 6 Feb 2020 16:55:00 +0000 (09:55 -0700)
committerBin Meng <bmeng.cn@gmail.com>
Fri, 7 Feb 2020 14:46:32 +0000 (22:46 +0800)
commit025543554c36615a66d66c154f3f763ac788ee15
treec792b8de3065a268ee654dc47259c9ef82d08914
parentd9a5fad80857005703d46b6ea27217baa17eb142
dm: irq: Add support for requesting interrupts

At present driver model supports the IRQ uclass but there is no way to
request a particular interrupt for a driver.

Add a mechanism, similar to clock and reset, to read the interrupts
required by a device from the device tree and to request those interrupts.

U-Boot itself does not have interrupt-driven handlers, so just provide a
means to read and clear an interrupt. This can be useful to handle
peripherals which must use an interrupt to determine when data is
available, for example.

Bring over the basic binding file as well, from Linux v5.4. Note that the
older binding is not supported in U-Boot; the newer 'special form' must be
used.

Add a simple test of the new functionality.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
arch/sandbox/dts/test.dts
doc/device-tree-bindings/interrupt-controller/interrupts.txt [new file with mode: 0644]
drivers/misc/irq-uclass.c
drivers/misc/irq_sandbox.c
include/irq.h
test/dm/irq.c