Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 150
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| 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.
Uh oh!There was an error while loading. Please reload this page. | ||
| 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, | ||
Uh oh!
There was an error while loading. Please reload this page.