summaryrefslogtreecommitdiffstats
path: root/sound/soc/intel/sst-baytrail-pcm.c
Commit message (Collapse)AuthorAgeFilesLines
* ASoC: Intel: Restore Baytrail ADSP streams only when ADSP was in resetJarkko Nikula2014-08-111-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | There is no need to restore and restart PCM streams in case ADSP didn't reach reset and power off state during system suspend/resume cycle. In that case stream is still active but paused and firmware doesn't allow allocating a new stream before paused stream is freed. ADSP remains active in case suspend sequence didn't go to suspend_late stage. This can happen when either suspend sequence is aborted by a wakeup or by letting only devices suspend by "echo devices >/sys/power/pm_test". Currently stream restoring fails in these suspend cases. Fix this by adding a flag that indicates is complete stream reinitialization needed or is it enough to resume paused stream. Flag is set when we know that ADSP reached suspend_late. Initial fix to this issue came from Fang Yang. I modified it a little and forward ported it to top of two other suspend/resume patches from me. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Tested-by: Borun Fu <borun.fu@intel.com> Cc: yang fang <yang.a.fang@intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: Intel: Wait Baytrail ADSP boot at resume_early stageJarkko Nikula2014-08-111-9/+4
| | | | | | | | | | | | Remove sst_byt_pcm_dev_resume() and move waiting of firmware boot into sst_byt_pcm_dev_resume_early(). Now suspend_late and resume_early phases are in sync with each other so that we know that ADSP was put into reset and was unpowered after suspend_late and is ready to resume IO after resume_early during resume stage in sst_byt_pcm_trigger(). Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Tested-by: Borun Fu <borun.fu@intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: Intel: Merge Baytrail ADSP suspend_noirq into suspend_lateJarkko Nikula2014-08-111-18/+0
| | | | | | | | | | | | | | | Merge DSP reset and cleanup sequence in sst_byt_pcm_dev_suspend_noirq() into sst_byt_pcm_dev_suspend_late(). First their order was wrong by first unloading firmware modules in suspend_late and then taking DSP into reset in suspend_noirq. Second ACPI has put device into OFF state already during suspend_late so trying to reset the DSP is a no-op at suspend_noirq stage. Fix these by moving DSP reset and cleanup into sst_byt_pcm_dev_suspend_late() before firmware unloading. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Tested-by: Borun Fu <borun.fu@intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: Intel: Cleanup HSW pcm format supportJie Yang2014-07-141-1/+1
| | | | | | | | | | | This change removes unsupported formats from System, Capture and Loopback FE DAIs. Also it fixes S24_LE support on all DAIs. While at this fix 24 bit flag for BYT as well. Signed-off-by: Jie Yang <yang.jie@intel.com> Signed-off-by: Mark Brown <broonie@linaro.org> Cc: stable@vger.kernel.org
* ASoC: Intel: Clear stored Baytrail DSP DMA pointer before stream startJarkko Nikula2014-06-011-0/+1
| | | | | | | | | Stored DSP DMA pointer must be cleared before starting the stream since PCM pointer callback sst_byt_pcm_pointer() can be called before pointer is updated. In that case last position of previous stream was wronly returned. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: Intel: Fix pcm stream context restore crashKevin Strasser2014-05-191-1/+3
| | | | | | | | | | | | | | | | In some cases the pcm stream is closed while context has been scheduled to be restored, causing a null pointer deref panic. Cancel work to ensure stream does not get freed while work is still active/pending. Also, restoring the pcm context can be safely skipped after the stream has been stopped. Check if pcm stream is still running before restoring stream context to help pending work finish more quickly in stream close path. Signed-off-by: Kevin Strasser <kevin.strasser@intel.com> Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: Intel: Fix simultaneous Baytrail SST capture and playbackJarkko Nikula2014-05-151-1/+1
| | | | | | | | | | | | I managed to drop a change to stream ID setting from commit 49fee1781634 ("ASoC: Intel: Only export one Baytrail DAI") leading to non-working simultaneous capture-playback since after one DAI conversion rtd->cpu_dai->id + 1 will be the same for both playback and capture. Use substream->stream + 1 like it was in original Liam's patch. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: Intel: Only export one Baytrail DAILiam Girdwood2014-05-141-5/+2
| | | | | | | | | | | | | We don't need more than one DAI for Baytrail SST. Usage becomes also more straightforward by grouping playback and capture streams under the same PCM device. [Jarkko: I made Liam's sst-baytrail-pcm.c change a few lines smaller and squashed together with my byt-rt5640.c change] Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: Intel: Make Baytrail PCM data per stream rather than per DAI deviceLiam Girdwood2014-05-141-8/+8
| | | | | | | | | | | | | Prepare for single Baytrail DAI playback/capture link by accessing PCM data using stream ID instead of rtd->dev. Now rtd->dev is unique for playback and capture since they are exported as separate DAIs but not once converted to single DAI. [Jarkko: Separated from another commit with updated commit log] Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: Intel: Use ACPI device for Baytrail PCM buffer allocationJarkko Nikula2014-05-131-5/+3
| | | | | | | | | | This follows the same idea than commit 10df350977b1 ("ASoC: Intel: Fix Audio DSP usage when IOMMU is enabled.") by using only ACPI device for all DMA allocations. Since DMA masking is already done in firmware loading it can be removed from here. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: Intel: Add Baytrail suspend/resume supportLiam Girdwood2014-05-121-1/+106
| | | | | | | | | | | | | | | | Add suspend and resume support to Baytrail SST DSP. This is implemented by unloading firmware modules and putting DSP into reset prior suspend and restarting DSP again in normal boot state after resume. Context restore for running streams is implemented by scheduling a work from sst_byt_pcm_trigger() that will allocate a stream with existing parameters and start it from last known buffer position before suspend. [Jarkko: Squashed together 5 WIP patches from Liam and 1 from me] Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: Intel: Pass stream start position to sst_byt_stream_start()Jarkko Nikula2014-05-121-1/+1
| | | | | | | | Stream start position will be needed in resume code. Prepare for it by adding start offset argument to sst_byt_stream_start(). Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: Intel: Sample Baytrail DSP DMA pointer only after each periodJarkko Nikula2014-05-121-13/+13
| | | | | | | | | | | | | | | | | | | | | This is for preparing suspend/resume support but can give also more safeguard against concurrent timestamp structure access between DSP firmware and host. Now DSP DMA pointer is sampled in each pcm pointer callback in sst_byt_pcm_pointer() but that is unneeded since DSP updates the timestamp period basis and can potentially be racy if sst_byt_pcm_pointer() is called when DSP is updating the timestamp. By taking DSP DMA pointer only after period elapsed IPC messages in byt_notify_pointer() and returning stored hw pointer in sst_byt_pcm_pointer() there is less risk for concurrent access. The same stored hw pointer can be also used in suspend/resume code for restarting the stream at the same position. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* Merge remote-tracking branches 'asoc/topic/ml26124', 'asoc/topic/of', ↵Mark Brown2014-03-121-0/+422
'asoc/topic/omap', 'asoc/topic/pxa' and 'asoc/topic/rcar' into asoc-next