forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 140
ASoC: SOF: Intel: hda: Disable L1 support during capture #1070
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
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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
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 |
|---|---|---|
|
|
@@ -185,6 +185,17 @@ hda_dsp_stream_get(struct snd_sof_dev *sdev, int direction) | |
| direction == SNDRV_PCM_STREAM_PLAYBACK ? | ||
| "playback" : "capture"); | ||
|
|
||
| /* | ||
| * Disable DMI Link L1 entry when capture stream is opened. | ||
| * Workaround to address a known issue with host DMA that results | ||
| * in xruns during pause/release in capture scenarios. | ||
| */ | ||
| if (!IS_ENABLED(SND_SOC_SOF_HDA_ALWAYS_ENABLE_DMI_L1)) | ||
| if (stream && direction == SNDRV_PCM_STREAM_CAPTURE) | ||
| snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, | ||
| HDA_VS_INTEL_EM2, | ||
| HDA_VS_INTEL_EM2_L1SEN, 0); | ||
|
|
||
| return stream; | ||
| } | ||
|
|
||
|
|
@@ -193,23 +204,43 @@ int hda_dsp_stream_put(struct snd_sof_dev *sdev, int direction, int stream_tag) | |
| { | ||
| struct hdac_bus *bus = sof_to_bus(sdev); | ||
| struct hdac_stream *s; | ||
| bool active_capture_stream = false; | ||
| bool found = false; | ||
|
|
||
| spin_lock_irq(&bus->reg_lock); | ||
|
|
||
| /* find used stream */ | ||
| /* | ||
| * close stream matching the stream tag | ||
| * and check if there are any open capture streams. | ||
| */ | ||
| list_for_each_entry(s, &bus->stream_list, list) { | ||
ranj063 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| if (s->direction == direction && | ||
| s->opened && s->stream_tag == stream_tag) { | ||
| if (!s->opened) | ||
| continue; | ||
|
|
||
| if (s->direction == direction && s->stream_tag == stream_tag) { | ||
| s->opened = false; | ||
| spin_unlock_irq(&bus->reg_lock); | ||
| return 0; | ||
| found = true; | ||
| } else if (s->direction == SNDRV_PCM_STREAM_CAPTURE) { | ||
| active_capture_stream = true; | ||
|
Member
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 don't get the logic here, testing twice for the s->direction is very odd. |
||
| } | ||
| } | ||
|
|
||
| spin_unlock_irq(&bus->reg_lock); | ||
|
|
||
| dev_dbg(sdev->dev, "stream_tag %d not opened!\n", stream_tag); | ||
| return -ENODEV; | ||
| /* Enable DMI L1 entry if there are no capture streams open */ | ||
| if (!IS_ENABLED(SND_SOC_SOF_HDA_ALWAYS_ENABLE_DMI_L1)) | ||
| if (!active_capture_stream) | ||
| snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, | ||
| HDA_VS_INTEL_EM2, | ||
| HDA_VS_INTEL_EM2_L1SEN, | ||
| HDA_VS_INTEL_EM2_L1SEN); | ||
|
|
||
| if (!found) { | ||
| dev_dbg(sdev->dev, "stream_tag %d not opened!\n", stream_tag); | ||
| return -ENODEV; | ||
| } | ||
|
|
||
| return 0; | ||
| } | ||
|
|
||
| int hda_dsp_stream_trigger(struct snd_sof_dev *sdev, | ||
|
|
||
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.