All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] ASoC: codecs: nau8310: Add NAU83G10 amplifier
@ 2026-11-18  8:42 Neo Chang
  2026-11-18  8:42 ` [PATCH v3 1/2] ASoC: dt-bindings: nuvoton,nau8310: Add NAU83G10 Neo Chang
  2026-11-18  8:42 ` [PATCH v3 2/2] ASoC: codecs: nau8310: Add support for NAU83G10 amplifier Neo Chang
  0 siblings, 2 replies; 4+ messages in thread
From: Neo Chang @ 2026-11-18  8:42 UTC (permalink / raw)
  To: broonie
  Cc: lgirdwood, perex, robh, krzk+dt, linux-sound, devicetree,
	alsa-devel, neo.chang70, kchsu0, sjlin0, Neo Chang


This patch series adds support for the Nuvoton NAU83G10 audio amplifier.

The NAU83G10 is a mono boost Class-D audio amplifier with
an integrated DSP and I/V-sense support. The driver supports
I2C register access through regmap.
DAPM widgets and routes, TDM interface configuration, and DSP firmware
loading.

The series is structured asd follows:
- Patch 1: Adds the YAML device tree bindings documentation.
- Patch 2: Adds the ASoC audio amplifier driver implementation.

---
Changes in v3:

[dt-bindings]
- Utilized standard physical unit suffixes (e.g., -microvolt, -ms, -ns) for
  electrical and timing properties rather than exposing raw register values.
- Corrects the description of the clock detection disable property (disabling rather than enabling).
- Added an 'allOf' constraint block to explicitly disallow boost-related 
  properties for the NAU8320 variant.
- Adds a usage example for the NAU8320 codec in the dt-bindings yaml.

[codec driver]
- Core & Probe Initialization:
  - Updated device tree property parsing strings to match the new standard unit suffixes.
  - Replaced i2c_remove() with devm_work_autocancel() to prevent uncancelled work.
  - Added device match data to I2C ID tables and verified hardware silicon 
    ID during probe().
  - Dropped obsolete of_match_ptr() and ACPI_PTR() wrappers.
  - Resolved uninitialized `kcs_rst` variable warning by handling empty 
    DSP replies properly.
  - Fixed TDM slot corruption by preventing bitwise-ORing of encoded TX 
    slot selectors, and added bounds checks/warnings for slot configurations.
  - Updated Kconfig description to explicitly include support for the 
    NAU83G20 amplifier.
  - Removed redundant nau8310_sw_reset_chip() and sync regcache after reset.
    
- DAPM, Controls, & Power Management:
  - Fixed type confusion in nau8310_biq_coeff_put() by replacing the 
    incorrect snd_kcontrol_chip() with snd_soc_kcontrol_component().
  - Fixed race conditions in DSP mixer controls by adding DAPM mutex and expanding device lock coverage.
  - Enable and disable Sense pin control to DSP playback streams invoke snd_soc_dapm_sync() in 
    shutdown().
  - Removed nau8310_adc_event() from the "ALC gain selection mode" widget 
    to fix ADCDAT_OE power lifecycle issues.
  - Cleared the firmware loaded flag (`load_fw_done`) during system resume in 
    bypass mode to prevent DAPM from routing audio to an uninitialized DSP.
  - Removed incorrect DAC unmuting behavior in the firmware setup error path.
  - Removed redundant clock source switching from nau8310_dsp_snd_soc_dapm_put().
  - Removed redundant check_dsp_enabled() function.

- Clocks & Hardware Constraints:
  - Fixed clock configuration for 64kHz/96kHz rates, restricted NAU8310_RATES 
    to supported sample rates only, and validated `mult_sel` before executing 
    register writes in nau8310_clock_apply().
  - Added a lock in nau8310_clock_event() to prevent race conditions during 
    system resume by flushing firmware work in DAPM clock events.
  - Updated DAC oversampling control to use SOC_VALUE_ENUM_SINGLE() instead 
    of SOC_ENUM_SINGLE() to prevent exposing reserved register values to userspace.
  - Fixed the maximum ADC volume TLV gain to 2412 (24.12 dB) to match the 
    standard 0.01 dB ALSA scale.
  - Fixed the maximum DSP KCS payload length to 1024 bytes.
  - Fixed sparse endianness warnings in BIQ coefficients controls.
  - Fixed code comment formatting to follow standard kernel style.

Changes in v2:

[dt-bindings]
- No changes since v1.

[codec driver]
- Sort SND_SOC_NAU8310 alphabetically in Kconfig and Makefile.
- Fix uninitialized variable 'kcs_setup_comp.set_kcs_offset' warning reported by kernel test robot.
  Cast 'data[i]' to u32 before bit shifting in payload packing to prevent incorrect sign extension.
- Replace deprecated SND_SOC_DAIFMT_MASTER_MASK with SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK.
- Demote DSP ready status log from dev_info to dev_dbg to reduce log spam.
- Support requesting DSP firmware via 'firmware-name' property defined in device tree.
- Use snd_soc_kcontrol_component() instead of dapm lookup in standard kcontrol handlers.
- Make clock configuration stateless by passing 'fs' and 'mclk' directly as arguments.
  This prevents internal OSC switching from overwriting active user configurations set via set_sysclk(),
  ensuring stable state management during suspend/resume.
- Acquire nau8310->lock within the clock event handler to prevent race conditions during
  DSP command execution and concurrent firmware loading.
- Add NAU8310_CLK_ID_INT to set_sysclk() to properly handle internal ring oscillator configurations.

Neo Chang (2):
  ASoC: dt-bindings: nuvoton,nau8310: Add NAU83G10
  ASoC: codecs: nau8310: Add support for NAU83G10 amplifier

 .../bindings/sound/nuvoton,nau8310.yaml       |  186 ++
 sound/soc/codecs/Kconfig                      |   14 +
 sound/soc/codecs/Makefile                     |    2 +
 sound/soc/codecs/nau8310-dsp.c                |  678 ++++++
 sound/soc/codecs/nau8310-dsp.h                |  111 +
 sound/soc/codecs/nau8310.c                    | 2068 +++++++++++++++++
 sound/soc/codecs/nau8310.h                    |  635 +++++
 7 files changed, 3694 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/nuvoton,nau8310.yaml
 create mode 100644 sound/soc/codecs/nau8310-dsp.c
 create mode 100644 sound/soc/codecs/nau8310-dsp.h
 create mode 100644 sound/soc/codecs/nau8310.c
 create mode 100644 sound/soc/codecs/nau8310.h

-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-18  9:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-18  8:42 [PATCH v3 0/2] ASoC: codecs: nau8310: Add NAU83G10 amplifier Neo Chang
2026-11-18  8:42 ` [PATCH v3 1/2] ASoC: dt-bindings: nuvoton,nau8310: Add NAU83G10 Neo Chang
2026-11-18  8:42 ` [PATCH v3 2/2] ASoC: codecs: nau8310: Add support for NAU83G10 amplifier Neo Chang
2026-11-18  9:31   ` sashiko-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.