[alsa-devel] [PATCH 0/3] ASoC: core/dapm/topology: minor fixes
3 small patches that have been used for a while but not contributed upstream.
The first patch fixes a name mismatch when using the same machine driver on ApolloLake and GeminiLake Chromebooks.
The second one fixes a minor mistake in the location of a topology pointer update, and aligns the code on the same pattern.
The last one corrects yet another miss with the introduction of the new buffer/src/scheduler soc_dapm elements which were always showing as 'On'
Liam Girdwood (1): ASoC: topology: Align tplg pointer increment across all kcontrols
Pierre-Louis Bossart (1): ASoC: core: support driver alias names for FE topology overrides
Ranjani Sridharan (1): ASoC: dapm: set power_check callback for widgets that shouldnt be always on
sound/soc/soc-core.c | 7 +++++-- sound/soc/soc-dapm.c | 7 +++++++ sound/soc/soc-topology.c | 17 +++++++++-------- 3 files changed, 21 insertions(+), 10 deletions(-)
When the same machine driver is reused between platforms but with a different alias, using the driver name is not enough. Add additional fallback case to use the card device name.
Tested on GeminiLake with bxt_da7219_max98357a machine driver
Suggested-by: Liam Girdwood liam.r.girdwood@linux.intel.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/soc/soc-core.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 93d316d5bf8e..e1671cfb3cf0 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1974,10 +1974,13 @@ static void soc_check_tplg_fes(struct snd_soc_card *card) continue;
/* for this machine ? */ + if (!strcmp(component->driver->ignore_machine, + card->dev->driver->name)) + goto match; if (strcmp(component->driver->ignore_machine, - card->dev->driver->name)) + dev_name(card->dev))) continue; - +match: /* machine matches, so override the rtd data */ for_each_card_prelinks(card, i, dai_link) {
From: Liam Girdwood liam.r.girdwood@linux.intel.com
This aligns all kcontrol tplg pointer increments to be consistent in the respective create methods and ensures that the position is pointing to the next widget rather the current invalid widget.
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/soc/soc-topology.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index 25fca7055464..40fa2a48fa1d 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -993,8 +993,6 @@ static int soc_tplg_denum_create(struct soc_tplg *tplg, unsigned int count,
for (i = 0; i < count; i++) { ec = (struct snd_soc_tplg_enum_control *)tplg->pos; - tplg->pos += (sizeof(struct snd_soc_tplg_enum_control) + - ec->priv.size);
/* validate kcontrol */ if (strnlen(ec->hdr.name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN) == @@ -1005,6 +1003,9 @@ static int soc_tplg_denum_create(struct soc_tplg *tplg, unsigned int count, if (se == NULL) return -ENOMEM;
+ tplg->pos += (sizeof(struct snd_soc_tplg_enum_control) + + ec->priv.size); + dev_dbg(tplg->dev, "ASoC: adding enum kcontrol %s size %d\n", ec->hdr.name, ec->items);
@@ -1281,14 +1282,14 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_dmixer_create( if (sm == NULL) goto err;
- tplg->pos += (sizeof(struct snd_soc_tplg_mixer_control) + - mc->priv.size); - /* validate kcontrol */ if (strnlen(mc->hdr.name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN) == SNDRV_CTL_ELEM_ID_NAME_MAXLEN) goto err_str;
+ tplg->pos += (sizeof(struct snd_soc_tplg_mixer_control) + + mc->priv.size); + dev_dbg(tplg->dev, " adding DAPM widget mixer control %s at %d\n", mc->hdr.name, i);
@@ -1373,6 +1374,9 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_denum_create( if (se == NULL) goto err;
+ tplg->pos += (sizeof(struct snd_soc_tplg_enum_control) + + ec->priv.size); + dev_dbg(tplg->dev, " adding DAPM widget enum control %s\n", ec->hdr.name);
@@ -1437,9 +1441,6 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_denum_create( ec->hdr.name); goto err_se; } - - tplg->pos += (sizeof(struct snd_soc_tplg_enum_control) + - ec->priv.size); }
return kc;
From: Ranjani Sridharan ranjani.sridharan@linux.intel.com
Currently, buffers, schedulers, src's, encoders, decoders and effect type dapm widgets remain always on as their power_check method is not set. Setting this callback allows these widgets in the audio path to be powered managed properly.
Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/soc/soc-dapm.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 1ec06ef6d161..4bc31b91fded 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -3650,6 +3650,13 @@ snd_soc_dapm_new_control_unlocked(struct snd_soc_dapm_context *dapm, case snd_soc_dapm_dac: case snd_soc_dapm_aif_in: case snd_soc_dapm_pga: + case snd_soc_dapm_buffer: + case snd_soc_dapm_scheduler: + case snd_soc_dapm_effect: + case snd_soc_dapm_src: + case snd_soc_dapm_asrc: + case snd_soc_dapm_encoder: + case snd_soc_dapm_decoder: case snd_soc_dapm_out_drv: case snd_soc_dapm_micbias: case snd_soc_dapm_line:
participants (1)
-
Pierre-Louis Bossart