forked from torvalds/linux
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dt-bindings: Convert gpio-mmio to yaml
This is a generic binding for simple MMIO GPIO controllers. Although we have a single driver for these controllers, they were previously spread over several files. Consolidate them. The register descriptions are adapted from the comments in the source. There is no set order for the registers, so I have not specified one. Rename brcm,bcm6345-gpio to brcm,bcm63xx-gpio to reflect that bcm6345 has moved. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
- Loading branch information
1 parent
e390263
commit 2d1e86b
Showing
4 changed files
with
135 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) | ||
%YAML 1.2 | ||
--- | ||
$id: http://devicetree.org/schemas/gpio/gpio-mmio.yaml# | ||
$schema: http://devicetree.org/meta-schemas/core.yaml# | ||
|
||
title: Generic MMIO GPIO | ||
|
||
maintainers: | ||
- Linus Walleij <linus.walleij@linaro.org> | ||
- Bartosz Golaszewski <brgl@bgdev.pl> | ||
|
||
description: | ||
Some simple GPIO controllers may consist of a single data register or a pair | ||
of set/clear-bit registers. Such controllers are common for glue logic in | ||
FPGAs or ASICs. Commonly, these controllers are accessed over memory-mapped | ||
NAND-style parallel busses. | ||
|
||
properties: | ||
big-endian: true | ||
|
||
compatible: | ||
enum: | ||
- brcm,bcm6345-gpio # Broadcom BCM6345 GPIO controller | ||
- wd,mbl-gpio # Western Digital MyBook Live memory-mapped GPIO controller | ||
- ni,169445-nand-gpio # National Instruments 169445 GPIO NAND controller | ||
|
||
'#gpio-cells': | ||
const: 2 | ||
|
||
gpio-controller: | ||
true | ||
|
||
reg: | ||
minItems: 1 | ||
description: | ||
A list of registers in the controller. The width of each register is | ||
determined by its size. All registers must have the same width. The number | ||
of GPIOs is set by the width, with bit 0 corresponding to GPIO 0. | ||
items: | ||
- description: | ||
Register to READ the value of the GPIO lines. If GPIO line is high, | ||
the bit will be set. If the GPIO line is low, the bit will be cleared. | ||
This register may also be used to drive GPIOs if the SET register is | ||
omitted. | ||
- description: | ||
Register to SET the value of the GPIO lines. Setting a bit in this | ||
register will drive the GPIO line high. | ||
- description: | ||
Register to CLEAR the value of the GPIO lines. Setting a bit in this | ||
register will drive the GPIO line low. If this register is omitted, | ||
the SET register will be used to clear the GPIO lines as well, by | ||
actively writing the line with 0. | ||
- description: | ||
Register to set the line as OUTPUT. Setting a bit in this register | ||
will turn that line into an output line. Conversely, clearing a bit | ||
will turn that line into an input. | ||
- description: | ||
Register to set this line as INPUT. Setting a bit in this register | ||
will turn that line into an input line. Conversely, clearing a bit | ||
will turn that line into an output. | ||
|
||
reg-names: | ||
minItems: 1 | ||
maxItems: 5 | ||
items: | ||
enum: | ||
- dat | ||
- set | ||
- clr | ||
- dirout | ||
- dirin | ||
|
||
native-endian: true | ||
|
||
no-output: | ||
$ref: /schemas/types.yaml#/definitions/flag | ||
description: | ||
If this property is present, the controller cannot drive the GPIO lines. | ||
|
||
required: | ||
- compatible | ||
- reg | ||
- reg-names | ||
- '#gpio-cells' | ||
- gpio-controller | ||
|
||
additionalProperties: false | ||
|
||
examples: | ||
- | | ||
gpio@1f300010 { | ||
compatible = "ni,169445-nand-gpio"; | ||
reg = <0x1f300010 0x4>; | ||
reg-names = "dat"; | ||
gpio-controller; | ||
#gpio-cells = <2>; | ||
}; | ||
gpio@1f300014 { | ||
compatible = "ni,169445-nand-gpio"; | ||
reg = <0x1f300014 0x4>; | ||
reg-names = "dat"; | ||
gpio-controller; | ||
#gpio-cells = <2>; | ||
no-output; | ||
}; | ||
gpio@e0000000 { | ||
compatible = "wd,mbl-gpio"; | ||
reg-names = "dat"; | ||
reg = <0xe0000000 0x1>; | ||
#gpio-cells = <2>; | ||
gpio-controller; | ||
}; | ||
gpio@e0100000 { | ||
compatible = "wd,mbl-gpio"; | ||
reg-names = "dat"; | ||
reg = <0xe0100000 0x1>; | ||
#gpio-cells = <2>; | ||
gpio-controller; | ||
no-output; | ||
}; | ||
gpio@fffe0406 { | ||
compatible = "brcm,bcm6345-gpio"; | ||
reg-names = "dirout", "dat"; | ||
reg = <0xfffe0406 2>, <0xfffe040a 2>; | ||
native-endian; | ||
gpio-controller; | ||
#gpio-cells = <2>; | ||
}; |
38 changes: 0 additions & 38 deletions
38
Documentation/devicetree/bindings/gpio/ni,169445-nand-gpio.txt
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.