ASoC: dapm: add code to configure dai link parameters
PATCH v9 1/1 ASoC: dapm: add code to configure dai link parameters
dai-link params for codec-codec links were fixed. The fixed link between codec and another chip which may be another codec, baseband, bluetooth codec etc may require run time configuaration changes. This change provides an optional alsa control to select one of the params from a list of params.
Signed-off-by Nikesh Oswal <[email protected]>
--- include/sound/soc-dapm.h | 3 + include/sound/soc.h | 1 + sound/soc/soc-core.c | 6 +- sound/soc/soc-dapm.c | 164 ++++++++++++++++++++++++++++++++++++++++++++-- 4 files changed, 166 insertions(+), 8 deletions(-)
include/sound/soc-dapm.h +3 -0
@@ -378,6 +378,7 @@ int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card);void snd_soc_dapm_connect_dai_link_widgets (struct snd_soc_card *card);int snd_soc_dapm_new_pcm (struct snd_soc_card *card,const struct snd_soc_pcm_stream *params, +unsigned int num_params,struct snd_soc_dapm_widget *source,struct snd_soc_dapm_widget *sink);
@@ -531,6 +532,8 @@ struct snd_soc_dapm_widget {void *priv;/* widget specific data */ struct regulator *regulator;/* attached regulator */ const struct snd_soc_pcm_stream *params;/* params for dai links */ +unsigned int num_params;/* number of params for dai links */ +unsigned int params_select;/* currently selected param for dai link */ /* dapm control */ int reg;/* negative reg = no direct dapm */
include/sound/soc.h +1 -0
@@ -941,6 +941,7 @@ struct snd_soc_dai_link {int be_id;/* optional ID for machine driver BE identification */ const struct snd_soc_pcm_stream *params; +unsigned int num_params;unsigned int dai_fmt;/* format to set on init */
sound/soc/soc-core.c +4 -2
@@ -1230,7 +1230,8 @@ static int soc_link_dai_widgets(struct snd_soc_card *card, capture_w = cpu_dai->capture_widget;if (play_w && capture_w) { ret =snd_soc_dapm_new_pcm (card, dai_link->params, - capture_w, play_w); + dai_link->num_params, capture_w, + play_w);if (ret !=0 ) {dev_err (card->dev,"ASoC: Can't link %s to %s: %d\n" , play_w->name, capture_w->name, ret);
@@ -1242,7 +1243,8 @@ static int soc_link_dai_widgets(struct snd_soc_card *card, capture_w = codec_dai->capture_widget;if (play_w && capture_w) { ret =snd_soc_dapm_new_pcm (card, dai_link->params, - capture_w, play_w); + dai_link->num_params, capture_w, + play_w);if (ret !=0 ) {dev_err (card->dev,"ASoC: Can't link %s to %s: %d\n" , play_w->name, capture_w->name, ret);
sound/soc/soc-dapm.c +158 -6
220 lines not on this page · raw message
Signature · 1 line
1.7.9.5
Quoted 5 lines · Nikesh Oswal
dai-link params for codec-codec links were fixed. The fixed link between codec and another chip which may be another codec, baseband, bluetooth codec etc may require run time configuaration changes. This change provides an optional alsa control to select one of the params from a list of params.
Applied, thanks!