Skip to contentSkip to conversation

schemas: iio: add label

PATCH Applied Krzysztof Kozlowski 3 participants 4 messages May 7, 2023 – Jun 10, 2023 IIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 schemas: iio: add label

Linux IIO core code parses label property which is already used in several IIO devices.

---
 dtschema/schemas/iio/iio.yaml | 4 ++++
 1 file changed, 4 insertions(+)
dtschema/schemas/iio/iio.yaml +4 -0
index 5ce5e147aef1..727ca0f9afec 100644
@@ -30,6 +30,10 @@ properties:
       with a single IIO output and 1 for nodes with multiple IIO outputs.
       A few unusual devices have a 2 level mapping.
 
+  label:
+    description:
+      Unique name to identify which IIO channel or device this is.
+
   mount-matrix:
     $ref: /schemas/types.yaml#/definitions/non-unique-string-array
     minItems: 9
Signature · 1 line
2.34.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines · On Sun, 7 May 2023 19:12:19 +0200 Krzysztof Kozlowski <[email protected]> wrote:

Linux IIO core code parses label property which is already used in several IIO devices.

---
 dtschema/schemas/iio/iio.yaml | 4 ++++
 1 file changed, 4 insertions(+)
dtschema/schemas/iio/iio.yaml +0 -0
index 5ce5e147aef1..727ca0f9afec 100644

dtschema/schemas/iio/iio.yaml properties: · line 35

Quoted 6 lines
dtschema/schemas/iio/iio.yaml +3 -0
@@ -30,6 +30,10 @@ properties:
       with a single IIO output and 1 for nodes with multiple IIO outputs.
       A few unusual devices have a 2 level mapping.
 
+  label:
+    description:
+      Unique name to identify which IIO channel or device this is.

Ah. I thought this as covered by the entry in dt-core.yaml

If not fair enough, though is this flexible enough to cover that it can exist at device level and in a channel node?

If so lgtm

Quoted 4 lines
dtschema/schemas/iio/iio.yaml +1 -0
+
   mount-matrix:
     $ref: /schemas/types.yaml#/definitions/non-unique-string-array
     minItems: 9
maintainer
#3 lore raw
Quoted 4 lines · On Thu, 8 Jun 2023 12:13:55 -0600 Rob Herring <[email protected]> wrote:
Quoted 3 lines · Krzysztof Kozlowski

Linux IIO core code parses label property which is already used in several IIO devices.

Quoted 8 lines
Quoted 5 lines
---
 dtschema/schemas/iio/iio.yaml | 4 ++++
 1 file changed, 4 insertions(+)

Applied, thanks!

I'm guessing you already know this but I hit it during testing. dtschema/main + ruamel.yaml 0.17.24 and later seem to be broken. It installs fine but...

AttributeError: module 'ruamel.yaml' has no attribute 'YAML'

$ /usr/bin/dt-doc-validate                                                                                                  
Traceback (most recent call last):                                                                                                                        
  File "/usr/bin/dt-doc-validate", line 4, in <module>                                                                                                    
    __import__('pkg_resources').run_script('dtschema==2023.5.dev6+g4ddf315.d20230610', 'dt-doc-validate')                                                 
  File "/usr/lib/python3.11/site-packages/pkg_resources/__init__.py", line 720, in run_script                                                             
    self.require(requires)[0].run_script(script_name, ns)                                                                                                 
  File "/usr/lib/python3.11/site-packages/pkg_resources/__init__.py", line 1559, in run_script                                                            
    exec(code, namespace, namespace)                                                                                                                      
  File "/usr/lib/python3.11/site-packages/dtschema-2023.5.dev6+g4ddf315.d20230610-py3.11.egg/EGG-INFO/scripts/dt-doc-validate", line 16, in <module>      
    import dtschema                                                                                                                                       
  File "/usr/lib/python3.11/site-packages/dtschema-2023.5.dev6+g4ddf315.d20230610-py3.11.egg/dtschema/__init__.py", line 1, in <module>                   
    from dtschema.lib import (                                                                                                                            
  File "/usr/lib/python3.11/site-packages/dtschema-2023.5.dev6+g4ddf315.d20230610-py3.11.egg/dtschema/lib.py", line 35, in <module>                       
    rtyaml = ruamel.yaml.YAML(typ='rt')   

I've worked around this by setting a max version at 0.17. Only change in ruamel.yaml between those is:
https://sourceforge.net/p/ruamel-yaml/code/ci/4309006902d2453399588f4ddccfb3fc460e1eba/

My python is terrible so I'm not looking into this further.

Jonathan