Skip to content

Commit

Permalink
ASoC: core: Add name prefix for machines with topology rewrites
Browse files Browse the repository at this point in the history
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
lrgirdwo authored and broonie committed Apr 17, 2018
1 parent 45f8cb5 commit f11a5c2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/sound/soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -1015,6 +1015,7 @@ struct snd_soc_platform_driver {

/* this platform uses topology and ignore machine driver FEs */
const char *ignore_machine;
const char *topology_name_prefix;
int (*be_hw_params_fixup)(struct snd_soc_pcm_runtime *rtd,
struct snd_pcm_hw_params *params);
bool use_dai_pcm_id; /* use the DAI link PCM ID as PCM device number */
Expand Down Expand Up @@ -1167,6 +1168,7 @@ struct snd_soc_card {
const char *long_name;
const char *driver_name;
char dmi_longname[80];
char topology_shortname[32];

struct device *dev;
struct snd_card *snd_card;
Expand Down
8 changes: 8 additions & 0 deletions sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2143,6 +2143,14 @@ static void soc_check_tplg_fes(struct snd_soc_card *card)
if (!dai_link->stream_name)
dai_link->stream_name = dai_link->name;
}

/* Inform userspace we are using alternate topology */
if (platform->driver->topology_name_prefix) {
snprintf(card->topology_shortname, 32, "%s-%s",
platform->driver->topology_name_prefix,
card->name);
card->name = card->topology_shortname;
}
}
}

Expand Down

0 comments on commit f11a5c2

Please sign in to comment.