Skip to contentSkip to conversation

dt-bindings: sound: add Microsemi ZL38060 binding

PATCH In review Sven Van Asbroeck 2 participants 8 messages Apr 17, 2020 – Apr 21, 2020

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

PATCH v2 1/2 dt-bindings: sound: add Microsemi ZL38060 binding

Add devicetree binding for the Microsemi ZL38060 Connected Home Audio Processor.

---

Tree: v5.7-rc1

v1->v2:

- removed all properties related to amp-en-gpios
- removed 'mscc,load-firmware' property

For further details, see v1->v2 notes in 2nd patch.

 .../devicetree/bindings/sound/zl38060.yaml    | 69 +++++++++++++++++++
 1 file changed, 69 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/zl38060.yaml
Documentation/devicetree/bindings/sound/zl38060.yaml new file +69 -0
new file mode 100644
index 000000000000..338e2a13c775
@@ -0,0 +1,69 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/zl38060.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ZL38060 Connected Home Audio Processor from Microsemi.
+
+description: |
+  The ZL38060 is a "Connected Home Audio Processor" from Microsemi,
+  which consists of a Digital Signal Processor (DSP), several Digital
+  Audio Interfaces (DAIs), analog outputs, and a block of 14 GPIOs.
+
+maintainers:
+  - Jaroslav Kysela <[email protected]>
+  - Takashi Iwai <[email protected]>
+
+properties:
+  compatible:
+    const: mscc,zl38060
+
+  reg:
+    description:
+      SPI device address.
+    maxItems: 1
+
+  spi-max-frequency:
+    maximum: 24000000
+
+  reset-gpios:
+    description:
+      A GPIO line handling reset of the chip. As the line is active low,
+      it should be marked GPIO_ACTIVE_LOW (see ../gpio/gpio.txt)
+    maxItems: 1
+
+  '#gpio-cells':
+    const: 2
+
+  gpio-controller: true
+
+  '#sound-dai-cells':
+    const: 0
+
+required:
+  - compatible
+  - reg
+  - '#gpio-cells'
+  - gpio-controller
+  - '#sound-dai-cells'
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    spi0 {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        codec: zl38060@0 {
+            gpio-controller;
+            #gpio-cells = <2>;
+            #sound-dai-cells = <0>;
+            compatible = "mscc,zl38060";
+            reg = <0>;
+            spi-max-frequency = <12000000>;
+            reset-gpios = <&gpio1 0 GPIO_ACTIVE_LOW>;
+        };
+    };
Signature · 1 line
2.17.1
#1 lore raw

PATCH v2 2/2 ASoC: Add initial ZL38060 driver

The ZL38060 is a "Connected Home Audio Processor" from Microsemi, which consists of a Digital Signal Processor (DSP), several Digital Audio Interfaces (DAIs), analog outputs, and a block of 14 GPIOs.

This driver supports only a tiny subset of the chip's functionality and possible configurations:
- bypass mode (whole dsp block is bypassed)
- chip's I2S DAI routed directly to/from DACs and microphone
- chip's internal clock is driven by a 12 MHz external crystal
- chip's DAI connected to CPU is I2S, and bit + frame clock master
- chip must be strapped for "host boot": in this mode, firmware will be provided by this driver.

---

Tree: v5.7-rc1

v1->v2:

Mark Brown:

- fixup comment style at top of file.

- fixup curly braces in if-elseif-else statement.

- explicitly put the chip in reset so it reverts to a known state.

- remove 'mscc,load-firmware' devicetree property, which provided support for switching between chip bootstrap modes (host boot / auto boot from external flash).
On reflection, I cannot test correct operation of auto-boot - it involves interaction with the Bootloader Status Register, and I have no access to an auto-boot zl38060.
This means the only tested and supported mode will be 'host boot', where the firmware is programmed by the host CPU (ie. Linux).

- remove amplifier enable gpio. if required, it should be part of the machine layer.

Sven Van Asbroeck:

- add dapm widgets: DAC1, DAC2, DMICL. Routed to Playback and Capture, respectively. This is required to drive a microphone amp-enable gpio from the machine layer.

 sound/soc/codecs/Kconfig   |  11 +
 sound/soc/codecs/Makefile  |   2 +
 sound/soc/codecs/zl38060.c | 638 +++++++++++++++++++++++++++++++++++++
 3 files changed, 651 insertions(+)
 create mode 100644 sound/soc/codecs/zl38060.c
sound/soc/codecs/Kconfig +11 -0
index e6a0c5d05fa5..7cb032757d32 100644
@@ -272,6 +272,7 @@ config SND_SOC_ALL_CODECS
 	imply SND_SOC_WM9712
 	imply SND_SOC_WM9713
 	imply SND_SOC_WSA881X
+	imply SND_SOC_ZL38060
 	help
 	  Normally ASoC codec drivers are only built if a machine driver which
 	  uses them is also built since they are only usable with a machine
@@ -1642,6 +1643,16 @@ config SND_SOC_WSA881X
 	  This enables support for Qualcomm WSA8810/WSA8815 Class-D
 	  Smart Speaker Amplifier.
 
+config SND_SOC_ZL38060
+	tristate "Microsemi ZL38060 Connected Home Audio Processor"
+	depends on SPI_MASTER
+	select GPIOLIB
+	select REGMAP
+	help
+	  Support for ZL38060 Connected Home Audio Processor from Microsemi,
+	  which consists of a Digital Signal Processor (DSP), several Digital
+	  Audio Interfaces (DAIs), analog outputs, and a block of 14 GPIOs.
+
 config SND_SOC_ZX_AUD96P22
 	tristate "ZTE ZX AUD96P22 CODEC"
 	depends on I2C
sound/soc/codecs/Makefile +2 -0
index 03533157cda6..a603532c7af5 100644
@@ -288,6 +288,7 @@ snd-soc-wm9712-objs := wm9712.o
 snd-soc-wm9713-objs := wm9713.o
 snd-soc-wm-hubs-objs := wm_hubs.o
 snd-soc-wsa881x-objs := wsa881x.o
+snd-soc-zl38060-objs := zl38060.o
 snd-soc-zx-aud96p22-objs := zx_aud96p22.o
 # Amp
 snd-soc-max9877-objs := max9877.o
@@ -588,6 +589,7 @@ obj-$(CONFIG_SND_SOC_WM9713)	+= snd-soc-wm9713.o
 obj-$(CONFIG_SND_SOC_WM_ADSP)	+= snd-soc-wm-adsp.o
 obj-$(CONFIG_SND_SOC_WM_HUBS)	+= snd-soc-wm-hubs.o
 obj-$(CONFIG_SND_SOC_WSA881X)	+= snd-soc-wsa881x.o
+obj-$(CONFIG_SND_SOC_ZL38060)	+= snd-soc-zl38060.o
 obj-$(CONFIG_SND_SOC_ZX_AUD96P22) += snd-soc-zx-aud96p22.o
 
 # Amp
sound/soc/codecs/zl38060.c new file +638 -0

638 lines not on this page · raw message

Signature · 1 line
2.17.1
maintainer
#2 lore raw
In reply to Sven Van Asbroeck

Documentation/devicetree/bindings/sound/zl38060.yaml line 16

Quoted 3 lines · Sven Van Asbroeck
Documentation/devicetree/bindings/sound/zl38060.yaml new file +3 -0
+maintainers:
+  - Jaroslav Kysela <[email protected]>
+  - Takashi Iwai <[email protected]>

This is supposed to be people maintianing this specific binding, not the subsystem.

#3 lore raw
Quoted 7 lines · Mark Brown

Documentation/devicetree/bindings/sound/zl38060.yaml line 16

Quoted 4 lines
Documentation/devicetree/bindings/sound/zl38060.yaml new file +3 -0
+maintainers:
+  - Jaroslav Kysela <[email protected]>
+  - Takashi Iwai <[email protected]>

This is supposed to be people maintianing this specific binding, not the subsystem.

That would be Liam and yourself?

maintainer
#4 lore raw
Quoted 10 lines · Sven Van Asbroeck
Quoted 6 lines · Mark Brown

Documentation/devicetree/bindings/sound/zl38060.yaml line 16

Quoted 3 lines
Documentation/devicetree/bindings/sound/zl38060.yaml new file +3 -0
+maintainers:
+  - Jaroslav Kysela <[email protected]>
+  - Takashi Iwai <[email protected]>

This is supposed to be people maintianing this specific binding, not the subsystem.

That would be Liam and yourself?

I'd expect someone with knowledge of the hardware such as yourself.

#5 lore raw
Quoted 2 lines · Mark Brown

I'd expect someone with knowledge of the hardware such as yourself.

I claim no expertise - I was just getting tired of dragging the out-of-tree vendor
driver for this chip from kernel to kernel. AFAIK, most people using this chip have forked the vendor driver and adapted it to their specific needs.

If my name has to be there, I'd be keen to hand it over once someone more familiar with this chip comes along.

Hopefully someone from Microsemi will be monitoring this discussion.

maintainer
#6 lore raw
Quoted 11 lines · Sven Van Asbroeck
Quoted 2 lines · Mark Brown

I'd expect someone with knowledge of the hardware such as yourself.

I claim no expertise - I was just getting tired of dragging the out-of-tree vendor
driver for this chip from kernel to kernel. AFAIK, most people using this chip have forked the vendor driver and adapted it to their specific needs.

If my name has to be there, I'd be keen to hand it over once someone more familiar with this chip comes along.

I think by virtue of taking this step you have become the de facto upstream expert on this chip! Like you say hopefully someone more familiar (ideally from Microsemi) will turn up.

maintainer
#7 lore raw
In reply to Sven Van Asbroeck
Quoted 9 lines · Sven Van Asbroeck

Add devicetree binding for the Microsemi ZL38060 Connected Home Audio Processor.

---

Tree: v5.7-rc1

[...]

Applied to

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

Thanks!

[1/2] dt-bindings: sound: add Microsemi ZL38060 binding

      commit: 19f303caf63693502cf34897ade76202afe5f445
[2/2] ASoC: Add initial ZL38060 driver
      commit: 52e8a94baf9026276fcdc9ff21a50dc2ca0bc94b

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