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
S0ix rework#1631
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
S0ix rework #1631
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
b9e873d
ASoC: SOF: pm: Unify suspend/resume routines
ranj063 d36260e
ASoC: SOF: Do not reset hw_params for streams that ignored suspend
ranj063 247b06a
ASoC: SOF: Add system_suspend_target field to struct snd_sof_dev
ranj063 4f7e5de
ASoC: SOF: pm: Introduce DSP power states
ranj063 f16db35
ASoC: SOF: Move DSP power state transitions to platform-specific ops
ranj063 7cb4a25
ASoC: SOF: audio: Add helper to check if only D0i3 streams are active
ranj063 f71ad2c
ASoC: SOF: Intel: hda: Amend the DSP state transition diagram
ranj063 3c0e447
ASoC: SOF: Intel: cnl: Implement feature to support DSP D0i3 in S0
ranj063 0289044
ASoC: SOF: Intel: hda: Allow trace DMA in S0 when DSP is in D0I3 for …
ranj063 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 |
|---|---|---|
| @@ -171,23 +171,60 @@ static bool cnl_compact_ipc_compress(struct snd_sof_ipc_msg *msg, | ||
| static int cnl_ipc_send_msg(struct snd_sof_dev *sdev, | ||
| struct snd_sof_ipc_msg *msg) | ||
| { | ||
| struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata; | ||
| struct sof_ipc_cmd_hdr *hdr; | ||
| const struct sof_dsp_power_state target_state = { | ||
| .state = SOF_DSP_PM_D0, | ||
| .substate = SOF_HDA_DSP_PM_D0I0, | ||
| }; | ||
| u32 dr = 0; | ||
| u32 dd = 0; | ||
| int ret; | ||
| /* | ||
| * Currently the only compact IPC supported is the PM_GATE | ||
| * IPC which is used for transitioning the DSP between the | ||
| * D0I0 and D0I3 states. And these are sent only during the | ||
| * set_power_state() op. Therefore, there will never be a case | ||
| * that a compact IPC results in the DSP exiting D0I3 without | ||
| * the host and FW being in sync. | ||
| */ | ||
| if (cnl_compact_ipc_compress(msg, &dr, &dd)) { | ||
| /* send the message via IPC registers */ | ||
| snd_sof_dsp_write(sdev, HDA_DSP_BAR, CNL_DSP_REG_HIPCIDD, | ||
| dd); | ||
| snd_sof_dsp_write(sdev, HDA_DSP_BAR, CNL_DSP_REG_HIPCIDR, | ||
| CNL_DSP_REG_HIPCIDR_BUSY | dr); | ||
| } else { | ||
| /* send the message via mailbox */ | ||
| sof_mailbox_write(sdev, sdev->host_box.offset, msg->msg_data, | ||
| msg->msg_size); | ||
| snd_sof_dsp_write(sdev, HDA_DSP_BAR, CNL_DSP_REG_HIPCIDR, | ||
| CNL_DSP_REG_HIPCIDR_BUSY); | ||
| return 0; | ||
ranj063 marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| } | ||
| /* ensure the DSP is in D0I0 before sending the message via mailbox */ | ||
| ret = snd_sof_dsp_set_power_state(sdev, &target_state); | ||
| if (ret < 0) { | ||
| dev_err(sdev->dev, "error: resuming DSP %d\n", ret); | ||
| return ret; | ||
| } | ||
| /* send the message via mailbox */ | ||
| sof_mailbox_write(sdev, sdev->host_box.offset, msg->msg_data, | ||
| msg->msg_size); | ||
| snd_sof_dsp_write(sdev, HDA_DSP_BAR, CNL_DSP_REG_HIPCIDR, | ||
| CNL_DSP_REG_HIPCIDR_BUSY); | ||
| hdr = msg->msg_data; | ||
| /* | ||
| * Use mod_delayed_work() to schedule the delayed work | ||
| * to avoid scheduling multiple workqueue items when | ||
| * IPCs are sent at a high-rate. mod_delayed_work() | ||
| * modifies the timer if the work is pending. | ||
| * Also, a new delayed work should not be queued after the | ||
| * the CTX_SAVE IPC, which is sent before the DSP enters D3. | ||
| */ | ||
| if (hdr->cmd != (SOF_IPC_GLB_PM_MSG | SOF_IPC_PM_CTX_SAVE)) | ||
| mod_delayed_work(system_wq, &hdev->d0i3_work, | ||
| msecs_to_jiffies(SOF_HDA_D0I3_WORK_DELAY_MS)); | ||
| return 0; | ||
| } | ||
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.