Skip to content

ASoC: meson: gx: add base support for I2S audio input

Valerio Setti linux-amlogic linux-arm-kernel linux-devicetree linux-sound lkml sashiko-reviews 5 versions – In review

Get series with b4
b4 am [email protected] change-id 20260831-audin-9cabb450cc94

Versions newest first

  1. v5 Latest7 patches 10 repliesIn review
  2. v47 patches 9 repliesSuperseded
  3. v37 patches 2 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v26 patches1 replySuperseded
v16 patches5 repliesSuperseded

Changes in v5 from the cover letter

- Take the PCM stream lock in the FIFO polling timer callback and skip re-arming it if a trigger already did so, fixing a race on quick PAUSE_PUSH -> PAUSE_RELEASE transitions. [Sashiko]
- Cancel the FIFO polling timer in the DAI 'shutdown' callback, so the timer is guaranteed to be stopped before the DAI data is freed on driver unbind. [Sashiko]
- Fixed commit message for commit 'ASoC: meson: aiu: add I2S Capture DAI' as requested by Jerome. Since the code is unchanged I kept the 'Reviewed-by' tag.
- Link to v4: https://patch.msgid.link/[email protected]

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7ASoC: dt-bindings: add amlogic,gxbb-audinDocumentation/devicetree/bindings/sound/amlogic,gxbb-audin.yaml+69 -02 replies
2/7ASoC: meson: build gx-formatter as a separate modulesound/soc/meson/Kconfig sound/soc/meson/Makefile+7 -11 reply
3/7ASoC: meson: aiu-encoder-i2s: ensure clk divider gets disabled in hw_freesound/soc/meson/aiu-encoder-i2s.c+5 -71 reply
4/7ASoC: meson: add AUDIN driversound/soc/meson/Kconfig sound/soc/meson/Makefile sound/soc/meson/audin-fifo.c +3 more+797 -03 replies
5/7ASoC: meson: aiu: add I2S Capture DAIsound/soc/meson/aiu.c+7 -01 reply
6/7ASoC: meson: gx-card: add support for audin FIFOsound/soc/meson/gx-card.c+9 -72 replies
7/7arm64: dts: amlogic: gx: add AUDIN nodearch/arm64/boot/dts/amlogic/meson-gx.dtsi arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi arch/arm64/boot/dts/amlogic/meson-gxl.dtsi+20 -00 replies

Reviews trailers per patch

6 of 7 patches have a Reviewed-by or Acked-by.

PatchKrzysztof KozlowskiJerome BrunetMartin Blumenstingl
1/7R-b
2/7R-b R-b
3/7R-b
4/7
5/7R-b R-b
6/7R-b
7/7R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v5 thread

Cover letter [PATCH v5 0/7] ASoC: meson: gx: add base support for I2S audio input

This series is the 2nd part of the initial RFC [1] proposed to add audio input support to the Meson GX SoCs. After the AIU reshaping series [2] that has recently been merged, this one adds the audio input path itself.

Apart from some glue commits for gx-formatter Kconfig split, a fix for i2s clock divider disabling in aiu-encoder-i2s, DT, bindings and integration with gx-card, the core commit is the 4th one, which adds the AUDIN driver. This is the counterpart of AIU for capture: it gets the entire register range, it handles peripheral clock and reset, it instantiates the I2S data formatter as widget and FIFOs as DAIs.

Resulting capture topology is:
pads --> AIU I2S Encoder -> AUDIN I2S Formatter -> AUDIN FIFO -> RAM

This series includes all the changes related to this work (dt-bindings, drivers and device-tree) in order to give the full picture in one single place.

Unfortunately, since no Meson GXBB/GXL board available in the tree features an I2S capture capable codec, this work cannot be directly tested out of the box. To test it an external codec must be connected to the SoC. When working on this series, a custom hat board with an NXP SGTL5000 codec has been plugged on top of an Odroid-C2 (GXBB). The last commit of this series fully details all the device-tree changes which are required to finalize the support for this scenario.
With this hardware configuration it has been possible to successfully validate the implementation with:
- alsa tools (arecord)
- pcm-tests

[1]: https://lore.kernel.org/linux-sound/[email protected]/
[2]: https://lore.kernel.org/linux-sound/[email protected]/

---
Changes in v5:
- Take the PCM stream lock in the FIFO polling timer callback and skip re-arming it if a trigger already did so, fixing a race on quick PAUSE_PUSH -> PAUSE_RELEASE transitions. [Sashiko]
- Cancel the FIFO polling timer in the DAI 'shutdown' callback, so the timer is guaranteed to be stopped before the DAI data is freed on driver unbind. [Sashiko]
- Fixed commit message for commit 'ASoC: meson: aiu: add I2S Capture DAI' as requested by Jerome. Since the code is unchanged I kept the 'Reviewed-by' tag.
- Link to v4: https://patch.msgid.link/[email protected]

Changes in v4:
- Dropped the family compatible 'amlogic,gx-audin'. 'amlogic,gxbb-audin' and 'amlogic,gxl-audin' are now the compatibles for GXBB and GXL SoCs, respectively, with the former also used as fallback for the latter. [Krzysztof]
- Link to v3: https://patch.msgid.link/[email protected]

Changes in v3:
- Fixed i2s clock divider disabling in 'aiu-encoder-i2s' 'hw_free'. [Sashiko]
- Specified const value of "#sound-dai-cells" property in dt-binding. [Sashiko]
- Advance 'last_pos' by whole periods in the FIFO polling timer to avoid drifting period notifications. [Sashiko]
- Link to v2: https://patch.msgid.link/[email protected]

Changes in v2:
- Dropped FIFO child nodes from AUDIN in device-tree. Now AUDIN is the only sound component and FIFOs are its DAIs. This is the same design used in AIU. [Krzysztof]
- Renamed driver compatible, using 'amlogic,gx-audin' as fallback and 'amlogic,gx[bb|l]-audin' as SoC specific. Fixed also other reported comments on the binding. [Krzysztof]
- Adjusted headers inclusion in 'audin.c' and spacing in the empty entry of 'meson_gx_audin_of_match'. [Uwe]
- Replaced 'snd_soc_component_read' with 'regmap_read' in 'audin_fifo_pos' in order to prevent sleeping in atomic context. Also changed the hrtimer from hard-irq to a soft-irq one. [Sashiko]
- Added 'sync_stop' callback in 'audin_component' to ensure the hrtimer is fully stopped before attempting to restart the stream in a "start->stop->prepare->start" scenario.
- Link to v1: https://patch.msgid.link/[email protected]

To: Jerome Brunet <[email protected]>
To: Liam Girdwood <[email protected]>
To: Mark Brown <[email protected]>
To: Rob Herring <[email protected]>
To: Krzysztof Kozlowski <[email protected]>
To: Conor Dooley <[email protected]>
To: Valerio Setti <[email protected]>
To: Jaroslav Kysela <[email protected]>
To: Takashi Iwai <[email protected]>
To: Neil Armstrong <[email protected]>
To: Kevin Hilman <[email protected]>
To: Martin Blumenstingl <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
Valerio Setti (7):
ASoC: dt-bindings: add amlogic,gxbb-audin
ASoC: meson: build gx-formatter as a separate module
ASoC: meson: aiu-encoder-i2s: ensure clk divider gets disabled in hw_free
ASoC: meson: add AUDIN driver
ASoC: meson: aiu: add I2S Capture DAI
ASoC: meson: gx-card: add support for audin FIFO
arm64: dts: amlogic: gx: add AUDIN node

 .../bindings/sound/amlogic,gxbb-audin.yaml         |  69 ++++
 arch/arm64/boot/dts/amlogic/meson-gx.dtsi          |   9 +
 arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi        |   5 +
 arch/arm64/boot/dts/amlogic/meson-gxl.dtsi         |   6 +
 sound/soc/meson/Kconfig                            |  14 +
 sound/soc/meson/Makefile                           |   7 +-
 sound/soc/meson/aiu-encoder-i2s.c                  |  12 +-
 sound/soc/meson/aiu.c                              |   7 +
 sound/soc/meson/audin-fifo.c                       | 392 +++++++++++++++++++++
 sound/soc/meson/audin-formatter-i2s.c              | 174 +++++++++
 sound/soc/meson/audin.c                            | 188 ++++++++++
 sound/soc/meson/audin.h                            |  30 ++
 sound/soc/meson/gx-card.c                          |  16 +-
 13 files changed, 914 insertions(+), 15 deletions(-)

---
base-commit: cee9395acd8043be0644b25c34bfa86623f2b935
change-id: 20260831-audin-9cabb450cc94

Best regards,

Signature · 1 line
Valerio Setti <[email protected]>