Skip to content
Permalink
Browse files

scripts/dts: Fix detection of a GPIO specifier

We should only assume a GPIO specifier is either named <FOO>-gpios or
gpios.  Any other form like ngpios should not be considered a GPIO
specifier.  especially since 'ngpios' is the standard property name for
the number of gpio's that are implemented.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
  • Loading branch information...
galak committed Aug 7, 2019
1 parent 9976999 commit 8622c3415d2f99121aab97277614155cb8cf1702
Showing with 2 additions and 2 deletions.
  1. +1 −1 scripts/dts/edtlib.py
  2. +1 −1 scripts/dts/extract_dts_includes.py
@@ -1357,7 +1357,7 @@ def _gpios(node):
res = {}

for name, prop in node.props.items():
if name.endswith("gpios"):
if name.endswith("-gpios") or name == "gpios":
# Get the prefix from the property name:
# - gpios -> "" (deprecated, should have a prefix)
# - foo-gpios -> "foo"
@@ -84,7 +84,7 @@ def generate_prop_defines(node_path, prop):
compatible.extract(node_path, prop, def_label)
elif 'clocks' in prop:
clocks.extract(node_path, prop, def_label)
elif 'pwms' in prop or 'gpios' in prop:
elif 'pwms' in prop or '-gpios' in prop or prop == "gpios":
prop_values = reduced[node_path]['props'][prop]
generic = prop[:-1] # Drop the 's' from the prop

0 comments on commit 8622c34

Please sign in to comment.
You can’t perform that action at this time.