ASoC: sdw_utils: generate combined spk components string#5445
ASoC: sdw_utils: generate combined spk components string#5445bardliao merged 2 commits intothesofproject:topic/sof-devfrom
Conversation
| { | ||
| .direction = {true, false}, | ||
| .dai_name = "rt1320-aif1", | ||
| .component_name = "rt1320", |
There was a problem hiding this comment.
I would update the commit message and reword/sentence it as these:
extracted from DAI name. And different codecs
without rely on the rtd_init. And can combine different
Sentences are not really easy to follow.
I would also mention why you only add the component_name to SOC_SDW_DAI_TYPE_AMP only (as far as I can see).
There was a problem hiding this comment.
commit message updated.
| { | ||
| .direction = {true, true}, | ||
| .dai_name = "max98373-aif1", | ||
| .component_name = "mx8373", |
There was a problem hiding this comment.
is it max98373 or mx8373 ?
There was a problem hiding this comment.
According to https://github.com/thesofproject/linux/blob/topic/sof-dev/sound/soc/sdw_utils/soc_sdw_maxim.c#L31, I think it should be mx8373.
card->components = devm_kasprintf(card->dev, GFP_KERNEL,
"%s spk:mx%04x",
card->components, maxim_part_id);|
|
||
| int asoc_sdw_cs_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) | ||
| { | ||
| const char *dai_name = rtd->dai_link->codecs->dai_name; |
There was a problem hiding this comment.
do you have a link for the suggestion? Out of curiosity
There was a problem hiding this comment.
| if (strlen (spk_components) == 0) | ||
| spk_components = | ||
| devm_kasprintf(card->dev, GFP_KERNEL, "%s", | ||
| codec_info->dais[dai_index].component_name); |
There was a problem hiding this comment.
I guess we need a human readable (UCM readable) name here, right?
iow, "spk:rt722+rt1320" and "spk:0x722+0x1320" (printing the part_id as %#x) would not work here, right?
There was a problem hiding this comment.
Right, it will be "spk:rt722+rt1320" as it is "spk:rt722 spk:rt1320" now.
8839376 to
f394dd5
Compare
Currently the sdw machine driver uses different way to get the component name from the DAI name for different codecs in the rtd_init callback. It means that we need to rely on the rtd_init callback to get the component name. Add an optional component string to the asoc_sdw_dai_info struct allows the machine driver to get the component name directly. The commit adds the component names for the AMP dais for the preparation to set card->components string for combined speaker configs. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
The suggestion from UCM for 2 speaker components is using 1 "spk" tag with 2 component names. Like "spk:rt722+rt1320". The commit removes the creation of the "spk" components in each rtd_init callback and creat the string in asoc_sdw_rtd_init(). Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
f394dd5 to
a6f3a25
Compare
The suggestion from UCM for 2 speaker components is using 1 "spk" tag with 2 component names. Like "spk:rt722+rt1320". The PR creates the combined spk component string with the suggested format.
Note that I didn't tough the
cs35l56-bridgeandcs42l43-spkstrings since they seem be special cases. I.e. Depends on the quirks. Not sure how UCM work when cs42l43 speaker and cs35l56 work together. :)