2023-06-08 06:34:43

by “Ryan

[permalink] [raw]
Subject: [PATCH 1/2] ASoC: dt-bindings: max98388: add amplifier driver

From: Ryan Lee <[email protected]>

Add dt-bindings information for Analog Devices MAX98388 I2S Amplifier

Signed-off-by: Ryan Lee <[email protected]>
---
.../bindings/sound/adi,max98388.yaml | 79 +++++++++++++++++++
1 file changed, 79 insertions(+)
create mode 100644 Documentation/devicetree/bindings/sound/adi,max98388.yaml

diff --git a/Documentation/devicetree/bindings/sound/adi,max98388.yaml b/Documentation/devicetree/bindings/sound/adi,max98388.yaml
new file mode 100644
index 000000000000..fc0ac8d8c3ae
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/adi,max98388.yaml
@@ -0,0 +1,79 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/adi,max98388.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices MAX98388 Speaker Amplifier
+
+maintainers:
+ - Ryan Lee <[email protected]>
+
+description:
+ The MAX98388 is a mono Class-D speaker amplifier with I/V feedback.
+ The device provides a PCM interface for audio data and a standard
+ I2C interface for control data communication.
+
+allOf:
+ - $ref: dai-common.yaml#
+
+properties:
+ compatible:
+ enum:
+ - adi,max98388
+ reg:
+ maxItems: 1
+ description: I2C address of the device.
+
+ '#sound-dai-cells':
+ const: 0
+
+ adi,vmon-slot-no:
+ description: slot number of the voltage feedback monitor
+ $ref: "/schemas/types.yaml#/definitions/uint32"
+ minimum: 0
+ maximum: 15
+ default: 0
+
+ adi,imon-slot-no:
+ description: slot number of the current feedback monitor
+ $ref: "/schemas/types.yaml#/definitions/uint32"
+ minimum: 0
+ maximum: 15
+ default: 1
+
+ adi,interleave-mode:
+ description:
+ For cases where a single combined channel for the I/V feedback data
+ is not sufficient, the device can also be configured to share
+ a single data output channel on alternating frames.
+ In this configuration, the current and voltage data will be frame
+ interleaved on a single output channel.
+ type: boolean
+
+ reset-gpios:
+ maxItems: 1
+
+required:
+ - compatible
+ - reg
+ - "#sound-dai-cells"
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/gpio/gpio.h>
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ max98388: amplifier@39 {
+ compatible = "adi,max98388";
+ reg = <0x39>;
+ #sound-dai-cells = <0>;
+ adi,vmon-slot-no = <0>;
+ adi,imon-slot-no = <1>;
+ adi,interleave-mode;
+ reset-gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
+ };
+ };
--
2.34.1



2023-06-08 07:47:30

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 1/2] ASoC: dt-bindings: max98388: add amplifier driver

On 08/06/2023 07:42, “Ryan wrote:
> From: Ryan Lee <[email protected]>
>
> Add dt-bindings information for Analog Devices MAX98388 I2S Amplifier
>
> Signed-off-by: Ryan Lee <[email protected]>

Thank you for your patch. There is something to discuss/improve.

> +
> +allOf:
> + - $ref: dai-common.yaml#
> +
> +properties:
> + compatible:
> + enum:
> + - adi,max98388

Blank line

> + reg:
> + maxItems: 1
> + description: I2C address of the device.

Drop description, it's obvious.

> +
> + '#sound-dai-cells':
> + const: 0
> +
> + adi,vmon-slot-no:
> + description: slot number of the voltage feedback monitor
> + $ref: "/schemas/types.yaml#/definitions/uint32"

Drop quotes.

> + minimum: 0
> + maximum: 15
> + default: 0
> +
> + adi,imon-slot-no:
> + description: slot number of the current feedback monitor
> + $ref: "/schemas/types.yaml#/definitions/uint32"

Drop quotes.

> + minimum: 0
> + maximum: 15
> + default: 1
> +
> + adi,interleave-mode:
> + description:
> + For cases where a single combined channel for the I/V feedback data
> + is not sufficient, the device can also be configured to share
> + a single data output channel on alternating frames.
> + In this configuration, the current and voltage data will be frame
> + interleaved on a single output channel.
> + type: boolean
> +
> + reset-gpios:
> + maxItems: 1
> +
> +required:
> + - compatible
> + - reg
> + - "#sound-dai-cells"

Keep consistent quotes - either ' or "

> +
> +unevaluatedProperties: false


Best regards,
Krzysztof


2023-06-10 00:05:38

by Lee, RyanS

[permalink] [raw]
Subject: RE: [PATCH 1/2] ASoC: dt-bindings: max98388: add amplifier driver

> -----Original Message-----
> From: Krzysztof Kozlowski <[email protected]>
> Sent: Thursday, June 8, 2023 12:18 AM
> To: “Ryan <[email protected]>; [email protected];
> [email protected]; [email protected];
> [email protected]; [email protected]; [email protected];
> [email protected]; Lee, RyanS <[email protected]>;
> [email protected]; [email protected];
> [email protected]; [email protected];
> [email protected]; [email protected];
> [email protected]; [email protected];
> [email protected]; [email protected]
> Cc: [email protected]
> Subject: Re: [PATCH 1/2] ASoC: dt-bindings: max98388: add amplifier driver
>
> [External]
>
> On 08/06/2023 07:42, “Ryan wrote:
> > From: Ryan Lee <[email protected]>
> >
> > Add dt-bindings information for Analog Devices MAX98388 I2S Amplifier
> >
> > Signed-off-by: Ryan Lee <[email protected]>
>
> Thank you for your patch. There is something to discuss/improve.
Thanks for the comments. I shall fix the issues and submit the patch again.

>
> > +
> > +allOf:
> > + - $ref: dai-common.yaml#
> > +
> > +properties:
> > + compatible:
> > + enum:
> > + - adi,max98388
>
> Blank line
>
> > + reg:
> > + maxItems: 1
> > + description: I2C address of the device.
>
> Drop description, it's obvious.
>
> > +
> > + '#sound-dai-cells':
> > + const: 0
> > +
> > + adi,vmon-slot-no:
> > + description: slot number of the voltage feedback monitor
> > + $ref: "/schemas/types.yaml#/definitions/uint32"
>
> Drop quotes.
>
> > + minimum: 0
> > + maximum: 15
> > + default: 0
> > +
> > + adi,imon-slot-no:
> > + description: slot number of the current feedback monitor
> > + $ref: "/schemas/types.yaml#/definitions/uint32"
>
> Drop quotes.
>
> > + minimum: 0
> > + maximum: 15
> > + default: 1
> > +
> > + adi,interleave-mode:
> > + description:
> > + For cases where a single combined channel for the I/V feedback data
> > + is not sufficient, the device can also be configured to share
> > + a single data output channel on alternating frames.
> > + In this configuration, the current and voltage data will be frame
> > + interleaved on a single output channel.
> > + type: boolean
> > +
> > + reset-gpios:
> > + maxItems: 1
> > +
> > +required:
> > + - compatible
> > + - reg
> > + - "#sound-dai-cells"
>
> Keep consistent quotes - either ' or "
>
> > +
> > +unevaluatedProperties: false
>
>
> Best regards,
> Krzysztof