Devicetree
 help / color / mirror / Atom feed
* [PATCH] ASoC: dt-bindings: sound: asahi-kasei,ak4118: Convert DT schema
@ 2026-05-24 12:33 Manish Baing
  2026-05-24 12:44 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Manish Baing @ 2026-05-24 12:33 UTC (permalink / raw)
  To: lgirdwood, broonie, robh, krzk+dt, conor+dt, peron.clem
  Cc: linux-sound, devicetree, linux-kernel, manishbaing2789

Convert the Asahi Kasei AK4118 S/PDIF transceiver bindings from
text format to YAML schema.

Signed-off-by: Manish Baing <manishbaing2789@gmail.com>
---
 .../devicetree/bindings/sound/ak4118.txt      | 22 -------
 .../bindings/sound/asahi-kasei,ak4118.yaml    | 57 +++++++++++++++++++
 2 files changed, 57 insertions(+), 22 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/sound/ak4118.txt
 create mode 100644 Documentation/devicetree/bindings/sound/asahi-kasei,ak4118.yaml

diff --git a/Documentation/devicetree/bindings/sound/ak4118.txt b/Documentation/devicetree/bindings/sound/ak4118.txt
deleted file mode 100644
index 6e11a2f7404c..000000000000
--- a/Documentation/devicetree/bindings/sound/ak4118.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-AK4118 S/PDIF transceiver
-
-This device supports I2C mode.
-
-Required properties:
-
-- compatible : "asahi-kasei,ak4118"
-- reg : The I2C address of the device for I2C
-- reset-gpios: A GPIO specifier for the reset pin
-- irq-gpios: A GPIO specifier for the IRQ pin
-
-Example:
-
-&i2c {
-	ak4118: ak4118@13 {
-		#sound-dai-cells = <0>;
-		compatible = "asahi-kasei,ak4118";
-		reg = <0x13>;
-		reset-gpios = <&gpio 0 GPIO_ACTIVE_LOW>
-		irq-gpios = <&gpio 1 GPIO_ACTIVE_HIGH>;
-	};
-};
diff --git a/Documentation/devicetree/bindings/sound/asahi-kasei,ak4118.yaml b/Documentation/devicetree/bindings/sound/asahi-kasei,ak4118.yaml
new file mode 100644
index 000000000000..54cee45ac051
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/asahi-kasei,ak4118.yaml
@@ -0,0 +1,57 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/asahi-kasei,ak4118.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Asahi Kasei AK4118 Digital Audio Transceiver
+
+maintainers:
+  - Clément Péron <peron.clem@gmail.com>
+
+allOf:
+  - $ref: dai-common.yaml#
+
+properties:
+  compatible:
+    const: asahi-kasei,ak4118
+
+  reg:
+    maxItems: 1
+    description: I2C address of the device
+
+  "#sound-dai-cells":
+    const: 0
+
+  interrupts:
+    maxItems: 1
+
+  reset-gpios:
+    maxItems: 1
+    description: GPIO used for the Reset pin
+
+required:
+  - compatible
+  - reg
+  - "#sound-dai-cells"
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        audio-codec@13 {
+            compatible = "asahi-kasei,ak4118";
+            reg = <0x13>;
+            #sound-dai-cells = <0>;
+            interrupt-parent = <&gpio1>;
+            interrupts = <0 IRQ_TYPE_EDGE_RISING>;
+            reset-gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
+        };
+    };
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ASoC: dt-bindings: sound: asahi-kasei,ak4118: Convert DT schema
  2026-05-24 12:33 [PATCH] ASoC: dt-bindings: sound: asahi-kasei,ak4118: Convert DT schema Manish Baing
@ 2026-05-24 12:44 ` sashiko-bot
  0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-05-24 12:44 UTC (permalink / raw)
  To: Manish Baing; +Cc: devicetree, conor+dt, robh

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Critical] The schema conversion incorrectly replaces the 'irq-gpios' property with 'interrupts', breaking compatibility with existing device trees and the driver.
- [High] The 'reset-gpios' and 'irq-gpios' properties are missing from the YAML 'required' list, weakening schema constraints.
--

commit 0e4f9fd8065be8e0dd8e4f0d56bb269c25f2d4bb
Author: Manish Baing <manishbaing2789@gmail.com>

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

Convert the Asahi Kasei AK4118 S/PDIF transceiver bindings from text format
to YAML schema.

> diff --git a/Documentation/devicetree/bindings/sound/asahi-kasei,ak4118.yaml b/Documentation/devicetree/bindings/sound/asahi-kasei,ak4118.yaml
> new file mode 100644
> index 0000000000000..54cee45ac0513
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/asahi-kasei,ak4118.yaml
[ ... ]
> @@ -0,0 +1,57 @@
[ ... ]
> +  "#sound-dai-cells":
> +    const: 0
> +
> +  interrupts:
> +    maxItems: 1

[Severity: Critical]
Does changing the property from irq-gpios to interrupts cause a regression
for existing device trees and the driver?

Looking at the original text binding, irq-gpios was specified. The driver in
sound/soc/codecs/ak4118.c fetches the interrupt line as a gpio:

devm_gpiod_get(&i2c->dev, "irq", GPIOD_IN)

Since the schema sets unevaluatedProperties to false, existing device trees
containing irq-gpios will fail validation.

Additionally, if new device trees use interrupts instead, won't the driver
fail during probe due to a missing gpio?

> +
> +  reset-gpios:
> +    maxItems: 1
> +    description: GPIO used for the Reset pin
> +
> +required:
> +  - compatible
> +  - reg
> +  - "#sound-dai-cells"

[Severity: High]
Should reset-gpios and irq-gpios be included in this required list?

The original ak4118.txt binding marked both of these as required properties.
The driver unconditionally calls devm_gpiod_get() for both reset and irq
rather than the optional variants.

Omitting them here could allow incomplete device trees to silently pass
schema validation but still fail at runtime during the driver probe.

> +
> +unevaluatedProperties: false

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260524123415.108301-1-manishbaing2789@gmail.com?part=1

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-05-24 12:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-24 12:33 [PATCH] ASoC: dt-bindings: sound: asahi-kasei,ak4118: Convert DT schema Manish Baing
2026-05-24 12:44 ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox