-
Notifications
You must be signed in to change notification settings - Fork 143
ASoC: SOF: Intel: reset SPIB in hda_data_stream_cleanup #5718
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
base: topic/sof-dev
Are you sure you want to change the base?
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 |
|---|---|---|
|
|
@@ -1324,11 +1324,23 @@ int hda_data_stream_cleanup(struct device *dev, struct snd_dma_buffer *dmab, | |
| struct snd_sof_dev *sdev = dev_get_drvdata(dev); | ||
| struct hdac_stream *hstream = hdac_stream(hext_stream); | ||
| int sd_offset = SOF_STREAM_SD_OFFSET(hstream); | ||
| int ret = 0; | ||
| int ret1; | ||
| int ret; | ||
|
|
||
| if (hstream->direction == SNDRV_PCM_STREAM_PLAYBACK) | ||
| ret = hda_dsp_stream_spib_config(sdev, hext_stream, HDA_DSP_SPIB_DISABLE, 0); | ||
| else | ||
| /* | ||
| * Reset SPIB. The SPIB value will only take effect when SPIB is enabled, | ||
| * That is why we need to set the value with HDA_DSP_SPIB_ENABLE | ||
| */ | ||
| ret = hda_dsp_stream_spib_config(sdev, hext_stream, HDA_DSP_SPIB_ENABLE, 0); | ||
| if (ret < 0) { | ||
| dev_err(sdev->dev, "%s: failed to reset SPIB: %d\n", __func__, ret); | ||
| } | ||
|
|
||
| ret1 = hda_dsp_stream_spib_config(sdev, hext_stream, HDA_DSP_SPIB_DISABLE, 0); | ||
| if (!ret) | ||
| ret = ret1; | ||
|
|
||
|
Comment on lines
+1334
to
+1342
|
||
| if (hstream->direction == SNDRV_PCM_STREAM_CAPTURE) | ||
| snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, sd_offset, | ||
| SOF_HDA_SD_CTL_DMA_START, 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.
ret1is non-descriptive in this context. Renaming it to reflect the operation (e.g.ret_disable) would make the error-handling logic easier to follow and reduce the chance of mistakes during future edits.