Skip to contentSkip to conversation

ASoC: dt-bindings: max98388: add amplifier driver

PATCH In review “Ryan 2 participants 3 messages Jun 13, 2023 – Jun 15, 2023

Subsystems (4)
lore
Share & tools
lore

“Ryan

author
#0 lore raw

PATCH v3 1/2 ASoC: dt-bindings: max98388: add amplifier driver

From: Ryan Lee <[email protected]>

Add dt-bindings information for Analog Devices MAX98388 I2S Amplifier

---
Changes from v1:
Removed unnecessary blank line and description. Modified quotes.

Changes from v2:
No change.

 .../bindings/sound/adi,max98388.yaml          | 79 +++++++++++++++++++
 1 file changed, 79 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/adi,max98388.yaml
Documentation/devicetree/bindings/sound/adi,max98388.yaml new file +79 -0
new file mode 100644
index 000000000000..93ccd5905736
@@ -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
+
+  '#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>;
+        };
+    };

base-commit: 53ab6975c12d1ad86c599a8927e8c698b144d669

Signature · 1 line
2.34.1
author
#1 lore raw

PATCH v3 2/2 ASoC: max98388: add amplifier driver

From: Ryan Lee <[email protected]>

Added Analog Devices MAX98388 amplifier driver.
MAX98388 provides a PCM interface for audio data and a standard I2C interface for control data communication.

---
Changes from v1:
Fixed build warnings.
Changes from v2:
Modified 'reset_gpio' control code. 'dev_err_probe' for the error returns in i2c_probe function. Droped all wrappers.
Minor fixes for better readability.

 sound/soc/codecs/Kconfig    |   10 +
 sound/soc/codecs/Makefile   |    2 +
 sound/soc/codecs/max98388.c | 1013 +++++++++++++++++++++++++++++++++++
 sound/soc/codecs/max98388.h |  234 ++++++++
 4 files changed, 1259 insertions(+)
 create mode 100644 sound/soc/codecs/max98388.c
 create mode 100644 sound/soc/codecs/max98388.h
sound/soc/codecs/Kconfig +10 -0
index 1f68d18515a6..e579ef11beb4 100644
@@ -137,6 +137,7 @@ config SND_SOC_ALL_CODECS
 	imply SND_SOC_MAX98363
 	imply SND_SOC_MAX98373_I2C
 	imply SND_SOC_MAX98373_SDW
+	imply SND_SOC_MAX98388
 	imply SND_SOC_MAX98390
 	imply SND_SOC_MAX98396
 	imply SND_SOC_MAX9850
@@ -1175,6 +1176,15 @@ config SND_SOC_MAX98373_SDW
 	  interface for control data. Select this if MAX98373 is
 	  connected via soundwire.
 
+config SND_SOC_MAX98388
+	tristate "Analog Devices MAX98388 Speaker Amplifier"
+	depends on I2C
+	help
+	  Enable support for Analog Devices MAX98388 audio
+	  amplifier. The device provides a PCM interface for
+	  audio data and a standard I2C interface for control
+	  data communication.
+
 config SND_SOC_MAX98390
 	tristate "Maxim Integrated MAX98390 Speaker Amplifier"
 	depends on I2C
sound/soc/codecs/Makefile +2 -0
index 67f336a12d74..0fd003d432e5 100644
@@ -153,6 +153,7 @@ snd-soc-max98363-objs := max98363.o
 snd-soc-max98373-objs := max98373.o
 snd-soc-max98373-i2c-objs := max98373-i2c.o
 snd-soc-max98373-sdw-objs := max98373-sdw.o
+snd-soc-max98388-objs := max98388.o
 snd-soc-max98390-objs := max98390.o
 snd-soc-max98396-objs := max98396.o
 snd-soc-max9850-objs := max9850.o
@@ -525,6 +526,7 @@ obj-$(CONFIG_SND_SOC_MAX98363)	+= snd-soc-max98363.o
 obj-$(CONFIG_SND_SOC_MAX98373)	+= snd-soc-max98373.o
 obj-$(CONFIG_SND_SOC_MAX98373_I2C)   += snd-soc-max98373-i2c.o
 obj-$(CONFIG_SND_SOC_MAX98373_SDW)   += snd-soc-max98373-sdw.o
+obj-$(CONFIG_SND_SOC_MAX98388)	+= snd-soc-max98388.o
 obj-$(CONFIG_SND_SOC_MAX98390)	+= snd-soc-max98390.o
 obj-$(CONFIG_SND_SOC_MAX98396)	+= snd-soc-max98396.o
 obj-$(CONFIG_SND_SOC_MAX9850)	+= snd-soc-max9850.o
sound/soc/codecs/max98388.c new file +1013 -0

1,013 lines not on this page · raw message

sound/soc/codecs/max98388.h new file +234 -0

234 lines not on this page · raw message

Signature · 1 line
2.34.1
maintainer
#2 lore raw
In reply to “Ryan
Quoted 3 lines · “Ryan

Add dt-bindings information for Analog Devices MAX98388 I2S Amplifier

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/2] ASoC: dt-bindings: max98388: add amplifier driver

      commit: 4cab2d5faf7eff9896a15be3b301150b6fbfcaba
[2/2] ASoC: max98388: add amplifier driver
      commit: 6a8e1d46f0621c15d2993c5e847f4f264102f93d

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark