diff --git a/dtschema/dtb.py b/dtschema/dtb.py index 909531b8..6973d0b3 100644 --- a/dtschema/dtb.py +++ b/dtschema/dtb.py @@ -415,7 +415,7 @@ def fixup_phandles(validator, dt, path=''): def fixup_gpios(dt): - if 'gpio-hog' in dt: + if 'gpio-hog' in dt or 'gpio-line' in dt: return for k, v in dt.items(): if isinstance(v, dict): diff --git a/dtschema/schemas/gpio/gpio-consumer.yaml b/dtschema/schemas/gpio/gpio-consumer.yaml index b307c621..099182e2 100644 --- a/dtschema/schemas/gpio/gpio-consumer.yaml +++ b/dtschema/schemas/gpio/gpio-consumer.yaml @@ -12,10 +12,11 @@ description: Schema for GPIO consumer devicetree bindings maintainers: - Rob Herring -# do not select this schema for GPIO hogs +# do not select this schema for GPIO hog/line child nodes select: properties: gpio-hog: false + gpio-line: false properties: gpios: diff --git a/dtschema/schemas/gpio/gpio-hog.yaml b/dtschema/schemas/gpio/gpio-hog.yaml index bc1a72e5..4cf40996 100644 --- a/dtschema/schemas/gpio/gpio-hog.yaml +++ b/dtschema/schemas/gpio/gpio-hog.yaml @@ -36,6 +36,9 @@ properties: line-name: $ref: /schemas/types.yaml#/definitions/string + gpio-line-name: + $ref: /schemas/types.yaml#/definitions/string + output-high: $ref: /schemas/types.yaml#/definitions/flag diff --git a/dtschema/schemas/gpio/gpio-line.yaml b/dtschema/schemas/gpio/gpio-line.yaml new file mode 100644 index 00000000..b6335c1e --- /dev/null +++ b/dtschema/schemas/gpio/gpio-line.yaml @@ -0,0 +1,48 @@ +# SPDX-License-Identifier: BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/gpio/gpio-line.yaml# +$schema: http://devicetree.org/meta-schemas/base.yaml# + +title: GPIO Line Nodes + +description: Schema for GPIO line initialization devicetree bindings + +maintainers: + - Rob Herring + +# select this schema for GPIO line setup nodes +select: + properties: + gpio-line: true + + required: + - gpio-line + +properties: + $nodename: + pattern: "-line(-[0-9]+)?$" + + gpio-line: + $ref: /schemas/types.yaml#/definitions/flag + + gpios: + $ref: /schemas/types.yaml#/definitions/uint32-matrix + + input: + $ref: /schemas/types.yaml#/definitions/flag + + output-high: + $ref: /schemas/types.yaml#/definitions/flag + + output-low: + $ref: /schemas/types.yaml#/definitions/flag + + gpio-line-name: + $ref: /schemas/types.yaml#/definitions/string + +required: + - gpio-line + - gpios + +additionalProperties: false