Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH v3 0/2] ASoC: wm8731: interface activation order
@ 2026-11-28  9:23 Rafael Diniz
  2026-11-28  9:23 ` [PATCH v3 1/2] ASoC: wm8731: activate the interface after the converters, before the outputs Rafael Diniz
  2026-11-28  9:23 ` [PATCH v3 2/2] ASoC: wm8731: use one sample width for both directions Rafael Diniz
  0 siblings, 2 replies; 5+ messages in thread
From: Rafael Diniz @ 2026-11-28  9:23 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: Charles Keepax, Jaroslav Kysela, Takashi Iwai, patches,
	linux-sound

On a WM8731 that provides the clocks (96 kHz from a 12 MHz crystal, as
on the AudioInjector stereo card for the Raspberry Pi), about one
capture start in five came up deaf: DC offset and noise at their usual
levels, no signal, until the interface was deactivated and activated
again.  The trigger is the ADC powering up under an active interface,
which the driver's ACTIVE supply widget does on every capture start.

Patch 1 powers the ADC and DAC from one supply that sets ACTIVE once
they are up and clears it before they go down, so ACTIVE also comes
before OUTPD is cleared, as the datasheet asks.  Patch 2 makes both
directions use one sample width, as they already use one rate.

Changes in v3:
- Split in two patches (Charles).
- ACTIVE is set and cleared by the converters' supply itself (POST_PMU
  and PRE_PMD) instead of a DAPM post widget: it now comes before the
  output mixer clears OUTPD (Mark), and it also runs on power changes
  that are not stream events, such as a mixer switch (also raised by
  the AI review).
- Dropped the -EBUSY check in hw_params.  symmetric_rate already keeps
  the rate, and patch 2 sets symmetric_sample_bits for the width
  (Charles).  This also drops the false -EBUSY within pmdown_time that
  the AI review found.
- The supply powers the ADC and DAC only; the line input keeps its own
  widget.  In v2 it was on the supply too, and as the AudioInjector
  card's machine driver keeps the line input powered, the converters and
  the interface then never went down on that card: v2's hardware result
  came from that, not from the new order.  v3's result is with the
  converters and ACTIVE switching on every start.

v2: https://lore.kernel.org/linux-sound/20261120080825.2078162-1-rafael@riseup.net/

Rafael Diniz (2):
  ASoC: wm8731: activate the interface after the converters, before the
    outputs
  ASoC: wm8731: use one sample width for both directions

 sound/soc/codecs/wm8731.c | 60 +++++++++++++++++++++++++++++++++++----
 sound/soc/codecs/wm8731.h |  7 +++++
 2 files changed, 62 insertions(+), 5 deletions(-)


base-commit: 4405c18c95d2d0f99f6c581ef0ee8591a1aa6ccd
-- 
2.47.3


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

end of thread, other threads:[~2026-11-30 10:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-28  9:23 [PATCH v3 0/2] ASoC: wm8731: interface activation order Rafael Diniz
2026-11-28  9:23 ` [PATCH v3 1/2] ASoC: wm8731: activate the interface after the converters, before the outputs Rafael Diniz
2026-11-30 10:28   ` Charles Keepax
2026-11-28  9:23 ` [PATCH v3 2/2] ASoC: wm8731: use one sample width for both directions Rafael Diniz
2026-11-30 10:03   ` Charles Keepax

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox