Path: blob/master/Documentation/devicetree/bindings/gpio/gpio-mmio.yaml
26308 views
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)1%YAML 1.22---3$id: http://devicetree.org/schemas/gpio/gpio-mmio.yaml#4$schema: http://devicetree.org/meta-schemas/core.yaml#56title: Generic MMIO GPIO78maintainers:9- Linus Walleij <linus.walleij@linaro.org>10- Bartosz Golaszewski <brgl@bgdev.pl>1112description:13Some simple GPIO controllers may consist of a single data register or a pair14of set/clear-bit registers. Such controllers are common for glue logic in15FPGAs or ASICs. Commonly, these controllers are accessed over memory-mapped16NAND-style parallel busses.1718properties:19compatible:20enum:21- brcm,bcm6345-gpio22- ni,169445-nand-gpio23- wd,mbl-gpio # Western Digital MyBook Live memory-mapped GPIO controller2425big-endian: true2627'#gpio-cells':28const: 22930gpio-controller: true3132little-endian: true3334reg:35minItems: 136description:37A list of registers in the controller. The width of each register is38determined by its size. All registers must have the same width. The number39of GPIOs is set by the width, with bit 0 corresponding to GPIO 0, unless40the ngpios property further restricts the number of used lines.41items:42- description:43Register to READ the value of the GPIO lines. If GPIO line is high,44the bit will be set. If the GPIO line is low, the bit will be cleared.45This register may also be used to drive GPIOs if the SET register is46omitted.47- description:48Register to SET the value of the GPIO lines. Setting a bit in this49register will drive the GPIO line high.50- description:51Register to CLEAR the value of the GPIO lines. Setting a bit in this52register will drive the GPIO line low. If this register is omitted,53the SET register will be used to clear the GPIO lines as well, by54actively writing the line with 0.55- description:56Register to set the line as OUTPUT. Setting a bit in this register57will turn that line into an output line. Conversely, clearing a bit58will turn that line into an input.59- description:60Register to set this line as INPUT. Setting a bit in this register61will turn that line into an input line. Conversely, clearing a bit62will turn that line into an output.6364reg-names:65minItems: 166maxItems: 567items:68enum:69- dat70- set71- clr72- dirout73- dirin7475native-endian: true7677ngpios:78minimum: 179maximum: 6380description:81If this property is present the number of usable GPIO lines are restricted82to the first 0 .. ngpios lines. This is useful when the GPIO MMIO register83has 32 bits for GPIO but only the first 12 are actually connected to84real electronics, and then we set ngpios to 12.8586no-output:87$ref: /schemas/types.yaml#/definitions/flag88description:89If this property is present, the controller cannot drive the GPIO lines.9091required:92- compatible93- reg94- reg-names95- '#gpio-cells'96- gpio-controller9798additionalProperties: false99100examples:101- |102gpio@1f300010 {103compatible = "ni,169445-nand-gpio";104reg = <0x1f300010 0x4>;105reg-names = "dat";106gpio-controller;107#gpio-cells = <2>;108};109110gpio@e0100000 {111compatible = "wd,mbl-gpio";112reg-names = "dat";113reg = <0xe0100000 0x1>;114#gpio-cells = <2>;115gpio-controller;116no-output;117};118119gpio@fffe0406 {120compatible = "brcm,bcm6345-gpio";121reg-names = "dirout", "dat";122reg = <0xfffe0406 2>, <0xfffe040a 2>;123ngpios = <15>;124native-endian;125gpio-controller;126#gpio-cells = <2>;127};128129130