The DesignWare GPIO IP can be configured for either 1 interrupt or 1 per GPIO in port A, but the driver currently only supports 1 interrupt. See the DesignWare DW_apb_gpio Databook description of the 'GPIO_INTR_IO' parameter. This change allows the driver to work with up to 32 interrupts, it will get as many interrupts as specified in the DT 'interrupts' property. It doesn't do anything clever with the different interrupts, it just calls the same handler used for single interrupt hardware. ACPI companion code provided by Hoan Tran <hotran@apm.com>. This was tested on X-Gene by Hoan. Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com> Reviewed-by: Rob Herring <robh@kernel.org> Acked-by: Lee Jones <lee.jones@linaro.org> Acked-by: Hoan Tran <hotran@apm.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
67 lines
2.3 KiB
Plaintext
67 lines
2.3 KiB
Plaintext
* Synopsys DesignWare APB GPIO controller
|
|
|
|
Required properties:
|
|
- compatible : Should contain "snps,dw-apb-gpio"
|
|
- reg : Address and length of the register set for the device.
|
|
- #address-cells : should be 1 (for addressing port subnodes).
|
|
- #size-cells : should be 0 (port subnodes).
|
|
|
|
The GPIO controller has a configurable number of ports, each of which are
|
|
represented as child nodes with the following properties:
|
|
|
|
Required properties:
|
|
- compatible : "snps,dw-apb-gpio-port"
|
|
- gpio-controller : Marks the device node as a gpio controller.
|
|
- #gpio-cells : Should be two. The first cell is the pin number and
|
|
the second cell is used to specify the gpio polarity:
|
|
0 = active high
|
|
1 = active low
|
|
- reg : The integer port index of the port, a single cell.
|
|
|
|
Optional properties:
|
|
- interrupt-controller : The first port may be configured to be an interrupt
|
|
controller.
|
|
- #interrupt-cells : Specifies the number of cells needed to encode an
|
|
interrupt. Shall be set to 2. The first cell defines the interrupt number,
|
|
the second encodes the triger flags encoded as described in
|
|
Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
|
|
- interrupt-parent : The parent interrupt controller.
|
|
- interrupts : The interrupts to the parent controller raised when GPIOs
|
|
generate the interrupts. If the controller provides one combined interrupt
|
|
for all GPIOs, specify a single interrupt. If the controller provides one
|
|
interrupt for each GPIO, provide a list of interrupts that correspond to each
|
|
of the GPIO pins. When specifying multiple interrupts, if any are unconnected,
|
|
use the interrupts-extended property to specify the interrupts and set the
|
|
interrupt controller handle for unused interrupts to 0.
|
|
- snps,nr-gpios : The number of pins in the port, a single cell.
|
|
- resets : Reset line for the controller.
|
|
|
|
Example:
|
|
|
|
gpio: gpio@20000 {
|
|
compatible = "snps,dw-apb-gpio";
|
|
reg = <0x20000 0x1000>;
|
|
#address-cells = <1>;
|
|
#size-cells = <0>;
|
|
|
|
porta: gpio-controller@0 {
|
|
compatible = "snps,dw-apb-gpio-port";
|
|
gpio-controller;
|
|
#gpio-cells = <2>;
|
|
snps,nr-gpios = <8>;
|
|
reg = <0>;
|
|
interrupt-controller;
|
|
#interrupt-cells = <2>;
|
|
interrupt-parent = <&vic1>;
|
|
interrupts = <0>;
|
|
};
|
|
|
|
portb: gpio-controller@1 {
|
|
compatible = "snps,dw-apb-gpio-port";
|
|
gpio-controller;
|
|
#gpio-cells = <2>;
|
|
snps,nr-gpios = <8>;
|
|
reg = <1>;
|
|
};
|
|
};
|