Skip to contentSkip to conversation

ASoC: dt-bindings: sound: asahi-kasei,ak5386: Convert DT schema

PATCH Superseded Manish Baing 2 participants 2 messages May 24

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: dt-bindings: sound: asahi-kasei,ak5386: Convert DT schema

Convert the Asahi Kasei AK5386 ADC binding from text format to YAML schema.

---
 .../devicetree/bindings/sound/ak5386.txt      | 23 ----------
 .../bindings/sound/asahi-kasei,ak5386.yaml    | 44 +++++++++++++++++++
 2 files changed, 44 insertions(+), 23 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/sound/ak5386.txt
 create mode 100644 Documentation/devicetree/bindings/sound/asahi-kasei,ak5386.yaml
Documentation/devicetree/bindings/sound/ak5386.txt deleted +0 -23
deleted file mode 100644
index ec3df3abba0c..000000000000
@@ -1,23 +0,0 @@
-AK5386 Single-ended 24-Bit 192kHz delta-sigma ADC
-
-This device has no control interface.
-
-Required properties:
-
-  - compatible : "asahi-kasei,ak5386"
-
-Optional properties:
-
-  - reset-gpio : a GPIO spec for the reset/power down pin.
-		 If specified, it will be deasserted at probe time.
-  - va-supply : a regulator spec, providing 5.0V
-  - vd-supply : a regulator spec, providing 3.3V
-
-Example:
-
-spdif: ak5386@0 {
-	compatible = "asahi-kasei,ak5386";
-	reset-gpio = <&gpio0 23>;
-	va-supply = <&vdd_5v0_reg>;
-	vd-supply = <&vdd_3v3_reg>;
-};
Documentation/devicetree/bindings/sound/asahi-kasei,ak5386.yaml new file +44 -0

44 lines not on this page · raw message

Signature · 1 line
2.43.0
#1 lore raw
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [Medium] The schema uses `additionalProperties: false` but omits a reference to `dai-common.yaml#` and…

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] The schema uses additionalProperties: false but omits a reference to dai-common.yaml# and the #sound-dai-cells property, which will cause validation failures for valid audio configurations.
- [Medium] The new schema breaks backward compatibility by rejecting the legacy reset-gpio property that was documented in the original text binding.
--

commit 53f12bd4c4466e68926d73a25cd532a103036343
Author: Manish Baing <[email protected]>

ASoC: dt-bindings: sound: asahi-kasei,ak5386: Convert DT schema

This commit converts the Asahi Kasei AK5386 ADC binding from the legacy text format to the YAML schema format.

Quoted 4 lines
Documentation/devicetree/bindings/sound/ak5386.txt deleted +0 -0
deleted file mode 100644

[ ... ]

Quoted 4 lines
Documentation/devicetree/bindings/sound/ak5386.txt deleted +0 -4
-Optional properties:
-
-  - reset-gpio : a GPIO spec for the reset/power down pin.
-		 If specified, it will be deasserted at probe time.

[ ... ]

Quoted 4 lines
Documentation/devicetree/bindings/sound/asahi-kasei,ak5386.yaml new file +0 -0
new file mode 100644

[ ... ]

Documentation/devicetree/bindings/sound/asahi-kasei,ak5386.yaml line 22

Quoted 7 lines
Documentation/devicetree/bindings/sound/asahi-kasei,ak5386.yaml new file +7 -0
+properties:
+  compatible:
+    const: asahi-kasei,ak5386
+
+  reset-gpios:
+    maxItems: 1
+    description: A GPIO spec for the reset/power down pin.

[Severity: Medium]
Does this break backward compatibility with existing device trees?

The original text binding explicitly documented the reset pin as reset-gpio (singular), and existing device trees may be using that property.

Since the driver uses devm_gpiod_get_optional() which handles the legacy -gpio suffix automatically, the driver still works, but the new schema will reject it due to additionalProperties: false.

Should the legacy reset-gpio property be defined here, perhaps marked as deprecated, to maintain DT ABI backwards compatibility?

Documentation/devicetree/bindings/sound/asahi-kasei,ak5386.yaml line 33

Quoted 11 lines
Documentation/devicetree/bindings/sound/asahi-kasei,ak5386.yaml new file +11 -0
+
+  va-supply:
+    description: Power supply for the analog section.
+
+  vd-supply:
+    description: Power supply for the digital section.
+
+required:
+  - compatible
+
+additionalProperties: false

[Severity: Medium]
Will this reject valid audio configurations?

The AK5386 functions as an audio codec and Digital Audio Interface (DAI) provider. Standard ASoC generic sound cards require the codec node to have the #sound-dai-cells property to resolve the codec phandle.

Because the schema enforces additionalProperties: false without defining #sound-dai-cells or referencing dai-common.yaml#, it seems dtbs_check will fail on valid device trees.

Should this include a reference to dai-common.yaml# and use
unevaluatedProperties: false instead?

[ ... ]

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1