ASoC: topology: Add Kconfig option for topology
Mark Brown
maintainerPATCH 1/1 ASoC: topology: Add Kconfig option for topology
Allow the topology code to be compiled out so that users who don't need topology don't need to havve the code compiled in, saving them some memory.
Some more configuration could be added to remove some of the hooks into the core data structures but that is probably best done with some refactoring to use functions to do the updates of the data structures rather than ifdefing in the code as we'd need to do at the minute.
--- include/sound/soc-topology.h | 12 ++++++++++++ sound/soc/Kconfig | 3 +++ sound/soc/Makefile | 3 +++ 3 files changed, 18 insertions(+)
include/sound/soc-topology.h +12 -0
@@ -141,6 +141,8 @@ struct snd_soc_tplg_ops {int io_ops_count; }; +#ifdef CONFIG_SND_SOC_TOPOLOGY +/* gets a pointer to data from the firmware block header */ static inline const void *snd_soc_tplg_get_data (struct snd_soc_tplg_hdr *hdr) {
@@ -165,4 +167,14 @@ int snd_soc_tplg_widget_bind_event(struct snd_soc_dapm_widget *w, const struct snd_soc_tplg_widget_events *events, int num_events, u16 event_type); +#else + +static inline int snd_soc_tplg_component_remove (struct snd_soc_component *comp, +u32 index) +{ +return 0 ; +} + +#endif +#endif
sound/soc/Kconfig +3 -0
@@ -30,6 +30,9 @@ config SND_SOC_GENERIC_DMAENGINE_PCM bool select SND_DMAENGINE_PCM +config SND_SOC_TOPOLOGY + bool + # All the supported SoCs source "sound/soc/adi/Kconfig" source "sound/soc/atmel/Kconfig"
sound/soc/Makefile +3 -0
@@ -1,6 +1,9 @@ snd-soc-core-objs := soc-core.o soc-dapm.o soc-jack.o soc-cache.o soc-utils.o snd-soc-core-objs += soc-pcm.o soc-compress.o soc-io.o soc-devres.o soc-ops.o + +ifneq ($(CONFIG_SND_SOC_TOPOLOGY),) snd-soc-core-objs += soc-topology.o +endif ifneq ($(CONFIG_SND_SOC_GENERIC_DMAENGINE_PCM),) snd-soc-core-objs += soc-generic-dmaengine-pcm.o
Signature · 1 line
2.5.0
Quoted 65 lines · Mark Brown
Allow the topology code to be compiled out so that users who don't need topology don't need to havve the code compiled in, saving them some memory.
Some more configuration could be added to remove some of the hooks into the core data structures but that is probably best done with some refactoring to use functions to do the updates of the data structures rather than ifdefing in the code as we'd need to do at the minute.
Suggested-by Takashi Iwai <[email protected]>Signed-off-by Mark Brown <[email protected]>--- include/sound/soc-topology.h | 12 ++++++++++++ sound/soc/Kconfig | 3 +++ sound/soc/Makefile | 3 +++ 3 files changed, 18 insertions(+)include/sound/soc-topology.h +12
-0@@ -141,6 +141,8 @@ struct snd_soc_tplg_ops {int io_ops_count; }; +#ifdef CONFIG_SND_SOC_TOPOLOGY +/* gets a pointer to data from the firmware block header */ static inline const void *snd_soc_tplg_get_data (struct snd_soc_tplg_hdr *hdr) {@@ -165,4 +167,14 @@ int snd_soc_tplg_widget_bind_event(struct snd_soc_dapm_widget *w, const struct snd_soc_tplg_widget_events *events, int num_events, u16 event_type); +#else + +static inline int snd_soc_tplg_component_remove (struct snd_soc_component *comp, +u32 index) +{ +return 0 ; +} + +#endif +#endif sound/soc/Kconfig +3
-0@@ -30,6 +30,9 @@ config SND_SOC_GENERIC_DMAENGINE_PCM bool select SND_DMAENGINE_PCM +config SND_SOC_TOPOLOGY + bool + # All the supported SoCs source "sound/soc/adi/Kconfig" source "sound/soc/atmel/Kconfig"sound/soc/Makefile +0
-0
sound/soc/Makefile line 6
Quoted 6 lines
sound/soc/Makefile +3
-0@@ -1,6 +1,9 @@ snd-soc-core-objs := soc-core.o soc-dapm.o soc-jack.o soc-cache.o soc-utils.o snd-soc-core-objs += soc-pcm.o soc-compress.o soc-io.o soc-devres.o soc-ops.o + +ifneq ($(CONFIG_SND_SOC_TOPOLOGY),) snd-soc-core-objs += soc-topology.o +endif
This can be simplified like
snd-soc-core-$(CONFIG_SND_SOC_TOPOLOGY) += soc-topology.o
Takashi
Mark Brown
maintainerQuoted 9 lines · Takashi Iwai
sound/soc/Makefile line 6
Quoted 3 lines · Mark Brown
sound/soc/Makefile +2
-0+ifneq ($(CONFIG_SND_SOC_TOPOLOGY),) snd-soc-core-objs += soc-topology.o +endifThis can be simplified like
snd-soc-core-$(CONFIG_SND_SOC_TOPOLOGY) += soc-topology.o
Yeah, that thought did occur to me while I was doing this however all the other optional files for the core that are in there already use the same idiom for some reason so I'm going to go back and update them all at once later rather than having some in one style and some in another.
Quoted 10 lines · Mark Brown
Quoted 7 lines · Takashi Iwai
sound/soc/Makefile line 6
Quoted 3 lines · Mark Brown
sound/soc/Makefile +2
-0+ifneq ($(CONFIG_SND_SOC_TOPOLOGY),) snd-soc-core-objs += soc-topology.o +endifThis can be simplified like
Quoted 6 lines
Quoted 1 line
snd-soc-core-$(CONFIG_SND_SOC_TOPOLOGY) += soc-topology.o
Yeah, that thought did occur to me while I was doing this however all the other optional files for the core that are in there already use the same idiom for some reason so I'm going to go back and update them all at once later rather than having some in one style and some in another.
That should suffice. Thanks!
Takashi
Mark Brown
maintainerApplied "ASoC: topology: Add Kconfig option for topology" to the asoc tree
In reply to Mark BrownThe patch
ASoC: topology: Add Kconfig option for topology
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
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
Quoted 1 line
From
78b50f39142612d01073595d33e7cc48f03a5a2fMon Sep 17 00:00:00 2001
From: Mark Brown <[email protected]>
Date: Sat, 15 Aug 2015 08:24:20 -0700
Subject: [PATCH] ASoC: topology: Add Kconfig option for topology
Allow the topology code to be compiled out so that users who don't need topology don't need to havve the code compiled in, saving them some memory.
Some more configuration could be added to remove some of the hooks into the core data structures but that is probably best done with some refactoring to use functions to do the updates of the data structures rather than ifdefing in the code as we'd need to do at the minute.
--- include/sound/soc-topology.h | 12 ++++++++++++ sound/soc/Kconfig | 3 +++ sound/soc/Makefile | 3 +++ 3 files changed, 18 insertions(+)
include/sound/soc-topology.h +12 -0
@@ -141,6 +141,8 @@ struct snd_soc_tplg_ops {int io_ops_count; }; +#ifdef CONFIG_SND_SOC_TOPOLOGY +/* gets a pointer to data from the firmware block header */ static inline const void *snd_soc_tplg_get_data (struct snd_soc_tplg_hdr *hdr) {
@@ -165,4 +167,14 @@ int snd_soc_tplg_widget_bind_event(struct snd_soc_dapm_widget *w, const struct snd_soc_tplg_widget_events *events, int num_events, u16 event_type); +#else + +static inline int snd_soc_tplg_component_remove (struct snd_soc_component *comp, +u32 index) +{ +return 0 ; +} + +#endif +#endif
sound/soc/Kconfig +3 -0
@@ -30,6 +30,9 @@ config SND_SOC_GENERIC_DMAENGINE_PCM bool select SND_DMAENGINE_PCM +config SND_SOC_TOPOLOGY + bool + # All the supported SoCs source "sound/soc/adi/Kconfig" source "sound/soc/atmel/Kconfig"
sound/soc/Makefile +3 -0
@@ -1,6 +1,9 @@ snd-soc-core-objs := soc-core.o soc-dapm.o soc-jack.o soc-cache.o soc-utils.o snd-soc-core-objs += soc-pcm.o soc-compress.o soc-io.o soc-devres.o soc-ops.o + +ifneq ($(CONFIG_SND_SOC_TOPOLOGY),) snd-soc-core-objs += soc-topology.o +endif ifneq ($(CONFIG_SND_SOC_GENERIC_DMAENGINE_PCM),) snd-soc-core-objs += soc-generic-dmaengine-pcm.o
Signature · 1 line
2.5.0