162306a36Sopenharmony_ciNXP LPC18xx/43xx GPIO controller Device Tree Bindings 262306a36Sopenharmony_ci----------------------------------------------------- 362306a36Sopenharmony_ci 462306a36Sopenharmony_ciRequired properties: 562306a36Sopenharmony_ci- compatible : Should be "nxp,lpc1850-gpio" 662306a36Sopenharmony_ci- reg : List of addresses and lengths of the GPIO controller 762306a36Sopenharmony_ci register sets 862306a36Sopenharmony_ci- reg-names : Should be "gpio", "gpio-pin-ic", "gpio-group0-ic" and 962306a36Sopenharmony_ci "gpio-gpoup1-ic" 1062306a36Sopenharmony_ci- clocks : Phandle and clock specifier pair for GPIO controller 1162306a36Sopenharmony_ci- resets : Phandle and reset specifier pair for GPIO controller 1262306a36Sopenharmony_ci- gpio-controller : Marks the device node as a GPIO controller 1362306a36Sopenharmony_ci- #gpio-cells : Should be two: 1462306a36Sopenharmony_ci - The first cell is the GPIO line number 1562306a36Sopenharmony_ci - The second cell is used to specify polarity 1662306a36Sopenharmony_ci- interrupt-controller : Marks the device node as an interrupt controller 1762306a36Sopenharmony_ci- #interrupt-cells : Should be two: 1862306a36Sopenharmony_ci - The first cell is an interrupt number within 1962306a36Sopenharmony_ci 0..9 range, for GPIO pin interrupts it is equal 2062306a36Sopenharmony_ci to 'nxp,gpio-pin-interrupt' property value of 2162306a36Sopenharmony_ci GPIO pin configuration, 8 is for GPIO GROUP0 2262306a36Sopenharmony_ci interrupt, 9 is for GPIO GROUP1 interrupt 2362306a36Sopenharmony_ci - The second cell is used to specify interrupt type 2462306a36Sopenharmony_ci 2562306a36Sopenharmony_ciOptional properties: 2662306a36Sopenharmony_ci- gpio-ranges : Mapping between GPIO and pinctrl 2762306a36Sopenharmony_ci 2862306a36Sopenharmony_ciExample: 2962306a36Sopenharmony_ci#define LPC_GPIO(port, pin) (port * 32 + pin) 3062306a36Sopenharmony_ci#define LPC_PIN(port, pin) (0x##port * 32 + pin) 3162306a36Sopenharmony_ci 3262306a36Sopenharmony_cigpio: gpio@400f4000 { 3362306a36Sopenharmony_ci compatible = "nxp,lpc1850-gpio"; 3462306a36Sopenharmony_ci reg = <0x400f4000 0x4000>, <0x40087000 0x1000>, 3562306a36Sopenharmony_ci <0x40088000 0x1000>, <0x40089000 0x1000>; 3662306a36Sopenharmony_ci reg-names = "gpio", "gpio-pin-ic", 3762306a36Sopenharmony_ci "gpio-group0-ic", "gpio-gpoup1-ic"; 3862306a36Sopenharmony_ci clocks = <&ccu1 CLK_CPU_GPIO>; 3962306a36Sopenharmony_ci resets = <&rgu 28>; 4062306a36Sopenharmony_ci gpio-controller; 4162306a36Sopenharmony_ci #gpio-cells = <2>; 4262306a36Sopenharmony_ci interrupt-controller; 4362306a36Sopenharmony_ci #interrupt-cells = <2>; 4462306a36Sopenharmony_ci gpio-ranges = <&pinctrl LPC_GPIO(0,0) LPC_PIN(0,0) 2>, 4562306a36Sopenharmony_ci ... 4662306a36Sopenharmony_ci <&pinctrl LPC_GPIO(7,19) LPC_PIN(f,5) 7>; 4762306a36Sopenharmony_ci}; 4862306a36Sopenharmony_ci 4962306a36Sopenharmony_cigpio_joystick { 5062306a36Sopenharmony_ci compatible = "gpio-keys"; 5162306a36Sopenharmony_ci ... 5262306a36Sopenharmony_ci 5362306a36Sopenharmony_ci button0 { 5462306a36Sopenharmony_ci ... 5562306a36Sopenharmony_ci interrupt-parent = <&gpio>; 5662306a36Sopenharmony_ci interrupts = <1 IRQ_TYPE_EDGE_BOTH>; 5762306a36Sopenharmony_ci gpios = <&gpio LPC_GPIO(4,8) GPIO_ACTIVE_LOW>; 5862306a36Sopenharmony_ci }; 5962306a36Sopenharmony_ci}; 60