Uh oh!
There was an error while loading. Please reload this page.
forked from torvalds/linux
- Notifications
You must be signed in to change notification settings - Fork 150
fixup! ASoC: SOF: Intel: hda: make sure DAI widget is set up before IPC#2888
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
Merged
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -41,11 +41,7 @@ | ||
| #define EXCEPT_MAX_HDR_SIZE 0x400 | ||
| #define HDA_EXT_ROM_STATUS_SIZE 8 | ||
| /* | ||
| * Helper function to set up a DAI widget in the DSP and then send the updated DAI config during | ||
| * hw_params or send the updated DAI_CONFIG and then free the DAI widget during hw_free | ||
| */ | ||
| int hda_ctrl_dai_widget_setup(struct snd_soc_dapm_widget *w, bool setup) | ||
| int hda_ctrl_dai_widget_setup(struct snd_soc_dapm_widget *w) | ||
| { | ||
| struct snd_sof_widget *swidget = w->dobj.private; | ||
| struct snd_soc_component *component = swidget->scomp; | ||
| @@ -66,28 +62,60 @@ int hda_ctrl_dai_widget_setup(struct snd_soc_dapm_widget *w, bool setup) | ||
| /* | ||
| * For static pipelines, the DAI widget would already be set up and calling | ||
| * sof_widget_setup()/free() simply returns without doing anything. | ||
| * For dynamic pipelines, the DAI widget will be set up or freed here. | ||
| * sof_widget_setup() simply returns without doing anything. | ||
| * For dynamic pipelines, the DAI widget will be set up now. | ||
| */ | ||
| if (setup) { | ||
| ret = sof_widget_setup(sdev, swidget); | ||
| if (ret < 0) { | ||
| dev_err(sdev->dev, "error: setting up DAI widget %s\n", w->name); | ||
| return ret; | ||
| } | ||
| ret = sof_widget_setup(sdev, swidget); | ||
| if (ret < 0) { | ||
| dev_err(sdev->dev, "error: failed setting up DAI widget %s\n", w->name); | ||
| return ret; | ||
| } | ||
| /* send DAI_CONFIG IPC */ | ||
| return sof_ipc_tx_message(sdev->ipc, config->hdr.cmd, config, config->hdr.size, | ||
| &reply, sizeof(reply)); | ||
| /* send DAI_CONFIG IPC */ | ||
| ret = sof_ipc_tx_message(sdev->ipc, config->hdr.cmd, config, config->hdr.size, | ||
| &reply, sizeof(reply)); | ||
| if (ret < 0) { | ||
| dev_err(sdev->dev, "error: failed setting DAI config for %s\n", w->name); | ||
| return ret; | ||
| } | ||
| sof_dai->configured = true; | ||
| return 0; | ||
| } | ||
| int hda_ctrl_dai_widget_free(struct snd_soc_dapm_widget *w) | ||
| { | ||
| struct snd_sof_widget *swidget = w->dobj.private; | ||
| struct snd_soc_component *component = swidget->scomp; | ||
| struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(component); | ||
| struct sof_ipc_dai_config *config; | ||
| struct snd_sof_dai *sof_dai; | ||
| struct sof_ipc_reply reply; | ||
| int ret; | ||
| sof_dai = swidget->private; | ||
| if (!sof_dai || !sof_dai->dai_config) { | ||
| dev_err(sdev->dev, "error: No config to free DAI %s\n", w->name); | ||
| return -EINVAL; | ||
| } | ||
| /* nothing to do if hw_free() is called without restarting the stream after resume. */ | ||
| if (!sof_dai->configured) | ||
ranj063 marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| return 0; | ||
| config = &sof_dai->dai_config[sof_dai->current_config]; | ||
| ret = sof_ipc_tx_message(sdev->ipc, config->hdr.cmd, config, config->hdr.size, | ||
| &reply, sizeof(reply)); | ||
| if (ret < 0) { | ||
| dev_err(sdev->dev, "error: updating DAI config for %s\n", w->name); | ||
| dev_err(sdev->dev, "error: failed resetting DAI config for %s\n", w->name); | ||
| return ret; | ||
| } | ||
| sof_dai->configured = false; | ||
| return sof_widget_free(sdev, swidget); | ||
| } | ||
| @@ -129,7 +157,10 @@ static int sdw_dai_config_ipc(struct snd_sof_dev *sdev, | ||
| config->dai_index = (link_id << 8) | dai_id; | ||
| config->alh.stream_id = alh_stream_id; | ||
| return hda_ctrl_dai_widget_setup(w, setup); | ||
| if (setup) | ||
| return hda_ctrl_dai_widget_setup(w); | ||
| return hda_ctrl_dai_widget_free(w); | ||
| } | ||
| static int sdw_params_stream(struct device *dev, | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.