Skip to content

Commit e4e95d8

Browse files
gustawbroonie
authored andcommitted
ASoC: Intel: Skylake: Simplify m_state for loadable modules
States SKL_MODULE_LOADED and SKL_MODULE_UNLOADED are redundant with 'loadable' flag in struct skl_module. Additionally skl_tplg_mixer_dapm_post_pmd_event() sets m_state always to SKL_MODULE_UNINIT so next unload function isn't called for such modules. Signed-off-by: Gustaw Lewandowski <[email protected]> Signed-off-by: Cezary Rojewski <[email protected]> Tested-by: Lukasz Majczak <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent c5ed9c5 commit e4e95d8

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

sound/soc/intel/skylake/skl-topology.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -498,8 +498,6 @@ skl_tplg_init_pipe_modules(struct skl_dev *skl, struct skl_pipe *pipe)
498498
mconfig->id.module_id, mconfig->guid);
499499
if (ret < 0)
500500
return ret;
501-
502-
mconfig->m_state = SKL_MODULE_LOADED;
503501
}
504502

505503
/* prepare the DMA if the module is gateway cpr */
@@ -558,8 +556,7 @@ static int skl_tplg_unload_pipe_modules(struct skl_dev *skl,
558556
mconfig = w_module->w->priv;
559557
uuid_mod = (guid_t *)mconfig->guid;
560558

561-
if (mconfig->module->loadable && skl->dsp->fw_ops.unload_mod &&
562-
mconfig->m_state > SKL_MODULE_UNINIT) {
559+
if (mconfig->module->loadable && skl->dsp->fw_ops.unload_mod) {
563560
ret = skl->dsp->fw_ops.unload_mod(skl->dsp,
564561
mconfig->id.module_id);
565562
if (ret < 0)

sound/soc/intel/skylake/skl-topology.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,10 +311,8 @@ struct skl_pipe {
311311

312312
enum skl_module_state {
313313
SKL_MODULE_UNINIT = 0,
314-
SKL_MODULE_LOADED = 1,
315-
SKL_MODULE_INIT_DONE = 2,
316-
SKL_MODULE_BIND_DONE = 3,
317-
SKL_MODULE_UNLOADED = 4,
314+
SKL_MODULE_INIT_DONE = 1,
315+
SKL_MODULE_BIND_DONE = 2,
318316
};
319317

320318
enum d0i3_capability {

0 commit comments

Comments
 (0)