-
Notifications
You must be signed in to change notification settings - Fork 142
ASoC: sdw_utils: generate combined spk components string #5445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -135,6 +135,7 @@ struct asoc_sdw_codec_info codec_info_list[] = { | |
| { | ||
| .direction = {true, false}, | ||
| .dai_name = "rt712-sdca-aif2", | ||
| .component_name = "rt712", | ||
| .dai_type = SOC_SDW_DAI_TYPE_AMP, | ||
| .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID}, | ||
| .init = asoc_sdw_rt_amp_init, | ||
|
|
@@ -275,6 +276,7 @@ struct asoc_sdw_codec_info codec_info_list[] = { | |
| { | ||
| .direction = {true, false}, | ||
| .dai_name = "rt1320-aif1", | ||
| .component_name = "rt1320", | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would update the commit message and reword/sentence it as these: I would also mention why you only add the component_name to SOC_SDW_DAI_TYPE_AMP only (as far as I can see).
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. commit message updated. |
||
| .dai_type = SOC_SDW_DAI_TYPE_AMP, | ||
| .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID}, | ||
| .init = asoc_sdw_rt_amp_init, | ||
|
|
@@ -409,6 +411,7 @@ struct asoc_sdw_codec_info codec_info_list[] = { | |
| { | ||
| .direction = {true, false}, | ||
| .dai_name = "rt722-sdca-aif2", | ||
| .component_name = "rt722", | ||
| .dai_type = SOC_SDW_DAI_TYPE_AMP, | ||
| /* No feedback capability is provided by rt722-sdca codec driver*/ | ||
| .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID}, | ||
|
|
@@ -438,6 +441,7 @@ struct asoc_sdw_codec_info codec_info_list[] = { | |
| { | ||
| .direction = {true, true}, | ||
| .dai_name = "max98373-aif1", | ||
| .component_name = "mx8373", | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is it max98373 or mx8373 ?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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); |
||
| .dai_type = SOC_SDW_DAI_TYPE_AMP, | ||
| .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_AMP_IN_DAI_ID}, | ||
| .init = asoc_sdw_maxim_init, | ||
|
|
@@ -456,6 +460,7 @@ struct asoc_sdw_codec_info codec_info_list[] = { | |
| { | ||
| .direction = {true, false}, | ||
| .dai_name = "max98363-aif1", | ||
| .component_name = "mx8363", | ||
| .dai_type = SOC_SDW_DAI_TYPE_AMP, | ||
| .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID}, | ||
| .init = asoc_sdw_maxim_init, | ||
|
|
@@ -491,6 +496,7 @@ struct asoc_sdw_codec_info codec_info_list[] = { | |
| { | ||
| .direction = {true, false}, | ||
| .dai_name = "cs35l56-sdw1", | ||
| .component_name = "cs35l56", | ||
| .dai_type = SOC_SDW_DAI_TYPE_AMP, | ||
| .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID}, | ||
| .init = asoc_sdw_cs_amp_init, | ||
|
|
@@ -516,6 +522,7 @@ struct asoc_sdw_codec_info codec_info_list[] = { | |
| { | ||
| .direction = {true, false}, | ||
| .dai_name = "cs35l56-sdw1", | ||
| .component_name = "cs35l56", | ||
| .dai_type = SOC_SDW_DAI_TYPE_AMP, | ||
| .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID}, | ||
| .init = asoc_sdw_cs_amp_init, | ||
|
|
@@ -733,6 +740,7 @@ int asoc_sdw_rtd_init(struct snd_soc_pcm_runtime *rtd) | |
| struct snd_soc_card *card = rtd->card; | ||
| struct asoc_sdw_codec_info *codec_info; | ||
| struct snd_soc_dai *dai; | ||
| const char *spk_components=""; | ||
| int dai_index; | ||
| int ret; | ||
| int i; | ||
|
|
@@ -785,7 +793,32 @@ int asoc_sdw_rtd_init(struct snd_soc_pcm_runtime *rtd) | |
| if (ret) | ||
| return ret; | ||
| } | ||
|
|
||
| /* Generate the spk component string for card->components string */ | ||
| if (codec_info->dais[dai_index].dai_type == SOC_SDW_DAI_TYPE_AMP && | ||
| codec_info->dais[dai_index].component_name) { | ||
| if (strlen (spk_components) == 0) | ||
| spk_components = | ||
| devm_kasprintf(card->dev, GFP_KERNEL, "%s", | ||
| codec_info->dais[dai_index].component_name); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess we need a human readable (UCM readable) name here, right?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right, it will be "spk:rt722+rt1320" as it is "spk:rt722 spk:rt1320" now. |
||
| else | ||
| /* Append component name to spk_components */ | ||
| spk_components = | ||
| devm_kasprintf(card->dev, GFP_KERNEL, | ||
| "%s+%s", spk_components, | ||
| codec_info->dais[dai_index].component_name); | ||
| } | ||
|
|
||
| codec_info->dais[dai_index].rtd_init_done = true; | ||
|
|
||
| } | ||
|
|
||
| if (strlen (spk_components) > 0) { | ||
| /* Update card components for speaker components */ | ||
| card->components = devm_kasprintf(card->dev, GFP_KERNEL, "%s spk:%s", | ||
| card->components, spk_components); | ||
| if (!card->components) | ||
| return -ENOMEM; | ||
| } | ||
|
|
||
| return 0; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you have a link for the suggestion? Out of curiosity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alsa-project/alsa-ucm-conf#567 (comment)