Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH v4 0/2] ASoC: wm8731: interface activation order
@ 2026-11-30 20:17 Rafael Diniz
  2026-11-30 20:17 ` [PATCH v4 1/2] ASoC: wm8731: activate the interface after the inputs, before the outputs Rafael Diniz
  2026-11-30 20:17 ` [PATCH v4 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-30 20:17 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: Rafael Diniz, 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 with the interface
inactive and sets ACTIVE at the last step before the outputs, as the
datasheet's power-up sequence has it.  Patch 2 makes both directions use
one sample width, as they already use one rate.

Changes in v4:
- ACTIVE now comes after the microphone and line inputs and just before
  OUTPD (Charles).  OUTPD moves from the output mixer to an output
  driver widget, which DAPM powers last.  The ADC sets ACTIVE for
  capture, the output driver for playback, and the DAC when the outputs
  are already up for the line bypass.  The converters' supply still
  clears it, after everything else has gone down.
- The ADC and DAC still power up together while either direction runs
  (Mark's point on power, discussed in the v3 thread).  Powering one up
  under an active interface would need ACTIVE cycled, and on this card,
  where the codec provides the clocks, a cycle with both streams running
  left the capture channels swapped in 38 of 52 trials.
- Patch 2 unchanged, with Charles's Reviewed-by.

v3: https://lore.kernel.org/linux-sound/20261128092306.1566199-1-rafael@riseup.net/

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

 sound/soc/codecs/wm8731.c | 109 ++++++++++++++++++++++++++++++++++----
 sound/soc/codecs/wm8731.h |   8 +++
 2 files changed, 107 insertions(+), 10 deletions(-)


base-commit: 4405c18c95d2d0f99f6c581ef0ee8591a1aa6ccd
-- 
2.47.3


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

* [PATCH v4 1/2] ASoC: wm8731: activate the interface after the inputs, before the outputs
  2026-11-30 20:17 [PATCH v4 0/2] ASoC: wm8731: interface activation order Rafael Diniz
@ 2026-11-30 20:17 ` Rafael Diniz
  2026-12-03 10:55   ` Charles Keepax
  2026-11-30 20:17 ` [PATCH v4 2/2] ASoC: wm8731: use one sample width for both directions Rafael Diniz
  1 sibling, 1 reply; 5+ messages in thread
From: Rafael Diniz @ 2026-11-30 20:17 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: Rafael Diniz, Charles Keepax, Jaroslav Kysela, Takashi Iwai,
	patches, linux-sound

The datasheet's power-up sequence powers everything but the outputs,
sets the other registers, activates the digital audio interface and
clears OUTPD last.  The driver has ACTIVE as a supply widget of its own,
which DAPM powers ahead of the ADC and DAC, so every stream start powers
a converter up under an active interface.

With the codec as clock provider at 96 kHz from a 12 MHz crystal (USB
mode), as on the AudioInjector stereo card for the Raspberry Pi, about
one capture start in five then leaves the ADC delivering its DC offset
and noise at their usual levels but no signal, until the interface is
deactivated and activated again.  Both orders reproduce it on a running
codec over I2C: the driver's start order (interface active, then the ADC
powered up) went deaf in 1 of 8 trials, and powering the ADC down and up
under an active interface in 2 of 8.  Activating the interface with the
ADC already powered stayed healthy in 42 of 42.

Power the ADC and DAC from one supply with the interface inactive, and
set ACTIVE at the last step before the outputs.  DAPM powers supplies
first, then the microphone bias, the output mixer, the line input and
the ADC, so OUTPD moves from the output mixer to an output driver widget
of its own, which DAPM powers after all of them.  For capture the ADC's
POST_PMU sets ACTIVE, after the microphone and line inputs; for playback
the output driver's PRE_PMU sets it, before OUTPD is cleared, unless the
converters are down (the line bypass alone).  When the outputs are
already up for the line bypass, the DAC's POST_PMU sets it.  The supply
clears ACTIVE in PRE_PMD, once everything else is down, before powering
the converters down.  The events run on any power change, a mixer switch
as well as a stream start, and a second stream finds the converters
powered and the interface left as it is.  A subsequence orders the
supply after the oscillator going up and before it going down.

The register writes traced on that card follow the datasheet's order:
oscillator, ADC and DAC, ACTIVE for capture, with MICPD cleared before
ACTIVE when the microphone input is selected; oscillator, ADC and DAC,
ACTIVE, then OUTPD for playback; OUTPD, ACTIVE, ADC and DAC, oscillator
going down.  Starting playback under the line bypass, with the outputs
already up, sets ACTIVE after the converters from the DAC's event, and
the line bypass alone powers only the outputs.  The machine driver keeps
the line input powered, so its place in the order doesn't show on this
card.

Tested on a Raspberry Pi 4 with that card, 6.18.60 (Raspberry Pi kernel,
where the driver is the same as here): after each of 30 daemon restarts,
each a fresh capture and playback start with nothing in user space
cycling the interface, the capture decoded a test transmission from a
second station; before this patch about one start in five came up deaf.
Built with W=1 on mainline.

The analysis, the I2C reproducers, the patch and this changelog were
written with Claude Code (Claude Opus 5.5) from the reported fault, the
kernel sources and the reviews of v2 and v3, and the tool ran the
hardware tests on the submitter's test setup at the submitter's
direction.

Fixes: 8a27bd9a3318 ("ASoC: Manage WM8731 ACTIVE bit as a supply widget")
Link: https://github.com/raspberrypi/linux/issues/7776
Signed-off-by: Rafael Diniz <rafael@riseup.net>
---
 sound/soc/codecs/wm8731.c | 108 ++++++++++++++++++++++++++++++++++----
 sound/soc/codecs/wm8731.h |   8 +++
 2 files changed, 106 insertions(+), 10 deletions(-)

diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c
index f25b50919..97fa4fa29 100644
--- a/sound/soc/codecs/wm8731.c
+++ b/sound/soc/codecs/wm8731.c
@@ -167,18 +167,105 @@ SOC_DAPM_SINGLE("HiFi Playback Switch", WM8731_APANA, 4, 1, 0),
 static const struct snd_kcontrol_new wm8731_input_mux_controls =
 SOC_DAPM_ENUM("Input Select", wm8731_insel_enum);
 
+/*
+ * The datasheet's power-up sequence powers everything but the outputs, sets
+ * the other registers, activates the digital audio interface and powers the
+ * outputs last.  With the codec as clock provider at 96 kHz (12 MHz crystal,
+ * USB mode), powering the ADC up under an active interface left it, about
+ * one time in five, delivering its DC offset and noise but no signal, until
+ * the interface was deactivated and activated again.
+ *
+ * So a supply powers the ADC and DAC with the interface inactive, and the
+ * interface is activated at the last step before the outputs: after the ADC
+ * for capture, which DAPM powers after the microphone and line inputs, and
+ * before the output drivers (OUTPD) for playback.  When the outputs are
+ * already up, for the line bypass, the DAC activates it.  The supply clears
+ * ACTIVE once everything else is down, before powering the converters down.
+ * A second stream finds the converters powered and the interface left as it
+ * is.  The subsequence puts the supply after the oscillator going up and
+ * before it going down.
+ */
+#define WM8731_PWR_CONVERTERS	(WM8731_PWR_ADCPD | WM8731_PWR_DACPD)
+
+static void wm8731_activate(struct snd_soc_component *component)
+{
+	snd_soc_component_update_bits(component, WM8731_ACTIVE,
+				      WM8731_ACTIVE_ACTIVE,
+				      WM8731_ACTIVE_ACTIVE);
+}
+
+static int wm8731_converters_event(struct snd_soc_dapm_widget *w,
+				   struct snd_kcontrol *kcontrol, int event)
+{
+	struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
+
+	switch (event) {
+	case SND_SOC_DAPM_PRE_PMU:
+		snd_soc_component_update_bits(component, WM8731_PWR,
+					      WM8731_PWR_CONVERTERS, 0);
+		break;
+	case SND_SOC_DAPM_PRE_PMD:
+		snd_soc_component_update_bits(component, WM8731_ACTIVE,
+					      WM8731_ACTIVE_ACTIVE, 0);
+		break;
+	case SND_SOC_DAPM_POST_PMD:
+		snd_soc_component_update_bits(component, WM8731_PWR,
+					      WM8731_PWR_CONVERTERS,
+					      WM8731_PWR_CONVERTERS);
+		break;
+	}
+	return 0;
+}
+
+static int wm8731_adc_event(struct snd_soc_dapm_widget *w,
+			    struct snd_kcontrol *kcontrol, int event)
+{
+	wm8731_activate(snd_soc_dapm_to_component(w->dapm));
+	return 0;
+}
+
+static int wm8731_dac_event(struct snd_soc_dapm_widget *w,
+			    struct snd_kcontrol *kcontrol, int event)
+{
+	struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
+
+	/* Otherwise the outputs' own event activates it */
+	if (!(snd_soc_component_read(component, WM8731_PWR) & WM8731_PWR_OUTPD))
+		wm8731_activate(component);
+	return 0;
+}
+
+static int wm8731_outputs_event(struct snd_soc_dapm_widget *w,
+				struct snd_kcontrol *kcontrol, int event)
+{
+	struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
+
+	/* Not for the line bypass alone, with the converters down */
+	if (!(snd_soc_component_read(component, WM8731_PWR) &
+	      WM8731_PWR_CONVERTERS))
+		wm8731_activate(component);
+	return 0;
+}
+
 static const struct snd_soc_dapm_widget wm8731_dapm_widgets[] = {
-SND_SOC_DAPM_SUPPLY("ACTIVE",WM8731_ACTIVE, 0, 0, NULL, 0),
 SND_SOC_DAPM_SUPPLY("OSC", WM8731_PWR, 5, 1, NULL, 0),
-SND_SOC_DAPM_MIXER("Output Mixer", WM8731_PWR, 4, 1,
+SND_SOC_DAPM_SUPPLY_S("Converters", 1, SND_SOC_NOPM, 0, 0,
+		      wm8731_converters_event,
+		      SND_SOC_DAPM_PRE_PMU |
+		      SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD),
+SND_SOC_DAPM_MIXER("Output Mixer", SND_SOC_NOPM, 0, 0,
 	&wm8731_output_mixer_controls[0],
 	ARRAY_SIZE(wm8731_output_mixer_controls)),
-SND_SOC_DAPM_DAC("DAC", "HiFi Playback", WM8731_PWR, 3, 1),
+SND_SOC_DAPM_OUT_DRV_E("Outputs", WM8731_PWR, 4, 1, NULL, 0,
+		       wm8731_outputs_event, SND_SOC_DAPM_PRE_PMU),
+SND_SOC_DAPM_DAC_E("DAC", "HiFi Playback", SND_SOC_NOPM, 0, 0,
+		   wm8731_dac_event, SND_SOC_DAPM_POST_PMU),
 SND_SOC_DAPM_OUTPUT("LOUT"),
 SND_SOC_DAPM_OUTPUT("LHPOUT"),
 SND_SOC_DAPM_OUTPUT("ROUT"),
 SND_SOC_DAPM_OUTPUT("RHPOUT"),
-SND_SOC_DAPM_ADC("ADC", "HiFi Capture", WM8731_PWR, 2, 1),
+SND_SOC_DAPM_ADC_E("ADC", "HiFi Capture", SND_SOC_NOPM, 0, 0,
+		   wm8731_adc_event, SND_SOC_DAPM_POST_PMU),
 SND_SOC_DAPM_MUX("Input Mux", SND_SOC_NOPM, 0, 0, &wm8731_input_mux_controls),
 SND_SOC_DAPM_PGA("Line Input", WM8731_PWR, 0, 1, NULL, 0),
 SND_SOC_DAPM_MICBIAS("Mic Bias", WM8731_PWR, 1, 1),
@@ -199,8 +286,8 @@ static int wm8731_check_osc(struct snd_soc_dapm_widget *source,
 static const struct snd_soc_dapm_route wm8731_intercon[] = {
 	{"DAC", NULL, "OSC", wm8731_check_osc},
 	{"ADC", NULL, "OSC", wm8731_check_osc},
-	{"DAC", NULL, "ACTIVE"},
-	{"ADC", NULL, "ACTIVE"},
+	{"DAC", NULL, "Converters"},
+	{"ADC", NULL, "Converters"},
 
 	/* output mixer */
 	{"Output Mixer", "Line Bypass Switch", "Line Input"},
@@ -208,10 +295,11 @@ static const struct snd_soc_dapm_route wm8731_intercon[] = {
 	{"Output Mixer", "Mic Sidetone Switch", "Mic Bias"},
 
 	/* outputs */
-	{"RHPOUT", NULL, "Output Mixer"},
-	{"ROUT", NULL, "Output Mixer"},
-	{"LHPOUT", NULL, "Output Mixer"},
-	{"LOUT", NULL, "Output Mixer"},
+	{"Outputs", NULL, "Output Mixer"},
+	{"RHPOUT", NULL, "Outputs"},
+	{"ROUT", NULL, "Outputs"},
+	{"LHPOUT", NULL, "Outputs"},
+	{"LOUT", NULL, "Outputs"},
 
 	/* input mux */
 	{"Input Mux", "Line In", "Line Input"},
diff --git a/sound/soc/codecs/wm8731.h b/sound/soc/codecs/wm8731.h
index 8d5a7a9ca..bc75dac04 100644
--- a/sound/soc/codecs/wm8731.h
+++ b/sound/soc/codecs/wm8731.h
@@ -33,6 +33,14 @@ struct snd_pcm_hw_constraint_list;
 #define WM8731_ACTIVE   0x09
 #define WM8731_RESET	0x0f
 
+/* WM8731_PWR */
+#define WM8731_PWR_ADCPD	0x0004
+#define WM8731_PWR_DACPD	0x0008
+#define WM8731_PWR_OUTPD	0x0010
+
+/* WM8731_ACTIVE */
+#define WM8731_ACTIVE_ACTIVE	0x0001
+
 #define WM8731_CACHEREGNUM 	10
 
 #define WM8731_SYSCLK_MCLK 0
-- 
2.47.3


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

* [PATCH v4 2/2] ASoC: wm8731: use one sample width for both directions
  2026-11-30 20:17 [PATCH v4 0/2] ASoC: wm8731: interface activation order Rafael Diniz
  2026-11-30 20:17 ` [PATCH v4 1/2] ASoC: wm8731: activate the interface after the inputs, before the outputs Rafael Diniz
@ 2026-11-30 20:17 ` Rafael Diniz
  2026-12-01 12:00   ` Mark Brown
  1 sibling, 1 reply; 5+ messages in thread
From: Rafael Diniz @ 2026-11-30 20:17 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: Rafael Diniz, Charles Keepax, Jaroslav Kysela, Takashi Iwai,
	patches, linux-sound

Playback and capture share one interface format register (IFACE), whose
IWL field sets the word length for both directions, as SRATE sets one
sample rate for both.  symmetric_rate already makes a second stream use
the rate of the running one, but a second stream at a different width
rewrites IWL under the running stream, which then carries samples of the
wrong length.

Set symmetric_sample_bits, so the second stream gets the width of the
running one.  Its hw_params then writes back the values already there;
rewriting SRATE and IFACE with their values under an active interface
stayed healthy in 12 of 12 trials on the hardware below.

Tested on a Raspberry Pi 4 with the AudioInjector stereo card, 6.18.60
(Raspberry Pi kernel, where the driver is the same as here): with a
32-bit capture stream running, a 16-bit playback stream is refused as a
format not available, and the register trace shows no write to IFACE.
Built with W=1 on mainline.

This patch and its changelog were written with Claude Code (Claude Opus
5.5) following the review of v2.

Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Rafael Diniz <rafael@riseup.net>
---
 sound/soc/codecs/wm8731.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c
index 97fa4fa29..b19f7b106 100644
--- a/sound/soc/codecs/wm8731.c
+++ b/sound/soc/codecs/wm8731.c
@@ -645,6 +645,7 @@ static struct snd_soc_dai_driver wm8731_dai = {
 		.formats = WM8731_FORMATS,},
 	.ops = &wm8731_dai_ops,
 	.symmetric_rate = 1,
+	.symmetric_sample_bits = 1,
 };
 
 static const struct snd_soc_component_driver soc_component_dev_wm8731 = {
-- 
2.47.3


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

* Re: [PATCH v4 2/2] ASoC: wm8731: use one sample width for both directions
  2026-11-30 20:17 ` [PATCH v4 2/2] ASoC: wm8731: use one sample width for both directions Rafael Diniz
@ 2026-12-01 12:00   ` Mark Brown
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2026-12-01 12:00 UTC (permalink / raw)
  To: Rafael Diniz
  Cc: Liam Girdwood, Charles Keepax, Jaroslav Kysela, Takashi Iwai,
	patches, linux-sound

[-- Attachment #1: Type: text/plain, Size: 741 bytes --]

On Mon, Nov 30, 2026 at 08:17:09PM +0000, Rafael Diniz wrote:
> Playback and capture share one interface format register (IFACE), whose
> IWL field sets the word length for both directions, as SRATE sets one
> sample rate for both.  symmetric_rate already makes a second stream use
> the rate of the running one, but a second stream at a different width
> rewrites IWL under the running stream, which then carries samples of the
> wrong length.

Please do not submit new versions of already applied patches, please
submit incremental updates to the existing code.  Modifying existing
commits creates problems for other users building on top of those
commits so it's best practice to only change pubished git commits if
absolutely essential.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH v4 1/2] ASoC: wm8731: activate the interface after the inputs, before the outputs
  2026-11-30 20:17 ` [PATCH v4 1/2] ASoC: wm8731: activate the interface after the inputs, before the outputs Rafael Diniz
@ 2026-12-03 10:55   ` Charles Keepax
  0 siblings, 0 replies; 5+ messages in thread
From: Charles Keepax @ 2026-12-03 10:55 UTC (permalink / raw)
  To: Rafael Diniz
  Cc: Mark Brown, Liam Girdwood, Jaroslav Kysela, Takashi Iwai, patches,
	linux-sound

On Mon, Nov 30, 2026 at 08:17:08PM +0000, Rafael Diniz wrote:
> +static void wm8731_activate(struct snd_soc_component *component)
> +{
> +	snd_soc_component_update_bits(component, WM8731_ACTIVE,
> +				      WM8731_ACTIVE_ACTIVE,
> +				      WM8731_ACTIVE_ACTIVE);
> +}
> +
> +static int wm8731_converters_event(struct snd_soc_dapm_widget *w,
> +				   struct snd_kcontrol *kcontrol, int event)
> +{
> +	struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
> +
> +	switch (event) {
> +	case SND_SOC_DAPM_PRE_PMU:
> +		snd_soc_component_update_bits(component, WM8731_PWR,
> +					      WM8731_PWR_CONVERTERS, 0);
> +		break;
> +	case SND_SOC_DAPM_PRE_PMD:
> +		snd_soc_component_update_bits(component, WM8731_ACTIVE,
> +					      WM8731_ACTIVE_ACTIVE, 0);
> +		break;
> +	case SND_SOC_DAPM_POST_PMD:
> +		snd_soc_component_update_bits(component, WM8731_PWR,
> +					      WM8731_PWR_CONVERTERS,
> +					      WM8731_PWR_CONVERTERS);
> +		break;
> +	}
> +	return 0;
> +}
> +
> +static int wm8731_adc_event(struct snd_soc_dapm_widget *w,
> +			    struct snd_kcontrol *kcontrol, int event)
> +{
> +	wm8731_activate(snd_soc_dapm_to_component(w->dapm));
> +	return 0;
> +}
> +
> +static int wm8731_dac_event(struct snd_soc_dapm_widget *w,
> +			    struct snd_kcontrol *kcontrol, int event)
> +{
> +	struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
> +
> +	/* Otherwise the outputs' own event activates it */
> +	if (!(snd_soc_component_read(component, WM8731_PWR) & WM8731_PWR_OUTPD))
> +		wm8731_activate(component);
> +	return 0;
> +}
> +
> +static int wm8731_outputs_event(struct snd_soc_dapm_widget *w,
> +				struct snd_kcontrol *kcontrol, int event)
> +{
> +	struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
> +
> +	/* Not for the line bypass alone, with the converters down */
> +	if (!(snd_soc_component_read(component, WM8731_PWR) &
> +	      WM8731_PWR_CONVERTERS))
> +		wm8731_activate(component);
> +	return 0;
> +}
> +
>  static const struct snd_soc_dapm_widget wm8731_dapm_widgets[] = {
> -SND_SOC_DAPM_SUPPLY("ACTIVE",WM8731_ACTIVE, 0, 0, NULL, 0),
>  SND_SOC_DAPM_SUPPLY("OSC", WM8731_PWR, 5, 1, NULL, 0),
> -SND_SOC_DAPM_MIXER("Output Mixer", WM8731_PWR, 4, 1,
> +SND_SOC_DAPM_SUPPLY_S("Converters", 1, SND_SOC_NOPM, 0, 0,
> +		      wm8731_converters_event,
> +		      SND_SOC_DAPM_PRE_PMU |
> +		      SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD),
> +SND_SOC_DAPM_MIXER("Output Mixer", SND_SOC_NOPM, 0, 0,
>  	&wm8731_output_mixer_controls[0],
>  	ARRAY_SIZE(wm8731_output_mixer_controls)),
> -SND_SOC_DAPM_DAC("DAC", "HiFi Playback", WM8731_PWR, 3, 1),
> +SND_SOC_DAPM_OUT_DRV_E("Outputs", WM8731_PWR, 4, 1, NULL, 0,
> +		       wm8731_outputs_event, SND_SOC_DAPM_PRE_PMU),
> +SND_SOC_DAPM_DAC_E("DAC", "HiFi Playback", SND_SOC_NOPM, 0, 0,
> +		   wm8731_dac_event, SND_SOC_DAPM_POST_PMU),
>  SND_SOC_DAPM_OUTPUT("LOUT"),
>  SND_SOC_DAPM_OUTPUT("LHPOUT"),
>  SND_SOC_DAPM_OUTPUT("ROUT"),
>  SND_SOC_DAPM_OUTPUT("RHPOUT"),
> -SND_SOC_DAPM_ADC("ADC", "HiFi Capture", WM8731_PWR, 2, 1),
> +SND_SOC_DAPM_ADC_E("ADC", "HiFi Capture", SND_SOC_NOPM, 0, 0,
> +		   wm8731_adc_event, SND_SOC_DAPM_POST_PMU),
>  SND_SOC_DAPM_MUX("Input Mux", SND_SOC_NOPM, 0, 0, &wm8731_input_mux_controls),
>  SND_SOC_DAPM_PGA("Line Input", WM8731_PWR, 0, 1, NULL, 0),
>  SND_SOC_DAPM_MICBIAS("Mic Bias", WM8731_PWR, 1, 1),

This looks slightly better I think this gets the power up to:

1) Power OSCPD
2) Power ADCPD/DACPD
3) Power MICPD
4) Set ACTIVE
5) Power LINEINPD
6) Power OUTPD

That still seems to have the LINEINPD in the wrong place to me
and it seems quite complex. Why the complex handling on the
active bit? It seems to be attempting to delay disabling the
active bit until the very end of the power down, but I was
expecting the power down to just basically be the inverse of the
power up. Is there an additional requirement in the datasheet I
am missing?

Thanks,
Charles

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

end of thread, other threads:[~2026-12-03 10:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30 20:17 [PATCH v4 0/2] ASoC: wm8731: interface activation order Rafael Diniz
2026-11-30 20:17 ` [PATCH v4 1/2] ASoC: wm8731: activate the interface after the inputs, before the outputs Rafael Diniz
2026-12-03 10:55   ` Charles Keepax
2026-11-30 20:17 ` [PATCH v4 2/2] ASoC: wm8731: use one sample width for both directions Rafael Diniz
2026-12-01 12:00   ` Mark Brown

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