October 2017
Intermediate to advanced
586 pages
14h 8m
English
Now, we will declare our controller in the DT. As you may remember from Chapter 6, The Concept of Device Tree, every interrupt controller must have the Boolean property interrupt controller set. The second mandatory Boolean property is gpio-controller, since it is a GPIO controller, too. We need to define how many cells are needed for an interrupt specifier for our device. Since we have the irq_domain_ops.xlate field set to irq_domain_xlate_twocell, #interrupt-cells should be set to 2:
expander: mcp23016@20 { compatible = "microchip,mcp23016"; reg = <0x20>; interrupt-controller; #interrupt-cells = <2>; gpio-controller; #gpio-cells = <2>; interrupt-parent = <&gpio4>; interrupts = <29 IRQ_TYPE_EDGE_FALLING>; ...