From patchwork Wed Aug 18 07:57:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 12443549 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB8FFC4338F for ; Wed, 18 Aug 2021 07:57:50 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 66D2B60ED5 for ; Wed, 18 Aug 2021 07:57:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 66D2B60ED5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id F2D2C1691; Wed, 18 Aug 2021 09:56:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz F2D2C1691 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1629273469; bh=1qLflFj88eE1NClXqNBtjfeBukBSuE0M+n2XUtHsmhk=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=QtgIga5IDolhi7kidQogzu2IwOIKKKdLrfNrQlOwc6HzsZblqS2SNZn7563BJGaJq 2qhipLWE1hbTqmz7cDfLbGlKp6d8lkVYBnRPAUSuMftngnD2v6fbgzwbbw9yDPm6Rk cg/ilDhLSsryIw1zgMbvBlvtEnd02pK+636vLNBI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 43E27F804FD; Wed, 18 Aug 2021 09:55:24 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id EE240F804ED; Wed, 18 Aug 2021 09:55:21 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 55F79F804E7 for ; Wed, 18 Aug 2021 09:55:18 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 55F79F804E7 X-IronPort-AV: E=McAfee;i="6200,9189,10079"; a="195855540" X-IronPort-AV: E=Sophos;i="5.84,330,1620716400"; d="scan'208";a="195855540" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Aug 2021 00:55:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,330,1620716400"; d="scan'208";a="676974957" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga006.fm.intel.com with ESMTP; 18 Aug 2021 00:55:14 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org Subject: [PATCH 07/11] ASoC: Intel: Skylake: Simplify m_state for loadable modules Date: Wed, 18 Aug 2021 09:57:38 +0200 Message-Id: <20210818075742.1515155-8-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210818075742.1515155-1-cezary.rojewski@intel.com> References: <20210818075742.1515155-1-cezary.rojewski@intel.com> MIME-Version: 1.0 Cc: Cezary Rojewski , 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 , hdegoede@redhat.com, broonie@kernel.org, jenny.tc@intel.com, lma@semihalf.com, vamshi.krishna.gopal@intel.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Gustaw Lewandowski 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 Signed-off-by: Cezary Rojewski --- 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 {