ASoC: soc-pcm: add soc_rtd_xxx()
cover ASoC: soc-pcm: add soc_rtd_xxx()
Hi Mark
My ALSA SoC cleanup series focus to soc-pcm as 2nd step :) These create new soc_rtd_xxx() function, and cleanup soc-pcm.c (It will be more cleanup later)
Kuninori Morimoto (7):
ASoC: soc-pcm: add soc_rtd_startup()
ASoC: soc-pcm: add soc_rtd_shutdown()
ASoC: soc-pcm: add soc_rtd_prepare()
ASoC: soc-pcm: add soc_rtd_hw_params()
ASoC: soc-pcm: add soc_rtd_hw_free()
ASoC: soc-pcm: add soc_rtd_trigger()
ASoC: soc-core: remove null_snd_soc_ops
sound/soc/soc-core.c | 4 -- sound/soc/soc-pcm.c | 118 ++++++++++++++++++++++++++++++++++----------------- 2 files changed, 79 insertions(+), 43 deletions(-)
Signature · 6 lines
2.7.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 1/7 ASoC: soc-pcm: add soc_rtd_startup()
From: Kuninori Morimoto <[email protected]>
Add soc_rtd_startup() to make the code easier to read
--- sound/soc/soc-pcm.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)
sound/soc/soc-pcm.c +14 -7
@@ -28,6 +28,15 @@#define DPCM_MAX_BE_USERS 8 +static int soc_rtd_startup (struct snd_soc_pcm_runtime *rtd, +struct snd_pcm_substream *substream) +{ +if (rtd->dai_link->ops && + rtd->dai_link->ops->startup) +return rtd->dai_link->ops->startup (substream); +return 0 ; +} +/** * snd_soc_runtime_activate() - Increment active count for PCM runtime components * @rtd: ASoC PCM runtime that is activated
@@ -522,13 +531,11 @@ static int soc_pcm_open(struct snd_pcm_substream *substream) codec_dai->rx_mask =0 ; } -if (rtd->dai_link->ops->startup) { - ret = rtd->dai_link->ops->startup (substream); -if (ret <0 ) { -pr_err ("ASoC: %s startup failed: %d\n" , - rtd->dai_link->name, ret); - goto machine_err; - } + ret =soc_rtd_startup (rtd, substream); +if (ret <0 ) { +pr_err ("ASoC: %s startup failed: %d\n" , + rtd->dai_link->name, ret); + goto machine_err; }/* Dynamic PCM DAI links compat checks use dynamic capabilities */
Signature · 6 lines
2.7.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Mark Brown
maintainer[alsa-devel] Applied "ASoC: soc-pcm: add soc_rtd_startup()" to the asoc tree
The patch
ASoC: soc-pcm: add soc_rtd_startup()
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
From f183f9277a0f16e340bbcb28bf30834652ef10e1 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <[email protected]>
Date: Wed, 22 Jan 2020 09:44:35 +0900
Subject: [PATCH] ASoC: soc-pcm: add soc_rtd_startup()
Add soc_rtd_startup() to make the code easier to read
--- sound/soc/soc-pcm.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)
sound/soc/soc-pcm.c +14 -7
@@ -28,6 +28,15 @@#define DPCM_MAX_BE_USERS 8 +static int soc_rtd_startup (struct snd_soc_pcm_runtime *rtd, +struct snd_pcm_substream *substream) +{ +if (rtd->dai_link->ops && + rtd->dai_link->ops->startup) +return rtd->dai_link->ops->startup (substream); +return 0 ; +} +/** * snd_soc_runtime_activate() - Increment active count for PCM runtime components * @rtd: ASoC PCM runtime that is activated
@@ -522,13 +531,11 @@ static int soc_pcm_open(struct snd_pcm_substream *substream) codec_dai->rx_mask =0 ; } -if (rtd->dai_link->ops->startup) { - ret = rtd->dai_link->ops->startup (substream); -if (ret <0 ) { -pr_err ("ASoC: %s startup failed: %d\n" , - rtd->dai_link->name, ret); - goto machine_err; - } + ret =soc_rtd_startup (rtd, substream); +if (ret <0 ) { +pr_err ("ASoC: %s startup failed: %d\n" , + rtd->dai_link->name, ret); + goto machine_err; }/* Dynamic PCM DAI links compat checks use dynamic capabilities */
Signature · 6 lines
2.20.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 2/7 ASoC: soc-pcm: add soc_rtd_shutdown()
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
Add soc_rtd_shutdown() to make the code easier to read
--- sound/soc/soc-pcm.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
sound/soc/soc-pcm.c +10 -4
@@ -37,6 +37,14 @@ static int soc_rtd_startup(struct snd_soc_pcm_runtime *rtd,return 0 ; } +static void soc_rtd_shutdown (struct snd_soc_pcm_runtime *rtd, +struct snd_pcm_substream *substream) +{ +if (rtd->dai_link->ops && + rtd->dai_link->ops->shutdown) + rtd->dai_link->ops->shutdown (substream); +} +/** * snd_soc_runtime_activate() - Increment active count for PCM runtime components * @rtd: ASoC PCM runtime that is activated
@@ -602,8 +610,7 @@ static int soc_pcm_open(struct snd_pcm_substream *substream)return 0 ; config_err: -if (rtd->dai_link->ops->shutdown) - rtd->dai_link->ops->shutdown (substream); +soc_rtd_shutdown (rtd, substream); machine_err: i = rtd->num_codecs;
@@ -674,8 +681,7 @@ static int soc_pcm_close(struct snd_pcm_substream *substream)for_each_rtd_codec_dai (rtd, i, codec_dai)snd_soc_dai_shutdown (codec_dai, substream); -if (rtd->dai_link->ops->shutdown) - rtd->dai_link->ops->shutdown (substream); +soc_rtd_shutdown (rtd, substream);soc_pcm_components_close (substream,NULL );
Signature · 6 lines
2.7.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Mark Brown
maintainer[alsa-devel] Applied "ASoC: soc-pcm: add soc_rtd_shutdown()" to the asoc tree
The patch
ASoC: soc-pcm: add soc_rtd_shutdown()
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
From 0be429f9fcfccfbbbcdb40e154a5c2328da17ca9 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <[email protected]>
Date: Wed, 22 Jan 2020 09:44:40 +0900
Subject: [PATCH] ASoC: soc-pcm: add soc_rtd_shutdown()
Add soc_rtd_shutdown() to make the code easier to read
--- sound/soc/soc-pcm.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
sound/soc/soc-pcm.c +10 -4
@@ -37,6 +37,14 @@ static int soc_rtd_startup(struct snd_soc_pcm_runtime *rtd,return 0 ; } +static void soc_rtd_shutdown (struct snd_soc_pcm_runtime *rtd, +struct snd_pcm_substream *substream) +{ +if (rtd->dai_link->ops && + rtd->dai_link->ops->shutdown) + rtd->dai_link->ops->shutdown (substream); +} +/** * snd_soc_runtime_activate() - Increment active count for PCM runtime components * @rtd: ASoC PCM runtime that is activated
@@ -602,8 +610,7 @@ static int soc_pcm_open(struct snd_pcm_substream *substream)return 0 ; config_err: -if (rtd->dai_link->ops->shutdown) - rtd->dai_link->ops->shutdown (substream); +soc_rtd_shutdown (rtd, substream); machine_err: i = rtd->num_codecs;
@@ -674,8 +681,7 @@ static int soc_pcm_close(struct snd_pcm_substream *substream)for_each_rtd_codec_dai (rtd, i, codec_dai)snd_soc_dai_shutdown (codec_dai, substream); -if (rtd->dai_link->ops->shutdown) - rtd->dai_link->ops->shutdown (substream); +soc_rtd_shutdown (rtd, substream);soc_pcm_components_close (substream,NULL );
Signature · 6 lines
2.20.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 3/7 ASoC: soc-pcm: add soc_rtd_prepare()
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
Add soc_rtd_prepare() to make the code easier to read
--- sound/soc/soc-pcm.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)
sound/soc/soc-pcm.c +14 -7
@@ -45,6 +45,15 @@ static void soc_rtd_shutdown(struct snd_soc_pcm_runtime *rtd, rtd->dai_link->ops->shutdown (substream); } +static int soc_rtd_prepare (struct snd_soc_pcm_runtime *rtd, +struct snd_pcm_substream *substream) +{ +if (rtd->dai_link->ops && + rtd->dai_link->ops->prepare) +return rtd->dai_link->ops->prepare (substream); +return 0 ; +} +/** * snd_soc_runtime_activate() - Increment active count for PCM runtime components * @rtd: ASoC PCM runtime that is activated
@@ -716,13 +725,11 @@ static int soc_pcm_prepare(struct snd_pcm_substream *substream)mutex_lock_nested (&rtd->card->pcm_mutex, rtd->card->pcm_subclass); -if (rtd->dai_link->ops->prepare) { - ret = rtd->dai_link->ops->prepare (substream); -if (ret <0 ) { -dev_err (rtd->card->dev,"ASoC: machine prepare error:" -" %d\n" , ret); - goto out; - } + ret =soc_rtd_prepare (rtd, substream); +if (ret <0 ) { +dev_err (rtd->card->dev, +"ASoC: machine prepare error: %d\n" , ret); + goto out; }for_each_rtd_components (rtd, i, component) {
Signature · 6 lines
2.7.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Mark Brown
maintainer[alsa-devel] Applied "ASoC: soc-pcm: add soc_rtd_prepare()" to the asoc tree
The patch
ASoC: soc-pcm: add soc_rtd_prepare()
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
From 44c1a75b0d889b3a5faff9edc837d972806bb46a Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <[email protected]>
Date: Wed, 22 Jan 2020 09:44:44 +0900
Subject: [PATCH] ASoC: soc-pcm: add soc_rtd_prepare()
Add soc_rtd_prepare() to make the code easier to read
--- sound/soc/soc-pcm.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)
sound/soc/soc-pcm.c +14 -7
@@ -45,6 +45,15 @@ static void soc_rtd_shutdown(struct snd_soc_pcm_runtime *rtd, rtd->dai_link->ops->shutdown (substream); } +static int soc_rtd_prepare (struct snd_soc_pcm_runtime *rtd, +struct snd_pcm_substream *substream) +{ +if (rtd->dai_link->ops && + rtd->dai_link->ops->prepare) +return rtd->dai_link->ops->prepare (substream); +return 0 ; +} +/** * snd_soc_runtime_activate() - Increment active count for PCM runtime components * @rtd: ASoC PCM runtime that is activated
@@ -716,13 +725,11 @@ static int soc_pcm_prepare(struct snd_pcm_substream *substream)mutex_lock_nested (&rtd->card->pcm_mutex, rtd->card->pcm_subclass); -if (rtd->dai_link->ops->prepare) { - ret = rtd->dai_link->ops->prepare (substream); -if (ret <0 ) { -dev_err (rtd->card->dev,"ASoC: machine prepare error:" -" %d\n" , ret); - goto out; - } + ret =soc_rtd_prepare (rtd, substream); +if (ret <0 ) { +dev_err (rtd->card->dev, +"ASoC: machine prepare error: %d\n" , ret); + goto out; }for_each_rtd_components (rtd, i, component) {
Signature · 6 lines
2.20.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 4/7 ASoC: soc-pcm: add soc_rtd_hw_params()
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
Add soc_rtd_hw_params() to make the code easier to read
--- sound/soc/soc-pcm.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-)
sound/soc/soc-pcm.c +15 -7
@@ -54,6 +54,16 @@ static int soc_rtd_prepare(struct snd_soc_pcm_runtime *rtd,return 0 ; } +static int soc_rtd_hw_params (struct snd_soc_pcm_runtime *rtd, +struct snd_pcm_substream *substream, +struct snd_pcm_hw_params *params) +{ +if (rtd->dai_link->ops && + rtd->dai_link->ops->hw_params) +return rtd->dai_link->ops->hw_params (substream, params); +return 0 ; +} +/** * snd_soc_runtime_activate() - Increment active count for PCM runtime components * @rtd: ASoC PCM runtime that is activated
@@ -826,13 +836,11 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream,if (ret) goto out; -if (rtd->dai_link->ops->hw_params) { - ret = rtd->dai_link->ops->hw_params (substream, params); -if (ret <0 ) { -dev_err (rtd->card->dev,"ASoC: machine hw_params" -" failed: %d\n" , ret); - goto out; - } + ret =soc_rtd_hw_params (rtd, substream, params); +if (ret <0 ) { +dev_err (rtd->card->dev, +"ASoC: machine hw_params failed: %d\n" , ret); + goto out; }for_each_rtd_codec_dai (rtd, i, codec_dai) {
Signature · 6 lines
2.7.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Mark Brown
maintainer[alsa-devel] Applied "ASoC: soc-pcm: add soc_rtd_hw_params()" to the asoc tree
The patch
ASoC: soc-pcm: add soc_rtd_hw_params()
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
From de9ad990284f16a435675e4e73c7ffaaea9ee4b2 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <[email protected]>
Date: Wed, 22 Jan 2020 09:44:48 +0900
Subject: [PATCH] ASoC: soc-pcm: add soc_rtd_hw_params()
Add soc_rtd_hw_params() to make the code easier to read
--- sound/soc/soc-pcm.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-)
sound/soc/soc-pcm.c +15 -7
@@ -54,6 +54,16 @@ static int soc_rtd_prepare(struct snd_soc_pcm_runtime *rtd,return 0 ; } +static int soc_rtd_hw_params (struct snd_soc_pcm_runtime *rtd, +struct snd_pcm_substream *substream, +struct snd_pcm_hw_params *params) +{ +if (rtd->dai_link->ops && + rtd->dai_link->ops->hw_params) +return rtd->dai_link->ops->hw_params (substream, params); +return 0 ; +} +/** * snd_soc_runtime_activate() - Increment active count for PCM runtime components * @rtd: ASoC PCM runtime that is activated
@@ -826,13 +836,11 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream,if (ret) goto out; -if (rtd->dai_link->ops->hw_params) { - ret = rtd->dai_link->ops->hw_params (substream, params); -if (ret <0 ) { -dev_err (rtd->card->dev,"ASoC: machine hw_params" -" failed: %d\n" , ret); - goto out; - } + ret =soc_rtd_hw_params (rtd, substream, params); +if (ret <0 ) { +dev_err (rtd->card->dev, +"ASoC: machine hw_params failed: %d\n" , ret); + goto out; }for_each_rtd_codec_dai (rtd, i, codec_dai) {
Signature · 6 lines
2.20.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 5/7 ASoC: soc-pcm: add soc_rtd_hw_free()
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
Add soc_rtd_hw_free() to make the code easier to read
--- sound/soc/soc-pcm.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
sound/soc/soc-pcm.c +10 -4
@@ -64,6 +64,14 @@ static int soc_rtd_hw_params(struct snd_soc_pcm_runtime *rtd,return 0 ; } +static void soc_rtd_hw_free (struct snd_soc_pcm_runtime *rtd, +struct snd_pcm_substream *substream) +{ +if (rtd->dai_link->ops && + rtd->dai_link->ops->hw_free) + rtd->dai_link->ops->hw_free (substream); +} +/** * snd_soc_runtime_activate() - Increment active count for PCM runtime components * @rtd: ASoC PCM runtime that is activated
@@ -935,8 +943,7 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream, codec_dai->rate =0 ; } -if (rtd->dai_link->ops->hw_free) - rtd->dai_link->ops->hw_free (substream); +soc_rtd_hw_free (rtd, substream);mutex_unlock (&rtd->card->pcm_mutex);return ret;
@@ -979,8 +986,7 @@ static int soc_pcm_hw_free(struct snd_pcm_substream *substream) }/* free any machine hw params */ -if (rtd->dai_link->ops->hw_free) - rtd->dai_link->ops->hw_free (substream); +soc_rtd_hw_free (rtd, substream);/* free any component resources */ soc_pcm_components_hw_free (substream,NULL );
Signature · 6 lines
2.7.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Mark Brown
maintainer[alsa-devel] Applied "ASoC: soc-pcm: add soc_rtd_hw_free()" to the asoc tree
The patch
ASoC: soc-pcm: add soc_rtd_hw_free()
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
From 49f020e5714d2c48c8ed9a89169ef6a058e54c2f Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <[email protected]>
Date: Wed, 22 Jan 2020 09:44:52 +0900
Subject: [PATCH] ASoC: soc-pcm: add soc_rtd_hw_free()
Add soc_rtd_hw_free() to make the code easier to read
--- sound/soc/soc-pcm.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
sound/soc/soc-pcm.c +10 -4
@@ -64,6 +64,14 @@ static int soc_rtd_hw_params(struct snd_soc_pcm_runtime *rtd,return 0 ; } +static void soc_rtd_hw_free (struct snd_soc_pcm_runtime *rtd, +struct snd_pcm_substream *substream) +{ +if (rtd->dai_link->ops && + rtd->dai_link->ops->hw_free) + rtd->dai_link->ops->hw_free (substream); +} +/** * snd_soc_runtime_activate() - Increment active count for PCM runtime components * @rtd: ASoC PCM runtime that is activated
@@ -935,8 +943,7 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream, codec_dai->rate =0 ; } -if (rtd->dai_link->ops->hw_free) - rtd->dai_link->ops->hw_free (substream); +soc_rtd_hw_free (rtd, substream);mutex_unlock (&rtd->card->pcm_mutex);return ret;
@@ -979,8 +986,7 @@ static int soc_pcm_hw_free(struct snd_pcm_substream *substream) }/* free any machine hw params */ -if (rtd->dai_link->ops->hw_free) - rtd->dai_link->ops->hw_free (substream); +soc_rtd_hw_free (rtd, substream);/* free any component resources */ soc_pcm_components_hw_free (substream,NULL );
Signature · 6 lines
2.20.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 6/7 ASoC: soc-pcm: add soc_rtd_trigger()
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
Add soc_rtd_trigger() to make the code easier to read
--- sound/soc/soc-pcm.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-)
sound/soc/soc-pcm.c +16 -10
@@ -72,6 +72,16 @@ static void soc_rtd_hw_free(struct snd_soc_pcm_runtime *rtd, rtd->dai_link->ops->hw_free (substream); } +static int soc_rtd_trigger (struct snd_soc_pcm_runtime *rtd, +struct snd_pcm_substream *substream, +int cmd) +{ +if (rtd->dai_link->ops && + rtd->dai_link->ops->trigger) +return rtd->dai_link->ops->trigger (substream, cmd); +return 0 ; +} +/** * snd_soc_runtime_activate() - Increment active count for PCM runtime components * @rtd: ASoC PCM runtime that is activated
@@ -1013,11 +1023,9 @@ static int soc_pcm_trigger_start(struct snd_pcm_substream *substream, int cmd)struct snd_soc_dai *codec_dai;int i, ret; -if (rtd->dai_link->ops->trigger) { - ret = rtd->dai_link->ops->trigger (substream, cmd); -if (ret <0 ) -return ret; - } + ret =soc_rtd_trigger (rtd, substream, cmd); +if (ret <0 ) +return ret;for_each_rtd_components (rtd, i, component) { ret =snd_soc_component_trigger (component, substream, cmd);
@@ -1062,11 +1070,9 @@ static int soc_pcm_trigger_stop(struct snd_pcm_substream *substream, int cmd)return ret; } -if (rtd->dai_link->ops->trigger) { - ret = rtd->dai_link->ops->trigger (substream, cmd); -if (ret <0 ) -return ret; - } + ret =soc_rtd_trigger (rtd, substream, cmd); +if (ret <0 ) +return ret;return 0 ; }
Signature · 6 lines
2.7.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Mark Brown
maintainer[alsa-devel] Applied "ASoC: soc-pcm: add soc_rtd_trigger()" to the asoc tree
The patch
ASoC: soc-pcm: add soc_rtd_trigger()
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
From ad2bf9f252d667b385df606b4b762c26151bee78 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <[email protected]>
Date: Wed, 22 Jan 2020 09:44:56 +0900
Subject: [PATCH] ASoC: soc-pcm: add soc_rtd_trigger()
Add soc_rtd_trigger() to make the code easier to read
--- sound/soc/soc-pcm.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-)
sound/soc/soc-pcm.c +16 -10
@@ -72,6 +72,16 @@ static void soc_rtd_hw_free(struct snd_soc_pcm_runtime *rtd, rtd->dai_link->ops->hw_free (substream); } +static int soc_rtd_trigger (struct snd_soc_pcm_runtime *rtd, +struct snd_pcm_substream *substream, +int cmd) +{ +if (rtd->dai_link->ops && + rtd->dai_link->ops->trigger) +return rtd->dai_link->ops->trigger (substream, cmd); +return 0 ; +} +/** * snd_soc_runtime_activate() - Increment active count for PCM runtime components * @rtd: ASoC PCM runtime that is activated
@@ -1013,11 +1023,9 @@ static int soc_pcm_trigger_start(struct snd_pcm_substream *substream, int cmd)struct snd_soc_dai *codec_dai;int i, ret; -if (rtd->dai_link->ops->trigger) { - ret = rtd->dai_link->ops->trigger (substream, cmd); -if (ret <0 ) -return ret; - } + ret =soc_rtd_trigger (rtd, substream, cmd); +if (ret <0 ) +return ret;for_each_rtd_components (rtd, i, component) { ret =snd_soc_component_trigger (component, substream, cmd);
@@ -1062,11 +1070,9 @@ static int soc_pcm_trigger_stop(struct snd_pcm_substream *substream, int cmd)return ret; } -if (rtd->dai_link->ops->trigger) { - ret = rtd->dai_link->ops->trigger (substream, cmd); -if (ret <0 ) -return ret; - } + ret =soc_rtd_trigger (rtd, substream, cmd); +if (ret <0 ) +return ret;return 0 ; }
Signature · 6 lines
2.20.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 7/7 ASoC: soc-core: remove null_snd_soc_ops
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
All rtd->dai_link callback functions are controlled by soc_rtd_xxxx(), and checking rtd->dai_link->ops.
We don't need to have null_snd_soc_ops anymore.
This patch removes it.
--- sound/soc/soc-core.c | 4 ---- 1 file changed, 4 deletions(-)
sound/soc/soc-core.c +0 -4
@@ -342,8 +342,6 @@ struct snd_soc_component *snd_soc_lookup_component(struct device *dev, }EXPORT_SYMBOL_GPL (snd_soc_lookup_component); -static const struct snd_soc_ops null_snd_soc_ops; -struct snd_soc_pcm_runtime *snd_soc_get_pcm_runtime (struct snd_soc_card *card,struct snd_soc_dai_link *dai_link)
@@ -488,8 +486,6 @@ static struct snd_soc_pcm_runtime *soc_new_pcm_runtime(*/ rtd->card = card; rtd->dai_link = dai_link; -if (!rtd->dai_link->ops) - rtd->dai_link->ops = &null_snd_soc_ops;/* see for_each_card_rtds */ list_add_tail (&rtd->list, &card->rtd_list);
Signature · 6 lines
2.7.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Mark Brown
maintainer[alsa-devel] Applied "ASoC: soc-core: remove null_snd_soc_ops" to the asoc tree
The patch
ASoC: soc-core: remove null_snd_soc_ops
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
From d8e2e0d2491e78f3f7b451c3a93ba29950efe2cf Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <[email protected]>
Date: Wed, 22 Jan 2020 09:45:00 +0900
Subject: [PATCH] ASoC: soc-core: remove null_snd_soc_ops
All rtd->dai_link callback functions are controlled by soc_rtd_xxxx(), and checking rtd->dai_link->ops.
We don't need to have null_snd_soc_ops anymore.
This patch removes it.
--- sound/soc/soc-core.c | 4 ---- 1 file changed, 4 deletions(-)
sound/soc/soc-core.c +0 -4
@@ -342,8 +342,6 @@ struct snd_soc_component *snd_soc_lookup_component(struct device *dev, }EXPORT_SYMBOL_GPL (snd_soc_lookup_component); -static const struct snd_soc_ops null_snd_soc_ops; -struct snd_soc_pcm_runtime *snd_soc_get_pcm_runtime (struct snd_soc_card *card,struct snd_soc_dai_link *dai_link)
@@ -488,8 +486,6 @@ static struct snd_soc_pcm_runtime *soc_new_pcm_runtime(*/ rtd->card = card; rtd->dai_link = dai_link; -if (!rtd->dai_link->ops) - rtd->dai_link->ops = &null_snd_soc_ops;/* see for_each_card_rtds */ list_add_tail (&rtd->list, &card->rtd_list);
Signature · 6 lines
2.20.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Quoted 7 lines · Kuninori Morimoto
Hi Mark
My ALSA SoC cleanup series focus to soc-pcm as 2nd step :) These create new
soc_rtd_xxx()function, and cleanupsoc-pcm.c(It will be more cleanup later)
Quoted 8 lines
Kuninori Morimoto (7):
ASoC: soc-pcm: addsoc_rtd_startup()
ASoC: soc-pcm: addsoc_rtd_shutdown()
ASoC: soc-pcm: addsoc_rtd_prepare()
ASoC: soc-pcm: addsoc_rtd_hw_params()
ASoC: soc-pcm: addsoc_rtd_hw_free()
ASoC: soc-pcm: addsoc_rtd_trigger()
ASoC: soc-core: removenull_snd_soc_ops
The series looks good. Thanks, Morimoto-san.
_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Pierre-Louis Bossart
Reviewed-byQuoted 14 lines
Quoted 5 lines
My ALSA SoC cleanup series focus to soc-pcm as 2nd step :) These create new
soc_rtd_xxx()function, and cleanupsoc-pcm.c(It will be more cleanup later)Quoted 8 lines
Kuninori Morimoto (7):
ASoC: soc-pcm: addsoc_rtd_startup()
ASoC: soc-pcm: addsoc_rtd_shutdown()
ASoC: soc-pcm: addsoc_rtd_prepare()
ASoC: soc-pcm: addsoc_rtd_hw_params()
ASoC: soc-pcm: addsoc_rtd_hw_free()
ASoC: soc-pcm: addsoc_rtd_trigger()
ASoC: soc-core: removenull_snd_soc_ops
Quoted 3 lines
The series looks good. Thanks, Morimoto-san.
Reviewed-by Ranjani Sridharan <[email protected]>
LGTM as well.
_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel