Skip to contentSkip to conversation

dt-bindings: add simple-audio-mux binding

PATCH In review Alexandre Belloni 3 participants 5 messages Dec 5, 2020 – Dec 11, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 dt-bindings: add simple-audio-mux binding

Add devicetree documentation for simple audio multiplexers

---
Cc: Rob Herring <[email protected]>

 .../bindings/sound/simple-audio-mux.yaml      | 41 +++++++++++++++++++
 1 file changed, 41 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/simple-audio-mux.yaml
Documentation/devicetree/bindings/sound/simple-audio-mux.yaml new file +41 -0
new file mode 100644
index 000000000000..5986d1fcbb54
@@ -0,0 +1,41 @@
+# SPDX-License-Identifier: (GPL-2.0+ OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/simple-audio-mux.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Simple Audio Multiplexer
+
+maintainers:
+  - Alexandre Belloni <[email protected]>
+
+description: |
+  Simple audio multiplexers are driven using gpios, allowing to select which of
+  their input line is connected to the output line.
+
+properties:
+  compatible:
+    const: simple-audio-mux
+
+  mux-gpios:
+    description: |
+      GPIOs used to select the input line.
+
+  sound-name-prefix:
+    $ref: /schemas/types.yaml#/definitions/string
+    description:
+      Used as prefix for sink/source names of the component. Must be a
+      unique string among multiple instances of the same component.
+
+required:
+  - compatible
+  - mux-gpios
+
+additionalProperties: false
+
+examples:
+  - |
+    mux {
+        compatible = "simple-audio-mux";
+        mux-gpios = <&gpio 3 0>;
+    };
Signature · 1 line
2.28.0
#1 lore raw

PATCH 2/2 ASoC: add simple-mux

Add a driver for simple mux driven by gpios. It currently only supports one gpio, muxing one of two inputs to a single output.

---
 sound/soc/codecs/Kconfig      |   5 ++
 sound/soc/codecs/Makefile     |   4 ++
 sound/soc/codecs/simple-mux.c | 124 ++++++++++++++++++++++++++++++++++
 3 files changed, 133 insertions(+)
 create mode 100644 sound/soc/codecs/simple-mux.c
sound/soc/codecs/Kconfig +5 -0
index 34c6dd04b85a..3847e490f795 100644
@@ -181,6 +181,7 @@ config SND_SOC_ALL_CODECS
 	imply SND_SOC_SGTL5000
 	imply SND_SOC_SI476X
 	imply SND_SOC_SIMPLE_AMPLIFIER
+	imply SND_SOC_SIMPLE_MUX
 	imply SND_SOC_SIRF_AUDIO_CODEC
 	imply SND_SOC_SPDIF
 	imply SND_SOC_SSM2305
@@ -1240,6 +1241,10 @@ config SND_SOC_SIMPLE_AMPLIFIER
 	tristate "Simple Audio Amplifier"
 	select GPIOLIB
 
+config SND_SOC_SIMPLE_MUX
+	tristate "Simple Audio Mux"
+	select GPIOLIB
+
 config SND_SOC_SIRF_AUDIO_CODEC
 	tristate "SiRF SoC internal audio codec"
 	select REGMAP_MMIO
sound/soc/codecs/Makefile +4 -0
index 11ce98c25d6c..90f1a2b7ade0 100644
@@ -305,6 +305,8 @@ snd-soc-tpa6130a2-objs := tpa6130a2.o
 snd-soc-tas2552-objs := tas2552.o
 snd-soc-tas2562-objs := tas2562.o
 snd-soc-tas2764-objs := tas2764.o
+# Mux
+snd-soc-simple-mux-objs := simple-mux.o
 
 obj-$(CONFIG_SND_SOC_88PM860X)	+= snd-soc-88pm860x.o
 obj-$(CONFIG_SND_SOC_AB8500_CODEC)	+= snd-soc-ab8500-codec.o
@@ -613,3 +615,5 @@ obj-$(CONFIG_SND_SOC_MAX9877)	+= snd-soc-max9877.o
 obj-$(CONFIG_SND_SOC_MAX98504)	+= snd-soc-max98504.o
 obj-$(CONFIG_SND_SOC_SIMPLE_AMPLIFIER)	+= snd-soc-simple-amplifier.o
 obj-$(CONFIG_SND_SOC_TPA6130A2)	+= snd-soc-tpa6130a2.o
+# Mux
+obj-$(CONFIG_SND_SOC_SIMPLE_MUX)	+= snd-soc-simple-mux.o
sound/soc/codecs/simple-mux.c new file +124 -0

124 lines not on this page · raw message

Signature · 1 line
2.28.0
maintainer
#2 lore raw
In reply to Alexandre Belloni
Quoted 1 line · Alexandre Belloni

Add devicetree documentation for simple audio multiplexers

Applied to

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

Thanks!

[1/2] dt-bindings: add simple-audio-mux binding

      commit: f17a7db22b8ff1688f30bb66aeeaa8cc088e5230
[2/2] ASoC: add simple-mux
      commit: 342fbb7578d1741ff646d7b08e14e8753267b9fa

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

maintainer
#3 lore raw
In reply to Alexandre Belloni
Quoted 16 lines · Alexandre Belloni

Add devicetree documentation for simple audio multiplexers

---
Cc: Rob Herring <[email protected]>

 .../bindings/sound/simple-audio-mux.yaml      | 41 +++++++++++++++++++
 1 file changed, 41 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/simple-audio-mux.yaml
Documentation/devicetree/bindings/sound/simple-audio-mux.yaml new file +0 -0
new file mode 100644
index 000000000000..5986d1fcbb54

Documentation/devicetree/bindings/sound/simple-audio-mux.yaml line 10

Quoted 10 lines
Documentation/devicetree/bindings/sound/simple-audio-mux.yaml new file +10 -0
@@ -0,0 +1,41 @@
+# SPDX-License-Identifier: (GPL-2.0+ OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/simple-audio-mux.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Simple Audio Multiplexer
+
+maintainers:
+  - Alexandre Belloni <[email protected]>

typo

Documentation/devicetree/bindings/sound/simple-audio-mux.yaml line 14

Quoted 4 lines
Documentation/devicetree/bindings/sound/simple-audio-mux.yaml new file +4 -0
+
+description: |
+  Simple audio multiplexers are driven using gpios, allowing to select which of
+  their input line is connected to the output line.

What's wrong with the generic mux binding and driver(s)?

Quoted 30 lines
Documentation/devicetree/bindings/sound/simple-audio-mux.yaml new file +27 -0
+
+properties:
+  compatible:
+    const: simple-audio-mux
+
+  mux-gpios:
+    description: |
+      GPIOs used to select the input line.
+
+  sound-name-prefix:
+    $ref: /schemas/types.yaml#/definitions/string
+    description:
+      Used as prefix for sink/source names of the component. Must be a
+      unique string among multiple instances of the same component.
+
+required:
+  - compatible
+  - mux-gpios
+
+additionalProperties: false
+
+examples:
+  - |
+    mux {
+        compatible = "simple-audio-mux";
+        mux-gpios = <&gpio 3 0>;
+    };
Signature · 1 line
2.28.0
#4 lore raw
Quoted 2 lines · Rob Herring

What's wrong with the generic mux binding and driver(s)?

The main issue is that the driver doesn't expose audio routes and so DAPM can't do its job properly. Also, it is more convenient to have the control part of the ALSA sound card which is not possible with gpio-mux.

You could argue that we can have simple-audio-mux use the mux subsystem but we still need a new binding and driver anyway, just as we have io-channel-mux or i2c-mux. I'm not sure this would be useful but I can be convinced otherwise.

Quoted 30 lines
Quoted 30 lines
Documentation/devicetree/bindings/sound/simple-audio-mux.yaml new file +27 -0
+
+properties:
+  compatible:
+    const: simple-audio-mux
+
+  mux-gpios:
+    description: |
+      GPIOs used to select the input line.
+
+  sound-name-prefix:
+    $ref: /schemas/types.yaml#/definitions/string
+    description:
+      Used as prefix for sink/source names of the component. Must be a
+      unique string among multiple instances of the same component.
+
+required:
+  - compatible
+  - mux-gpios
+
+additionalProperties: false
+
+examples:
+  - |
+    mux {
+        compatible = "simple-audio-mux";
+        mux-gpios = <&gpio 3 0>;
+    };
Signature · 1 line
2.28.0
Signature · 3 lines
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com