Skip to content

Commit

Permalink
[HACK] ASoC: soc-pcm: relax requirement on direction check
Browse files Browse the repository at this point in the history
The patches added a requirement that the cpu and codec dais support the direction set by the dailink.

One some Intel platform, we "cheat" when the echo reference is
generated. The dailink is marked as supporting capture even though the
amplifier cannot generate the echo reference; the echo reference is
actually generated in the firmware and the DAI not used for capture proper.

Signed-off-by: Pierre-Louis Bossart <[email protected]>
  • Loading branch information
plbossart committed Apr 25, 2024
1 parent e1df624 commit c102f11
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions sound/soc/soc-pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2844,9 +2844,21 @@ static int soc_get_playback_capture(struct snd_soc_pcm_runtime *rtd,
codec_capture_t = 1;
}

if (cpu_play_t && codec_play_t)
if (cpu_play_t && !codec_play_t) {
dev_err(rtd->dev, "CPU dai %s supports playback but codec DAI %s does not\n",
cpu_dai->name,
codec_dai->name);
}

if (cpu_capture_t && !codec_capture_t) {
dev_err(rtd->dev, "CPU dai %s supports capture but codec DAI %s does not\n",
cpu_dai->name,
codec_dai->name);
}

if (cpu_play_t)
has_playback = 1;
if (cpu_capture_t && codec_capture_t)
if (cpu_capture_t)
has_capture = 1;
}

Expand Down

0 comments on commit c102f11

Please sign in to comment.