Skip to content

Commit 5b0c02f

Browse files
Nicolas Frattarolibroonie
authored andcommitted
ASoC: es8328: fix route from DAC to output
The ES8328 codec driver, which is also used for the ES8388 chip that appears to have an identical register map, claims that the output can either take the route from DAC->Mixer->Output or through DAC->Output directly. To the best of what I could find, this is not true, and creates problems. Without DACCONTROL17 bit index 7 set for the left channel, as well as DACCONTROL20 bit index 7 set for the right channel, I cannot get any analog audio out on Left Out 2 and Right Out 2 respectively, despite the DAPM routes claiming that this should be possible. Furthermore, the same is the case for Left Out 1 and Right Out 1, showing that those two don't have a direct route from DAC to output bypassing the mixer either. Those control bits toggle whether the DACs are fed (stale bread?) into their respective mixers. If one "unmutes" the mixer controls in alsamixer, then sure, the audio output works, but if it doesn't work without the mixer being fed the DAC input then evidently it's not a direct output from the DAC. ES8328/ES8388 are seemingly not alone in this. ES8323, which uses a separate driver for what appears to be a very similar register map, simply flips those two bits on in its probe function, and then pretends there is no power management whatsoever for the individual controls. Fair enough. My theory as to why nobody has noticed this up to this point is that everyone just assumes it's their fault when they had to unmute an additional control in ALSA. Fix this in the es8328 driver by removing the erroneous direct route, then get rid of the playback switch controls and have those bits tied to the mixer's widget instead, which until now had no register to play with. Fixes: 567e4f9 ("ASoC: add es8328 codec driver") Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com> Link: https://patch.msgid.link/20250222-es8328-route-bludgeoning-v1-1-99bfb7fb22d9@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent f5468be commit 5b0c02f

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

sound/soc/codecs/es8328.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ static const struct snd_kcontrol_new es8328_right_line_controls =
233233

234234
/* Left Mixer */
235235
static const struct snd_kcontrol_new es8328_left_mixer_controls[] = {
236-
SOC_DAPM_SINGLE("Playback Switch", ES8328_DACCONTROL17, 7, 1, 0),
237236
SOC_DAPM_SINGLE("Left Bypass Switch", ES8328_DACCONTROL17, 6, 1, 0),
238237
SOC_DAPM_SINGLE("Right Playback Switch", ES8328_DACCONTROL18, 7, 1, 0),
239238
SOC_DAPM_SINGLE("Right Bypass Switch", ES8328_DACCONTROL18, 6, 1, 0),
@@ -243,7 +242,6 @@ static const struct snd_kcontrol_new es8328_left_mixer_controls[] = {
243242
static const struct snd_kcontrol_new es8328_right_mixer_controls[] = {
244243
SOC_DAPM_SINGLE("Left Playback Switch", ES8328_DACCONTROL19, 7, 1, 0),
245244
SOC_DAPM_SINGLE("Left Bypass Switch", ES8328_DACCONTROL19, 6, 1, 0),
246-
SOC_DAPM_SINGLE("Playback Switch", ES8328_DACCONTROL20, 7, 1, 0),
247245
SOC_DAPM_SINGLE("Right Bypass Switch", ES8328_DACCONTROL20, 6, 1, 0),
248246
};
249247

@@ -336,10 +334,10 @@ static const struct snd_soc_dapm_widget es8328_dapm_widgets[] = {
336334
SND_SOC_DAPM_DAC("Left DAC", "Left Playback", ES8328_DACPOWER,
337335
ES8328_DACPOWER_LDAC_OFF, 1),
338336

339-
SND_SOC_DAPM_MIXER("Left Mixer", SND_SOC_NOPM, 0, 0,
337+
SND_SOC_DAPM_MIXER("Left Mixer", ES8328_DACCONTROL17, 7, 0,
340338
&es8328_left_mixer_controls[0],
341339
ARRAY_SIZE(es8328_left_mixer_controls)),
342-
SND_SOC_DAPM_MIXER("Right Mixer", SND_SOC_NOPM, 0, 0,
340+
SND_SOC_DAPM_MIXER("Right Mixer", ES8328_DACCONTROL20, 7, 0,
343341
&es8328_right_mixer_controls[0],
344342
ARRAY_SIZE(es8328_right_mixer_controls)),
345343

@@ -418,19 +416,14 @@ static const struct snd_soc_dapm_route es8328_dapm_routes[] = {
418416
{ "Right Line Mux", "PGA", "Right PGA Mux" },
419417
{ "Right Line Mux", "Differential", "Differential Mux" },
420418

421-
{ "Left Out 1", NULL, "Left DAC" },
422-
{ "Right Out 1", NULL, "Right DAC" },
423-
{ "Left Out 2", NULL, "Left DAC" },
424-
{ "Right Out 2", NULL, "Right DAC" },
425-
426-
{ "Left Mixer", "Playback Switch", "Left DAC" },
419+
{ "Left Mixer", NULL, "Left DAC" },
427420
{ "Left Mixer", "Left Bypass Switch", "Left Line Mux" },
428421
{ "Left Mixer", "Right Playback Switch", "Right DAC" },
429422
{ "Left Mixer", "Right Bypass Switch", "Right Line Mux" },
430423

431424
{ "Right Mixer", "Left Playback Switch", "Left DAC" },
432425
{ "Right Mixer", "Left Bypass Switch", "Left Line Mux" },
433-
{ "Right Mixer", "Playback Switch", "Right DAC" },
426+
{ "Right Mixer", NULL, "Right DAC" },
434427
{ "Right Mixer", "Right Bypass Switch", "Right Line Mux" },
435428

436429
{ "DAC DIG", NULL, "DAC STM" },

0 commit comments

Comments
 (0)