summaryrefslogtreecommitdiffstats
path: root/sound/soc/intel
AgeCommit message (Collapse)Author
2014-06-03Merge remote-tracking branches 'asoc/topic/gpio' and 'asoc/topic/intel' into ↵Mark Brown
asoc-next
2014-06-01ASoC: intel: The Baytrail/MAX98090 driver depends on I2CMark Brown
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-01ASoC: Intel: byt-rt5640: Use card PM ops from coreJarkko Nikula
Use card PM ops from ASoC core instead of defining custom PM ops here since we are calling anyway common suspend/resume callbacks. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-01ASoC: Intel: Use devm_snd_soc_register_cardJarkko Nikula
Simplify byt-rt5640.c and haswell.c machine drivers by using devm_snd_soc_register_card(). Remove also needless dev_set_drvdata() from byt_rt5640_probe() since snd_soc_register_card() does it too. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Cc: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-01ASoC: Intel: remove duplicate headersAndy Shevchenko
A few files contain duplicate headers. This patch removes the second entry of duplicate in each file under question. There is no functional changes. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Cc: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-01ASoC: Intel: Clear stored Baytrail DSP DMA pointer before stream startJarkko Nikula
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>
2014-06-01ASoC: Intel: byt/hsw: Add missing kthread_stop to error/cleanup pathImre Deak
Baytrail and Haswell SST IPC don't stop the kernel thread in error and cleanup path thus leaving orphan kernel thread behind in such a case. Also while at it, fix one error path in sst-haswell-ipc.c that doesn't free hsw->msg. [Jarkko: I edited the commit log a little] Signed-off-by: Imre Deak <imre.deak@intel.com> Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-01ASoC: Intel: Add Baytrail byt-max98090 machine driverJarkko Nikula
Add machine driver and ACPI probing for Baytrail SST with MAX98090 codec. Jack detect code from Kevin Strasser <kevin.strasser@intel.com>, GPIO resolving from Mika Westerberg <mika.westerberg@linux.intel.com> and fixes and cleanups from 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>
2014-05-26ASoC: Intel: avoid format string leak to thread nameKees Cook
This makes sure a format string can never get processed into the worker thread name from the device name. Signed-off-by: Kees Cook <keescook@chromium.org> Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-22Merge remote-tracking branches 'asoc/topic/headers', 'asoc/topic/intel', ↵Mark Brown
'asoc/topic/jz4740', 'asoc/topic/max98090', 'asoc/topic/max98095', 'asoc/topic/mc13783' and 'asoc/topic/multicodec' into asoc-next
2014-05-22Merge remote-tracking branch 'asoc/topic/dapm-init' into asoc-nextMark Brown
2014-05-22Merge remote-tracking branch 'asoc/topic/component' into asoc-nextMark Brown
2014-05-19ASoC: Intel: Fix pcm stream context restore crashKevin Strasser
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>
2014-05-19ASoC: Remove needless snd_soc_dapm_enable_pin() from machine driver initsJarkko Nikula
ALSA SoC core marks widgets as connected by default when they are initialized in snd_soc_dapm_new_control() so there is no need to call snd_soc_dapm_enable_pin() from machine driver init functions. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-19ASoC: Remove needless snd_soc_dapm_sync() from machine driver initsJarkko Nikula
ALSA SoC core takes care of calling snd_soc_dapm_sync() at the end snd_soc_instantiate_card() so there is no need to call it from machine driver init functions. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-16ASoC: Intel: remove codec memeber from codec structsVinod Koul
As we already have a memeber struct snd_sst_params.codec to fill this. so removing duplicate instance Signed-off-by: Vinod Koul <vinod.koul@intel.com> Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-16ASoC: Intel: add drain_notify supportVinod Koul
This patch adds the support to implement drain_notify in Intels mfld driver Signed-off-by: Vinod Koul <vinod.koul@intel.com> Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-16ASoC: Intel: Revert "rename pcm dias to media dai"Vinod Koul
This reverts commit 0cac6fc3eb5218fe40d1c2910abc643ab21d9f19. This comiit was dropped from rev2 and would not be required as it renames the platform ops as well which is not required. Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-15ASoC: Intel: Fix simultaneous Baytrail SST capture and playbackJarkko Nikula
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>
2014-05-14ASoC: Intel: Only export one Baytrail DAILiam Girdwood
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>
2014-05-14ASoC: Intel: Make Baytrail PCM data per stream rather than per DAI deviceLiam Girdwood
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>
2014-05-13Merge branch 'fix/intel' of ↵Mark Brown
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-intel Conflicts: sound/soc/intel/sst-baytrail-dsp.c
2014-05-13ASoC: Intel: Fix Baytrail SST DSP firmware loadingJarkko Nikula
Commit 10df350977b1 ("ASoC: Intel: Fix Audio DSP usage when IOMMU is enabled.") caused following regression in Baytrail SST: baytrail-pcm-audio baytrail-pcm-audio: error: DMA alloc failed baytrail-pcm-audio baytrail-pcm-audio: error: failed to load firmware Fix this by calling dma_coerce_mask_and_coherent() in sst_byt_init() with the same dma_dev device what is now used in sst_fw_new() when allocating the DMA buffer. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-13ASoC: Intel: Use ACPI device for Baytrail PCM buffer allocationJarkko Nikula
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>
2014-05-12ASoC: Intel: Allow byt-5640 machine driver and SST core go to suspendJarkko Nikula
Since there is no support for compressed audio in Baytrail ADSP firmware there is no need to leave it on during suspend since ALSA PCM buffers are too small for leaving ADSP on for playing or recording. Implement PM callbacks to Baytrail byt-rt5640.c machine driver that call snd_soc_suspend and snd_soc_resume functions and unset the ignore_suspend fields in DAI links. This makes soc-core and ALSA core gracefully suspend and resume active stream and call sst_byt_pcm_trigger() during suspend-resume cycle. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-12ASoC: Intel: Add Baytrail suspend/resume supportLiam Girdwood
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>
2014-05-12ASoC: Intel: Allow Rx/Tx message list can be cleared prior to suspendLiam Girdwood
Suspend/resume requires reloading FW to boot state so we need to also make sure that the driver matches the FW state at boot. 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>
2014-05-12ASoC: Intel: Move Baytrail extended fw address saving to sst_byt_boot()Jarkko Nikula
We have to save the physical address of extended firmware block in the beginning of mailbox every time when we boot the DSP firmware since that mailbox address is re-used after DSP firmware is running. Otherwise DSP firmware will get bogus extended firmware block address during next DSP boot. Currently this is not problem but becomes when DSP runtime rebooting is implemented. Prepare for that by moving extended firmware address saving from sst_byt_init() to sst_byt_boot(). Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-12ASoC: Intel: Pass stream start position to sst_byt_stream_start()Jarkko Nikula
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>
2014-05-12ASoC: Intel: Simplify Baytrail stream control IPC constructionJarkko Nikula
Baytrail ADSP stream IPC simplifies a little by moving IPC_IA_START_STREAM construction and sending directly into sst_byt_stream_start() from sst_byt_stream_operations(). This is because IPC_IA_START_STREAM is only stream IPC with extra message data so this move saves a few code lines. Main motivation for this is to prepare for passing stream start position to sst_byt_stream_start() which will be needed in resume code. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-12ASoC: Intel: Sample Baytrail DSP DMA pointer only after each periodJarkko Nikula
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>
2014-05-09ASoC: Intel: Build Medfield compressed opsMark Brown
Since commit 4b68b4e1c564 (ASoC: Intel: split the pcm and compress to different files) the compressed ops haven't been built causing link failures on allyesconfig and making the driver unbuildable. Add the object to the Makefile to fix that. Signed-off-by: Mark Brown <broonie@linaro.org> Acked-by Vinod Koul <vinod.koul@intel.com>
2014-05-08ASoC: Intel: rename pcm dias to media daiVinod Koul
this is for further updates to driver which supports DPCM :) Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-08ASoC: Intel: remove unused sst-mfld platform daisVinod Koul
With DPCM we have media dai used and no seperate headset and speaker dai so remove the speaker dai The vibra is no longer supported thru audio, so remove Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-08ASoC: Intel: split the pcm and compress to different filesVinod Koul
For manging them and adding support for more platforms Code move only Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-08ASoC: Intel: mark sst_set_stream_status as non staticVinod Koul
as this will be used in compressed split file in subsequent patch Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-08ASoc: Intel: rename sst-mfld-platform.cVinod Koul
to sst-mfld-platform-pcm.c so that we can split pcm and compress to different files for upcoming changes to support more platforms Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-08ASoC: Intel: remove FSF snail mail addressVinod Koul
As this address can move Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-08ASoC: Intel: move component registration blobVinod Koul
to the place near it is used Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-08ASoC: Intel: Add support to unload/reload firmware modules.Liam Girdwood
Add some SST API calls to unload and reload firmware modules. This can be used by PM code to restore state and also allow modular FW to unload and release memory blocks. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-07ASoC: Intel: Fix block offset calculations.Liam Girdwood
Block offset calculations are done in the contiguous allocator so are not required here. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-05ASoC: Intel: Fix check for pdata usage before dereference.Liam Girdwood
This patch fixes the following dereference check ordering. sound/soc/intel/sst-haswell-pcm.c:749 hsw_pcm_probe() warn: variable dereferenced before check 'pdata' (see line 746) git remote add asoc git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git git remote update asoc git checkout 0b708c87f66a15190fb43661c2320fd48c4dc6c8 vim +/pdata +749 sound/soc/intel/sst-haswell-pcm.c a4b12990 Mark Brown 2014-03-12 740 }; a4b12990 Mark Brown 2014-03-12 741 a4b12990 Mark Brown 2014-03-12 742 static int hsw_pcm_probe(struct snd_soc_platform *platform) a4b12990 Mark Brown 2014-03-12 743 { a4b12990 Mark Brown 2014-03-12 744 struct sst_pdata *pdata = dev_get_platdata(platform->dev); a4b12990 Mark Brown 2014-03-12 745 struct hsw_priv_data *priv_data; 0b708c87 Liam Girdwood 2014-05-02 @746 struct device *dma_dev = pdata->dma_dev; 0b708c87 Liam Girdwood 2014-05-02 747 int i, ret = 0; a4b12990 Mark Brown 2014-03-12 748 a4b12990 Mark Brown 2014-03-12 @749 if (!pdata) a4b12990 Mark Brown 2014-03-12 750 return -ENODEV; a4b12990 Mark Brown 2014-03-12 751 a4b12990 Mark Brown 2014-03-12 752 priv_data = devm_kzalloc(platform->dev, sizeof(*priv_data), GFP_KERNEL); Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-02ASoC: Intel: Fix stream position pointer.Liam Girdwood
Read the stream offset and presentation position from DSP memory rather than using the old estimated position. This fixes timing issues with pulseaudio. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-02ASoC: Intel: Fix allow hw_params to be called more than once.Liam Girdwood
hw_params() can be called multiple times. Make sure we release the DSP stream that was allocated on previous hw_params() calls before allocating a new DSP stream. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-02ASoC: Intel: Fix Audio DSP usage when IOMMU is enabled.Liam Girdwood
The Intel IOMMU requires that the ACPI device is used to allocate all DMA memory buffers. This means we need to pass the DMA device pointer into child component devices that allocate DMA memory. We also only set the DMA mask for the ACPI device now instead of for each component device. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-02ASoC: Intel: Fix Haswell/Broadwell DSP page table creation.Liam Girdwood
Fix page table creation on Haswell and Broadwell to remove unsafe virt_to_phys mappings and use more portable SG buffer. Use audio buffer APIs to allocate DMA buffers. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-02ASoC: Intel: Fix allocated block list usage when adding blocks.Liam Girdwood
Make sure we add the allocated blocks to the modules list of blocks. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-02ASoC: Intel: Fix block allocation so we only allocate blocks once.Liam Girdwood
Make sure we dont alloc blocks twice with requests spanning more than one block. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-24ASoC: Intel: Cancel hsw_notification_work before freeing the streamJarkko Nikula
I suppose there is a possibility that hsw_notification_work() may run after sst_hsw_stream_free() which can lead to a kernel crash since struct sst_hsw_stream is freed at that point and stream = container_of(work, struct sst_hsw_stream, notify_work) is not valid when hsw_notification_work() is run. Reported-by: Derek Basehore <dbasehore@chromium.org> Reported-by: Wenkai Du <wenkai.du@intel.com> Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-23ASoC: Intel: Fix audio crash due to race condition in stream deletionWenkai Du
There is a race between sst_byt_stream_free() and sst_byt_get_stream() if sst_byt_get_stream() called from sst_byt_irq_thread() context is accessing the byt->stream_list while a stream is deleted from the list. A stream is added to byt->stream_list in sst_byt_stream_new() and deleted in sst_byt_stream_free(). sst_byt_get_stream() is always protected by sst->spinlock, but the stream addition and deletion are not protected. The patch adds spinlock to both stream addition and deletion. [Jarkko: Same fix added to sst-haswell-ipc.c too] Signed-off-by: Wenkai Du <wenkai.du@intel.com> Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>