diff mbox series

[dt-schema] schemas: iio: add label

Message ID 20230507171219.232216-1-krzk@kernel.org (mailing list archive)
State Handled Elsewhere
Headers show
Series [dt-schema] schemas: iio: add label | expand

Commit Message

Krzysztof Kozlowski May 7, 2023, 5:12 p.m. UTC
Linux IIO core code parses label property which is already used in
several IIO devices.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 dtschema/schemas/iio/iio.yaml | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Jonathan Cameron May 13, 2023, 6:12 p.m. UTC | #1
On Sun,  7 May 2023 19:12:19 +0200
Krzysztof Kozlowski <krzk@kernel.org> wrote:

> Linux IIO core code parses label property which is already used in
> several IIO devices.
> 
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> ---
>  dtschema/schemas/iio/iio.yaml | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/dtschema/schemas/iio/iio.yaml b/dtschema/schemas/iio/iio.yaml
> index 5ce5e147aef1..727ca0f9afec 100644
> --- a/dtschema/schemas/iio/iio.yaml
> +++ b/dtschema/schemas/iio/iio.yaml
> @@ -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

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> +
>    mount-matrix:
>      $ref: /schemas/types.yaml#/definitions/non-unique-string-array
>      minItems: 9
Rob Herring (Arm) June 8, 2023, 6:13 p.m. UTC | #2
On Sun, 07 May 2023 19:12:19 +0200, Krzysztof Kozlowski wrote:
> Linux IIO core code parses label property which is already used in
> several IIO devices.
> 
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> ---
>  dtschema/schemas/iio/iio.yaml | 4 ++++
>  1 file changed, 4 insertions(+)
> 

Applied, thanks!
Jonathan Cameron June 10, 2023, 5:42 p.m. UTC | #3
On Thu, 8 Jun 2023 12:13:55 -0600
Rob Herring <robh@kernel.org> wrote:

> On Sun, 07 May 2023 19:12:19 +0200, Krzysztof Kozlowski wrote:
> > Linux IIO core code parses label property which is already used in
> > several IIO devices.
> > 
> > Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> > ---
> >  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
diff mbox series

Patch

diff --git a/dtschema/schemas/iio/iio.yaml b/dtschema/schemas/iio/iio.yaml
index 5ce5e147aef1..727ca0f9afec 100644
--- a/dtschema/schemas/iio/iio.yaml
+++ b/dtschema/schemas/iio/iio.yaml
@@ -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