Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4fd9bbc6 authored by Tien Hock Loh's avatar Tien Hock Loh Committed by Linus Walleij
Browse files

drivers/gpio: Altera soft IP GPIO driver device tree binding



Adds a new driver device tree binding for Altera soft GPIO IP

Signed-off-by: default avatarTien Hock Loh <thloh@altera.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent c5abbba9
Loading
Loading
Loading
Loading
+43 −0
Original line number Original line Diff line number Diff line
Altera GPIO controller bindings

Required properties:
- compatible:
  - "altr,pio-1.0"
- reg: Physical base address and length of the controller's registers.
- #gpio-cells : Should be 2
  - The first cell is the gpio offset number.
  - The second cell is reserved and is currently unused.
- gpio-controller : Marks the device node as a GPIO controller.
- interrupt-controller: Mark the device node as an interrupt controller
- #interrupt-cells : Should be 1. The interrupt type is fixed in the hardware.
  - The first cell is the GPIO offset number within the GPIO controller.
- interrupts: Specify the interrupt.
- altr,interrupt-trigger: Specifies the interrupt trigger type the GPIO
  hardware is synthesized. This field is required if the Altera GPIO controller
  used has IRQ enabled as the interrupt type is not software controlled,
  but hardware synthesized. Required if GPIO is used as an interrupt
  controller. The value is defined in <dt-bindings/interrupt-controller/irq.h>
  Only the following flags are supported:
    IRQ_TYPE_EDGE_RISING
    IRQ_TYPE_EDGE_FALLING
    IRQ_TYPE_EDGE_BOTH
    IRQ_TYPE_LEVEL_HIGH

Optional properties:
- altr,ngpio: Width of the GPIO bank. This defines how many pins the
  GPIO device has. Ranges between 1-32. Optional and defaults to 32 if not
  specified.

Example:

gpio_altr: gpio@0xff200000 {
	compatible = "altr,pio-1.0";
	reg = <0xff200000 0x10>;
	interrupts = <0 45 4>;
	altr,ngpio = <32>;
	altr,interrupt-trigger = <IRQ_TYPE_EDGE_RISING>;
	#gpio-cells = <2>;
	gpio-controller;
	#interrupt-cells = <1>;
	interrupt-controller;
};