aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-pcm.c
AgeCommit message (Collapse)Author
2019-11-20ASoC: dpcm: Properly initialise hw->rate_maxCharles Keepax
[ Upstream commit e33ffbd9cd39da09831ce62c11025d830bf78d9e ] If the CPU DAI does not initialise rate_max, say if using using KNOT or CONTINUOUS, then the rate_max field will be initialised to 0. A value of zero in the rate_max field of the hardware runtime will cause the sound card to support no sample rates at all. Obviously this is not desired, just a different mechanism is being used to apply the constraints. As such update the setting of rate_max in dpcm_init_runtime_hw to be consistent with the non-DPCM cases and set rate_max to UINT_MAX if nothing is defined on the CPU DAI. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-07-10ASoC: soc-pcm: BE dai needs prepare when pause release after resumeLibin Yang
[ Upstream commit 5087a8f17df868601cd7568299e91c28086d2b45 ] If playback/capture is paused and system enters S3, after system returns from suspend, BE dai needs to call prepare() callback when playback/capture is released from pause if RESUME_INFO flag is not set. Currently, the dpcm_be_dai_prepare() function will block calling prepare() if the pcm is in SND_SOC_DPCM_STATE_PAUSED state. This will cause the following test case fail if the pcm uses BE: playback -> pause -> S3 suspend -> S3 resume -> pause release The playback may exit abnormally when pause is released because the BE dai prepare() is not called. This patch allows dpcm_be_dai_prepare() to call dai prepare() callback in SND_SOC_DPCM_STATE_PAUSED state. Signed-off-by: Libin Yang <libin.yang@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-05-10ASoC:soc-pcm:fix a codec fixup issue in TDM caseRander Wang
[ Upstream commit 570f18b6a8d1f0e60e8caf30e66161b6438dcc91 ] On HDaudio platforms, if playback is started when capture is working, there is no audible output. This can be root-caused to the use of the rx|tx_mask to store an HDaudio stream tag. If capture is stared before playback, rx_mask would be non-zero on HDaudio platform, then the channel number of playback, which is in the same codec dai with the capture, would be changed by soc_pcm_codec_params_fixup based on the tx_mask at first, then overwritten by this function based on rx_mask at last. According to the author of tx|rx_mask, tx_mask is for playback and rx_mask is for capture. And stream direction is checked at all other references of tx|rx_mask in ASoC, so here should be an error. This patch checks stream direction for tx|rx_mask for fixup function. This issue would affect not only HDaudio+ASoC, but also I2S codecs if the channel number based on rx_mask is not equal to the one for tx_mask. It could be rarely reproduecd because most drivers in kernel set the same channel number to tx|rx_mask or rx_mask is zero. Tested on all platforms using stream_tag & HDaudio and intel I2S platforms. Signed-off-by: Rander Wang <rander.wang@linux.intel.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
2018-08-08Merge branch 'asoc-4.18' into asoc-4.19 wmadsp depMark Brown
2018-08-01ASoC: soc-pcm: Use delay set in component pointer functionAkshu Agrawal
Take into account the base delay set in pointer callback. There are cases where a pointer function populates runtime->delay, such as: ./sound/pci/hda/hda_controller.c ./sound/soc/intel/atom/sst-mfld-platform-pcm.c This delay was getting lost and was overwritten by delays from codec or cpu dai delay function if exposed. Now, Total delay = base delay + cpu_dai delay + codec_dai delay Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-11ASoC: dpcm: add rate merge to the BE stream mergeJerome Brunet
As done for format and channels, add the possibility to merge the backend rates on the frontend rates. This useful if the backend does not support all rates supported by the frontend, or if several backends (cpu and codecs) with different capabilities are connected to the same frontend. Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-11ASoC: dpcm: rework runtime stream mergeJerome Brunet
The goal of this patch is to simplify a bit dpcm runtime stream merge by removing several local variables. ATM, merge functions return the BE 'filter' values which should then be filtered against the FE stream values. This create a lot of local variable and unnecessary init of min and max. Instead of this, we can pass the FE stream values directly and let the BE filtering functions perform the merge 'in-place' Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-03ASoC: core: Allow topology to override machine driver FE DAI link config.Liam Girdwood
Machine drivers statically define a number of DAI links that currently cannot be changed or removed by topology. This means PCMs and platform components cannot be changed by topology at runtime AND machine drivers are tightly coupled to topology. This patch allows topology to override the machine driver DAI link config in order to reuse machine drivers with different topologies and platform components. The patch supports :- 1) create new FE PCMs with a topology defined PCM ID. 2) destroy existing static FE PCMs 3) change the platform component driver. 4) assign any new HW params fixups. 5) assign a new card name prefix to differentiate this topology to userspace. The patch requires no changes to the machine drivers, but does add some platform component flags that the platform component driver can assign before loading topologies. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-02ASoC: soc-pcm.c: convert to SPDX identifiersKuninori Morimoto
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-28ASoC: dpcm: don't merge format from invalid codec daiJerome Brunet
When merging codec formats, dpcm_runtime_base_format() should skip the codecs which are not supporting the current stream direction. At the moment, if a BE link has more than one codec, and only one of these codecs has no capture DAI, it becomes impossible to start a capture stream because the merged format would be 0. Skipping invalid codec DAI solves the problem. Fixes: b073ed4e2126 ("ASoC: soc-pcm: DPCM cares BE format") Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
2018-06-28ASoC: dpcm: extend channel merging to the backend cpu daiJerome Brunet
Extend dpcm_merge_chan to also check backend cpu dai channels capabilities. Apply the same policy as soc_pcm_init_runtime_hw() for multicodec links and only check cpu dai in this case. Cc: Jiada Wang <jiada_wang@mentor.com> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-28ASoC: dpcm: improve runtime update predictabilityJerome Brunet
As it is, dpcm_runtime_update() performs the old path and new path update of a frontend before going on to the next frontend DAI. Depending the order of the FEs within the rtd list, the result of the update might be different. For example: * Frontend A connected to backend C, with a 48kHz playback * Frontend B connected to backend D, with a 44.1kHz playback * FE A appears before FE B in the rtd list of the card. If we reparent BE C to FE B (disconnecting BE D): * old path update of FE A will run first, and BE C will get hw_free() and shutdown() * new path update of FE B will run after and BE C, which is stopped, so it will be configured at 44.1kHz, as expected If we reparent BE D to FE A (disconnecting BE C): * new path update of FE A will run first but since BE D is still running at 44.1kHz, it won't be reconfigured (no call to startup() or hw_params()) * old path update of FE B runs after, nothing happens * In this case, we end up with a BE playing at 44.1kHz a stream which is supposed to be played at 48Khz (too slow) To improve this situation, this patch performs all the FE old paths update before going on to update the new paths. With this, the result should no longer depend on the order of the FE within the card rtd list. Please note that there might be a small performance penalty since dpcm_process_paths() is called twice per stream direction. Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-22ASoC: soc-pcm: DPCM cares BE channel constraintJiada Wang
Current DPCM is caring only FE channel configuration. Sometimes it will be trouble if user selects channel which isn't supported by BE. This patch adds new .dpcm_merged_chan on struct snd_soc_dai_link. DPCM will use FE / BE merged channel if struct snd_soc_dai_link has it. Signed-off-by: Jiada Wang <jiada_wang@mentor.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-19ASoC: pcm: Tidy up open/hw_params handlingCharles Keepax
Currently, the core will continue processing open/hw_params component callbacks after one has failed even though it will abort immediately afterwards. This is unnecessary and also has the issue that close/hw_free will be called on the component which failed open/hw_params which could result in issues if the driver doesn't expect this behaviour. Update the core to abort processing open/hw_params when an error is hit and only call close/hw_free for those components that were successfully opened. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-30ASoC: core: Fix return code shown on error for hw_paramsJon Hunter
When the call to hw_params for a component fails, the error code is held by the variable '__ret' but the error message displays the value held by the variable 'ret'. Fix the return code shown when hw_params fails for a component. Fixes: b8135864d4d3 ("ASoC: snd_soc_component_driver has snd_pcm_ops") Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-29ASoC: dpcm: symmetry constraint on FE substreamKai Chieh Chuang
We should set BE symmetric constraint on FE substream. in case one BE is used by two FE1/FE2, the first BE runtime will use FE1's substream->runtime. hence the FE1's will be constrained by BE symmetry property. Though, second FE2 call dpcm_apply_symmetry, the be_substream->runtime == FE1's substream->runtime. The FE2's substream->runtime will not be constrained by BE's symmetry property. Signed-off-by: KaiChieh Chuang <kaichieh.chuang@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-29ASoC: dpcm: fix BE dai not hw_free and shutdownKai Chieh Chuang
In case, one BE is used by two FE1/FE2 FE1--->BE--> | FE2----] when FE1/FE2 call dpcm_be_dai_hw_free() together the BE users will be 2 (> 1), hence cannot be hw_free the be state will leave at, ex. SND_SOC_DPCM_STATE_STOP later FE1/FE2 call dpcm_be_dai_shutdown(), will be skip due to wrong state. leaving the BE not being hw_free and shutdown. The BE dai will be hw_free later when calling dpcm_be_dai_shutdown() if still in invalid state. Signed-off-by: KaiChieh Chuang <kaichieh.chuang@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-21ASoC: core: fix return code in error messageDaniel Mack
Log the correct error code in case the .open() call to a component fails. Signed-off-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-09ASoC: remove Codec related codeKuninori Morimoto
Now no one is using Codec related code. Let's remove all Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-09ASoC: remove unneeded .pcm_new/freeKuninori Morimoto
commit ef050bece1b55 ("ASoC: Remove platform code now everything is componentised") removed platform code, but it didn't remove .pcm_new/free which existed only for platform. This patch remove these Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-04-26ASoC: Remove platform code now everything is componentisedCharles Keepax
As all drivers have been moved over to the new generic component code remove the now unused platform specific code. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Acked-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-04-19ASoC: topology: Revert recent changes while boot errors are investigatedMark Brown
Krzysztof Kozlowski reported a NULL dereference in _instantiate_card() on Odroid XU3 and XU boards which he bisected to 45f8cb57da0d7 (ASoC: core: Allow topology to override machine driver FE DAI link config). Revert that commit for now, along with f11a5c27f928 (ASoC: core: Add name prefix for machines with topology rewrites) due to dependency issues, in order to keep things booting cleanly in -next. Reported-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-04-17ASoC: core: Allow topology to override machine driver FE DAI link config.Liam Girdwood
Machine drivers statically define a number of DAI links that currently cannot be changed or removed by topology. This means PCMs and platform components cannot be changed by topology at runtime AND machine drivers are tightly coupled to topology. This patch allows topology to override the machine driver DAI link config in order to reuse machine drivers with different topologies and platform components. The patch supports :- 1) create new FE PCMs with a topology defined PCM ID. 2) destroy existing static FE PCMs 3) change the platform component driver. 4) assign any new HW params fixups. The patch requires no changes to the machine drivers, but does add some platform component flags that the platform component driver can assign before loading topologies. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-03-19ASoC: pcm: improve debug output for DPCM BE searching.Liam Girdwood
Improve the DPCM BE search debug output to make it easier to debug issues in topologies. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-02-07Merge remote-tracking branches 'asoc/topic/max98373', 'asoc/topic/mtk', ↵Mark Brown
'asoc/topic/pcm', 'asoc/topic/rockchip' and 'asoc/topic/sam9g20_wm8731' into asoc-next
2018-01-24ASoC: soc-pcm: rename .pmdown_time to .use_pmdown_time for ComponentKuninori Morimoto
commit fbb16563c6c2 ("ASoC: snd_soc_component_driver has pmdown_time") added new .pmdown_time which is for inverted version of current .ignore_pmdown_time But it is confusable name. Let's rename it to .use_pmdown_time Reported-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-01-24ASoC: soc-pcm: don't call flush_delayed_work() many times in ↵Kuninori Morimoto
soc_pcm_private_free() commit f523acebbb74 ("ASoC: add Component level pcm_new/pcm_free v2") added component level pcm_new/pcm_free, but flush_delayed_work() on soc_pcm_private_free() is called in for_each_rtdcom() loop. It doesn't need to be called many times. This patch moves it out of loop. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-10-23ASoC: snd_soc_component_driver has pmdown_timeKuninori Morimoto
Current snd_soc_runtime_ignore_pmdown_time() tallys all Codec and CPU's "ignore_pmdown_time". Now, CPU (= via compoent) ignore_pmdown_time is fixed as "true". Codec's one is copied from Codec driver. This means Codec side default is "false". Current all Codec driver will be replaced into Component, thus, we can use for_each_rtdcom() for this totalization. This patch adds new "pmdown_time" on Component driver. Its inverted value will be used for this "ignore" totalizaton. Of course all existing Component driver doesn't have its settings now, thus, all existing "pmdown_time" is "false". This means all Components will ignore pmdown time. This is current CPU behavior. To keep compatibility, snd_soc_runtime_ignore_pmdown_time() totalize Component's inverted "pmdown_time" (= total will be true) and Codec's "ignore_pmdown_time" (= depends on Codec driver settings). Because It is using AND operation, its result is based on Codec driver settings only. This means this operation can keep compatibility and doesn't have nonconformity. When we replace Codec to Component, the driver which has ".ignore_pmdown_time = true" will be just removed, and the driver which doesn't have it will have new ".pmdown_time = true". Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-10-23ASoC: snd_soc_component_driver has snd_pcm_opsKuninori Morimoto
Platform will be replaced into Component in the future. snd_soc_platform_driver has snd_pcm_ops, but snd_soc_component_driver doesn't have it. To prepare for replacing, this patch adds snd_pcm_ops on component driver. platform will be replaced into component, and its code will be removed. But during replacing, both platform and component process code exists. To keep compatibility, to avoid platform NULL access and to avoid platform/component duplicate operation during replacing process, this patch has such code. Some of this code will be removed when platform was removed. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-09-27ASoC: add Component level pcm_new/pcm_free v2Kuninori Morimoto
In current ALSA SoC, Platform only has pcm_new/pcm_free feature, but it should be supported on Component level. This patch adds it. The v1 was added commit 99b04f4c4051f7 ("ASoC: add Component level pcm_new/pcm_free") but it called all "card" connected component's pcm_new/free, it was wrong. This patch calls "rtd" connected component. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-09-27Merge branch 'fix/pcm' of ↵Mark Brown
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-core
2017-09-27ASoC: pcm: Sync delayed work before releasing resourcesTakashi Iwai
When ASoC driver is unbound dynamically during its operation (i.e. a kind of hot-unplug), we may hit Oops due to the resource access after the release by a delayed work, something like: Unable to handle kernel paging request at virtual address dead000000000220 .... PC is at soc_dapm_dai_stream_event.isra.14+0x20/0xd0 LR is at snd_soc_dapm_stream_event+0x74/0xa8 .... [<ffff000008715610>] soc_dapm_dai_stream_event.isra.14+0x20/0xd0 [<ffff00000871989c>] snd_soc_dapm_stream_event+0x74/0xa8 [<ffff00000871b23c>] close_delayed_work+0x3c/0x50 [<ffff0000080bbd6c>] process_one_work+0x1ac/0x318 [<ffff0000080bbf20>] worker_thread+0x48/0x420 [<ffff0000080c201c>] kthread+0xfc/0x128 [<ffff0000080842f0>] ret_from_fork+0x10/0x18 For fixing the race, this patch adds a sync-point in pcm private_free callback to finish the delayed work before actually releasing the resources. Reported-by: Hiep Cao Minh <cm-hiep@jinso.co.jp> Reported-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-09-26ASoC: add null_snd_soc_ops and reduce NULL ops checkKuninori Morimoto
Double NULL pointer check for ops and ops->func is difficult to read and might be forget to check it if new func was add. This patch adds new null_snd_soc_ops and use it if rtd->dai_link didn't have it to avoid NULL ops, and reduces ops NULL check. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-09-25ASoC: remove unneeded dai->driver->ops checkKuninori Morimoto
On soc_add_dai(), it uses null_dai_ops if driver doesn't have its own ops. This means, dai->driver->ops never been NULL. dai->driver->ops check is not needed. This patch removes it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-09-20ASoC: soc-pcm: check symmetry after hw_paramsjiada wang
hw_params may be fixup by be_hw_params_fixup, calling soc_pcm_params_symmetry() before hw_params will have issue if there is hw_params changes in be_hw_params_fixup. For example, with following use case 1. a dai-link which is able to convert sample rate on BE side 2. set BE playback and capture sample rate to 44100Hz 3. play a 48000Hz audio stream with this dai-link 4. record from this dai-link with 44100Hz sample rate Got following error message when record starts [ 495.013527] be_link_ak4613: ASoC: unmatched rate symmetry: 48000 - 44100 [ 495.021729] be_link_ak4613: ASoC: hw_params BE failed -22 [ 495.028589] rsnd_link0: ASoC: hw_params BE failed -22 Because in soc_pcm_hw_params(), FE rate is still having value before it is fixup by be_hw_params_fixup(), when soc_pcm_params_symmetry() checks symmetry, thus soc_pcm_params_symmetry() complains about the unmatched rate between the active stream and the new stream tries to start. This patch moves soc_pcm_params_symmetry() after hw_params to resolve the above issue. Signed-off-by: Jiada Wang <jiada_wang@mentor.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-09-01Merge remote-tracking branch 'asoc/topic/core' into asoc-nextMark Brown
2017-08-10Merge branch 'topic/pcm' of ↵Mark Brown
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-core
2017-08-10ASoC: use snd_soc_rtdcom_add() and convert to consistent operationKuninori Morimoto
Basically, current ALSA SoC framework is based on CPU/Codec/Platform, but its operation doesn't have consistent. Thus, source code was unreadable, and difficult to understand. This patch connects each component (= CPU/Codec/Platform) to rtd by using snd_soc_rtdcom_add(), and convert uneven operations to consistent operation. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-08-01Merge remote-tracking branches 'asoc/fix/dpcm', 'asoc/fix/imx', ↵Mark Brown
'asoc/fix/msm8916', 'asoc/fix/multi-pcm', 'asoc/fix/of-graph' and 'asoc/fix/pxa' into asoc-linus
2017-07-31ASoC: soc-pcm: Remove unused 'debugfs_dpcm_state' entryFabio Estevam
'debugfs_dpcm_state' member from structure snd_soc_pcm_runtime is never used at all, so it is safe to remove it. Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-17ASoC: fix pcm-creation regressionJohan Hovold
This reverts commit 99b04f4c4051 ("ASoC: add Component level pcm_new/pcm_free"), which started calling the pcm_new callback for every component in a *card* when creating a new pcm, something which does not seem to make any sense. This specifically led to memory leaks in systems with more than one platform component and where DMA memory is allocated in the platform-driver callback. For example, when both mcasp devices are being used on an am335x board, DMA memory would be allocated twice for every DAI link during probe. When CONFIG_SND_VERBOSE_PROCFS was set this fortunately also led to warnings such as: WARNING: CPU: 0 PID: 565 at ../fs/proc/generic.c:346 proc_register+0x110/0x154 proc_dir_entry 'sub0/prealloc' already registered Since there seems to be no users of the new component callbacks, and the current implementation introduced a regression, let's revert the offending commit for now. Fixes: 99b04f4c4051 ("ASoC: add Component level pcm_new/pcm_free") Signed-off-by: Johan Hovold <johan@kernel.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Tested-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable <stable@vger.kernel.org> # 4.10
2017-07-17ASoC: do not close shared backend dailinkBanajit Goswami
Multiple frontend dailinks may be connected to a backend dailink at the same time. When one of frontend dailinks is closed, the associated backend dailink should not be closed if it is connected to other active frontend dailinks. Change ensures that backend dailink is closed only after all connected frontend dailinks are closed. Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org> Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org> Signed-off-by: Patrick Lai <plai@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
2017-06-02ALSA: pcm: Drop the old copy and silence opsTakashi Iwai
Now that all users of old copy and silence ops have been converted to the new PCM ops, the old stuff can be retired and go away. Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-02ALSA: pcm: Introduce copy_user, copy_kernel and fill_silence opsTakashi Iwai
For supporting the explicit in-kernel copy of PCM buffer data, and also for further code refactoring, three new PCM ops, copy_user, copy_kernel and fill_silence, are introduced. The old copy and silence ops will be deprecated and removed later once when all callers are converted. The copy_kernel ops is the new one, and it's supposed to transfer the PCM data from the given kernel buffer to the hardware ring-buffer (or vice-versa depending on the stream direction), while the copy_user ops is equivalent with the former copy ops, to transfer the data from the user-space buffer. The major difference of the new copy_* and fill_silence ops from the previous ops is that the new ops take bytes instead of frames for size and position arguments. It has two merits: first, it allows the callback implementation often simpler (just call directly memcpy() & co), and second, it may unify the implementations of both interleaved and non-interleaved cases, as we'll see in the later patch. As of this stage, copy_kernel ops isn't referred yet, but only copy_user is used. Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-19Merge remote-tracking branch 'asoc/topic/component' into asoc-nextMark Brown
2017-01-10ASoC: remove snd_soc_platform_trigger()Kuninori Morimoto
No one is using snd_soc_platform_trigger(). Let's remove it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-09ASoC: remove .bespoke_trigger from snd_soc_platform_driverKuninori Morimoto
No existing platform is using .bespoke_trigger. Let's remove it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-09ASoC: remove .delay from snd_soc_platform_driverKuninori Morimoto
No existing platform is using .delay. Let's remove it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-06ASoC: dpcm: Avoid putting stream state to STOP when FE stream is pausedPatrick Lai
When multiple front-ends are using the same back-end, putting state of a front-end to STOP state upon receiving pause command will result in backend stream getting released by DPCM framework unintentionally. In order to avoid backend to be released when another active front-end stream is present, put the stream state to PAUSED state instead of STOP state. Signed-off-by: Patrick Lai <plai@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-12-15ASoC: add Component level pcm_new/pcm_freeKuninori Morimoto
In current ALSA SoC, Platform only has pcm_new/pcm_free feature, but it should be supported on Component level. This patch adds it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>