Revision tags: v6.6.25, v6.6.24, v6.6.23, v6.6.16, v6.6.15, v6.6.14, v6.6.13, v6.6.12, v6.6.11, v6.6.10, v6.6.9, v6.6.8, v6.6.7, v6.6.6, v6.6.5, v6.6.4, v6.6.3, v6.6.2, v6.5.11, v6.6.1, v6.5.10, v6.6, v6.5.9, v6.5.8, v6.5.7, v6.5.6 |
|
#
76aca10c |
| 03-Oct-2023 |
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> |
ASoC: soc-dapm: Add helper for comparing widget name
Some drivers use one event callback for multiple widgets but still need to perform a bit different actions based on actual widget. This is done
ASoC: soc-dapm: Add helper for comparing widget name
Some drivers use one event callback for multiple widgets but still need to perform a bit different actions based on actual widget. This is done by comparing widget name, however drivers tend to miss possible name prefix. Add a helper to solve common mistakes.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20231003155710.821315-2-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|
Revision tags: v6.5.5, v6.5.4, v6.5.3, v6.5.2, v6.1.51, v6.5.1 |
|
#
ef98a488 |
| 31-Aug-2023 |
Takashi Iwai <tiwai@suse.de> |
ASoC: Name iov_iter argument as iterator instead of buffer
While transitioning ASoC code for iov_iter usages, I kept the argument name as "buf" as the original code. But, iov_iter is an iterator, a
ASoC: Name iov_iter argument as iterator instead of buffer
While transitioning ASoC code for iov_iter usages, I kept the argument name as "buf" as the original code. But, iov_iter is an iterator, and using the name "buf" may be misleading: the crucial difference is that iov_iter can be proceeded after the operation, hence it can't be passed twice, while a simple "buffer" sounds as if reusable.
To make the usage clearer, rename the argument from "buf" to "iter". There is no functional changes, just names.
Fixes: 66201cacc33d ("ASoC: component: Add generic PCM copy ops") Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Link: https://lore.kernel.org/r/CAHk-=wje+VkXjjfVTmK-uJdG_M5=ar14QxAwK+XDiq07k_pzBg@mail.gmail.com Reviewed-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20230831130457.8180-2-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
Revision tags: v6.1.50, v6.5, v6.1.49, v6.1.48, v6.1.46 |
|
#
205d3e03 |
| 15-Aug-2023 |
Takashi Iwai <tiwai@suse.de> |
ASoC: pcm: Drop obsoleted PCM copy_user ops
Now all ASoC users have been replaced to use the new PCM copy ops, let's drop the obsoleted copy_user ops and its helper function.
Reviewed-by: Mark Brow
ASoC: pcm: Drop obsoleted PCM copy_user ops
Now all ASoC users have been replaced to use the new PCM copy ops, let's drop the obsoleted copy_user ops and its helper function.
Reviewed-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20230815190136.8987-25-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
#
66201cac |
| 15-Aug-2023 |
Takashi Iwai <tiwai@suse.de> |
ASoC: component: Add generic PCM copy ops
For following the ALSA PCM core change, a new PCM copy ops is added toe ASoC component framework: snd_soc_component_driver receives the copy ops, and snd_so
ASoC: component: Add generic PCM copy ops
For following the ALSA PCM core change, a new PCM copy ops is added toe ASoC component framework: snd_soc_component_driver receives the copy ops, and snd_soc_pcm_component_copy() helper is provided.
This also fixes a long-standing potential bug where the ASoC driver covers only copy_user PCM callback and misses the copy from kernel pointers (such as OSS PCM layer), too.
As of this patch, the old copy_user is still kept, but it'll be dropped later after all drivers are converted.
Reviewed-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20230815190136.8987-19-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
Revision tags: v6.1.45, v6.1.44, v6.1.43, v6.1.42, v6.1.41, v6.1.40, v6.1.39, v6.1.38, v6.1.37, v6.1.36, v6.4, v6.1.35, v6.1.34, v6.1.33, v6.1.32, v6.1.31, v6.1.30, v6.1.29 |
|
#
ace9ed54 |
| 12-May-2023 |
Charles Keepax <ckeepax@opensource.cirrus.com> |
ASoC: soc-component: Add notify control helper function
Add a function to allow ASoC drivers to easily notify an ALSA control change. This function will automatically add any component naming prefix
ASoC: soc-component: Add notify control helper function
Add a function to allow ASoC drivers to easily notify an ALSA control change. This function will automatically add any component naming prefix into the control name.
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com Link: https://lore.kernel.org/r/20230512122838.243002-3-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org
show more ...
|
Revision tags: v6.1.28, v6.1.27, v6.1.26, v6.3, v6.1.25, v6.1.24, v6.1.23 |
|
#
38e42f6d |
| 05-Apr-2023 |
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> |
ASoC: expand snd_soc_dpcm_mutex_lock/unlock()
soc-pcm.c has snd_soc_dpcm_mutex_lock/unlock(), but other files can't use it because it is static function.
It requests snd_soc_pcm_runtime as paramete
ASoC: expand snd_soc_dpcm_mutex_lock/unlock()
soc-pcm.c has snd_soc_dpcm_mutex_lock/unlock(), but other files can't use it because it is static function.
It requests snd_soc_pcm_runtime as parameter (A), but sometimes we want to use it by snd_soc_card (B).
(A) static inline void snd_soc_dpcm_mutex_lock(struct snd_soc_pcm_runtime *rtd) { mutex_lock_nested(&rtd->card->pcm_mutex, rtd->card->pcm_subclass); } ^^^^^^^^^
(B) mutex_lock_nested(&card->pcm_mutex, card->pcm_subclass); ^^^^
We want to use it with both "rtd" and "card" for dapm lock/unlock. To enable it, this patch uses _Generic macro.
This patch makes snd_soc_dpcm_mutex_{un}lock() global function, and use it on each files.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87bkk1x3ud.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|
Revision tags: v6.1.22, v6.1.21, v6.1.20, v6.1.19, v6.1.18, v6.1.17, v6.1.16, v6.1.15, v6.1.14, v6.1.13, v6.2, v6.1.12, v6.1.11, v6.1.10, v6.1.9, v6.1.8 |
|
#
df55122b |
| 23-Jan-2023 |
Astrid Rost <astrid.rost@axis.com> |
ASoC: soc-component: add get_jack_type
Add function to return the jack type of snd_jack_types. This allows a generic card driver to add a jack with the specified type.
Signed-off-by: Astrid Rost <a
ASoC: soc-component: add get_jack_type
Add function to return the jack type of snd_jack_types. This allows a generic card driver to add a jack with the specified type.
Signed-off-by: Astrid Rost <astrid.rost@axis.com> Link: https://lore.kernel.org/r/20230123135913.2720991-2-astrid.rost@axis.com Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|
Revision tags: v6.1.7, v6.1.6, v6.1.5, v6.0.19, v6.0.18, v6.1.4, v6.1.3, v6.0.17, v6.1.2, v6.0.16, v6.1.1, v6.0.15, v6.0.14, v6.0.13, v6.1, v6.0.12, v6.0.11, v6.0.10, v5.15.80, v6.0.9, v5.15.79, v6.0.8, v5.15.78, v6.0.7, v5.15.77, v5.15.76, v6.0.6, v6.0.5, v5.15.75, v6.0.4, v6.0.3, v6.0.2, v5.15.74, v5.15.73, v6.0.1, v5.15.72 |
|
#
0c72dbc9 |
| 04-Oct-2022 |
Peter Ujfalusi <peter.ujfalusi@gmail.com> |
Revert "ASoC: soc-component: using pm_runtime_resume_and_get instead of pm_runtime_get_sync"
This reverts commit 08fc2a7448afc1660ec2f1b5c437fcd14155a7ee.
The reverted commit causes the following w
Revert "ASoC: soc-component: using pm_runtime_resume_and_get instead of pm_runtime_get_sync"
This reverts commit 08fc2a7448afc1660ec2f1b5c437fcd14155a7ee.
The reverted commit causes the following warnigs: Runtime PM usage count underflow!
This is due to the fact that the pm_runtime_resume_and_get() is calling pm_runtime_put_noidle() in case of < 0 return value of pm_runtime_get_sync() which includes the -EACCES. The change is wrong as -EACCES is returned in case of 'nested' get_sync() and it is a valid use of PM runtime.
Fixes: 08fc2a7448af ("ASoC: soc-component: using pm_runtime_resume_and_get instead of pm_runtime_get_sync")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@gmail.com> Link: https://lore.kernel.org/r/20221004115121.26180-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|
Revision tags: v6.0, v5.15.71, v5.15.70 |
|
#
08fc2a74 |
| 22-Sep-2022 |
Zhang Qilong <zhangqilong3@huawei.com> |
ASoC: soc-component: using pm_runtime_resume_and_get instead of pm_runtime_get_sync
Using the newest pm_runtime_resume_and_get is more appropriate for simplifing code here.
Signed-off-by: Zhang Qil
ASoC: soc-component: using pm_runtime_resume_and_get instead of pm_runtime_get_sync
Using the newest pm_runtime_resume_and_get is more appropriate for simplifing code here.
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com> Link: https://lore.kernel.org/r/20220922145846.114312-1-zhangqilong3@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|
Revision tags: v5.15.69, v5.15.68, v5.15.67, v5.15.66, v5.15.65, v5.15.64, v5.15.63, v5.15.62, v5.15.61, v5.15.60, v5.15.59, v5.19, v5.15.58, v5.15.57, v5.15.56, v5.15.55, v5.15.54, v5.15.53, v5.15.52, v5.15.51, v5.15.50, v5.15.49, v5.15.48, v5.15.47, v5.15.46, v5.15.45, v5.15.44, v5.15.43, v5.15.42, v5.18, v5.15.41, v5.15.40 |
|
#
232213bd |
| 13-May-2022 |
Charles Keepax <ckeepax@opensource.cirrus.com> |
ASoC: soc-component: Update handling to component delays
Currently the checking for if a component sits on the CPU or CODEC side of the DAI link is done with a helper function that checks if the com
ASoC: soc-component: Update handling to component delays
Currently the checking for if a component sits on the CPU or CODEC side of the DAI link is done with a helper function that checks if the component defines legacy_dai_naming. However, there are already a couple of CPU side components that explicitly opt in to non-legacy DAI naming and it doesn't seem like a very robust solution. Rather than looking for the flag check if the component is attached to any of the CODEC DAIs on the DAI link. This is more robust and helps to bring the core further in the direction of a component being a generic block rather than being classified as platform or CODEC drivers.
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220513090532.1450944-3-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|
Revision tags: v5.15.39, v5.15.38, v5.15.37, v5.15.36, v5.15.35, v5.15.34, v5.15.33, v5.15.32, v5.15.31, v5.17, v5.15.30, v5.15.29, v5.15.28, v5.15.27, v5.15.26, v5.15.25, v5.15.24, v5.15.23, v5.15.22, v5.15.21, v5.15.20, v5.15.19, v5.15.18, v5.15.17, v5.4.173, v5.15.16, v5.15.15, v5.16, v5.15.10, v5.15.9, v5.15.8, v5.15.7, v5.15.6, v5.15.5, v5.15.4, v5.15.3 |
|
#
403f830e |
| 16-Nov-2021 |
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> |
ASoC: soc-component: add snd_soc_pcm_component_delay()
Current soc-pcm.c :: soc_pcm_pointer() is assuming that component driver might update runtime->delay silently in snd_soc_pcm_component_pointer(
ASoC: soc-component: add snd_soc_pcm_component_delay()
Current soc-pcm.c :: soc_pcm_pointer() is assuming that component driver might update runtime->delay silently in snd_soc_pcm_component_pointer() (= A).
static snd_pcm_uframes_t soc_pcm_pointer(...) { ...
/* clearing the previous total delay */ => runtime->delay = 0;
(A) offset = snd_soc_pcm_component_pointer(substream);
/* base delay if assigned in pointer callback */ => delay = runtime->delay; ... }
1) The behavior that ".pointer callback secretly updates runtime->delay" is strange and confusable.
2) Current snd_soc_pcm_component_pointer() uses 1st found component's .pointer callback only, thus it is no problem for now. But runtime->delay might be overwrote if it adjusted to multiple components in the future.
3) Component delay is updated at .pointer callback timing (secretly). But some components which doesn't have .pointer callback might want to increase runtime->delay for some reasons.
We already have .delay function for DAI, but not have for Component. This patch adds new snd_soc_pcm_component_delay() for it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/874k8cy25t.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|
Revision tags: v5.15.2, v5.15.1, v5.15, v5.14.14, v5.14.13 |
|
#
b296997c |
| 14-Oct-2021 |
Srinivas Kandagatla <srinivas.kandagatla@linaro.org> |
ASoC: soc-component: improve error reporting for register access
Currently errors on register read/write/update are reported with an error code and the corresponding function but does not provide an
ASoC: soc-component: improve error reporting for register access
Currently errors on register read/write/update are reported with an error code and the corresponding function but does not provide any details on the which register number did it actually fail.
register number can give better clue and it should be easy to locate the code and fix.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20211014161330.26645-1-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|
Revision tags: v5.14.12, v5.14.11, v5.14.10, v5.14.9, v5.14.8, v5.14.7, v5.14.6, v5.10.67, v5.10.66, v5.14.5, v5.14.4, v5.10.65, v5.14.3, v5.10.64, v5.14.2, v5.10.63, v5.14.1, v5.10.62 |
|
#
cd46f382 |
| 01-Sep-2021 |
Peter Ujfalusi <peter.ujfalusi@linux.intel.com> |
ASoC: compress/component: Use module_get_when_open/put_when_close for cstream
Currently the try_module_get() and module_put() is not possible for compressed streams if the module_get_upon_open is se
ASoC: compress/component: Use module_get_when_open/put_when_close for cstream
Currently the try_module_get() and module_put() is not possible for compressed streams if the module_get_upon_open is set to 1 which means that\ the components are not protected in a same way as components when normal audio is used.
SOF is setting module_get_upon_open to 1 for component drivers which works correctly for audio stream but when compressed stream is used then the module is not protected.
Convert the compress open and free operation to mimic the steps of it's pcm counterpart to fix this issue.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20210901095255.3617-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|
#
a739fdc2 |
| 01-Sep-2021 |
Peter Ujfalusi <peter.ujfalusi@linux.intel.com> |
ASoC: soc-component: Convert the mark_module to void*
The mark_module of the snd_soc_component is strict snd_pcm_substream type which prevents it to be used by compressed streams.
Change the type t
ASoC: soc-component: Convert the mark_module to void*
The mark_module of the snd_soc_component is strict snd_pcm_substream type which prevents it to be used by compressed streams.
Change the type to void* along with the snd_soc_component_module_get() and snd_soc_component_module_put() to allow the same mark to be used by compressed when it's module_get_upon_open is set to 1.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20210901095255.3617-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|
Revision tags: v5.14, v5.10.61, v5.10.60 |
|
#
500b39da |
| 15-Aug-2021 |
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> |
ASoC: soc-component: cleanup cppcheck warning at snd_soc_pcm_component_pm_runtime_get()
This patch cleanups below cppcheck warning.
sound/soc/soc-component.c:1183:9: style: The scope of the variabl
ASoC: soc-component: cleanup cppcheck warning at snd_soc_pcm_component_pm_runtime_get()
This patch cleanups below cppcheck warning.
sound/soc/soc-component.c:1183:9: style: The scope of the variable 'ret' can be reduced. [variableScope] int i, ret; ^
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87sfzayolo.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|
#
31428c78 |
| 26-Jul-2021 |
Mark Brown <broonie@kernel.org> |
ASoC: component: Remove misplaced prefix handling in pin control functions
When the component level pin control functions were added they for some no longer obvious reason handled adding prefixing o
ASoC: component: Remove misplaced prefix handling in pin control functions
When the component level pin control functions were added they for some no longer obvious reason handled adding prefixing of widget names. This meant that when the lack of prefix handling in the DAPM level pin operations was fixed by ae4fc532244b3bb4d (ASoC: dapm: use component prefix when checking widget names) the one device using the component level API ended up with the prefix being applied twice, causing all lookups to fail.
Fix this by removing the redundant prefixing from the component code, which has the nice side effect of also making that code much simpler.
Reported-by: Richard Fitzgerald <rf@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org> Tested-by: Lucas Tanure <tanureal@opensource.cirrus.com> Link: https://lore.kernel.org/r/20210726194123.54585-1-broonie@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|
Revision tags: v5.10.53, v5.10.52, v5.10.51, v5.10.50, v5.10.49, v5.13, v5.10.46, v5.10.43, v5.10.42, v5.10.41, v5.10.40, v5.10.39, v5.4.119, v5.10.36, v5.10.35, v5.10.34, v5.4.116, v5.10.33, v5.12, v5.10.32, v5.10.31, v5.10.30, v5.10.27, v5.10.26, v5.10.25, v5.10.24 |
|
#
8bdfc045 |
| 11-Mar-2021 |
Shengjiu Wang <shengjiu.wang@nxp.com> |
ASoC: soc-component: Add snd_soc_pcm_component_ack
Add snd_soc_pcm_component_ack back, which can be used to get an updated buffer pointer in the platform driver. On Asymmetric multiprocessor, this p
ASoC: soc-component: Add snd_soc_pcm_component_ack
Add snd_soc_pcm_component_ack back, which can be used to get an updated buffer pointer in the platform driver. On Asymmetric multiprocessor, this pointer can be sent to Cortex-M core for audio processing.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://lore.kernel.org/r/1615516725-4975-2-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|
Revision tags: v5.10.23, v5.10.22, v5.10.21, v5.10.20, v5.10.19, v5.4.101, v5.10.18 |
|
#
933f98be |
| 21-Feb-2021 |
Krzysztof Kozlowski <krzk@kernel.org> |
ASoC: constify of_phandle_args in snd_soc_get_dai_name()
The pointer to of_phandle_args passed to snd_soc_get_dai_name() and of_xlate_dai_name() implementations is not modified. Since it is being u
ASoC: constify of_phandle_args in snd_soc_get_dai_name()
The pointer to of_phandle_args passed to snd_soc_get_dai_name() and of_xlate_dai_name() implementations is not modified. Since it is being used only to translate passed OF node to a DAI name, it should not be modified, so mark it as const for correctness and safer code.
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Link: https://lore.kernel.org/r/20210221153024.453583-1-krzk@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|
Revision tags: v5.10.17, v5.11, v5.10.16, v5.10.15, v5.10.14 |
|
#
8ac9e476 |
| 29-Jan-2021 |
Srinivas Kandagatla <srinivas.kandagatla@linaro.org> |
ASoC: soc-component: fix undefined reference to __ffssi2
microblaze-linux-gcc (GCC) 9.3.0 complains about missing __ffssi2 symbol while using __builtin_ffs at runtime.
This is because arch/h8300 is
ASoC: soc-component: fix undefined reference to __ffssi2
microblaze-linux-gcc (GCC) 9.3.0 complains about missing __ffssi2 symbol while using __builtin_ffs at runtime.
This is because arch/h8300 is compiled with -fno-builtin option.
so fallback and use kernel ffs() instead to all the arch builds happy!
Fixes: 1da0b9899abd ("ASoC: soc-component: add snd_soc_component_read/write_field()") Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20210129100539.23459-1-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|
#
1da0b989 |
| 26-Jan-2021 |
Srinivas Kandagatla <srinivas.kandagatla@linaro.org> |
ASoC: soc-component: add snd_soc_component_read/write_field()
It's often the case that we would write or read a particular field in register. With the current soc_component apis, reading a particula
ASoC: soc-component: add snd_soc_component_read/write_field()
It's often the case that we would write or read a particular field in register. With the current soc_component apis, reading a particular field in register would involve first read the register and then perform shift operations.
Ex: to read from a field mask of 0xf0
val = snd_soc_component_read(component, reg); field = ((val & 0xf0) >> 0x4);
This is sometimes prone to errors and code become less readable!
With this new api we could just do field = snd_soc_component_read_field(component, reg, 0xf0);
this makes it bit simple, easy to write and less error prone!
This also applies to writing!
There are various places in kernel which provides such field interfaces however soc_component seems to be missing this.
This patch is inspired by FIELD_GET/FIELD_PREP macros in include/linux/bitfield.h
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20210126171749.1863-1-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|
Revision tags: v5.10 |
|
#
6374f493 |
| 30-Nov-2020 |
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> |
ASoC: soc-pcm: care trigger rollback
soc_pcm_trigger() calls DAI/Component/Link trigger, but some of them might be failed.
static int soc_pcm_trigger(...) { ... switch (cmd) { case SNDRV_PC
ASoC: soc-pcm: care trigger rollback
soc_pcm_trigger() calls DAI/Component/Link trigger, but some of them might be failed.
static int soc_pcm_trigger(...) { ... switch (cmd) { case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_RESUME: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: ret = snd_soc_link_trigger(substream, cmd); if (ret < 0) break;
(*) ret = snd_soc_pcm_component_trigger(substream, cmd); if (ret < 0) break;
ret = snd_soc_pcm_dai_trigger(substream, cmd); break; case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_SUSPEND: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: ret = snd_soc_pcm_dai_trigger(substream, cmd); if (ret < 0) break;
ret = snd_soc_pcm_component_trigger(substream, cmd); if (ret < 0) break;
ret = snd_soc_link_trigger(substream, cmd); break; } ... }
For example, if soc_pcm_trigger() failed at (*) point, we need to rollback previous succeeded trigger.
This patch adds trigger mark for DAI/Component/Link, and do STOP if START/RESUME/PAUSE_RELEASE were failed.
Because it need to use new rollback parameter, we need to modify DAI/Component/Link trigger functions in the same time.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87a6uycssd.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|
#
f94ba9ac |
| 18-Nov-2020 |
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> |
ASoC: soc-component: add mark for snd_soc_component_compr_open/free()
soc_compr_open() does rollback when failed (A), but, it is almost same as soc_compr_free().
static int soc_compr_open(xxx) {
ASoC: soc-component: add mark for snd_soc_component_compr_open/free()
soc_compr_open() does rollback when failed (A), but, it is almost same as soc_compr_free().
static int soc_compr_open(xxx) { ... if (ret < 0) goto xxx_err; ... return 0;
^ machine_err: | ... | out: (A) ... | pm_err: | ... v return ret; }
The difference is soc_compr_free() is for all dai/component/substream, rollback is for succeeded part only.
This kind of duplicated code can be a hotbed of bugs, thus, we want to share soc_compr_free() and rollback. 1) snd_soc_dai_compr_startup/shutdown() => 2) snd_soc_component_compr_open/free() 3) snd_soc_link_compr_startup/shutdown()
This patch is for 2) snd_soc_component_compr_open/free(), and adds new cstream mark. It will mark cstream when startup() was suceeded. If rollback happen *after* that, it will check rollback flag and marked cstream.
It cares *previous* startup() only now, but we might want to check *whole* marked cstream in the future. This patch is using macro so that it can be easily adjust to it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87lfey5iwk.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|
#
bab78c23 |
| 12-Nov-2020 |
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> |
ASoC: soc-component: add snd_soc_component_compr_get_metadata()
component related function should be implemented at soc-component.c. This patch adds snd_soc_component_compr_get_metadata().
Signed-o
ASoC: soc-component: add snd_soc_component_compr_get_metadata()
component related function should be implemented at soc-component.c. This patch adds snd_soc_component_compr_get_metadata().
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87zh3l6gl8.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|
#
1b308fb1 |
| 12-Nov-2020 |
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> |
ASoC: soc-component: add snd_soc_component_compr_set_metadata()
component related function should be implemented at soc-component.c. This patch adds snd_soc_component_compr_set_metadata().
Signed-o
ASoC: soc-component: add snd_soc_component_compr_set_metadata()
component related function should be implemented at soc-component.c. This patch adds snd_soc_component_compr_set_metadata().
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/871rgx7v5t.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|
#
b5852e66 |
| 12-Nov-2020 |
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> |
ASoC: soc-component: add snd_soc_component_compr_copy()
component related function should be implemented at soc-component.c. This patch adds snd_soc_component_compr_copy().
Signed-off-by: Kuninori
ASoC: soc-component: add snd_soc_component_compr_copy()
component related function should be implemented at soc-component.c. This patch adds snd_soc_component_compr_copy().
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87361d7v5z.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|