Thread (27 messages) 27 messages, 5 authors, 2026-03-22

Re: [PATCH 5/5] dt-bindings: iio: adc: xilinx-xadc: convert to YAML format

From: Sai Krishna Potthuri <sai.krishna.potthuri@amd.com>
Date: 2026-03-19 14:50:36
Also in: linux-devicetree, linux-iio, lkml

Hi David Lechner,

On 3/19/2026 7:53 PM, David Lechner wrote:
On 3/19/26 8:52 AM, Sai Krishna Potthuri wrote:
quoted
Hi Krzysztof,

On 2/21/2026 4:08 PM, Krzysztof Kozlowski wrote:
quoted
On Fri, Feb 20, 2026 at 11:09:41AM +0530, Sai Krishna Potthuri wrote:
quoted
Convert the xilinx-xadc.txt Devicetree binding to a YAML schema format
and remove the old text binding.

+
+  xlnx,channels:
+    $ref: '#/$defs/channels'
+
+allOf:
Missing ref since you use unevaluatedProperties...
quoted
+  - if:
+      required:
+        - xlnx,external-mux
+      properties:
+        xlnx,external-mux:
+          enum:
+            - single
+            - dual
+    then:
+      required:
+        - xlnx,external-mux-channel
+
+required:
+  - compatible
+  - reg
+
+unevaluatedProperties: false
or you meant additionalProperties?
quoted
+
+$defs:
Why this is a def, not used directly? I see only one usage of this def.
I am getting the below error if i define the patternProperties directly.
Seems like complex vendor peroperties should be referenced via $ref.
Please suggest if there is any better way to deal this.
It is hard to say without seeing the new version of what you wrote.
In v1 series, i created $def and referenced this in xlnx,channels to 
avoid the error that i mentioned.

v1 code:
   xlnx,channels:
     $ref: '#/$defs/channels'

   $defs:
   channels:
     type: object
     description: List of external channels that are connected to the ADC
     properties:
       '#address-cells':
         const: 1
       '#size-cells':
         const: 0

     patternProperties:
       "^channel@([0-9]|1[0-6])$":
         type: object
         properties:
           reg:
             minimum: 0
             maximum: 16
             description: |
               Pair of pins the channel is connected to:
                 0: VP/VN
                 1-16: VAUXP[0-15]/VAUXN[0-15]
               Note each channel number should only be used at most once.

           xlnx,bipolar:
             type: boolean
             description: If set, the channel is used in bipolar mode

         required:
           - reg

         unevaluatedProperties: false

     required:
       - '#address-cells'
       - '#size-cells'

     unevaluatedProperties: false


Regards
Sai krishna


quoted
linux-xlnx/Documentation/devicetree/bindings/iio/adc/xilinx-xadc.yaml: properties:xlnx,channels:type: 'boolean' was expected
     hint: A vendor boolean property can use "type: boolean"
     from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml#
   LINT    ../Documentation/devicetree/bindings
   DTEX    Documentation/devicetree/bindings/iio/adc/xilinx-xadc.example.dts
   DTC [C] Documentation/devicetree/bindings/iio/adc/xilinx-xadc.example.dtb


Regards
Sai Krishna
quoted
quoted
+  channels:
+    type: object
+    description: List of external channels that are connected to the ADC
+    properties:
+      '#address-cells':
+        const: 1
+      '#size-cells':
+        const: 0
+
+    patternProperties:
+      "^channel@([0-9]|1[0-6])$":
+        type: object
+        properties:
+          reg:
+            minimum: 0
+            maximum: 16
+            description: |
+              Pair of pins the channel is connected to:
+                0: VP/VN
+                1-16: VAUXP[0-15]/VAUXN[0-15]
+              Note each channel number should only be used at most once.
+
+          xlnx,bipolar:
+            type: boolean
+            description: If set, the channel is used in bipolar mode
+
+        required:
+          - reg
+
+        unevaluatedProperties: false
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help