All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: dt-bindings: ak4458: Convert to dtschema
@ 2023-03-25 20:10 Saalim Quadri
  2023-03-25 20:15 ` Saalim Quadri
  2023-03-26  9:26 ` Krzysztof Kozlowski
  0 siblings, 2 replies; 5+ messages in thread
From: Saalim Quadri @ 2023-03-25 20:10 UTC (permalink / raw)
  To: shengjiu.wang, broonie, robh+dt, krzysztof.kozlowski+dt, daniel.baluta
  Cc: alsa-devel, devicetree, linux-kernel, Saalim Quadri

Convert the AK4458 audio DAC bindings to DT schema.

Signed-off-by: Saalim Quadri <danascape@gmail.com>
---
 .../devicetree/bindings/sound/ak4458.txt      | 28 ---------
 .../bindings/sound/asahi-kasei,ak4458.yaml    | 62 +++++++++++++++++++
 2 files changed, 62 insertions(+), 28 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/sound/ak4458.txt
 create mode 100644 Documentation/devicetree/bindings/sound/asahi-kasei,ak4458.yaml

diff --git a/Documentation/devicetree/bindings/sound/ak4458.txt b/Documentation/devicetree/bindings/sound/ak4458.txt
deleted file mode 100644
index 0416c14895d6..000000000000
--- a/Documentation/devicetree/bindings/sound/ak4458.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-AK4458 audio DAC
-
-This device supports I2C mode.
-
-Required properties:
-
-- compatible : "asahi-kasei,ak4458" or "asahi-kasei,ak4497"
-- reg : The I2C address of the device for I2C
-
-Optional properties:
-- reset-gpios: A GPIO specifier for the power down & reset pin
-- mute-gpios: A GPIO specifier for the soft mute pin
-- AVDD-supply: Analog power supply
-- DVDD-supply: Digital power supply
-- dsd-path: Select DSD input pins for ak4497
-            0: select #16, #17, #19 pins
-            1: select #3, #4, #5 pins
-
-Example:
-
-&i2c {
-	ak4458: dac@10 {
-		compatible = "asahi-kasei,ak4458";
-		reg = <0x10>;
-		reset-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>
-		mute-gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>
-	};
-};
diff --git a/Documentation/devicetree/bindings/sound/asahi-kasei,ak4458.yaml b/Documentation/devicetree/bindings/sound/asahi-kasei,ak4458.yaml
new file mode 100644
index 000000000000..b97aee96fa17
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/asahi-kasei,ak4458.yaml
@@ -0,0 +1,62 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/asahi-kasei,ak4458.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: AK4458 audio DAC
+
+maintainers:
+  - Shengjiu Wang <shengjiu.wang@nxp.com>
+
+properties:
+  compatible:
+    enum:
+      - asahi-kasei,ak4458
+      - asahi-kasei,ak4497
+
+  reg:
+    maxItems: 1
+
+  avdd-supply:
+    description: Analog power supply
+
+  dvdd-supply:
+    description: Digital power supply
+
+  reset-gpios:
+    maxItems: 1
+
+  mute-gpios:
+    maxItems: 1
+    description:
+      GPIO used to mute all the outputs
+
+  dsd-path:
+    description: Select DSD input pins for ak4497
+    $ref: /schemas/types.yaml#/definitions/uint32
+    oneOf:
+      - const: 0
+        description: select #16, #17, #19 pins
+      - const: 1
+        description: select #3, #4, #5 pins
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        ak4458: codec@10 {
+            compatible = "asahi-kasei,ak4458";
+            reg = <0x10>;
+            reset-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
+            mute-gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;
+        };
+    };
-- 
2.34.1


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

* Re: [PATCH] ASoC: dt-bindings: ak4458: Convert to dtschema
  2023-03-25 20:10 [PATCH] ASoC: dt-bindings: ak4458: Convert to dtschema Saalim Quadri
@ 2023-03-25 20:15 ` Saalim Quadri
  2023-03-26  9:26 ` Krzysztof Kozlowski
  1 sibling, 0 replies; 5+ messages in thread
From: Saalim Quadri @ 2023-03-25 20:15 UTC (permalink / raw)
  To: danascape
  Cc: alsa-devel, broonie, daniel.baluta, devicetree,
	krzysztof.kozlowski+dt, linux-kernel, robh+dt, shengjiu.wang

> +  dsd-path:
> +    description: Select DSD input pins for ak4497
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    oneOf:
> +      - const: 0
> +        description: select #16, #17, #19 pins
> +      - const: 1
> +        description: select #3, #4, #5 pins

I hope if you can review this part correctly.

Thank you,

Saalim

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

* Re: [PATCH] ASoC: dt-bindings: ak4458: Convert to dtschema
  2023-03-25 20:10 [PATCH] ASoC: dt-bindings: ak4458: Convert to dtschema Saalim Quadri
  2023-03-25 20:15 ` Saalim Quadri
@ 2023-03-26  9:26 ` Krzysztof Kozlowski
  2023-03-26 12:58   ` Saalim Quadri
  1 sibling, 1 reply; 5+ messages in thread
From: Krzysztof Kozlowski @ 2023-03-26  9:26 UTC (permalink / raw)
  To: Saalim Quadri, shengjiu.wang, broonie, robh+dt,
	krzysztof.kozlowski+dt, daniel.baluta
  Cc: alsa-devel, devicetree, linux-kernel

On 25/03/2023 21:10, Saalim Quadri wrote:
> Convert the AK4458 audio DAC bindings to DT schema.
> 
> Signed-off-by: Saalim Quadri <danascape@gmail.com>
> ---
>  .../devicetree/bindings/sound/ak4458.txt      | 28 ---------
>  .../bindings/sound/asahi-kasei,ak4458.yaml    | 62 +++++++++++++++++++
>  2 files changed, 62 insertions(+), 28 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/sound/ak4458.txt
>  create mode 100644 Documentation/devicetree/bindings/sound/asahi-kasei,ak4458.yaml
> 
> diff --git a/Documentation/devicetree/bindings/sound/ak4458.txt b/Documentation/devicetree/bindings/sound/ak4458.txt
> deleted file mode 100644
> index 0416c14895d6..000000000000
> --- a/Documentation/devicetree/bindings/sound/ak4458.txt
> +++ /dev/null
> @@ -1,28 +0,0 @@
> -AK4458 audio DAC
> -
> -This device supports I2C mode.
> -
> -Required properties:
> -
> -- compatible : "asahi-kasei,ak4458" or "asahi-kasei,ak4497"
> -- reg : The I2C address of the device for I2C
> -
> -Optional properties:
> -- reset-gpios: A GPIO specifier for the power down & reset pin
> -- mute-gpios: A GPIO specifier for the soft mute pin
> -- AVDD-supply: Analog power supply
> -- DVDD-supply: Digital power supply
> -- dsd-path: Select DSD input pins for ak4497
> -            0: select #16, #17, #19 pins
> -            1: select #3, #4, #5 pins
> -
> -Example:
> -
> -&i2c {
> -	ak4458: dac@10 {
> -		compatible = "asahi-kasei,ak4458";
> -		reg = <0x10>;
> -		reset-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>
> -		mute-gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>
> -	};
> -};
> diff --git a/Documentation/devicetree/bindings/sound/asahi-kasei,ak4458.yaml b/Documentation/devicetree/bindings/sound/asahi-kasei,ak4458.yaml
> new file mode 100644
> index 000000000000..b97aee96fa17
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/asahi-kasei,ak4458.yaml
> @@ -0,0 +1,62 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/sound/asahi-kasei,ak4458.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: AK4458 audio DAC
> +
> +maintainers:
> +  - Shengjiu Wang <shengjiu.wang@nxp.com>
> +
> +properties:
> +  compatible:
> +    enum:
> +      - asahi-kasei,ak4458
> +      - asahi-kasei,ak4497
> +
> +  reg:
> +    maxItems: 1
> +
> +  avdd-supply:
> +    description: Analog power supply
> +
> +  dvdd-supply:
> +    description: Digital power supply
> +
> +  reset-gpios:
> +    maxItems: 1
> +
> +  mute-gpios:
> +    maxItems: 1
> +    description:
> +      GPIO used to mute all the outputs
> +
> +  dsd-path:
> +    description: Select DSD input pins for ak4497
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    oneOf:
> +      - const: 0
> +        description: select #16, #17, #19 pins
> +      - const: 1
> +        description: select #3, #4, #5 pins
> +
> +required:
> +  - compatible
> +  - reg
> +

Based on driver:

allOf:
  - if:
      properties:
        compatible:
          enum:
            - ak4458.....
  then:
    properties:
      dsd-path: false

> +additionalProperties: false
> +
Best regards,
Krzysztof


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

* Re: [PATCH] ASoC: dt-bindings: ak4458: Convert to dtschema
  2023-03-26  9:26 ` Krzysztof Kozlowski
@ 2023-03-26 12:58   ` Saalim Quadri
  2023-03-26 14:49     ` Krzysztof Kozlowski
  0 siblings, 1 reply; 5+ messages in thread
From: Saalim Quadri @ 2023-03-26 12:58 UTC (permalink / raw)
  To: krzysztof.kozlowski
  Cc: alsa-devel, broonie, danascape, daniel.baluta, devicetree,
	krzysztof.kozlowski+dt, linux-kernel, robh+dt, shengjiu.wang

> allOf:
> - if:
>      properties:
>        compatible:
>          enum:
>            - ak4458.....
>  then:
>    properties:
>      dsd-path: false

Do we also require to add a descriptioon to explain the pins which will be selected based off on the value?
Or have you disabled it based on, that it is disabled for ak4458 codecs?

Thank you,

Saalim

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

* Re: [PATCH] ASoC: dt-bindings: ak4458: Convert to dtschema
  2023-03-26 12:58   ` Saalim Quadri
@ 2023-03-26 14:49     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2023-03-26 14:49 UTC (permalink / raw)
  To: Saalim Quadri
  Cc: alsa-devel, broonie, daniel.baluta, devicetree,
	krzysztof.kozlowski+dt, linux-kernel, robh+dt, shengjiu.wang

On 26/03/2023 14:58, Saalim Quadri wrote:
>> allOf:
>> - if:
>>      properties:
>>        compatible:
>>          enum:
>>            - ak4458.....
>>  then:
>>    properties:
>>      dsd-path: false
> 
> Do we also require to add a descriptioon to explain the pins which will be selected based off on the value?

Description where? What pins?

> Or have you disabled it based on, that it is disabled for ak4458 codecs?

What is disabled? The driver indicates the property is valid only for
ak4497.



Best regards,
Krzysztof


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

end of thread, other threads:[~2023-03-26 14:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-25 20:10 [PATCH] ASoC: dt-bindings: ak4458: Convert to dtschema Saalim Quadri
2023-03-25 20:15 ` Saalim Quadri
2023-03-26  9:26 ` Krzysztof Kozlowski
2023-03-26 12:58   ` Saalim Quadri
2023-03-26 14:49     ` Krzysztof Kozlowski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.