Skip to content

RFC ASoC: tegra: ASRC control fixes and ratio caching

Sheetal linux-sound linux-tegra lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3ASoC: tegra: Fix ASRC Stream6 input threshold controlsound/soc/tegra/tegra186_asrc.c+1 -11 reply
2/3ASoC: tegra: Update ASRC ratio controlssound/soc/tegra/tegra186_asrc.c sound/soc/tegra/tegra186_asrc.h+276 -1712 replies
3/3ASoC: tegra: Cache ASRC ratios until streams are activesound/soc/tegra/tegra186_asrc.c sound/soc/tegra/tegra186_asrc.h+89 -180 replies

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchThierry Reding
1/3R-b
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [RFC PATCH 0/3] ASoC: tegra: ASRC control fixes and ratio caching

This RFC series updates the Tegra186 ASRC driver control handling.

The main RFC point is the userspace-visible ALSA mixer control ABI change in patch 2. The existing per-stream controls expose the software ratio as separate integer and fractional mixer controls. This series replaces each pair with one two-value mixer control so userspace updates the integer and fractional parts together. That avoids programming a transient mixed ratio to hardware, but it does require userspace that sets ASRC software ratios to switch to the new paired controls.

Patch 1 fixes the Stream6 input-threshold control, which was using the same stream index as Stream5 and therefore addressed the wrong lane.

Patch 2 replaces the separate integer and fractional software ratio ALSA mixer controls with a paired two-value control per stream. This keeps the integer/fractional ratio update atomic from userspace, validates both values before programming hardware, serializes ratio-source and ratio updates, refreshes the hardware lock for large ratio jumps, and rolls back partial hardware updates on failure.

ALSA exposes one min and max range for all values in an integer-array control, so the paired ratio controls advertise the fractional field's full 32-bit range. The put callback validates the integer part separately against the hardware field width.

Patch 3 caches software ratio updates while the target stream is not active or the ASRC device is runtime suspended. Cached ratios are applied when streams are configured and restored after runtime resume, avoiding unsafe volatile register accesses while suspended.

Sheetal (3):
ASoC: tegra: Fix ASRC Stream6 input threshold control
ASoC: tegra: Update ASRC ratio controls
ASoC: tegra: Cache ASRC ratios until streams are active

 sound/soc/tegra/tegra186_asrc.c | 513 +++++++++++++++++++++-----------
 sound/soc/tegra/tegra186_asrc.h |   5 +
 2 files changed, 347 insertions(+), 171 deletions(-)
Signature · 1 line
2.43.0