Skip to content

Commit

Permalink
ASoC: soc-core: filter use of 'ignore_machine' field
Browse files Browse the repository at this point in the history
The 'ignore_machine' field is currently used to ignore all FE dailinks
statically added by the machine drivers, as well as override the
fixups for the BE dailinks. The motivation for this field was
primarily to reuse the same machine driver on Intel devices, both with
legacy and SOF-based platform drivers.

SOF is now used on Mediatek platforms, where the same card uses
SOF-based dailinks to deal with DSP-managed streams, as well as
'regular' dailinks. The 'ignore_machine' field set by the core SOF
platform driver is too strong, with dailinks not managed by SOF being
modified.

This patch adds a stricter filtering so that only dailinks managed by
a topology-based SOF driver are modified.

Reported-by: YC Hung <[email protected]>
Signed-off-by: Pierre-Louis Bossart <[email protected]>
Reviewed-by: Curtis Malainey <[email protected]>
Reviewed-by: Ranjani Sridharan <[email protected]>
Reviewed-by: Curtis Malainey <[email protected]>
Reviewed-by: Daniel Baluta <[email protected]>
  • Loading branch information
plbossart authored and kv2019i committed Nov 29, 2021
1 parent 8b7791a commit d8aa75d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1771,6 +1771,19 @@ static void soc_check_tplg_fes(struct snd_soc_card *card)
match:
/* machine matches, so override the rtd data */
for_each_card_prelinks(card, i, dai_link) {
struct snd_soc_dai_link_component *dlc;
struct snd_soc_dai *dai;

/*
* ignore dailinks exposed by other components, with the
* assumption that all cpu_dais are exposed by the same
* component
*/
dlc = asoc_link_to_cpu(dai_link, 0);
dai = snd_soc_find_dai(dlc);

if (!dai || dai->component != component)
continue;

/* ignore this FE */
if (dai_link->dynamic) {
Expand Down

0 comments on commit d8aa75d

Please sign in to comment.