From 37f784f7af6369c77e3d09d9551dae620e2b7d2e Mon Sep 17 00:00:00 2001 From: Andy Ross Date: Tue, 2 Jan 2024 16:47:14 -0800 Subject: [PATCH] module_adapter: Remove BASE_CONFIG_EXT attribute There was only ever one consumer for this attribute, and it didn't actually work. Just remove it, the ipc4 connection code is now using values directly out of module config. The BASE_CONFIG attribute does have a few components that are implementing their own version, so it can't be immediately removed. Signed-off-by: Andy Ross --- src/audio/module_adapter/module_adapter_ipc4.c | 16 ---------------- src/include/module/module/base.h | 2 -- src/include/sof/audio/component.h | 1 - src/include/sof/audio/component_ext.h | 15 +-------------- src/samples/audio/smart_amp_test_ipc4.c | 11 ----------- 5 files changed, 1 insertion(+), 44 deletions(-) diff --git a/src/audio/module_adapter/module_adapter_ipc4.c b/src/audio/module_adapter/module_adapter_ipc4.c index 5da830b1be53..81f7fca1d22d 100644 --- a/src/audio/module_adapter/module_adapter_ipc4.c +++ b/src/audio/module_adapter/module_adapter_ipc4.c @@ -167,22 +167,6 @@ int module_adapter_get_attribute(struct comp_dev *dev, uint32_t type, void *valu memcpy_s(value, sizeof(struct ipc4_base_module_cfg), &mod->priv.cfg.base_cfg, sizeof(mod->priv.cfg.base_cfg)); break; - case COMP_ATTR_BASE_CONFIG_EXT: - { - struct ipc4_base_module_cfg_ext *basecfg_ext = mod->priv.cfg.basecfg_ext; - size_t size; - - if (!basecfg_ext) { - comp_err(mod->dev, "No base config extn set for module"); - return -EINVAL; - } - - size = basecfg_ext->nb_input_pins * sizeof(struct ipc4_input_pin_format) + - basecfg_ext->nb_output_pins * sizeof(struct ipc4_output_pin_format); - memcpy_s(value, sizeof(*basecfg_ext) + size, - basecfg_ext, sizeof(*basecfg_ext) + size); - break; - } default: return -EINVAL; } diff --git a/src/include/module/module/base.h b/src/include/module/module/base.h index ef46b333984f..323599b055f2 100644 --- a/src/include/module/module/base.h +++ b/src/include/module/module/base.h @@ -34,8 +34,6 @@ struct module_config { uint8_t nb_output_pins; struct ipc4_input_pin_format *input_pins; struct ipc4_output_pin_format *output_pins; - struct ipc4_base_module_cfg_ext *basecfg_ext; /* legacy API */ - #endif }; diff --git a/src/include/sof/audio/component.h b/src/include/sof/audio/component.h index daafb8a5bb98..3896d2f55065 100644 --- a/src/include/sof/audio/component.h +++ b/src/include/sof/audio/component.h @@ -117,7 +117,6 @@ enum { #define COMP_ATTR_COPY_DIR 2 /**< Comp copy direction */ #define COMP_ATTR_VDMA_INDEX 3 /**< Comp index of the virtual DMA at the gateway. */ #define COMP_ATTR_BASE_CONFIG 4 /**< Component base config */ -#define COMP_ATTR_BASE_CONFIG_EXT 5 /**< Component base config extension */ /** @}*/ /** \name Trace macros diff --git a/src/include/sof/audio/component_ext.h b/src/include/sof/audio/component_ext.h index d7abce7b3d94..7d0a0c44dc78 100644 --- a/src/include/sof/audio/component_ext.h +++ b/src/include/sof/audio/component_ext.h @@ -230,8 +230,7 @@ static inline int comp_ipc4_get_attribute_remote(struct comp_dev *dev, uint32_t payload.type = type; /* - * Only COMP_ATTR_BASE_CONFIG and COMP_ATTR_BASE_CONFIG_EXT are supported for - * remote access + * Only COMP_ATTR_BASE_CONFIG is supported for remote access */ switch (type) { case COMP_ATTR_BASE_CONFIG: @@ -242,14 +241,6 @@ static inline int comp_ipc4_get_attribute_remote(struct comp_dev *dev, uint32_t payload.value = base_cfg; break; - case COMP_ATTR_BASE_CONFIG_EXT: - basecfg_ext = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM, - sizeof(*basecfg_ext) + size); - if (!basecfg_ext) - return -ENOMEM; - - payload.value = basecfg_ext; - break; default: return -EINVAL; } @@ -263,10 +254,6 @@ static inline int comp_ipc4_get_attribute_remote(struct comp_dev *dev, uint32_t base_cfg, sizeof(struct ipc4_base_module_cfg)); rfree(base_cfg); break; - case COMP_ATTR_BASE_CONFIG_EXT: - memcpy_s(value, size, basecfg_ext, size); - rfree(basecfg_ext); - break; } } diff --git a/src/samples/audio/smart_amp_test_ipc4.c b/src/samples/audio/smart_amp_test_ipc4.c index 31924781e666..001de7bbf5eb 100644 --- a/src/samples/audio/smart_amp_test_ipc4.c +++ b/src/samples/audio/smart_amp_test_ipc4.c @@ -100,16 +100,6 @@ static int smart_amp_init(struct processing_module *mod) *(struct ipc4_output_pin_format *)(base_cfg->base_cfg_ext.pin_formats + sizeof(sad->ipc4_cfg.input_pins)); - /* save the base config extension */ - size = sizeof(struct ipc4_base_module_cfg_ext) + in_size + out_size; - mod_data->cfg.basecfg_ext = rzalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM, size); - if (!mod_data->cfg.basecfg_ext) { - ret = -ENOMEM; - goto sad_fail; - } - - memcpy_s(mod_data->cfg.basecfg_ext, size, &base_cfg->base_cfg_ext, size); - return 0; sad_fail: @@ -172,7 +162,6 @@ static int smart_amp_free(struct processing_module *mod) struct module_data *mod_data = &mod->priv; struct comp_dev *dev = mod->dev; - rfree(mod_data->cfg.basecfg_ext); rfree(sad); #endif