Thread (3 messages) flat view 3 messages, 2 authors, 8d ago

Re: [PATCH] dt-bindings: iio: adc: xlnx,xadc: Convert to DT schema

From: sashiko-bot@kernel.org
Date: 2026-09-14 03:08:34

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] Missing `required` constraints for `#address-cells` and `#size-cells` under the `xlnx,channels` node.
- [Medium] The `xlnx,external-mux-channel` property is not conditionally required in the schema when `xlnx,external-mux` is configured.
--

commit 26fef0c106376ac6892ddac0175e6b4bb799f5f4
Author: Quchaosheng [off-list ref]

dt-bindings: iio: adc: xlnx,xadc: Convert to DT schema

This commit converts the Xilinx XADC and System Monitor bindings from
free-form text to DT schema format. The xlnx,channels container and external
channels are now described as a nested object to validate them.
quoted hunk ↗ jump to hunk
diff --git a/Documentation/devicetree/bindings/iio/adc/xlnx,xadc.yaml b/Documentation/devicetree/bindings/iio/adc/xlnx,xadc.yaml
new file mode 100644
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/adc/xlnx,xadc.yaml
[ ... ]
+  xlnx,external-mux:
+    description:
+      External multiplexer mode. When omitted no external multiplexer is
+      assumed to be used.
+    enum: [none, single, dual]
+    default: none
+
+  xlnx,external-mux-channel:
+    description:
+      Which pair of pins is used to sample data in external multiplexer mode.
+      In single mode the valid range is 0 to 16, in dual mode 1 to 8. This
+      property is required when external multiplexer mode is used and is
+      otherwise ignored.
[Severity: Medium]
Does this property need an allOf or if-then block to programmatically enforce
the requirement? The description mentions it is required when external
multiplexer mode is used, but the schema lacks the conditional requirement
logic. If a device tree configures xlnx,external-mux to single or dual but
omits xlnx,external-mux-channel, the schema validation will succeed, but the
driver probe will fail at runtime.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    minimum: 0
+    maximum: 16
+
+  xlnx,channels:
+    description:
+      Container for the external channels connected to the ADC. When this
+      node is absent no external channels are assumed to be connected.
+    type: object
+    additionalProperties: false
+
+    properties:
+      '#address-cells':
+        const: 1
+
+      '#size-cells':
+        const: 0
[Severity: Medium]
Are we missing a required list for these properties under the xlnx,channels
node? Incomplete device tree nodes that omit the #address-cells and
#size-cells properties will silently pass schema validation, despite
containing child nodes with unit addresses. This violates standard devicetree
semantics and fails to enforce the correct structure.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260914030226.437638-1-quchaosheng000406@163.com?part=1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help