Skip to content

Commit 1183c35

Browse files
bardliaobroonie
authored andcommitted
ASoC: Intel: boards: max98373: get dapm from cpu_dai
There is a prefix on max98373 codec, and the prefix will be added to the pin name However, there is no prefix on the "Right Spk" and "Left Spk" widgets. To avoid getting a redundant prefix, we should get dapm from cpu_dai component. Signed-off-by: Bard Liao <[email protected]> Signed-off-by: Pierre-Louis Bossart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent ae4fc53 commit 1183c35

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sound/soc/intel/boards/sof_maxim_common.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,18 @@ int max98373_trigger(struct snd_pcm_substream *substream, int cmd)
6363
{
6464
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
6565
struct snd_soc_dai *codec_dai;
66+
struct snd_soc_dai *cpu_dai;
6667
int j;
6768
int ret = 0;
6869

6970
/* set spk pin by playback only */
7071
if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
7172
return 0;
7273

74+
cpu_dai = asoc_rtd_to_cpu(rtd, 0);
7375
for_each_rtd_codec_dais(rtd, j, codec_dai) {
74-
struct snd_soc_component *component = codec_dai->component;
7576
struct snd_soc_dapm_context *dapm =
76-
snd_soc_component_get_dapm(component);
77+
snd_soc_component_get_dapm(cpu_dai->component);
7778
char pin_name[MAX_98373_PIN_NAME];
7879

7980
snprintf(pin_name, ARRAY_SIZE(pin_name), "%s Spk",

0 commit comments

Comments
 (0)