0001 NXP LPC18xx/43xx GPIO controller Device Tree Bindings
0002 -----------------------------------------------------
0003
0004 Required properties:
0005 - compatible : Should be "nxp,lpc1850-gpio"
0006 - reg : List of addresses and lengths of the GPIO controller
0007 register sets
0008 - reg-names : Should be "gpio", "gpio-pin-ic", "gpio-group0-ic" and
0009 "gpio-gpoup1-ic"
0010 - clocks : Phandle and clock specifier pair for GPIO controller
0011 - resets : Phandle and reset specifier pair for GPIO controller
0012 - gpio-controller : Marks the device node as a GPIO controller
0013 - #gpio-cells : Should be two:
0014 - The first cell is the GPIO line number
0015 - The second cell is used to specify polarity
0016 - interrupt-controller : Marks the device node as an interrupt controller
0017 - #interrupt-cells : Should be two:
0018 - The first cell is an interrupt number within
0019 0..9 range, for GPIO pin interrupts it is equal
0020 to 'nxp,gpio-pin-interrupt' property value of
0021 GPIO pin configuration, 8 is for GPIO GROUP0
0022 interrupt, 9 is for GPIO GROUP1 interrupt
0023 - The second cell is used to specify interrupt type
0024
0025 Optional properties:
0026 - gpio-ranges : Mapping between GPIO and pinctrl
0027
0028 Example:
0029 #define LPC_GPIO(port, pin) (port * 32 + pin)
0030 #define LPC_PIN(port, pin) (0x##port * 32 + pin)
0031
0032 gpio: gpio@400f4000 {
0033 compatible = "nxp,lpc1850-gpio";
0034 reg = <0x400f4000 0x4000>, <0x40087000 0x1000>,
0035 <0x40088000 0x1000>, <0x40089000 0x1000>;
0036 reg-names = "gpio", "gpio-pin-ic",
0037 "gpio-group0-ic", "gpio-gpoup1-ic";
0038 clocks = <&ccu1 CLK_CPU_GPIO>;
0039 resets = <&rgu 28>;
0040 gpio-controller;
0041 #gpio-cells = <2>;
0042 interrupt-controller;
0043 #interrupt-cells = <2>;
0044 gpio-ranges = <&pinctrl LPC_GPIO(0,0) LPC_PIN(0,0) 2>,
0045 ...
0046 <&pinctrl LPC_GPIO(7,19) LPC_PIN(f,5) 7>;
0047 };
0048
0049 gpio_joystick {
0050 compatible = "gpio-keys";
0051 ...
0052
0053 button0 {
0054 ...
0055 interrupt-parent = <&gpio>;
0056 interrupts = <1 IRQ_TYPE_EDGE_BOTH>;
0057 gpios = <&gpio LPC_GPIO(4,8) GPIO_ACTIVE_LOW>;
0058 };
0059 };