diff mbox series

[v4,2/8] dt-bindings: mmc: mmc-spi-slot: Change voltage-ranges to uint32-matrix

Message ID 20240611-ls_waring_esdhc-v4-2-d0d8a5b3f3cb@nxp.com (mailing list archive)
State New
Headers show
Series arm64: dts: convert fsl,esdhc.txt to yaml and fix layerscape dts warning | expand

Commit Message

Frank Li June 11, 2024, 4:01 p.m. UTC
According to common mmc core, voltages-ranges should be matrix.

Signed-off-by: Frank Li <Frank.Li@nxp.com>

---
Not sure why it impact other mmc yaml's voltage-ranges.
---
 Documentation/devicetree/bindings/mmc/mmc-spi-slot.yaml | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

Comments

Rob Herring (Arm) June 11, 2024, 8:23 p.m. UTC | #1
On Tue, Jun 11, 2024 at 12:01:47PM -0400, Frank Li wrote:
> According to common mmc core, voltages-ranges should be matrix.
> 
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> 
> ---
> Not sure why it impact other mmc yaml's voltage-ranges.

It's a quirk of the tools. When decoding properties, the tools only know 
all possible types. Types are global, not per binding. Sometimes it can 
be figured out, but cases like this cannot be.

> ---
>  Documentation/devicetree/bindings/mmc/mmc-spi-slot.yaml | 17 ++++++++++-------
>  1 file changed, 10 insertions(+), 7 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/mmc/mmc-spi-slot.yaml b/Documentation/devicetree/bindings/mmc/mmc-spi-slot.yaml
> index 36acc40c7d181..05815b837219d 100644
> --- a/Documentation/devicetree/bindings/mmc/mmc-spi-slot.yaml
> +++ b/Documentation/devicetree/bindings/mmc/mmc-spi-slot.yaml
> @@ -27,17 +27,20 @@ properties:
>      maxItems: 1
>  
>    voltage-ranges:
> -    $ref: /schemas/types.yaml#/definitions/uint32-array
> +    $ref: /schemas/types.yaml#/definitions/uint32-matrix
>      description: |
>        Two cells are required, first cell specifies minimum slot voltage (mV),
>        second cell specifies maximum slot voltage (mV).
>      items:
> -      - description: |
> -          value for minimum slot voltage in mV
> -        default: 3200
> -      - description: |
> -          value for maximum slot voltage in mV
> -        default: 3400
> +      items:
> +        - description: |
> +            value for minimum slot voltage in mV
> +          default: 3200
> +        - description: |
> +            value for maximum slot voltage in mV
> +          default: 3400
> +    minItems: 1
> +    maxItems: 8

From what I remember, SPI mode doesn't support voltage changes. 
Switching to 1.8V came much later in the spec. So it should be 
'maxItems: 1'. Or better yet, make the outer 'items' a list (of 1 
entry).

Rob
Frank Li June 12, 2024, 2:36 p.m. UTC | #2
On Tue, Jun 11, 2024 at 02:23:11PM -0600, Rob Herring wrote:
> On Tue, Jun 11, 2024 at 12:01:47PM -0400, Frank Li wrote:
> > According to common mmc core, voltages-ranges should be matrix.
> > 
> > Signed-off-by: Frank Li <Frank.Li@nxp.com>
> > 
> > ---
> > Not sure why it impact other mmc yaml's voltage-ranges.
> 
> It's a quirk of the tools. When decoding properties, the tools only know 
> all possible types. Types are global, not per binding. Sometimes it can 
> be figured out, but cases like this cannot be.
> 
> > ---
> >  Documentation/devicetree/bindings/mmc/mmc-spi-slot.yaml | 17 ++++++++++-------
> >  1 file changed, 10 insertions(+), 7 deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/mmc/mmc-spi-slot.yaml b/Documentation/devicetree/bindings/mmc/mmc-spi-slot.yaml
> > index 36acc40c7d181..05815b837219d 100644
> > --- a/Documentation/devicetree/bindings/mmc/mmc-spi-slot.yaml
> > +++ b/Documentation/devicetree/bindings/mmc/mmc-spi-slot.yaml
> > @@ -27,17 +27,20 @@ properties:
> >      maxItems: 1
> >  
> >    voltage-ranges:
> > -    $ref: /schemas/types.yaml#/definitions/uint32-array
> > +    $ref: /schemas/types.yaml#/definitions/uint32-matrix
> >      description: |
> >        Two cells are required, first cell specifies minimum slot voltage (mV),
> >        second cell specifies maximum slot voltage (mV).
> >      items:
> > -      - description: |
> > -          value for minimum slot voltage in mV
> > -        default: 3200
> > -      - description: |
> > -          value for maximum slot voltage in mV
> > -        default: 3400
> > +      items:
> > +        - description: |
> > +            value for minimum slot voltage in mV
> > +          default: 3200
> > +        - description: |
> > +            value for maximum slot voltage in mV
> > +          default: 3400
> > +    minItems: 1
> > +    maxItems: 8
> 
> From what I remember, SPI mode doesn't support voltage changes. 
> Switching to 1.8V came much later in the spec. So it should be 
> 'maxItems: 1'. Or better yet, make the outer 'items' a list (of 1 
> entry).

I don't understand "make the outer 'items' a list (of 1 entry)." Can guide
me how to write it?

Frank 

> 
> Rob
Krzysztof Kozlowski June 13, 2024, 6:35 a.m. UTC | #3
On 12/06/2024 16:36, Frank Li wrote:
> On Tue, Jun 11, 2024 at 02:23:11PM -0600, Rob Herring wrote:
>> On Tue, Jun 11, 2024 at 12:01:47PM -0400, Frank Li wrote:
>>> According to common mmc core, voltages-ranges should be matrix.
>>>
>>> Signed-off-by: Frank Li <Frank.Li@nxp.com>
>>>
>>> ---
>>> Not sure why it impact other mmc yaml's voltage-ranges.
>>
>> It's a quirk of the tools. When decoding properties, the tools only know 
>> all possible types. Types are global, not per binding. Sometimes it can 
>> be figured out, but cases like this cannot be.
>>
>>> ---
>>>  Documentation/devicetree/bindings/mmc/mmc-spi-slot.yaml | 17 ++++++++++-------
>>>  1 file changed, 10 insertions(+), 7 deletions(-)
>>>
>>> diff --git a/Documentation/devicetree/bindings/mmc/mmc-spi-slot.yaml b/Documentation/devicetree/bindings/mmc/mmc-spi-slot.yaml
>>> index 36acc40c7d181..05815b837219d 100644
>>> --- a/Documentation/devicetree/bindings/mmc/mmc-spi-slot.yaml
>>> +++ b/Documentation/devicetree/bindings/mmc/mmc-spi-slot.yaml
>>> @@ -27,17 +27,20 @@ properties:
>>>      maxItems: 1
>>>  
>>>    voltage-ranges:
>>> -    $ref: /schemas/types.yaml#/definitions/uint32-array
>>> +    $ref: /schemas/types.yaml#/definitions/uint32-matrix
>>>      description: |
>>>        Two cells are required, first cell specifies minimum slot voltage (mV),
>>>        second cell specifies maximum slot voltage (mV).
>>>      items:
>>> -      - description: |
>>> -          value for minimum slot voltage in mV
>>> -        default: 3200
>>> -      - description: |
>>> -          value for maximum slot voltage in mV
>>> -        default: 3400
>>> +      items:
>>> +        - description: |
>>> +            value for minimum slot voltage in mV
>>> +          default: 3200
>>> +        - description: |
>>> +            value for maximum slot voltage in mV
>>> +          default: 3400
>>> +    minItems: 1
>>> +    maxItems: 8
>>
>> From what I remember, SPI mode doesn't support voltage changes. 
>> Switching to 1.8V came much later in the spec. So it should be 
>> 'maxItems: 1'. Or better yet, make the outer 'items' a list (of 1 
>> entry).
> 
> I don't understand "make the outer 'items' a list (of 1 entry)." Can guide
> me how to write it?

voltage-ranges:
  $ref: /schemas/types.yaml#/definitions/uint32-matrix
  items:
    - items:
        - descr:
        - descr:

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/mmc/mmc-spi-slot.yaml b/Documentation/devicetree/bindings/mmc/mmc-spi-slot.yaml
index 36acc40c7d181..05815b837219d 100644
--- a/Documentation/devicetree/bindings/mmc/mmc-spi-slot.yaml
+++ b/Documentation/devicetree/bindings/mmc/mmc-spi-slot.yaml
@@ -27,17 +27,20 @@  properties:
     maxItems: 1
 
   voltage-ranges:
-    $ref: /schemas/types.yaml#/definitions/uint32-array
+    $ref: /schemas/types.yaml#/definitions/uint32-matrix
     description: |
       Two cells are required, first cell specifies minimum slot voltage (mV),
       second cell specifies maximum slot voltage (mV).
     items:
-      - description: |
-          value for minimum slot voltage in mV
-        default: 3200
-      - description: |
-          value for maximum slot voltage in mV
-        default: 3400
+      items:
+        - description: |
+            value for minimum slot voltage in mV
+          default: 3200
+        - description: |
+            value for maximum slot voltage in mV
+          default: 3400
+    minItems: 1
+    maxItems: 8
 
   gpios:
     description: |