mirror of https://github.com/thesofproject/sof.git
module_interface: Change the signature of prepare API
As part of the 3rd part module API changes, change the signature of the prepare op in the module interface API to pass the pointer to struct processing_module instead of comp_dev. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
This commit is contained in:
parent
90ecd4f137
commit
438b310403
|
@ -425,9 +425,10 @@ static int cadence_codec_init_process(struct comp_dev *dev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int cadence_codec_prepare(struct comp_dev *dev)
|
||||
static int cadence_codec_prepare(struct processing_module *mod)
|
||||
{
|
||||
int ret = 0, mem_tabs_size;
|
||||
struct comp_dev *dev = mod->dev;
|
||||
struct module_data *codec = comp_get_module_data(dev);
|
||||
struct cadence_codec_data *cd = codec->private;
|
||||
|
||||
|
|
|
@ -157,9 +157,10 @@ static int dts_codec_init(struct processing_module *mod)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int dts_codec_prepare(struct comp_dev *dev)
|
||||
static int dts_codec_prepare(struct processing_module *mod)
|
||||
{
|
||||
int ret;
|
||||
struct comp_dev *dev = mod->dev;
|
||||
struct module_data *codec = comp_get_module_data(dev);
|
||||
DtsSofInterfaceBufferConfiguration buffer_configuration;
|
||||
DtsSofInterfaceResult dts_result;
|
||||
|
|
|
@ -188,11 +188,11 @@ static int validate_config(struct module_config *cfg)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int module_prepare(struct comp_dev *dev)
|
||||
int module_prepare(struct processing_module *mod)
|
||||
{
|
||||
int ret;
|
||||
struct processing_module *mod = comp_get_drvdata(dev);
|
||||
struct module_data *md = &mod->priv;
|
||||
struct comp_dev *dev = mod->dev;
|
||||
|
||||
comp_dbg(dev, "module_prepare() start");
|
||||
|
||||
|
@ -201,7 +201,7 @@ int module_prepare(struct comp_dev *dev)
|
|||
if (mod->priv.state < MODULE_INITIALIZED)
|
||||
return -EPERM;
|
||||
|
||||
ret = md->ops->prepare(dev);
|
||||
ret = md->ops->prepare(mod);
|
||||
if (ret) {
|
||||
comp_err(dev, "module_prepare() error %d: module specific prepare failed, comp_id %d",
|
||||
ret, dev_comp_id(dev));
|
||||
|
|
|
@ -19,10 +19,10 @@ static int passthrough_codec_init(struct processing_module *mod)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int passthrough_codec_prepare(struct comp_dev *dev)
|
||||
static int passthrough_codec_prepare(struct processing_module *mod)
|
||||
{
|
||||
struct comp_dev *dev = mod->dev;
|
||||
struct module_data *codec = comp_get_module_data(dev);
|
||||
struct processing_module *mod = comp_get_drvdata(dev);
|
||||
|
||||
comp_info(dev, "passthrough_codec_prepare()");
|
||||
|
||||
|
|
|
@ -653,8 +653,9 @@ static int waves_codec_init(struct processing_module *mod)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int waves_codec_prepare(struct comp_dev *dev)
|
||||
static int waves_codec_prepare(struct processing_module *mod)
|
||||
{
|
||||
struct comp_dev *dev = mod->dev;
|
||||
int ret;
|
||||
|
||||
comp_dbg(dev, "waves_codec_prepare() start");
|
||||
|
|
|
@ -140,7 +140,7 @@ int codec_adapter_prepare(struct comp_dev *dev)
|
|||
}
|
||||
|
||||
/* Prepare codec */
|
||||
ret = module_prepare(dev);
|
||||
ret = module_prepare(mod);
|
||||
if (ret) {
|
||||
comp_err(dev, "codec_adapter_prepare() error %x: codec prepare failed",
|
||||
ret);
|
||||
|
|
|
@ -81,7 +81,7 @@ struct module_interface {
|
|||
* Module specific prepare procedure, called as part of codec_adapter
|
||||
* component preparation in .prepare()
|
||||
*/
|
||||
int (*prepare)(struct comp_dev *dev);
|
||||
int (*prepare)(struct processing_module *mod);
|
||||
/**
|
||||
* Module specific processing procedure, called as part of codec_adapter
|
||||
* component copy in .copy(). This procedure is responsible to consume
|
||||
|
@ -206,7 +206,7 @@ int module_init(struct processing_module *mod, struct module_interface *interfac
|
|||
void *module_allocate_memory(struct comp_dev *dev, uint32_t size, uint32_t alignment);
|
||||
int module_free_memory(struct comp_dev *dev, void *ptr);
|
||||
void module_free_all_memory(struct comp_dev *dev);
|
||||
int module_prepare(struct comp_dev *dev);
|
||||
int module_prepare(struct processing_module *mod);
|
||||
int module_process(struct comp_dev *dev);
|
||||
int module_apply_runtime_config(struct comp_dev *dev);
|
||||
int module_reset(struct comp_dev *dev);
|
||||
|
|
Loading…
Reference in New Issue