Skip to content

Commit

Permalink
ASoC: add control components management
Browse files Browse the repository at this point in the history
This ASCII string can carry additional information about
soundcard components or configuration. Add the possibility
to set this string via the ASoC card.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Cc: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20191119174933.25526-1-perex@perex.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Jaroslav Kysela authored and Mark Brown committed Nov 20, 2019
1 parent 0ced7b0 commit dc73d73
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/sound/soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -982,6 +982,7 @@ struct snd_soc_card {
const char *name;
const char *long_name;
const char *driver_name;
const char *components;
char dmi_longname[80];
char topology_shortname[32];

Expand Down
13 changes: 13 additions & 0 deletions sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2108,6 +2108,19 @@ static int snd_soc_bind_card(struct snd_soc_card *card)
soc_setup_card_name(card->snd_card->driver,
card->driver_name, card->name, 1);

if (card->components) {
/* the current implementation of snd_component_add() accepts */
/* multiple components in the string separated by space, */
/* but the string collision (identical string) check might */
/* not work correctly */
ret = snd_component_add(card->snd_card, card->components);
if (ret < 0) {
dev_err(card->dev, "ASoC: %s snd_component_add() failed: %d\n",
card->name, ret);
goto probe_end;
}
}

if (card->late_probe) {
ret = card->late_probe(card);
if (ret < 0) {
Expand Down

0 comments on commit dc73d73

Please sign in to comment.