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

From: Sai Krishna Potthuri

Date: Thu Mar 19 2026 - 11:13:14 EST


Hi David Lechner,

On 3/19/2026 8:28 PM, David Lechner wrote:
On 3/19/26 9:49 AM, Sai Krishna Potthuri wrote:
Hi David Lechner,

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

On 2/21/2026 4:08 PM, Krzysztof Kozlowski wrote:
On Fri, Feb 20, 2026 at 11:09:41AM +0530, Sai Krishna Potthuri wrote:
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...

+  - 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?

+
+$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.

Is the code below the code that causes the error?

No, the below code is not creating the error but Krzysztof asked the question on this code,
"Why this is a def, not used directly? I see only one usage of this def."

I am saying if i don't use the def and use it directly i am seeing the error that i mentioned. So, asking is there any better way to handle this case other than using def.

Regards
Sai Krishna



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

  $defs:
  channels:

Is this indent bug just from copying to email or does it exist in
the source that is causing the error?

    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






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


+  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