[PATCH v4 0/2] ASoC: codecs: Add Nuvoton NAU83G60 audio codec driver
Neo Chang <[email protected]> Tue, 9 Jun 2026 10:41:26 +0800
| Newsgroups | org.alsa-project.alsa-devel,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-sound |
|---|---|
| Message-ID | <[email protected]> |
This patch series adds support for the Nuvoton NAU83G60 audio codec. The NAU83G60 is a stereo Class-D amplifier with an integrated DSP and I/V-sense capabilities. The driver supports I2C register access through regmap, DAPM widgets and routes, TDM interface configuration, and DSP firmware loading. The series is structured as follows: - Patch 1: Adds the YAML device tree bindings documentation. - Patch 2: Adds the ASoC codec driver implementation. Changes in v4: [dt-bindings] - Refine the `firmware-name` description to clarify the loading order (Left then Right) and the PBTL mode behavior. - Remove the "dsp bypass" option description. - Update the example node to follow devicetree coding styles. [codec driver] - Clean up unused DSP state flags (dsp_enable, dsp_created, dsp_fws_num). - Fixed the use of an uninitialized stack variable (`status`). - Fixed unhandled failures in `nau8360_dsp_init()` that caused duplicated DAPM widgets to leak. - Add mutex protection for PEQ memory and TDM slot caches. - Restored the missing hardware memory access bit during suspend/resume to prevent PEQ coefficients from being silently lost. - Handled `regmap_read()` failure in `nau8360_vbat_level()` to prevent the usage of uninitialized stack memory. - Removed improper dynamic creation of DAPM widgets and routes within ALSA kcontrol `put` handlers, using proper static instantiation instead. - Moved RX enable logic to `startup()` for consistent stream state. - Replaced synchronous `request_firmware()` with `request_firmware_nowait()` to prevent deadlocks and avoid blocking the kernel during firmware I/O. - Explicitly disable TDM RX/TX when slots or slot_width is zero. Changes in v2/v3: - v3: Resolved YAML build warnings, added Kconfig/Makefile entries, fixed stack buffer overflows in DSP parsing, and refactored TDM slot validation logic. - v2: Migrated software/runtime configurations from DT properties to ALSA kcontrols, refactored TDM routing, and improved firmware path handling. Neo Chang (2): ASoC: dt-bindings: nuvoton,nau8360: Add NAU83G60 ASoC: codecs: nau8360: Add support for NAU83G60 amplifier .../bindings/sound/nuvoton,nau8360.yaml | 83 + sound/soc/codecs/Kconfig | 10 + sound/soc/codecs/Makefile | 2 + sound/soc/codecs/nau8360-dsp.c | 707 +++++ sound/soc/codecs/nau8360-dsp.h | 126 + sound/soc/codecs/nau8360.c | 2499 +++++++++++++++++ sound/soc/codecs/nau8360.h | 902 ++++++ 7 files changed, 4329 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/nuvoton,nau8360.yaml create mode 100644 sound/soc/codecs/nau8360-dsp.c create mode 100644 sound/soc/codecs/nau8360-dsp.h create mode 100644 sound/soc/codecs/nau8360.c create mode 100644 sound/soc/codecs/nau8360.h -- 2.25.1