All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cezary Rojewski <cezary.rojewski@intel.com>
To: alsa-devel@alsa-project.org
Cc: Cezary Rojewski <cezary.rojewski@intel.com>,
	jairaj.arava@intel.com, upstream@semihalf.com,
	harshapriya.n@intel.com, cujomalainey@google.com, tiwai@suse.com,
	pierre-louis.bossart@linux.intel.com,
	Gustaw Lewandowski <gustaw.lewandowski@linux.intel.com>,
	hdegoede@redhat.com, broonie@kernel.org, jenny.tc@intel.com,
	lma@semihalf.com, vamshi.krishna.gopal@intel.com
Subject: [PATCH 07/11] ASoC: Intel: Skylake: Simplify m_state for loadable modules
Date: Wed, 18 Aug 2021 09:57:38 +0200	[thread overview]
Message-ID: <20210818075742.1515155-8-cezary.rojewski@intel.com> (raw)
In-Reply-To: <20210818075742.1515155-1-cezary.rojewski@intel.com>

From: Gustaw Lewandowski <gustaw.lewandowski@linux.intel.com>

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 <gustaw.lewandowski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
---
 sound/soc/intel/skylake/skl-topology.c | 5 +----
 sound/soc/intel/skylake/skl-topology.h | 6 ++----
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c
index a35ee9d47d6d..51fb594bb172 100644
--- a/sound/soc/intel/skylake/skl-topology.c
+++ b/sound/soc/intel/skylake/skl-topology.c
@@ -498,8 +498,6 @@ skl_tplg_init_pipe_modules(struct skl_dev *skl, struct skl_pipe *pipe)
 				mconfig->id.module_id, mconfig->guid);
 			if (ret < 0)
 				return ret;
-
-			mconfig->m_state = SKL_MODULE_LOADED;
 		}
 
 		/* prepare the DMA if the module is gateway cpr */
@@ -558,8 +556,7 @@ static int skl_tplg_unload_pipe_modules(struct skl_dev *skl,
 		mconfig  = w_module->w->priv;
 		uuid_mod = (guid_t *)mconfig->guid;
 
-		if (mconfig->module->loadable && skl->dsp->fw_ops.unload_mod &&
-			mconfig->m_state > SKL_MODULE_UNINIT) {
+		if (mconfig->module->loadable && skl->dsp->fw_ops.unload_mod) {
 			ret = skl->dsp->fw_ops.unload_mod(skl->dsp,
 						mconfig->id.module_id);
 			if (ret < 0)
diff --git a/sound/soc/intel/skylake/skl-topology.h b/sound/soc/intel/skylake/skl-topology.h
index fb011862fb24..ad230fd64758 100644
--- a/sound/soc/intel/skylake/skl-topology.h
+++ b/sound/soc/intel/skylake/skl-topology.h
@@ -311,10 +311,8 @@ struct skl_pipe {
 
 enum skl_module_state {
 	SKL_MODULE_UNINIT = 0,
-	SKL_MODULE_LOADED = 1,
-	SKL_MODULE_INIT_DONE = 2,
-	SKL_MODULE_BIND_DONE = 3,
-	SKL_MODULE_UNLOADED = 4,
+	SKL_MODULE_INIT_DONE = 1,
+	SKL_MODULE_BIND_DONE = 2,
 };
 
 enum d0i3_capability {
-- 
2.25.1


  parent reply	other threads:[~2021-08-18  7:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-18  7:57 [PATCH 00/11] ASoC: Intel: Skylake: Fix and support complex Cezary Rojewski
2021-08-18  7:57 ` [PATCH 01/11] ASoC: Intel: kbl_da7219_max98927: Fix format selection for max98373 Cezary Rojewski
2021-08-18  7:57 ` [PATCH 02/11] ASoC: Intel: Skylake: Leave data as is when invoking TLV IPCs Cezary Rojewski
2021-08-18  7:57 ` [PATCH 03/11] ASoC: Intel: Skylake: Select proper format for NHLT blob Cezary Rojewski
2021-08-18  7:57 ` [PATCH 04/11] ASoC: Intel: Skylake: Fix module resource and format selection Cezary Rojewski
2021-08-18  7:57 ` [PATCH 05/11] ASoC: Intel: Skylake: Fix module configuration for KPB and MIXER Cezary Rojewski
2021-08-18  7:57 ` [PATCH 06/11] ASoC: Intel: Skylake: Fix passing loadable flag for module Cezary Rojewski
2021-08-18  7:57 ` Cezary Rojewski [this message]
2021-08-18  7:57 ` [PATCH 08/11] ASoC: Intel: Skylake: Support multiple format configs Cezary Rojewski
2021-08-18  7:57 ` [PATCH 09/11] ASoC: Intel: Skylake: Support modules with generic extension Cezary Rojewski
2021-08-18  7:57 ` [PATCH 10/11] ASoC: Intel: Skylake: Properly configure " Cezary Rojewski
2021-08-18  7:57 ` [PATCH 11/11] ASoC: Intel: Skylake: Select first entry for singular pipe config arrays Cezary Rojewski
2021-08-18 11:08 ` [PATCH 00/11] ASoC: Intel: Skylake: Fix and support complex Lukasz Majczak
2021-08-23 17:37 ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210818075742.1515155-8-cezary.rojewski@intel.com \
    --to=cezary.rojewski@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=cujomalainey@google.com \
    --cc=gustaw.lewandowski@linux.intel.com \
    --cc=harshapriya.n@intel.com \
    --cc=hdegoede@redhat.com \
    --cc=jairaj.arava@intel.com \
    --cc=jenny.tc@intel.com \
    --cc=lma@semihalf.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=tiwai@suse.com \
    --cc=upstream@semihalf.com \
    --cc=vamshi.krishna.gopal@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.