From patchwork Thu Aug 22 19:03:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 11109815 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 51D43174A for ; Thu, 22 Aug 2019 19:05:49 +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 D1F1A23400 for ; Thu, 22 Aug 2019 19:05:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="K1PAl0gG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D1F1A23400 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-devel-bounces@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 0B7D815E4; Thu, 22 Aug 2019 21:04:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0B7D815E4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566500747; bh=1YzCpB3TKMcUh5Eh34aH1Aw6VZ/D4QBFwH1junHQ9No=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=K1PAl0gGKxYXUl8q4x09CCmXaQGWySCZZ89hGuF4GJel5Ns7wd09NB/T3I+XEmUM6 Cav3DLl8beq5jKQykqHEcC5+Ln6PC9X7FnB9Icy/DauuO6z6TR4dHaSCC+uXysWMOv /e9n3zV+K0kGS0CEipL8pVJgAwUD5K0Ytshsyijg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 46FFDF80529; Thu, 22 Aug 2019 21:04:55 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 433DBF805E0; Thu, 22 Aug 2019 21:04:53 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 324D2F803D5 for ; Thu, 22 Aug 2019 21:04:44 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 324D2F803D5 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 12:04:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,417,1559545200"; d="scan'208";a="203524203" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga004.fm.intel.com with ESMTP; 22 Aug 2019 12:04:41 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org Date: Thu, 22 Aug 2019 21:03:51 +0200 Message-Id: <20190822190425.23001-2-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190822190425.23001-1-cezary.rojewski@intel.com> References: <20190822190425.23001-1-cezary.rojewski@intel.com> MIME-Version: 1.0 Cc: lgirdwood@gmail.com, broonie@kernel.org, tiwai@suse.com, =?utf-8?q?Amade?= =?utf-8?q?usz_S=C5=82awi=C5=84ski?= , pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 01/35] ASoC: Intel: Skylake: Put FW runtime params defs in one place 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: Amadeusz Sławiński Change Runtime Parameters enum to have its own prefix and then reuse those defines in all places where we actually use those parameters. Signed-off-by: Amadeusz Sławiński --- sound/soc/intel/skylake/skl-messages.c | 7 ++----- sound/soc/intel/skylake/skl-sst-ipc.h | 5 +++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sound/soc/intel/skylake/skl-messages.c b/sound/soc/intel/skylake/skl-messages.c index d43496c5f29e..b6cefb1f9b12 100644 --- a/sound/soc/intel/skylake/skl-messages.c +++ b/sound/soc/intel/skylake/skl-messages.c @@ -34,13 +34,11 @@ static int skl_free_dma_buf(struct device *dev, struct snd_dma_buffer *dmab) return 0; } -#define SKL_ASTATE_PARAM_ID 4 - void skl_dsp_set_astate_cfg(struct skl_dev *skl, u32 cnt, void *data) { struct skl_ipc_large_config_msg msg = {0}; - msg.large_param_id = SKL_ASTATE_PARAM_ID; + msg.large_param_id = SKL_BASEFW_ASTATE_TABLE; msg.param_data_size = (cnt * sizeof(struct skl_astate_param) + sizeof(cnt)); @@ -614,7 +612,6 @@ static void skl_setup_cpr_gateway_cfg(struct skl_dev *skl, skl_copy_copier_caps(mconfig, cpr_mconfig); } -#define DMA_CONTROL_ID 5 #define DMA_I2S_BLOB_SIZE 21 int skl_dsp_set_dma_control(struct skl_dev *skl, u32 *caps, @@ -631,7 +628,7 @@ int skl_dsp_set_dma_control(struct skl_dev *skl, u32 *caps, if (caps_size == 0) return 0; - msg.large_param_id = DMA_CONTROL_ID; + msg.large_param_id = SKL_BASEFW_DMA_CONTROL; msg.param_data_size = sizeof(struct skl_dma_control) + caps_size; dma_ctrl = kzalloc(msg.param_data_size, GFP_KERNEL); diff --git a/sound/soc/intel/skylake/skl-sst-ipc.h b/sound/soc/intel/skylake/skl-sst-ipc.h index 08ac31778325..0058d82bd5a4 100644 --- a/sound/soc/intel/skylake/skl-sst-ipc.h +++ b/sound/soc/intel/skylake/skl-sst-ipc.h @@ -67,6 +67,11 @@ struct skl_lib_info { const struct firmware *fw; }; +enum skl_basefw_runtime_param { + SKL_BASEFW_ASTATE_TABLE = 4, + SKL_BASEFW_DMA_CONTROL = 5, +}; + struct skl_ipc_init_instance_msg { u32 module_id; u32 instance_id; From patchwork Thu Aug 22 19:03:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 11109819 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2E4271399 for ; Thu, 22 Aug 2019 19:07:34 +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 B5905233FD for ; Thu, 22 Aug 2019 19:07:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="PTfruIYB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B5905233FD 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-devel-bounces@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 DB2661682; Thu, 22 Aug 2019 21:06:41 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DB2661682 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566500851; bh=Q0OevLlnJCl+KCKfOgON9+VxpnqthmkhsqgNhxfI6Nc=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=PTfruIYB/bg+z5tZbo9Kaq5gl/m5u3wYLpcKO1j80U5oPm4XhN8I+Mak8mATDoC10 SBEt/VWUpxKU5UA759hHdoGusD5wcJ0AnKkeLnAqx+QfWLDWRXdGK4HcM6n5NX0NX0 8MArr3mVHfXsfhADiSh0+4pTlwwa+ZR/ESRl4x0w= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 88921F805FD; Thu, 22 Aug 2019 21:05:08 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 547ACF805F7; Thu, 22 Aug 2019 21:04:57 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 18DEEF803F3 for ; Thu, 22 Aug 2019 21:04:45 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 18DEEF803F3 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 12:04:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,417,1559545200"; d="scan'208";a="203524212" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga004.fm.intel.com with ESMTP; 22 Aug 2019 12:04:42 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org Date: Thu, 22 Aug 2019 21:03:52 +0200 Message-Id: <20190822190425.23001-3-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190822190425.23001-1-cezary.rojewski@intel.com> References: <20190822190425.23001-1-cezary.rojewski@intel.com> Cc: lgirdwood@gmail.com, Cezary Rojewski , broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 02/35] ASoC: Intel: Skylake: Add FIRMWARE_CONFIG IPC request 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Implement interface for retrieving firmware configuration. Skylake driver will use this data instead of hardcoded values in updates to come. Most params are currently unused. In time driver dependency on fw config will increase, and with it, more parsing will be unveiled. Signed-off-by: Cezary Rojewski --- sound/soc/intel/skylake/skl-sst-ipc.c | 122 ++++++++++++++++++++++++++ sound/soc/intel/skylake/skl-sst-ipc.h | 72 +++++++++++++++ sound/soc/intel/skylake/skl.h | 1 + 3 files changed, 195 insertions(+) diff --git a/sound/soc/intel/skylake/skl-sst-ipc.c b/sound/soc/intel/skylake/skl-sst-ipc.c index 667cdddc289f..e9e11ec4c97b 100644 --- a/sound/soc/intel/skylake/skl-sst-ipc.c +++ b/sound/soc/intel/skylake/skl-sst-ipc.c @@ -11,6 +11,7 @@ #include "skl.h" #include "skl-sst-dsp.h" #include "skl-sst-ipc.h" +#include "skl-topology.h" #include "sound/hdaudio_ext.h" @@ -1067,3 +1068,124 @@ int skl_ipc_set_d0ix(struct sst_generic_ipc *ipc, struct skl_ipc_d0ix_msg *msg) return ret; } EXPORT_SYMBOL_GPL(skl_ipc_set_d0ix); + +int skl_ipc_fw_cfg_get(struct sst_generic_ipc *ipc, struct skl_fw_cfg *cfg) +{ + struct skl_ipc_large_config_msg msg = {0}; + struct skl_tlv *tlv; + size_t bytes = 0, offset = 0; + u8 *payload = NULL; + int ret; + + msg.module_id = 0; + msg.instance_id = 0; + msg.large_param_id = SKL_BASEFW_FIRMWARE_CONFIG; + + ret = skl_ipc_get_large_config(ipc, &msg, (u32 **)&payload, &bytes); + if (ret) + goto exit; + + while (offset < bytes) { + tlv = (struct skl_tlv *)(payload + offset); + + switch (tlv->type) { + case SKL_FW_CFG_FW_VERSION: + memcpy(&cfg->fw_version, tlv->value, + sizeof(cfg->fw_version)); + break; + + case SKL_FW_CFG_MEMORY_RECLAIMED: + cfg->memory_reclaimed = *tlv->value; + break; + + case SKL_FW_CFG_SLOW_CLOCK_FREQ_HZ: + cfg->slow_clock_freq_hz = *tlv->value; + break; + + case SKL_FW_CFG_FAST_CLOCK_FREQ_HZ: + cfg->fast_clock_freq_hz = *tlv->value; + break; + + case SKL_FW_CFG_ALH_SUPPORT_LEVEL: + cfg->alh_support = *tlv->value; + break; + + case SKL_FW_CFG_IPC_DL_MAILBOX_BYTES: + cfg->ipc_dl_mailbox_bytes = *tlv->value; + break; + + case SKL_FW_CFG_IPC_UL_MAILBOX_BYTES: + cfg->ipc_ul_mailbox_bytes = *tlv->value; + break; + + case SKL_FW_CFG_TRACE_LOG_BYTES: + cfg->trace_log_bytes = *tlv->value; + break; + + case SKL_FW_CFG_MAX_PPL_COUNT: + cfg->max_ppl_count = *tlv->value; + break; + + case SKL_FW_CFG_MAX_ASTATE_COUNT: + cfg->max_astate_count = *tlv->value; + break; + + case SKL_FW_CFG_MAX_MODULE_PIN_COUNT: + cfg->max_module_pin_count = *tlv->value; + break; + + case SKL_FW_CFG_MODULES_COUNT: + cfg->modules_count = *tlv->value; + break; + + case SKL_FW_CFG_MAX_MOD_INST_COUNT: + cfg->max_mod_inst_count = *tlv->value; + break; + + case SKL_FW_CFG_MAX_LL_TASKS_PER_PRI_COUNT: + cfg->max_ll_tasks_per_pri_count = *tlv->value; + break; + + case SKL_FW_CFG_LL_PRI_COUNT: + cfg->ll_pri_count = *tlv->value; + break; + + case SKL_FW_CFG_MAX_DP_TASKS_COUNT: + cfg->max_dp_tasks_count = *tlv->value; + break; + + case SKL_FW_CFG_MAX_LIBS_COUNT: + cfg->max_libs_count = *tlv->value; + break; + + case SKL_FW_CFG_XTAL_FREQ_HZ: + cfg->xtal_freq_hz = *tlv->value; + break; + + case SKL_FW_CFG_UAOL_SUPPORT: + cfg->uaol_support = *tlv->value; + break; + + case SKL_FW_CFG_POWER_GATING_POLICY: + cfg->power_gating_policy = *tlv->value; + break; + + case SKL_FW_CFG_DMA_BUFFER_CONFIG: + case SKL_FW_CFG_SCHEDULER_CONFIG: + case SKL_FW_CFG_CLOCKS_CONFIG: + break; + + default: + dev_info(ipc->dev, "Unrecognized fw param: %d\n", + tlv->type); + break; + } + + offset += sizeof(*tlv) + tlv->length; + } + +exit: + kfree(payload); + return ret; +} +EXPORT_SYMBOL_GPL(skl_ipc_fw_cfg_get); diff --git a/sound/soc/intel/skylake/skl-sst-ipc.h b/sound/soc/intel/skylake/skl-sst-ipc.h index 0058d82bd5a4..ebc5852e15d0 100644 --- a/sound/soc/intel/skylake/skl-sst-ipc.h +++ b/sound/soc/intel/skylake/skl-sst-ipc.h @@ -15,6 +15,12 @@ struct sst_dsp; struct sst_generic_ipc; +struct skl_tlv { + u32 type; + u32 length; + u8 value[0]; +}; + enum skl_ipc_pipeline_state { PPL_INVALID_STATE = 0, PPL_UNINITIALIZED = 1, @@ -70,6 +76,69 @@ struct skl_lib_info { enum skl_basefw_runtime_param { SKL_BASEFW_ASTATE_TABLE = 4, SKL_BASEFW_DMA_CONTROL = 5, + SKL_BASEFW_FIRMWARE_CONFIG = 7, +}; + +enum skl_fw_cfg_params { + SKL_FW_CFG_FW_VERSION = 0, + SKL_FW_CFG_MEMORY_RECLAIMED, + SKL_FW_CFG_SLOW_CLOCK_FREQ_HZ, + SKL_FW_CFG_FAST_CLOCK_FREQ_HZ, + SKL_FW_CFG_DMA_BUFFER_CONFIG, + SKL_FW_CFG_ALH_SUPPORT_LEVEL, + SKL_FW_CFG_IPC_DL_MAILBOX_BYTES, + SKL_FW_CFG_IPC_UL_MAILBOX_BYTES, + SKL_FW_CFG_TRACE_LOG_BYTES, + SKL_FW_CFG_MAX_PPL_COUNT, + SKL_FW_CFG_MAX_ASTATE_COUNT, + SKL_FW_CFG_MAX_MODULE_PIN_COUNT, + SKL_FW_CFG_MODULES_COUNT, + SKL_FW_CFG_MAX_MOD_INST_COUNT, + SKL_FW_CFG_MAX_LL_TASKS_PER_PRI_COUNT, + SKL_FW_CFG_LL_PRI_COUNT, + SKL_FW_CFG_MAX_DP_TASKS_COUNT, + SKL_FW_CFG_MAX_LIBS_COUNT, + SKL_FW_CFG_SCHEDULER_CONFIG, + SKL_FW_CFG_XTAL_FREQ_HZ, + SKL_FW_CFG_CLOCKS_CONFIG, + SKL_FW_CFG_UAOL_SUPPORT, + SKL_FW_CFG_POWER_GATING_POLICY, + SKL_FW_CFG_ASSERT_MODE, +}; + +struct skl_fw_version { + u16 major; + u16 minor; + u16 hotfix; + u16 build; +}; + +enum skl_alh_support_level { + ALH_NO_SUPPORT = 0x00000, + ALH_CAVS_1_8_CNL = 0x10000, +}; + +struct skl_fw_cfg { + struct skl_fw_version fw_version; + u32 memory_reclaimed; + u32 slow_clock_freq_hz; + u32 fast_clock_freq_hz; + enum skl_alh_support_level alh_support; + u32 ipc_dl_mailbox_bytes; + u32 ipc_ul_mailbox_bytes; + u32 trace_log_bytes; + u32 max_ppl_count; + u32 max_astate_count; + u32 max_module_pin_count; + u32 modules_count; + u32 max_mod_inst_count; + u32 max_ll_tasks_per_pri_count; + u32 ll_pri_count; + u32 max_dp_tasks_count; + u32 max_libs_count; + u32 xtal_freq_hz; + u32 uaol_support; + u32 power_gating_policy; }; struct skl_ipc_init_instance_msg { @@ -171,4 +240,7 @@ int skl_ipc_process_notification(struct sst_generic_ipc *ipc, struct skl_ipc_header header); void skl_ipc_tx_data_copy(struct ipc_message *msg, char *tx_data, size_t tx_size); + +int skl_ipc_fw_cfg_get(struct sst_generic_ipc *ipc, struct skl_fw_cfg *cfg); + #endif /* __SKL_IPC_H */ diff --git a/sound/soc/intel/skylake/skl.h b/sound/soc/intel/skylake/skl.h index f8c714153610..0d1c820e11cd 100644 --- a/sound/soc/intel/skylake/skl.h +++ b/sound/soc/intel/skylake/skl.h @@ -110,6 +110,7 @@ struct skl_dev { /* Populate module information */ struct list_head uuid_list; + struct skl_fw_cfg fw_cfg; /* Is firmware loaded */ bool fw_loaded; From patchwork Thu Aug 22 19:03:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 11109821 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F1FC91399 for ; Thu, 22 Aug 2019 19:08:20 +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 8553D233FD for ; Thu, 22 Aug 2019 19:08:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="CdISTOig" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8553D233FD 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-devel-bounces@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 C72411674; Thu, 22 Aug 2019 21:07:28 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C72411674 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566500898; bh=Mb6+MTNH8oy+cnOWgz10o7iCd6rgypRyKEYysKXheaM=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=CdISTOign7RkM0FCjRbPXzSV8FzzWLwU93i4DU1mwKscgfCPRbAAxMe42S4k61PIc 09lSRpXYVYIUQ5dh4Oe4O0rwMGkQBvtlV0TosVRySL6iIZu3/jRCebYWnZw0rtH8Wd iHIENTGxCaoUw9jQMMpfFNCH/TOTwZ7dKXlwHCcs= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E8C33F8060E; Thu, 22 Aug 2019 21:05:14 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 28D26F805F6; Thu, 22 Aug 2019 21:04:58 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 EFACAF8036D for ; Thu, 22 Aug 2019 21:04:47 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz EFACAF8036D X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 12:04:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,417,1559545200"; d="scan'208";a="203524220" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga004.fm.intel.com with ESMTP; 22 Aug 2019 12:04:44 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org Date: Thu, 22 Aug 2019 21:03:53 +0200 Message-Id: <20190822190425.23001-4-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190822190425.23001-1-cezary.rojewski@intel.com> References: <20190822190425.23001-1-cezary.rojewski@intel.com> Cc: lgirdwood@gmail.com, Cezary Rojewski , broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 03/35] ASoC: Intel: Skylake: Add HARDWARE_CONFIG IPC request 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Driver requests this property to discover underlying HW configuration. Internally hw config is split between core config followed by capabilities e.g.: i2s, gpdma. Most params are currently unused. In time driver dependency on hw config will increase, and with it, more parsing will be unveiled. Signed-off-by: Cezary Rojewski --- sound/soc/intel/skylake/skl-messages.c | 1 + sound/soc/intel/skylake/skl-sst-ipc.c | 87 ++++++++++++++++++++++++++ sound/soc/intel/skylake/skl-sst-ipc.h | 46 ++++++++++++++ sound/soc/intel/skylake/skl.h | 1 + 4 files changed, 135 insertions(+) diff --git a/sound/soc/intel/skylake/skl-messages.c b/sound/soc/intel/skylake/skl-messages.c index b6cefb1f9b12..d28b4887de27 100644 --- a/sound/soc/intel/skylake/skl-messages.c +++ b/sound/soc/intel/skylake/skl-messages.c @@ -320,6 +320,7 @@ int skl_free_dsp(struct skl_dev *skl) skl->dsp_ops->cleanup(bus->dev, skl); + kfree(skl->hw_cfg.i2s_caps.ctrl_base_addr); kfree(skl->cores.state); kfree(skl->cores.usage_count); diff --git a/sound/soc/intel/skylake/skl-sst-ipc.c b/sound/soc/intel/skylake/skl-sst-ipc.c index e9e11ec4c97b..91b5440c643d 100644 --- a/sound/soc/intel/skylake/skl-sst-ipc.c +++ b/sound/soc/intel/skylake/skl-sst-ipc.c @@ -1189,3 +1189,90 @@ int skl_ipc_fw_cfg_get(struct sst_generic_ipc *ipc, struct skl_fw_cfg *cfg) return ret; } EXPORT_SYMBOL_GPL(skl_ipc_fw_cfg_get); + +int skl_ipc_hw_cfg_get(struct sst_generic_ipc *ipc, struct skl_hw_cfg *cfg) +{ + struct skl_ipc_large_config_msg msg = {0}; + struct skl_tlv *tlv; + size_t size, bytes = 0, offset = 0; + u8 *payload = NULL; + int ret; + + msg.module_id = 0; + msg.instance_id = 0; + msg.large_param_id = SKL_BASEFW_HARDWARE_CONFIG; + + ret = skl_ipc_get_large_config(ipc, &msg, (u32 **)&payload, &bytes); + if (ret) + goto exit; + + while (offset < bytes) { + tlv = (struct skl_tlv *)(payload + offset); + + switch (tlv->type) { + case SKL_HW_CFG_CAVS_VER: + cfg->cavs_version = *tlv->value; + break; + + case SKL_HW_CFG_DSP_CORES: + cfg->dsp_cores = *tlv->value; + break; + + case SKL_HW_CFG_MEM_PAGE_BYTES: + cfg->mem_page_bytes = *tlv->value; + break; + + case SKL_HW_CFG_TOTAL_PHYS_MEM_PAGES: + cfg->total_phys_mem_pages = *tlv->value; + break; + + case SKL_HW_CFG_I2S_CAPS: + cfg->i2s_caps.version = tlv->value[0]; + size = tlv->value[1]; + cfg->i2s_caps.ctrl_count = size; + if (!size) + break; + + size *= sizeof(*cfg->i2s_caps.ctrl_base_addr); + cfg->i2s_caps.ctrl_base_addr = + kmemdup(&tlv->value[2], size, GFP_KERNEL); + if (!cfg->i2s_caps.ctrl_base_addr) { + ret = -ENOMEM; + goto exit; + } + break; + + case SKL_HW_CFG_GATEWAY_COUNT: + cfg->gateway_count = *tlv->value; + break; + + case SKL_HW_CFG_HP_EBB_COUNT: + cfg->hp_ebb_count = *tlv->value; + break; + + case SKL_HW_CFG_LP_EBB_COUNT: + cfg->lp_ebb_count = *tlv->value; + break; + + case SKL_HW_CFG_EBB_SIZE_BYTES: + cfg->ebb_size_bytes = *tlv->value; + break; + + case SKL_HW_CFG_GPDMA_CAPS: + case SKL_HW_CFG_UAOL_CAPS: + break; + + default: + dev_info(ipc->dev, "Unrecognized hw param: %d\n", + tlv->type); + break; + } + + offset += sizeof(*tlv) + tlv->length; + } + +exit: + kfree(payload); + return ret; +} +EXPORT_SYMBOL_GPL(skl_ipc_hw_cfg_get); diff --git a/sound/soc/intel/skylake/skl-sst-ipc.h b/sound/soc/intel/skylake/skl-sst-ipc.h index ebc5852e15d0..eefa52f7f97a 100644 --- a/sound/soc/intel/skylake/skl-sst-ipc.h +++ b/sound/soc/intel/skylake/skl-sst-ipc.h @@ -77,6 +77,7 @@ enum skl_basefw_runtime_param { SKL_BASEFW_ASTATE_TABLE = 4, SKL_BASEFW_DMA_CONTROL = 5, SKL_BASEFW_FIRMWARE_CONFIG = 7, + SKL_BASEFW_HARDWARE_CONFIG = 8, }; enum skl_fw_cfg_params { @@ -141,6 +142,50 @@ struct skl_fw_cfg { u32 power_gating_policy; }; +enum skl_hw_cfg_params { + SKL_HW_CFG_CAVS_VER, + SKL_HW_CFG_DSP_CORES, + SKL_HW_CFG_MEM_PAGE_BYTES, + SKL_HW_CFG_TOTAL_PHYS_MEM_PAGES, + SKL_HW_CFG_I2S_CAPS, + SKL_HW_CFG_GPDMA_CAPS, + SKL_HW_CFG_GATEWAY_COUNT, + SKL_HW_CFG_HP_EBB_COUNT, + SKL_HW_CFG_LP_EBB_COUNT, + SKL_HW_CFG_EBB_SIZE_BYTES, + SKL_HW_CFG_UAOL_CAPS +}; + +enum skl_cavs_version { + SKL_CAVS_VER_1_5 = 0x10005, + SKL_CAVS_VER_1_8 = 0x10008, +}; + +enum skl_i2s_version { + SKL_I2S_VER_15_SKYLAKE = 0x00000, + SKL_I2S_VER_15_BROXTON = 0x10000, + SKL_I2S_VER_15_BROXTON_P = 0x20000, + SKL_I2S_VER_18_KBL_CNL = 0x30000, +}; + +struct skl_i2s_caps { + enum skl_i2s_version version; + u32 ctrl_count; + u32 *ctrl_base_addr; +}; + +struct skl_hw_cfg { + enum skl_cavs_version cavs_version; + u32 dsp_cores; + u32 mem_page_bytes; + u32 total_phys_mem_pages; + struct skl_i2s_caps i2s_caps; + u32 gateway_count; + u32 hp_ebb_count; + u32 lp_ebb_count; + u32 ebb_size_bytes; +}; + struct skl_ipc_init_instance_msg { u32 module_id; u32 instance_id; @@ -242,5 +287,6 @@ void skl_ipc_tx_data_copy(struct ipc_message *msg, char *tx_data, size_t tx_size); int skl_ipc_fw_cfg_get(struct sst_generic_ipc *ipc, struct skl_fw_cfg *cfg); +int skl_ipc_hw_cfg_get(struct sst_generic_ipc *ipc, struct skl_hw_cfg *cfg); #endif /* __SKL_IPC_H */ diff --git a/sound/soc/intel/skylake/skl.h b/sound/soc/intel/skylake/skl.h index 0d1c820e11cd..972de5ddf2b7 100644 --- a/sound/soc/intel/skylake/skl.h +++ b/sound/soc/intel/skylake/skl.h @@ -111,6 +111,7 @@ struct skl_dev { /* Populate module information */ struct list_head uuid_list; struct skl_fw_cfg fw_cfg; + struct skl_hw_cfg hw_cfg; /* Is firmware loaded */ bool fw_loaded; From patchwork Thu Aug 22 19:03:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 11109827 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5DB8A174A for ; Thu, 22 Aug 2019 19:10:09 +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 E35EE233FD for ; Thu, 22 Aug 2019 19:10:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="t0WLuoFz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E35EE233FD 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-devel-bounces@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 26300167F; Thu, 22 Aug 2019 21:09:17 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 26300167F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566501007; bh=oIT++pjm3/EJVfYLyFUv/V5bGrknWCKqtGQCHL+u8gA=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=t0WLuoFz45meiWnpj5Na94alcS2lX9tixf9ywEIbt80G63D43KMCB8BKrNexou9iF tyDEkuukKLnOlTtu4vZSr2jcSAOGQDv1/606LZnvHw/69lvGx9fOpfn1Dm7KZBFdJS 5ZUAaVQvKhISNj02ocW4GlI4Y/k+gEn5of5AMSek= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id B4A40F8065C; Thu, 22 Aug 2019 21:05:26 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8C4C8F8060D; Thu, 22 Aug 2019 21:05:10 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 63552F80391 for ; Thu, 22 Aug 2019 21:04:48 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 63552F80391 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 12:04:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,417,1559545200"; d="scan'208";a="203524229" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga004.fm.intel.com with ESMTP; 22 Aug 2019 12:04:46 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org Date: Thu, 22 Aug 2019 21:03:54 +0200 Message-Id: <20190822190425.23001-5-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190822190425.23001-1-cezary.rojewski@intel.com> References: <20190822190425.23001-1-cezary.rojewski@intel.com> Cc: lgirdwood@gmail.com, Cezary Rojewski , broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 04/35] ASoC: Intel: Skylake: Unify firmware loading mechanism 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" There are certain operations we want to do before and after firmware loading e.g.: disabling/ enabling power and clock gating. To make code coherent, provide skl_init_fw as a unified way for loading dsp firmware. In consequence, this change provides CNL load library support during fw initialization which was previously missing. skl_dsp_fw_ops already takes care of fw and library load customization. New post-load additions in form of fw and hw config assignments make this change even more welcome. Signed-off-by: Cezary Rojewski --- sound/soc/intel/skylake/bxt-sst.c | 27 ----------------- sound/soc/intel/skylake/cnl-sst-dsp.h | 1 - sound/soc/intel/skylake/cnl-sst.c | 19 ------------ sound/soc/intel/skylake/skl-messages.c | 8 ----- sound/soc/intel/skylake/skl-pcm.c | 22 ++------------ sound/soc/intel/skylake/skl-sst-dsp.c | 1 + sound/soc/intel/skylake/skl-sst-dsp.h | 2 -- sound/soc/intel/skylake/skl-sst.c | 41 ++++++++++++++++++++++---- sound/soc/intel/skylake/skl.h | 2 +- 9 files changed, 40 insertions(+), 83 deletions(-) diff --git a/sound/soc/intel/skylake/bxt-sst.c b/sound/soc/intel/skylake/bxt-sst.c index 92a82e6b5fe6..5bece3a6d741 100644 --- a/sound/soc/intel/skylake/bxt-sst.c +++ b/sound/soc/intel/skylake/bxt-sst.c @@ -591,33 +591,6 @@ int bxt_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, } EXPORT_SYMBOL_GPL(bxt_sst_dsp_init); -int bxt_sst_init_fw(struct device *dev, struct skl_dev *skl) -{ - int ret; - struct sst_dsp *sst = skl->dsp; - - ret = sst->fw_ops.load_fw(sst); - if (ret < 0) { - dev_err(dev, "Load base fw failed: %x\n", ret); - return ret; - } - - skl_dsp_init_core_state(sst); - - if (skl->lib_count > 1) { - ret = sst->fw_ops.load_library(sst, skl->lib_info, - skl->lib_count); - if (ret < 0) { - dev_err(dev, "Load Library failed : %x\n", ret); - return ret; - } - } - skl->is_first_boot = false; - - return 0; -} -EXPORT_SYMBOL_GPL(bxt_sst_init_fw); - void bxt_sst_dsp_cleanup(struct device *dev, struct skl_dev *skl) { diff --git a/sound/soc/intel/skylake/cnl-sst-dsp.h b/sound/soc/intel/skylake/cnl-sst-dsp.h index 7bd4d2a8fdfa..50f4a53a607c 100644 --- a/sound/soc/intel/skylake/cnl-sst-dsp.h +++ b/sound/soc/intel/skylake/cnl-sst-dsp.h @@ -97,7 +97,6 @@ void cnl_ipc_free(struct sst_generic_ipc *ipc); int cnl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, const char *fw_name, struct skl_dsp_loader_ops dsp_ops, struct skl_dev **dsp); -int cnl_sst_init_fw(struct device *dev, struct skl_dev *skl); void cnl_sst_dsp_cleanup(struct device *dev, struct skl_dev *skl); #endif /*__CNL_SST_DSP_H__*/ diff --git a/sound/soc/intel/skylake/cnl-sst.c b/sound/soc/intel/skylake/cnl-sst.c index 4f64f097e9ae..8984653d925d 100644 --- a/sound/soc/intel/skylake/cnl-sst.c +++ b/sound/soc/intel/skylake/cnl-sst.c @@ -453,25 +453,6 @@ int cnl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, } EXPORT_SYMBOL_GPL(cnl_sst_dsp_init); -int cnl_sst_init_fw(struct device *dev, struct skl_dev *skl) -{ - int ret; - struct sst_dsp *sst = skl->dsp; - - ret = skl->dsp->fw_ops.load_fw(sst); - if (ret < 0) { - dev_err(dev, "load base fw failed: %d", ret); - return ret; - } - - skl_dsp_init_core_state(sst); - - skl->is_first_boot = false; - - return 0; -} -EXPORT_SYMBOL_GPL(cnl_sst_init_fw); - void cnl_sst_dsp_cleanup(struct device *dev, struct skl_dev *skl) { if (skl->dsp->fw) diff --git a/sound/soc/intel/skylake/skl-messages.c b/sound/soc/intel/skylake/skl-messages.c index d28b4887de27..cc949904717e 100644 --- a/sound/soc/intel/skylake/skl-messages.c +++ b/sound/soc/intel/skylake/skl-messages.c @@ -173,7 +173,6 @@ static const struct skl_dsp_ops dsp_ops[] = { .num_cores = 2, .loader_ops = skl_get_loader_ops, .init = skl_sst_dsp_init, - .init_fw = skl_sst_init_fw, .cleanup = skl_sst_dsp_cleanup }, { @@ -181,7 +180,6 @@ static const struct skl_dsp_ops dsp_ops[] = { .num_cores = 2, .loader_ops = skl_get_loader_ops, .init = skl_sst_dsp_init, - .init_fw = skl_sst_init_fw, .cleanup = skl_sst_dsp_cleanup }, { @@ -189,7 +187,6 @@ static const struct skl_dsp_ops dsp_ops[] = { .num_cores = 2, .loader_ops = bxt_get_loader_ops, .init = bxt_sst_dsp_init, - .init_fw = bxt_sst_init_fw, .cleanup = bxt_sst_dsp_cleanup }, { @@ -197,7 +194,6 @@ static const struct skl_dsp_ops dsp_ops[] = { .num_cores = 2, .loader_ops = bxt_get_loader_ops, .init = bxt_sst_dsp_init, - .init_fw = bxt_sst_init_fw, .cleanup = bxt_sst_dsp_cleanup }, { @@ -205,7 +201,6 @@ static const struct skl_dsp_ops dsp_ops[] = { .num_cores = 4, .loader_ops = bxt_get_loader_ops, .init = cnl_sst_dsp_init, - .init_fw = cnl_sst_init_fw, .cleanup = cnl_sst_dsp_cleanup }, { @@ -213,7 +208,6 @@ static const struct skl_dsp_ops dsp_ops[] = { .num_cores = 4, .loader_ops = bxt_get_loader_ops, .init = cnl_sst_dsp_init, - .init_fw = cnl_sst_init_fw, .cleanup = cnl_sst_dsp_cleanup }, { @@ -221,7 +215,6 @@ static const struct skl_dsp_ops dsp_ops[] = { .num_cores = 4, .loader_ops = bxt_get_loader_ops, .init = cnl_sst_dsp_init, - .init_fw = cnl_sst_init_fw, .cleanup = cnl_sst_dsp_cleanup }, { @@ -229,7 +222,6 @@ static const struct skl_dsp_ops dsp_ops[] = { .num_cores = 4, .loader_ops = bxt_get_loader_ops, .init = cnl_sst_dsp_init, - .init_fw = cnl_sst_init_fw, .cleanup = cnl_sst_dsp_cleanup }, }; diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-pcm.c index 7f287424af9b..1dbab3eac0e5 100644 --- a/sound/soc/intel/skylake/skl-pcm.c +++ b/sound/soc/intel/skylake/skl-pcm.c @@ -1408,7 +1408,6 @@ static int skl_platform_soc_probe(struct snd_soc_component *component) { struct hdac_bus *bus = dev_get_drvdata(component->dev); struct skl_dev *skl = bus_to_skl(bus); - const struct skl_dsp_ops *ops; int ret; pm_runtime_get_sync(component->dev); @@ -1424,25 +1423,10 @@ static int skl_platform_soc_probe(struct snd_soc_component *component) return ret; } - /* load the firmwares, since all is set */ - ops = skl_get_dsp_ops(skl->pci->device); - if (!ops) - return -EIO; - - /* - * Disable dynamic clock and power gating during firmware - * and library download - */ - skl->enable_miscbdcge(component->dev, false); - skl->clock_power_gating(component->dev, false); - - ret = ops->init_fw(component->dev, skl); - skl->enable_miscbdcge(component->dev, true); - skl->clock_power_gating(component->dev, true); - if (ret < 0) { - dev_err(component->dev, "Failed to boot first fw: %d\n", ret); + ret = skl_sst_init_fw(skl); + if (ret < 0) return ret; - } + skl_populate_modules(skl); skl->update_d0i3c = skl_update_d0i3c; diff --git a/sound/soc/intel/skylake/skl-sst-dsp.c b/sound/soc/intel/skylake/skl-sst-dsp.c index 225706d148d8..0eecf26986f9 100644 --- a/sound/soc/intel/skylake/skl-sst-dsp.c +++ b/sound/soc/intel/skylake/skl-sst-dsp.c @@ -44,6 +44,7 @@ void skl_dsp_init_core_state(struct sst_dsp *ctx) skl->cores.usage_count[i] = 0; } } +EXPORT_SYMBOL_GPL(skl_dsp_init_core_state); /* Get the mask for all enabled cores */ unsigned int skl_dsp_get_enabled_cores(struct sst_dsp *ctx) diff --git a/sound/soc/intel/skylake/skl-sst-dsp.h b/sound/soc/intel/skylake/skl-sst-dsp.h index cdfec0fca577..4da240582454 100644 --- a/sound/soc/intel/skylake/skl-sst-dsp.h +++ b/sound/soc/intel/skylake/skl-sst-dsp.h @@ -226,8 +226,6 @@ int skl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, int bxt_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, const char *fw_name, struct skl_dsp_loader_ops dsp_ops, struct skl_dev **dsp); -int skl_sst_init_fw(struct device *dev, struct skl_dev *skl); -int bxt_sst_init_fw(struct device *dev, struct skl_dev *skl); void skl_sst_dsp_cleanup(struct device *dev, struct skl_dev *skl); void bxt_sst_dsp_cleanup(struct device *dev, struct skl_dev *skl); diff --git a/sound/soc/intel/skylake/skl-sst.c b/sound/soc/intel/skylake/skl-sst.c index 8af7546def1f..8a8ecb9a4fc6 100644 --- a/sound/soc/intel/skylake/skl-sst.c +++ b/sound/soc/intel/skylake/skl-sst.c @@ -555,30 +555,59 @@ int skl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, } EXPORT_SYMBOL_GPL(skl_sst_dsp_init); -int skl_sst_init_fw(struct device *dev, struct skl_dev *skl) +int skl_sst_init_fw(struct skl_dev *skl) { - int ret; struct sst_dsp *sst = skl->dsp; + struct device *dev = skl->dev; + int (*lp_check)(struct sst_dsp *dsp, bool state); + int ret; + + lp_check = skl->ipc.ops.check_dsp_lp_on; + skl->enable_miscbdcge(dev, false); + skl->clock_power_gating(dev, false); ret = sst->fw_ops.load_fw(sst); if (ret < 0) { dev_err(dev, "Load base fw failed : %d\n", ret); - return ret; + goto exit; + } + + if (!skl->is_first_boot) + goto library_load; + /* Disable power check during cfg setup */ + skl->ipc.ops.check_dsp_lp_on = NULL; + + ret = skl_ipc_fw_cfg_get(&skl->ipc, &skl->fw_cfg); + if (ret < 0) { + dev_err(dev, "Failed to get fw cfg: %d\n", ret); + goto exit; + } + + ret = skl_ipc_hw_cfg_get(&skl->ipc, &skl->hw_cfg); + if (ret < 0) { + dev_err(dev, "Failed to get hw cfg: %d\n", ret); + goto exit; } skl_dsp_init_core_state(sst); +library_load: if (skl->lib_count > 1) { ret = sst->fw_ops.load_library(sst, skl->lib_info, skl->lib_count); if (ret < 0) { - dev_err(dev, "Load Library failed : %x\n", ret); - return ret; + dev_err(dev, "Load library failed : %x\n", ret); + goto exit; } } + skl->is_first_boot = false; +exit: + skl->ipc.ops.check_dsp_lp_on = lp_check; + skl->enable_miscbdcge(dev, true); + skl->clock_power_gating(dev, true); - return 0; + return ret; } EXPORT_SYMBOL_GPL(skl_sst_init_fw); diff --git a/sound/soc/intel/skylake/skl.h b/sound/soc/intel/skylake/skl.h index 972de5ddf2b7..1f86543fe954 100644 --- a/sound/soc/intel/skylake/skl.h +++ b/sound/soc/intel/skylake/skl.h @@ -161,7 +161,6 @@ struct skl_dsp_ops { int irq, const char *fw_name, struct skl_dsp_loader_ops loader_ops, struct skl_dev **skl_sst); - int (*init_fw)(struct device *dev, struct skl_dev *skl); void (*cleanup)(struct device *dev, struct skl_dev *skl); }; @@ -175,6 +174,7 @@ struct nhlt_specific_cfg *skl_get_ep_blob(struct skl_dev *skl, u32 instance, int skl_nhlt_update_topology_bin(struct skl_dev *skl); int skl_init_dsp(struct skl_dev *skl); int skl_free_dsp(struct skl_dev *skl); +int skl_sst_init_fw(struct skl_dev *skl); int skl_suspend_late_dsp(struct skl_dev *skl); int skl_suspend_dsp(struct skl_dev *skl); int skl_resume_dsp(struct skl_dev *skl); From patchwork Thu Aug 22 19:03:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 11109825 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 71BAD184E for ; Thu, 22 Aug 2019 19:09:33 +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 069B4233FD for ; Thu, 22 Aug 2019 19:09:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="eGVgSw2b" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 069B4233FD 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-devel-bounces@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 5476415E4; Thu, 22 Aug 2019 21:08:41 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5476415E4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566500971; bh=88bzGKfu+aZVvDGsgzMI0mbjAs4r2ARX8TF7g1MA1+w=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=eGVgSw2bD0n6axENlep07B3OWpIxNpNzciCQmixKh25I/nCskc0gImMeTYIJFeVii xjogftIAB1+J72bEHAlRFFJXqNdUAJlD3C5Sui11Fg2XqvwOSL44TbnVbIrGfxgpsd sW7meTAgB+5l+ju08fpBtsnOgI7WUP6Nn/R/5mVo= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 7F32DF80642; Thu, 22 Aug 2019 21:05:23 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 531A5F8060D; Thu, 22 Aug 2019 21:05:08 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 D9405F804CB for ; Thu, 22 Aug 2019 21:04:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D9405F804CB X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 12:04:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,417,1559545200"; d="scan'208";a="203524234" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga004.fm.intel.com with ESMTP; 22 Aug 2019 12:04:48 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org Date: Thu, 22 Aug 2019 21:03:55 +0200 Message-Id: <20190822190425.23001-6-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190822190425.23001-1-cezary.rojewski@intel.com> References: <20190822190425.23001-1-cezary.rojewski@intel.com> Cc: lgirdwood@gmail.com, Cezary Rojewski , broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 05/35] ASoC: Intel: Skylake: Reload libraries on D0 entry for CNL 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" As libraries are lost in D3, they need to be reloaded on D0 entry. Cannonlake's library load process is equivalent to Broxton's, thus reuse the existing one. Signed-off-by: Cezary Rojewski --- sound/soc/intel/skylake/bxt-sst.c | 3 ++- sound/soc/intel/skylake/cnl-sst.c | 11 +++++++++++ sound/soc/intel/skylake/skl-sst-dsp.h | 2 ++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/sound/soc/intel/skylake/bxt-sst.c b/sound/soc/intel/skylake/bxt-sst.c index 5bece3a6d741..cc9507d4702b 100644 --- a/sound/soc/intel/skylake/bxt-sst.c +++ b/sound/soc/intel/skylake/bxt-sst.c @@ -45,7 +45,7 @@ static unsigned int bxt_get_errorcode(struct sst_dsp *ctx) return sst_dsp_shim_read(ctx, BXT_ADSP_ERROR_CODE); } -static int +int bxt_load_library(struct sst_dsp *ctx, struct skl_lib_info *linfo, int lib_count) { struct snd_dma_buffer dmab; @@ -88,6 +88,7 @@ bxt_load_library(struct sst_dsp *ctx, struct skl_lib_info *linfo, int lib_count) skl_release_library(linfo, lib_count); return ret; } +EXPORT_SYMBOL_GPL(bxt_load_library); /* * First boot sequence has some extra steps. Core 0 waits for power diff --git a/sound/soc/intel/skylake/cnl-sst.c b/sound/soc/intel/skylake/cnl-sst.c index 8984653d925d..a2b3bce631fc 100644 --- a/sound/soc/intel/skylake/cnl-sst.c +++ b/sound/soc/intel/skylake/cnl-sst.c @@ -179,6 +179,16 @@ static int cnl_set_dsp_D0(struct sst_dsp *ctx, unsigned int core_id) return ret; } + if (cnl->lib_count > 1) { + ret = ctx->fw_ops.load_library(ctx, cnl->lib_info, + cnl->lib_count); + if (ret < 0) { + dev_err(ctx->dev, + "reload libs failed: %d\n", ret); + return ret; + } + } + cnl->cores.state[core_id] = SKL_DSP_RUNNING; return ret; } @@ -273,6 +283,7 @@ static const struct skl_dsp_fw_ops cnl_fw_ops = { .set_state_D3 = cnl_set_dsp_D3, .load_fw = cnl_load_base_firmware, .get_fw_errcode = cnl_get_errno, + .load_library = bxt_load_library, }; static struct sst_ops cnl_ops = { diff --git a/sound/soc/intel/skylake/skl-sst-dsp.h b/sound/soc/intel/skylake/skl-sst-dsp.h index 4da240582454..06979652985c 100644 --- a/sound/soc/intel/skylake/skl-sst-dsp.h +++ b/sound/soc/intel/skylake/skl-sst-dsp.h @@ -228,6 +228,8 @@ int bxt_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, struct skl_dev **dsp); void skl_sst_dsp_cleanup(struct device *dev, struct skl_dev *skl); void bxt_sst_dsp_cleanup(struct device *dev, struct skl_dev *skl); +int bxt_load_library(struct sst_dsp *ctx, struct skl_lib_info *linfo, + int lib_count); int snd_skl_parse_uuids(struct sst_dsp *ctx, const struct firmware *fw, unsigned int offset, int index); From patchwork Thu Aug 22 19:03:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 11109823 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D0533174A for ; Thu, 22 Aug 2019 19:09:10 +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 64D62233FD for ; Thu, 22 Aug 2019 19:09:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="POIx/GFf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 64D62233FD 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-devel-bounces@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 A94331670; Thu, 22 Aug 2019 21:08:18 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A94331670 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566500948; bh=WJ6Wq+hyEk7w5FhXKi32H9YBDPNLa3HKlz/D+kVCJQw=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=POIx/GFfLhrdug2UPZT7+RaB1bpJUhUMLLVD0W1vlbJIgouEXPgpP68JclCPtdQuw xvNT4Uz3oZkXG0hn8dJxFR/hgh0iGQo0FICnPS/PqndAaZRVxuXs7zunTNHCcOBxwh s7RvkC5PGoXC84au/3Cujz6dCh6xqQ2qpM7aORCc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 053A1F8063D; Thu, 22 Aug 2019 21:05:19 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7DAC9F805FE; Thu, 22 Aug 2019 21:05:07 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 69244F80112 for ; Thu, 22 Aug 2019 21:04:50 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 69244F80112 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 12:04:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,417,1559545200"; d="scan'208";a="203524240" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga004.fm.intel.com with ESMTP; 22 Aug 2019 12:04:49 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org Date: Thu, 22 Aug 2019 21:03:56 +0200 Message-Id: <20190822190425.23001-7-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190822190425.23001-1-cezary.rojewski@intel.com> References: <20190822190425.23001-1-cezary.rojewski@intel.com> Cc: lgirdwood@gmail.com, Cezary Rojewski , broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 06/35] ASoC: Intel: Skylake: Unhardcode dsp cores number 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" While on the quest for unhardcoding the driver, use skl hw_cfg property instead of hardcoded value to retrieve number of supported dsp cores. Signed-off-by: Cezary Rojewski --- sound/soc/intel/skylake/skl-messages.c | 28 ------------------------- sound/soc/intel/skylake/skl-sst-dsp.c | 29 +++++++++++++++++++------- sound/soc/intel/skylake/skl-sst-dsp.h | 2 +- sound/soc/intel/skylake/skl-sst.c | 4 +++- sound/soc/intel/skylake/skl.h | 1 - 5 files changed, 26 insertions(+), 38 deletions(-) diff --git a/sound/soc/intel/skylake/skl-messages.c b/sound/soc/intel/skylake/skl-messages.c index cc949904717e..e4ac1ae777e0 100644 --- a/sound/soc/intel/skylake/skl-messages.c +++ b/sound/soc/intel/skylake/skl-messages.c @@ -170,56 +170,48 @@ static struct skl_dsp_loader_ops bxt_get_loader_ops(void) static const struct skl_dsp_ops dsp_ops[] = { { .id = 0x9d70, - .num_cores = 2, .loader_ops = skl_get_loader_ops, .init = skl_sst_dsp_init, .cleanup = skl_sst_dsp_cleanup }, { .id = 0x9d71, - .num_cores = 2, .loader_ops = skl_get_loader_ops, .init = skl_sst_dsp_init, .cleanup = skl_sst_dsp_cleanup }, { .id = 0x5a98, - .num_cores = 2, .loader_ops = bxt_get_loader_ops, .init = bxt_sst_dsp_init, .cleanup = bxt_sst_dsp_cleanup }, { .id = 0x3198, - .num_cores = 2, .loader_ops = bxt_get_loader_ops, .init = bxt_sst_dsp_init, .cleanup = bxt_sst_dsp_cleanup }, { .id = 0x9dc8, - .num_cores = 4, .loader_ops = bxt_get_loader_ops, .init = cnl_sst_dsp_init, .cleanup = cnl_sst_dsp_cleanup }, { .id = 0xa348, - .num_cores = 4, .loader_ops = bxt_get_loader_ops, .init = cnl_sst_dsp_init, .cleanup = cnl_sst_dsp_cleanup }, { .id = 0x02c8, - .num_cores = 4, .loader_ops = bxt_get_loader_ops, .init = cnl_sst_dsp_init, .cleanup = cnl_sst_dsp_cleanup }, { .id = 0x06c8, - .num_cores = 4, .loader_ops = bxt_get_loader_ops, .init = cnl_sst_dsp_init, .cleanup = cnl_sst_dsp_cleanup @@ -245,7 +237,6 @@ int skl_init_dsp(struct skl_dev *skl) struct skl_dsp_loader_ops loader_ops; int irq = bus->irq; const struct skl_dsp_ops *ops; - struct skl_dsp_cores *cores; int ret; /* enable ppcap interrupt */ @@ -274,29 +265,10 @@ int skl_init_dsp(struct skl_dev *skl) goto unmap_mmio; skl->dsp_ops = ops; - cores = &skl->cores; - cores->count = ops->num_cores; - - cores->state = kcalloc(cores->count, sizeof(*cores->state), GFP_KERNEL); - if (!cores->state) { - ret = -ENOMEM; - goto unmap_mmio; - } - - cores->usage_count = kcalloc(cores->count, sizeof(*cores->usage_count), - GFP_KERNEL); - if (!cores->usage_count) { - ret = -ENOMEM; - goto free_core_state; - } - dev_dbg(bus->dev, "dsp registration status=%d\n", ret); return 0; -free_core_state: - kfree(cores->state); - unmap_mmio: iounmap(mmio_base); diff --git a/sound/soc/intel/skylake/skl-sst-dsp.c b/sound/soc/intel/skylake/skl-sst-dsp.c index 0eecf26986f9..15acbe80711e 100644 --- a/sound/soc/intel/skylake/skl-sst-dsp.c +++ b/sound/soc/intel/skylake/skl-sst-dsp.c @@ -8,7 +8,7 @@ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #include - +#include #include "../common/sst-dsp.h" #include "../common/sst-ipc.h" #include "../common/sst-dsp-priv.h" @@ -31,18 +31,33 @@ void skl_dsp_set_state_locked(struct sst_dsp *ctx, int state) * successful first boot. Hence core 0 will be running and other cores * will be reset */ -void skl_dsp_init_core_state(struct sst_dsp *ctx) +int skl_dsp_init_core_state(struct sst_dsp *ctx) { struct skl_dev *skl = ctx->thread_context; + struct skl_dsp_cores *cores = &skl->cores; int i; - skl->cores.state[SKL_DSP_CORE0_ID] = SKL_DSP_RUNNING; - skl->cores.usage_count[SKL_DSP_CORE0_ID] = 1; + cores->count = skl->hw_cfg.dsp_cores; + cores->state = kcalloc(cores->count, + sizeof(*cores->state), GFP_KERNEL); + if (!cores->state) + return -ENOMEM; + + cores->usage_count = kcalloc(cores->count, + sizeof(*cores->usage_count), GFP_KERNEL); + if (!cores->usage_count) { + kfree(cores->state); + return -ENOMEM; + } + + cores->state[SKL_DSP_CORE0_ID] = SKL_DSP_RUNNING; + cores->usage_count[SKL_DSP_CORE0_ID] = 1; - for (i = SKL_DSP_CORE0_ID + 1; i < skl->cores.count; i++) { - skl->cores.state[i] = SKL_DSP_RESET; - skl->cores.usage_count[i] = 0; + for (i = SKL_DSP_CORE0_ID + 1; i < cores->count; i++) { + cores->state[i] = SKL_DSP_RESET; + cores->usage_count[i] = 0; } + return 0; } EXPORT_SYMBOL_GPL(skl_dsp_init_core_state); diff --git a/sound/soc/intel/skylake/skl-sst-dsp.h b/sound/soc/intel/skylake/skl-sst-dsp.h index 06979652985c..2129627e6255 100644 --- a/sound/soc/intel/skylake/skl-sst-dsp.h +++ b/sound/soc/intel/skylake/skl-sst-dsp.h @@ -202,7 +202,7 @@ int skl_dsp_acquire_irq(struct sst_dsp *sst); bool is_skl_dsp_running(struct sst_dsp *ctx); unsigned int skl_dsp_get_enabled_cores(struct sst_dsp *ctx); -void skl_dsp_init_core_state(struct sst_dsp *ctx); +int skl_dsp_init_core_state(struct sst_dsp *ctx); int skl_dsp_enable_core(struct sst_dsp *ctx, unsigned int core_mask); int skl_dsp_disable_core(struct sst_dsp *ctx, unsigned int core_mask); int skl_dsp_core_power_up(struct sst_dsp *ctx, unsigned int core_mask); diff --git a/sound/soc/intel/skylake/skl-sst.c b/sound/soc/intel/skylake/skl-sst.c index 8a8ecb9a4fc6..163590682e1a 100644 --- a/sound/soc/intel/skylake/skl-sst.c +++ b/sound/soc/intel/skylake/skl-sst.c @@ -589,7 +589,9 @@ int skl_sst_init_fw(struct skl_dev *skl) goto exit; } - skl_dsp_init_core_state(sst); + ret = skl_dsp_init_core_state(sst); + if (ret < 0) + goto exit; library_load: if (skl->lib_count > 1) { diff --git a/sound/soc/intel/skylake/skl.h b/sound/soc/intel/skylake/skl.h index 1f86543fe954..71e69f52b7ab 100644 --- a/sound/soc/intel/skylake/skl.h +++ b/sound/soc/intel/skylake/skl.h @@ -155,7 +155,6 @@ struct skl_machine_pdata { struct skl_dsp_ops { int id; - unsigned int num_cores; struct skl_dsp_loader_ops (*loader_ops)(void); int (*init)(struct device *dev, void __iomem *mmio_base, int irq, const char *fw_name, From patchwork Thu Aug 22 19:03:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 11109829 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3CC43174A for ; Thu, 22 Aug 2019 19:10:57 +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 B9E7323400 for ; Thu, 22 Aug 2019 19:10:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="u8DdHgnd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B9E7323400 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-devel-bounces@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 47B5E1672; Thu, 22 Aug 2019 21:10:04 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 47B5E1672 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566501054; bh=fmk8W5tQTfLE/X9i6ILDcZVk/EwWNgRgPFL0EdMeX4E=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=u8DdHgndLPgKoOVPEjGFigC/zH3d4ia38GqXbhEhBkTi0HTaTKaIDrTPsJb67J9FP c3vbY7qXQRotLVL/ZPw2H78+VThesxa7f5Uk0ViNSaRjRuHbagUF9PKDOvBNjQU5EO I3OKKAmj/KqiU0nDGFP6EfMjPyr4L+M1f4cWMbu0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 5ABB8F80674; Thu, 22 Aug 2019 21:05:32 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id E274BF8060E; Thu, 22 Aug 2019 21:05:10 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 6C069F805A1 for ; Thu, 22 Aug 2019 21:04:54 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 6C069F805A1 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 12:04:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,417,1559545200"; d="scan'208";a="203524246" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga004.fm.intel.com with ESMTP; 22 Aug 2019 12:04:51 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org Date: Thu, 22 Aug 2019 21:03:57 +0200 Message-Id: <20190822190425.23001-8-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190822190425.23001-1-cezary.rojewski@intel.com> References: <20190822190425.23001-1-cezary.rojewski@intel.com> Cc: lgirdwood@gmail.com, Cezary Rojewski , broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 07/35] ASoC: Intel: Skylake: Update interrupt disabling routine 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" CNL disable interrupt routine correctly makes use of locked _update_bits whereas SKL lagged behind and still invokes unlocked variants. Update SKL equivalent to match its CNL brother. Signed-off-by: Cezary Rojewski --- sound/soc/intel/skylake/skl-sst-ipc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/intel/skylake/skl-sst-ipc.c b/sound/soc/intel/skylake/skl-sst-ipc.c index 91b5440c643d..4875a518dd54 100644 --- a/sound/soc/intel/skylake/skl-sst-ipc.c +++ b/sound/soc/intel/skylake/skl-sst-ipc.c @@ -582,11 +582,11 @@ void skl_ipc_op_int_enable(struct sst_dsp *ctx) void skl_ipc_op_int_disable(struct sst_dsp *ctx) { /* disable IPC DONE interrupt */ - sst_dsp_shim_update_bits_unlocked(ctx, SKL_ADSP_REG_HIPCCTL, + sst_dsp_shim_update_bits(ctx, SKL_ADSP_REG_HIPCCTL, SKL_ADSP_REG_HIPCCTL_DONE, 0); /* Disable IPC BUSY interrupt */ - sst_dsp_shim_update_bits_unlocked(ctx, SKL_ADSP_REG_HIPCCTL, + sst_dsp_shim_update_bits(ctx, SKL_ADSP_REG_HIPCCTL, SKL_ADSP_REG_HIPCCTL_BUSY, 0); } From patchwork Thu Aug 22 19:03:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 11109851 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 19043174A for ; Thu, 22 Aug 2019 19:11:47 +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 A032F23400 for ; Thu, 22 Aug 2019 19:11:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="sCfAFVeN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A032F23400 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-devel-bounces@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 CDA18847; Thu, 22 Aug 2019 21:10:54 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CDA18847 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566501104; bh=WLQhOT04mnvQJB0xVO4e1Jt5OteSdTS2u8wjc9UiN/0=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=sCfAFVeNT9NR7cbYwq2SKanZbF6vkn+RF33QqrdSwdb1MTSWegLYPVyWGRNw4HrMP kPB9SNeKt6LHKFirA5yke3kkYKXVOTyArajyRGJXTlG4U/QkLp6HxMNfyyE6ub6Y1W M1BfoqNCnHbNZYvd2ofguU8e4d3meaxRWUZbD7DU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D4D70F8067C; Thu, 22 Aug 2019 21:05:35 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4DC9DF8060F; Thu, 22 Aug 2019 21:05:11 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 96C30F805E0 for ; Thu, 22 Aug 2019 21:04:54 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 96C30F805E0 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 12:04:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,417,1559545200"; d="scan'208";a="203524252" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga004.fm.intel.com with ESMTP; 22 Aug 2019 12:04:52 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org Date: Thu, 22 Aug 2019 21:03:58 +0200 Message-Id: <20190822190425.23001-9-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190822190425.23001-1-cezary.rojewski@intel.com> References: <20190822190425.23001-1-cezary.rojewski@intel.com> Cc: lgirdwood@gmail.com, Cezary Rojewski , broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 08/35] ASoC: Intel: Skylake: Inline ipc free operations 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" skl_ipc_free and its equivalents are simple wrappers. Let's inline them, making room for cleanup mechanism unification. Signed-off-by: Cezary Rojewski --- sound/soc/intel/skylake/bxt-sst.c | 1 - sound/soc/intel/skylake/cnl-sst-dsp.c | 12 +++++------- sound/soc/intel/skylake/cnl-sst-dsp.h | 1 - sound/soc/intel/skylake/cnl-sst.c | 1 - sound/soc/intel/skylake/skl-sst-dsp.c | 5 ++++- sound/soc/intel/skylake/skl-sst-ipc.c | 13 ------------- sound/soc/intel/skylake/skl-sst-ipc.h | 1 - sound/soc/intel/skylake/skl-sst.c | 1 - 8 files changed, 9 insertions(+), 26 deletions(-) diff --git a/sound/soc/intel/skylake/bxt-sst.c b/sound/soc/intel/skylake/bxt-sst.c index cc9507d4702b..68f400cfb390 100644 --- a/sound/soc/intel/skylake/bxt-sst.c +++ b/sound/soc/intel/skylake/bxt-sst.c @@ -599,7 +599,6 @@ void bxt_sst_dsp_cleanup(struct device *dev, struct skl_dev *skl) if (skl->dsp->fw) release_firmware(skl->dsp->fw); skl_freeup_uuid_list(skl); - skl_ipc_free(&skl->ipc); skl->dsp->ops->free(skl->dsp); } EXPORT_SYMBOL_GPL(bxt_sst_dsp_cleanup); diff --git a/sound/soc/intel/skylake/cnl-sst-dsp.c b/sound/soc/intel/skylake/cnl-sst-dsp.c index 3ef1b194add1..189c1c7086e3 100644 --- a/sound/soc/intel/skylake/cnl-sst-dsp.c +++ b/sound/soc/intel/skylake/cnl-sst-dsp.c @@ -14,9 +14,9 @@ */ #include #include "../common/sst-dsp.h" -#include "../common/sst-ipc.h" #include "../common/sst-dsp-priv.h" #include "cnl-sst-dsp.h" +#include "skl.h" /* various timeout values */ #define CNL_DSP_PU_TO 50 @@ -209,10 +209,13 @@ irqreturn_t cnl_dsp_sst_interrupt(int irq, void *dev_id) void cnl_dsp_free(struct sst_dsp *dsp) { + struct skl_dev *skl = dsp->thread_context; + + cnl_ipc_op_int_disable(dsp); + sst_ipc_fini(&skl->ipc); cnl_ipc_int_disable(dsp); free_irq(dsp->irq, dsp); - cnl_ipc_op_int_disable(dsp); cnl_dsp_disable_core(dsp, SKL_DSP_CORE0_MASK); } EXPORT_SYMBOL_GPL(cnl_dsp_free); @@ -259,8 +262,3 @@ bool cnl_ipc_int_status(struct sst_dsp *ctx) CNL_ADSPIS_IPC; } -void cnl_ipc_free(struct sst_generic_ipc *ipc) -{ - cnl_ipc_op_int_disable(ipc->dsp); - sst_ipc_fini(ipc); -} diff --git a/sound/soc/intel/skylake/cnl-sst-dsp.h b/sound/soc/intel/skylake/cnl-sst-dsp.h index 50f4a53a607c..b1417639bc1c 100644 --- a/sound/soc/intel/skylake/cnl-sst-dsp.h +++ b/sound/soc/intel/skylake/cnl-sst-dsp.h @@ -92,7 +92,6 @@ void cnl_ipc_int_disable(struct sst_dsp *ctx); void cnl_ipc_op_int_enable(struct sst_dsp *ctx); void cnl_ipc_op_int_disable(struct sst_dsp *ctx); bool cnl_ipc_int_status(struct sst_dsp *ctx); -void cnl_ipc_free(struct sst_generic_ipc *ipc); int cnl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, const char *fw_name, struct skl_dsp_loader_ops dsp_ops, diff --git a/sound/soc/intel/skylake/cnl-sst.c b/sound/soc/intel/skylake/cnl-sst.c index a2b3bce631fc..76b23ea7802e 100644 --- a/sound/soc/intel/skylake/cnl-sst.c +++ b/sound/soc/intel/skylake/cnl-sst.c @@ -470,7 +470,6 @@ void cnl_sst_dsp_cleanup(struct device *dev, struct skl_dev *skl) release_firmware(skl->dsp->fw); skl_freeup_uuid_list(skl); - cnl_ipc_free(&skl->ipc); skl->dsp->ops->free(skl->dsp); } diff --git a/sound/soc/intel/skylake/skl-sst-dsp.c b/sound/soc/intel/skylake/skl-sst-dsp.c index 15acbe80711e..e0807db225f4 100644 --- a/sound/soc/intel/skylake/skl-sst-dsp.c +++ b/sound/soc/intel/skylake/skl-sst-dsp.c @@ -463,10 +463,13 @@ int skl_dsp_acquire_irq(struct sst_dsp *sst) void skl_dsp_free(struct sst_dsp *dsp) { + struct skl_dev *skl = dsp->thread_context; + + skl_ipc_op_int_disable(dsp); + sst_ipc_fini(&skl->ipc); skl_ipc_int_disable(dsp); free_irq(dsp->irq, dsp); - skl_ipc_op_int_disable(dsp); skl_dsp_disable_core(dsp, SKL_DSP_CORE0_MASK); } EXPORT_SYMBOL_GPL(skl_dsp_free); diff --git a/sound/soc/intel/skylake/skl-sst-ipc.c b/sound/soc/intel/skylake/skl-sst-ipc.c index 4875a518dd54..2700f882103d 100644 --- a/sound/soc/intel/skylake/skl-sst-ipc.c +++ b/sound/soc/intel/skylake/skl-sst-ipc.c @@ -620,19 +620,6 @@ int skl_ipc_init(struct device *dev, struct skl_dev *skl) return 0; } -void skl_ipc_free(struct sst_generic_ipc *ipc) -{ - /* Disable IPC DONE interrupt */ - sst_dsp_shim_update_bits(ipc->dsp, SKL_ADSP_REG_HIPCCTL, - SKL_ADSP_REG_HIPCCTL_DONE, 0); - - /* Disable IPC BUSY interrupt */ - sst_dsp_shim_update_bits(ipc->dsp, SKL_ADSP_REG_HIPCCTL, - SKL_ADSP_REG_HIPCCTL_BUSY, 0); - - sst_ipc_fini(ipc); -} - int skl_ipc_create_pipeline(struct sst_generic_ipc *ipc, u16 ppl_mem_size, u8 ppl_type, u8 instance_id, u8 lp_mode) { diff --git a/sound/soc/intel/skylake/skl-sst-ipc.h b/sound/soc/intel/skylake/skl-sst-ipc.h index eefa52f7f97a..fb150e656379 100644 --- a/sound/soc/intel/skylake/skl-sst-ipc.h +++ b/sound/soc/intel/skylake/skl-sst-ipc.h @@ -275,7 +275,6 @@ void skl_ipc_op_int_disable(struct sst_dsp *ctx); void skl_ipc_int_disable(struct sst_dsp *dsp); bool skl_ipc_int_status(struct sst_dsp *dsp); -void skl_ipc_free(struct sst_generic_ipc *ipc); int skl_ipc_init(struct device *dev, struct skl_dev *skl); void skl_clear_module_cnt(struct sst_dsp *ctx); diff --git a/sound/soc/intel/skylake/skl-sst.c b/sound/soc/intel/skylake/skl-sst.c index 163590682e1a..72ab579ddd27 100644 --- a/sound/soc/intel/skylake/skl-sst.c +++ b/sound/soc/intel/skylake/skl-sst.c @@ -620,7 +620,6 @@ void skl_sst_dsp_cleanup(struct device *dev, struct skl_dev *skl) release_firmware(skl->dsp->fw); skl_clear_module_table(skl->dsp); skl_freeup_uuid_list(skl); - skl_ipc_free(&skl->ipc); skl->dsp->ops->free(skl->dsp); if (skl->boot_complete) { skl->dsp->cl_dev.ops.cl_cleanup_controller(skl->dsp); From patchwork Thu Aug 22 19:03:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 11109853 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C4AD31399 for ; Thu, 22 Aug 2019 19:12:11 +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 59E9923400 for ; Thu, 22 Aug 2019 19:12:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="lzuRyfNR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 59E9923400 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-devel-bounces@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 9FCF8167B; Thu, 22 Aug 2019 21:11:19 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9FCF8167B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566501129; bh=CaXYkP+YVniQg+hNUHdkbp6888pmHQtJr2giTXc6f8I=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=lzuRyfNRvW32Ak9g212YP0mJ2jNHdsULkMZpuG6Tf/1YkbCdboCbt8DdquoPy7roj Xakjzv6SPe0X6SlQHQx4bbzcFR2g4VxDvSqecWdBmyBk7r2clgY7IvTXkaThrdCPta V8i852TxU8XflromzKd/RsIe6pxIMBe4z2Om8Irw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 9184EF805E0; Thu, 22 Aug 2019 21:05:42 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 186E0F80641; Thu, 22 Aug 2019 21:05:19 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 7C343F803D5 for ; Thu, 22 Aug 2019 21:04:55 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7C343F803D5 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 12:04:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,417,1559545200"; d="scan'208";a="203524259" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga004.fm.intel.com with ESMTP; 22 Aug 2019 12:04:54 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org Date: Thu, 22 Aug 2019 21:03:59 +0200 Message-Id: <20190822190425.23001-10-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190822190425.23001-1-cezary.rojewski@intel.com> References: <20190822190425.23001-1-cezary.rojewski@intel.com> Cc: lgirdwood@gmail.com, Cezary Rojewski , broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 09/35] ASoC: Intel: Skylake: Unify driver cleanup mechanism 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Driver cleanup process is similar for all platforms and sst_ops::free provides enough customization already. Unify them. Also remove redundant disable interrupt calls from new cleanup method. This is yet another checkpoint in quest for simplification or, perhaps a removal of skl_dsp_ops. Signed-off-by: Cezary Rojewski --- sound/soc/intel/skylake/bxt-sst.c | 11 ----------- sound/soc/intel/skylake/cnl-sst-dsp.h | 1 - sound/soc/intel/skylake/cnl-sst.c | 11 ----------- sound/soc/intel/skylake/skl-messages.c | 10 +--------- sound/soc/intel/skylake/skl-sst-dsp.h | 2 -- sound/soc/intel/skylake/skl-sst.c | 20 ++++++++++++-------- sound/soc/intel/skylake/skl.h | 2 +- 7 files changed, 14 insertions(+), 43 deletions(-) diff --git a/sound/soc/intel/skylake/bxt-sst.c b/sound/soc/intel/skylake/bxt-sst.c index 68f400cfb390..4e5fb7684415 100644 --- a/sound/soc/intel/skylake/bxt-sst.c +++ b/sound/soc/intel/skylake/bxt-sst.c @@ -592,16 +592,5 @@ int bxt_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, } EXPORT_SYMBOL_GPL(bxt_sst_dsp_init); -void bxt_sst_dsp_cleanup(struct device *dev, struct skl_dev *skl) -{ - - skl_release_library(skl->lib_info, skl->lib_count); - if (skl->dsp->fw) - release_firmware(skl->dsp->fw); - skl_freeup_uuid_list(skl); - skl->dsp->ops->free(skl->dsp); -} -EXPORT_SYMBOL_GPL(bxt_sst_dsp_cleanup); - MODULE_LICENSE("GPL v2"); MODULE_DESCRIPTION("Intel Broxton IPC driver"); diff --git a/sound/soc/intel/skylake/cnl-sst-dsp.h b/sound/soc/intel/skylake/cnl-sst-dsp.h index b1417639bc1c..f3d320b05eb5 100644 --- a/sound/soc/intel/skylake/cnl-sst-dsp.h +++ b/sound/soc/intel/skylake/cnl-sst-dsp.h @@ -96,6 +96,5 @@ bool cnl_ipc_int_status(struct sst_dsp *ctx); int cnl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, const char *fw_name, struct skl_dsp_loader_ops dsp_ops, struct skl_dev **dsp); -void cnl_sst_dsp_cleanup(struct device *dev, struct skl_dev *skl); #endif /*__CNL_SST_DSP_H__*/ diff --git a/sound/soc/intel/skylake/cnl-sst.c b/sound/soc/intel/skylake/cnl-sst.c index 76b23ea7802e..5143200579aa 100644 --- a/sound/soc/intel/skylake/cnl-sst.c +++ b/sound/soc/intel/skylake/cnl-sst.c @@ -464,16 +464,5 @@ int cnl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, } EXPORT_SYMBOL_GPL(cnl_sst_dsp_init); -void cnl_sst_dsp_cleanup(struct device *dev, struct skl_dev *skl) -{ - if (skl->dsp->fw) - release_firmware(skl->dsp->fw); - - skl_freeup_uuid_list(skl); - - skl->dsp->ops->free(skl->dsp); -} -EXPORT_SYMBOL_GPL(cnl_sst_dsp_cleanup); - MODULE_LICENSE("GPL v2"); MODULE_DESCRIPTION("Intel Cannonlake IPC driver"); diff --git a/sound/soc/intel/skylake/skl-messages.c b/sound/soc/intel/skylake/skl-messages.c index e4ac1ae777e0..8fd682872d0c 100644 --- a/sound/soc/intel/skylake/skl-messages.c +++ b/sound/soc/intel/skylake/skl-messages.c @@ -172,49 +172,41 @@ static const struct skl_dsp_ops dsp_ops[] = { .id = 0x9d70, .loader_ops = skl_get_loader_ops, .init = skl_sst_dsp_init, - .cleanup = skl_sst_dsp_cleanup }, { .id = 0x9d71, .loader_ops = skl_get_loader_ops, .init = skl_sst_dsp_init, - .cleanup = skl_sst_dsp_cleanup }, { .id = 0x5a98, .loader_ops = bxt_get_loader_ops, .init = bxt_sst_dsp_init, - .cleanup = bxt_sst_dsp_cleanup }, { .id = 0x3198, .loader_ops = bxt_get_loader_ops, .init = bxt_sst_dsp_init, - .cleanup = bxt_sst_dsp_cleanup }, { .id = 0x9dc8, .loader_ops = bxt_get_loader_ops, .init = cnl_sst_dsp_init, - .cleanup = cnl_sst_dsp_cleanup }, { .id = 0xa348, .loader_ops = bxt_get_loader_ops, .init = cnl_sst_dsp_init, - .cleanup = cnl_sst_dsp_cleanup }, { .id = 0x02c8, .loader_ops = bxt_get_loader_ops, .init = cnl_sst_dsp_init, - .cleanup = cnl_sst_dsp_cleanup }, { .id = 0x06c8, .loader_ops = bxt_get_loader_ops, .init = cnl_sst_dsp_init, - .cleanup = cnl_sst_dsp_cleanup }, }; @@ -282,7 +274,7 @@ int skl_free_dsp(struct skl_dev *skl) /* disable ppcap interrupt */ snd_hdac_ext_bus_ppcap_int_enable(bus, false); - skl->dsp_ops->cleanup(bus->dev, skl); + skl_sst_dsp_cleanup(skl); kfree(skl->hw_cfg.i2s_caps.ctrl_base_addr); kfree(skl->cores.state); diff --git a/sound/soc/intel/skylake/skl-sst-dsp.h b/sound/soc/intel/skylake/skl-sst-dsp.h index 2129627e6255..21d376692503 100644 --- a/sound/soc/intel/skylake/skl-sst-dsp.h +++ b/sound/soc/intel/skylake/skl-sst-dsp.h @@ -226,8 +226,6 @@ int skl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, int bxt_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, const char *fw_name, struct skl_dsp_loader_ops dsp_ops, struct skl_dev **dsp); -void skl_sst_dsp_cleanup(struct device *dev, struct skl_dev *skl); -void bxt_sst_dsp_cleanup(struct device *dev, struct skl_dev *skl); int bxt_load_library(struct sst_dsp *ctx, struct skl_lib_info *linfo, int lib_count); diff --git a/sound/soc/intel/skylake/skl-sst.c b/sound/soc/intel/skylake/skl-sst.c index 72ab579ddd27..a7a285ea24e1 100644 --- a/sound/soc/intel/skylake/skl-sst.c +++ b/sound/soc/intel/skylake/skl-sst.c @@ -613,17 +613,21 @@ int skl_sst_init_fw(struct skl_dev *skl) } EXPORT_SYMBOL_GPL(skl_sst_init_fw); -void skl_sst_dsp_cleanup(struct device *dev, struct skl_dev *skl) +void skl_sst_dsp_cleanup(struct skl_dev *skl) { + struct sst_dsp *dsp = skl->dsp; + + skl_release_library(skl->lib_info, skl->lib_count); + if (dsp->fw) + release_firmware(dsp->fw); + skl_clear_module_table(dsp); - if (skl->dsp->fw) - release_firmware(skl->dsp->fw); - skl_clear_module_table(skl->dsp); skl_freeup_uuid_list(skl); - skl->dsp->ops->free(skl->dsp); - if (skl->boot_complete) { - skl->dsp->cl_dev.ops.cl_cleanup_controller(skl->dsp); - skl_cldma_int_disable(skl->dsp); + dsp->ops->free(dsp); + + if (skl->boot_complete && dsp->cl_dev.bufsize) { + dsp->cl_dev.ops.cl_cleanup_controller(dsp); + skl_cldma_int_disable(dsp); } } EXPORT_SYMBOL_GPL(skl_sst_dsp_cleanup); diff --git a/sound/soc/intel/skylake/skl.h b/sound/soc/intel/skylake/skl.h index 71e69f52b7ab..62e2f2d450e4 100644 --- a/sound/soc/intel/skylake/skl.h +++ b/sound/soc/intel/skylake/skl.h @@ -160,7 +160,6 @@ struct skl_dsp_ops { int irq, const char *fw_name, struct skl_dsp_loader_ops loader_ops, struct skl_dev **skl_sst); - void (*cleanup)(struct device *dev, struct skl_dev *skl); }; int skl_platform_unregister(struct device *dev); @@ -174,6 +173,7 @@ int skl_nhlt_update_topology_bin(struct skl_dev *skl); int skl_init_dsp(struct skl_dev *skl); int skl_free_dsp(struct skl_dev *skl); int skl_sst_init_fw(struct skl_dev *skl); +void skl_sst_dsp_cleanup(struct skl_dev *skl); int skl_suspend_late_dsp(struct skl_dev *skl); int skl_suspend_dsp(struct skl_dev *skl); int skl_resume_dsp(struct skl_dev *skl); From patchwork Thu Aug 22 19:04:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 11109867 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 45FCF14DE for ; Thu, 22 Aug 2019 19:15:05 +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 CFBB723402 for ; Thu, 22 Aug 2019 19:15:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="qOkpT1LP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CFBB723402 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-devel-bounces@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 2AA85166B; Thu, 22 Aug 2019 21:14:13 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2AA85166B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566501303; bh=FbJjISgsSTnRGFN9fnrIRAqvuwk82Kkc8QOmZda5Luo=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=qOkpT1LPG1VknoCXEdAKcucmVgEPN9MAQCUGSLXbudo/yQKONeJteCsw2D3IY5H65 k92v2PC4OEKZo+itkHxwaeQGar/W0mrwsDaQ569gelufCMnQBqMh2fJZgEVfiGLbE7 ZdigwNGaRL4R843mGT8NgRQng+pwPNNsR3e4nvH4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 53441F80714; Thu, 22 Aug 2019 21:06:04 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2A7B8F8065E; Thu, 22 Aug 2019 21:05:26 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 8D075F8036D for ; Thu, 22 Aug 2019 21:04:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8D075F8036D X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 12:04:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,417,1559545200"; d="scan'208";a="203524267" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga004.fm.intel.com with ESMTP; 22 Aug 2019 12:04:56 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org Date: Thu, 22 Aug 2019 21:04:00 +0200 Message-Id: <20190822190425.23001-11-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190822190425.23001-1-cezary.rojewski@intel.com> References: <20190822190425.23001-1-cezary.rojewski@intel.com> Cc: lgirdwood@gmail.com, Cezary Rojewski , broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 10/35] ASoC: Intel: Relocate irq thread header to sst_ops 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" thread_fn is the only DSP core op which is located outside of sst_ops. Add it to the rest. Change enables further cleanups by following patches, mainly removal of sst_dsp_device struct. Signed-off-by: Cezary Rojewski --- sound/soc/intel/baytrail/sst-baytrail-dsp.c | 1 + sound/soc/intel/baytrail/sst-baytrail-ipc.c | 3 +-- sound/soc/intel/baytrail/sst-baytrail-ipc.h | 2 ++ sound/soc/intel/common/sst-dsp-priv.h | 1 + sound/soc/intel/common/sst-dsp.h | 1 - sound/soc/intel/common/sst-firmware.c | 2 +- sound/soc/intel/haswell/sst-haswell-dsp.c | 1 + sound/soc/intel/haswell/sst-haswell-ipc.c | 3 +-- sound/soc/intel/haswell/sst-haswell-ipc.h | 2 ++ sound/soc/intel/skylake/bxt-sst.c | 2 +- sound/soc/intel/skylake/cnl-sst.c | 28 ++++++++++----------- sound/soc/intel/skylake/skl-sst-dsp.c | 3 +-- sound/soc/intel/skylake/skl-sst.c | 1 - 13 files changed, 26 insertions(+), 24 deletions(-) diff --git a/sound/soc/intel/baytrail/sst-baytrail-dsp.c b/sound/soc/intel/baytrail/sst-baytrail-dsp.c index 4116ba66a4c2..4869e18116eb 100644 --- a/sound/soc/intel/baytrail/sst-baytrail-dsp.c +++ b/sound/soc/intel/baytrail/sst-baytrail-dsp.c @@ -352,6 +352,7 @@ struct sst_ops sst_byt_ops = { .ram_read = sst_memcpy_fromio_32, .ram_write = sst_memcpy_toio_32, .irq_handler = sst_byt_irq, + .thread_fn = sst_byt_irq_thread, .init = sst_byt_init, .free = sst_byt_free, .parse_fw = sst_byt_parse_fw_image, diff --git a/sound/soc/intel/baytrail/sst-baytrail-ipc.c b/sound/soc/intel/baytrail/sst-baytrail-ipc.c index 74274bd38f7a..23d65ad38e19 100644 --- a/sound/soc/intel/baytrail/sst-baytrail-ipc.c +++ b/sound/soc/intel/baytrail/sst-baytrail-ipc.c @@ -293,7 +293,7 @@ static int sst_byt_process_notification(struct sst_byt *byt, return 1; } -static irqreturn_t sst_byt_irq_thread(int irq, void *context) +irqreturn_t sst_byt_irq_thread(int irq, void *context) { struct sst_dsp *sst = (struct sst_dsp *) context; struct sst_byt *byt = sst_dsp_get_thread_context(sst); @@ -557,7 +557,6 @@ struct sst_dsp *sst_byt_get_dsp(struct sst_byt *byt) } static struct sst_dsp_device byt_dev = { - .thread = sst_byt_irq_thread, .ops = &sst_byt_ops, }; diff --git a/sound/soc/intel/baytrail/sst-baytrail-ipc.h b/sound/soc/intel/baytrail/sst-baytrail-ipc.h index 755098509327..9aba6b83ee5f 100644 --- a/sound/soc/intel/baytrail/sst-baytrail-ipc.h +++ b/sound/soc/intel/baytrail/sst-baytrail-ipc.h @@ -7,6 +7,7 @@ #ifndef __SST_BYT_IPC_H #define __SST_BYT_IPC_H +#include #include struct sst_byt; @@ -61,5 +62,6 @@ struct sst_dsp *sst_byt_get_dsp(struct sst_byt *byt); int sst_byt_dsp_suspend_late(struct device *dev, struct sst_pdata *pdata); int sst_byt_dsp_boot(struct device *dev, struct sst_pdata *pdata); int sst_byt_dsp_wait_for_ready(struct device *dev, struct sst_pdata *pdata); +irqreturn_t sst_byt_irq_thread(int irq, void *context); #endif diff --git a/sound/soc/intel/common/sst-dsp-priv.h b/sound/soc/intel/common/sst-dsp-priv.h index 3d8765ce3e0d..7ec477108948 100644 --- a/sound/soc/intel/common/sst-dsp-priv.h +++ b/sound/soc/intel/common/sst-dsp-priv.h @@ -49,6 +49,7 @@ struct sst_ops { /* IRQ handlers */ irqreturn_t (*irq_handler)(int irq, void *context); + irqreturn_t (*thread_fn)(int irq, void *context); /* SST init and free */ int (*init)(struct sst_dsp *sst, struct sst_pdata *pdata); diff --git a/sound/soc/intel/common/sst-dsp.h b/sound/soc/intel/common/sst-dsp.h index 604a80c5859b..05fa1ca72f46 100644 --- a/sound/soc/intel/common/sst-dsp.h +++ b/sound/soc/intel/common/sst-dsp.h @@ -175,7 +175,6 @@ struct sst_dsp; struct sst_dsp_device { /* Mandatory fields */ struct sst_ops *ops; - irqreturn_t (*thread)(int irq, void *context); void *thread_context; }; diff --git a/sound/soc/intel/common/sst-firmware.c b/sound/soc/intel/common/sst-firmware.c index d27947aeb079..c18236ca77f4 100644 --- a/sound/soc/intel/common/sst-firmware.c +++ b/sound/soc/intel/common/sst-firmware.c @@ -1237,7 +1237,7 @@ struct sst_dsp *sst_dsp_new(struct device *dev, /* Register the ISR */ err = request_threaded_irq(sst->irq, sst->ops->irq_handler, - sst_dev->thread, IRQF_SHARED, "AudioDSP", sst); + sst->ops->thread_fn, IRQF_SHARED, "AudioDSP", sst); if (err) goto irq_err; diff --git a/sound/soc/intel/haswell/sst-haswell-dsp.c b/sound/soc/intel/haswell/sst-haswell-dsp.c index 88c3f63bded9..c099dec7d61f 100644 --- a/sound/soc/intel/haswell/sst-haswell-dsp.c +++ b/sound/soc/intel/haswell/sst-haswell-dsp.c @@ -699,6 +699,7 @@ struct sst_ops haswell_ops = { .ram_read = sst_memcpy_fromio_32, .ram_write = sst_memcpy_toio_32, .irq_handler = hsw_irq, + .thread_fn = hsw_irq_thread, .init = hsw_init, .free = hsw_free, .parse_fw = hsw_parse_fw_image, diff --git a/sound/soc/intel/haswell/sst-haswell-ipc.c b/sound/soc/intel/haswell/sst-haswell-ipc.c index 5c73b11375e3..e25358d19aae 100644 --- a/sound/soc/intel/haswell/sst-haswell-ipc.c +++ b/sound/soc/intel/haswell/sst-haswell-ipc.c @@ -757,7 +757,7 @@ static int hsw_process_notification(struct sst_hsw *hsw) return handled; } -static irqreturn_t hsw_irq_thread(int irq, void *context) +irqreturn_t hsw_irq_thread(int irq, void *context) { struct sst_dsp *sst = (struct sst_dsp *) context; struct sst_hsw *hsw = sst_dsp_get_thread_context(sst); @@ -2046,7 +2046,6 @@ int sst_hsw_module_set_param(struct sst_hsw *hsw, } static struct sst_dsp_device hsw_dev = { - .thread = hsw_irq_thread, .ops = &haswell_ops, }; diff --git a/sound/soc/intel/haswell/sst-haswell-ipc.h b/sound/soc/intel/haswell/sst-haswell-ipc.h index fdc70c77e688..d4a936a75f7d 100644 --- a/sound/soc/intel/haswell/sst-haswell-ipc.h +++ b/sound/soc/intel/haswell/sst-haswell-ipc.h @@ -8,6 +8,7 @@ #ifndef __SST_HASWELL_IPC_H #define __SST_HASWELL_IPC_H +#include #include #include #include @@ -396,6 +397,7 @@ struct sst_hsw_ipc_fw_version; struct sst_hsw *sst_hsw_new(struct device *dev, const u8 *fw, size_t fw_length, u32 fw_offset); void sst_hsw_free(struct sst_hsw *hsw); +irqreturn_t hsw_irq_thread(int irq, void *context); int sst_hsw_fw_get_version(struct sst_hsw *hsw, struct sst_hsw_ipc_fw_version *version); u32 create_channel_map(enum sst_hsw_channel_config config); diff --git a/sound/soc/intel/skylake/bxt-sst.c b/sound/soc/intel/skylake/bxt-sst.c index 4e5fb7684415..8faffec4e943 100644 --- a/sound/soc/intel/skylake/bxt-sst.c +++ b/sound/soc/intel/skylake/bxt-sst.c @@ -535,6 +535,7 @@ static const struct skl_dsp_fw_ops bxt_fw_ops = { static struct sst_ops skl_ops = { .irq_handler = skl_dsp_sst_interrupt, + .thread_fn = skl_dsp_irq_thread_handler, .write = sst_shim32_write, .read = sst_shim32_read, .ram_read = sst_memcpy_fromio_32, @@ -543,7 +544,6 @@ static struct sst_ops skl_ops = { }; static struct sst_dsp_device skl_dev = { - .thread = skl_dsp_irq_thread_handler, .ops = &skl_ops, }; diff --git a/sound/soc/intel/skylake/cnl-sst.c b/sound/soc/intel/skylake/cnl-sst.c index 5143200579aa..02d8e72d2d5a 100644 --- a/sound/soc/intel/skylake/cnl-sst.c +++ b/sound/soc/intel/skylake/cnl-sst.c @@ -286,15 +286,6 @@ static const struct skl_dsp_fw_ops cnl_fw_ops = { .load_library = bxt_load_library, }; -static struct sst_ops cnl_ops = { - .irq_handler = cnl_dsp_sst_interrupt, - .write = sst_shim32_write, - .read = sst_shim32_read, - .ram_read = sst_memcpy_fromio_32, - .ram_write = sst_memcpy_toio_32, - .free = cnl_dsp_free, -}; - #define CNL_IPC_GLB_NOTIFY_RSP_SHIFT 29 #define CNL_IPC_GLB_NOTIFY_RSP_MASK 0x1 #define CNL_IPC_GLB_NOTIFY_RSP_TYPE(x) (((x) >> CNL_IPC_GLB_NOTIFY_RSP_SHIFT) \ @@ -370,11 +361,6 @@ static irqreturn_t cnl_dsp_irq_thread_handler(int irq, void *context) return IRQ_HANDLED; } -static struct sst_dsp_device cnl_dev = { - .thread = cnl_dsp_irq_thread_handler, - .ops = &cnl_ops, -}; - static void cnl_ipc_tx_msg(struct sst_generic_ipc *ipc, struct ipc_message *msg) { struct skl_ipc_header *header = (struct skl_ipc_header *)(&msg->tx.header); @@ -423,6 +409,20 @@ static int cnl_ipc_init(struct device *dev, struct skl_dev *cnl) return 0; } +static struct sst_ops cnl_ops = { + .irq_handler = cnl_dsp_sst_interrupt, + .thread_fn = cnl_dsp_irq_thread_handler, + .write = sst_shim32_write, + .read = sst_shim32_read, + .ram_read = sst_memcpy_fromio_32, + .ram_write = sst_memcpy_toio_32, + .free = cnl_dsp_free, +}; + +static struct sst_dsp_device cnl_dev = { + .ops = &cnl_ops, +}; + int cnl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, const char *fw_name, struct skl_dsp_loader_ops dsp_ops, struct skl_dev **dsp) diff --git a/sound/soc/intel/skylake/skl-sst-dsp.c b/sound/soc/intel/skylake/skl-sst-dsp.c index e0807db225f4..8d98089e3177 100644 --- a/sound/soc/intel/skylake/skl-sst-dsp.c +++ b/sound/soc/intel/skylake/skl-sst-dsp.c @@ -448,12 +448,11 @@ struct sst_dsp *skl_dsp_ctx_init(struct device *dev, int skl_dsp_acquire_irq(struct sst_dsp *sst) { - struct sst_dsp_device *sst_dev = sst->sst_dev; int ret; /* Register the ISR */ ret = request_threaded_irq(sst->irq, sst->ops->irq_handler, - sst_dev->thread, IRQF_SHARED, "AudioDSP", sst); + sst->ops->thread_fn, IRQF_SHARED, "AudioDSP", sst); if (ret) dev_err(sst->dev, "unable to grab threaded IRQ %d, disabling device\n", sst->irq); diff --git a/sound/soc/intel/skylake/skl-sst.c b/sound/soc/intel/skylake/skl-sst.c index a7a285ea24e1..9fd3cf30e87c 100644 --- a/sound/soc/intel/skylake/skl-sst.c +++ b/sound/soc/intel/skylake/skl-sst.c @@ -513,7 +513,6 @@ static struct sst_ops skl_ops = { }; static struct sst_dsp_device skl_dev = { - .thread = skl_dsp_irq_thread_handler, .ops = &skl_ops, }; From patchwork Thu Aug 22 19:04:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 11109859 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 528BB1399 for ; Thu, 22 Aug 2019 19:14:22 +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 D7E1C23401 for ; Thu, 22 Aug 2019 19:14:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="TIaX/pgG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D7E1C23401 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-devel-bounces@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 0EBDA1681; Thu, 22 Aug 2019 21:13:30 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0EBDA1681 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566501260; bh=oNoD3BBqoAk40QE0BXiUS7Huk4FpCeMAb43ynuNJiKw=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=TIaX/pgGwXRN0PzNe7L7z6N+p/0KfBbn8HNCtKH5AGuJlw4R2vEa3sgiB1BhkcEKK QoC/sBAC7hUJfegoUAUEbJVDcvuJRRxQ1m89WGhwCY0T2PwRRN+4dvUSSk8azKH0s/ FRpyA0WBHP0VRIO3eKH/eVERj9ZBPsvL8/vK4PZA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 8A0BCF8064C; Thu, 22 Aug 2019 21:05:57 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3FB01F8065D; Thu, 22 Aug 2019 21:05:25 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 EB4EEF800BF for ; Thu, 22 Aug 2019 21:04:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz EB4EEF800BF X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 12:04:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,417,1559545200"; d="scan'208";a="203524273" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga004.fm.intel.com with ESMTP; 22 Aug 2019 12:04:57 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org Date: Thu, 22 Aug 2019 21:04:01 +0200 Message-Id: <20190822190425.23001-12-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190822190425.23001-1-cezary.rojewski@intel.com> References: <20190822190425.23001-1-cezary.rojewski@intel.com> Cc: lgirdwood@gmail.com, Cezary Rojewski , broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 11/35] ASoC: Intel: Merge sst_dsp_device into sst_pdata 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" With all core ops united, sst_dsp_device is a stub struct. Merge it with sst_pdata and thus making it dsp-platform info struct. As sst_pdata is targeted to become a sole initialization struct for DSP drivers, update its definition to contain fw_name and machine board list too. Signed-off-by: Cezary Rojewski --- sound/soc/intel/baytrail/sst-baytrail-ipc.c | 10 +++------- sound/soc/intel/common/sst-dsp-priv.h | 1 - sound/soc/intel/common/sst-dsp.h | 17 ++++------------- sound/soc/intel/common/sst-firmware.c | 8 +++----- sound/soc/intel/haswell/sst-haswell-ipc.c | 10 +++------- sound/soc/intel/skylake/bxt-sst.c | 2 +- sound/soc/intel/skylake/cnl-sst-dsp.h | 2 +- sound/soc/intel/skylake/cnl-sst.c | 2 +- sound/soc/intel/skylake/skl-sst-dsp.c | 8 ++++---- sound/soc/intel/skylake/skl-sst-dsp.h | 6 +++--- sound/soc/intel/skylake/skl-sst-utils.c | 6 +++--- sound/soc/intel/skylake/skl-sst.c | 2 +- 12 files changed, 27 insertions(+), 47 deletions(-) diff --git a/sound/soc/intel/baytrail/sst-baytrail-ipc.c b/sound/soc/intel/baytrail/sst-baytrail-ipc.c index 23d65ad38e19..efa78e33caf2 100644 --- a/sound/soc/intel/baytrail/sst-baytrail-ipc.c +++ b/sound/soc/intel/baytrail/sst-baytrail-ipc.c @@ -556,10 +556,6 @@ struct sst_dsp *sst_byt_get_dsp(struct sst_byt *byt) return byt->dsp; } -static struct sst_dsp_device byt_dev = { - .ops = &sst_byt_ops, -}; - int sst_byt_dsp_suspend_late(struct device *dev, struct sst_pdata *pdata) { struct sst_byt *byt = pdata->dsp; @@ -701,10 +697,11 @@ int sst_byt_dsp_init(struct device *dev, struct sst_pdata *pdata) INIT_LIST_HEAD(&byt->stream_list); init_waitqueue_head(&byt->boot_wait); - byt_dev.thread_context = byt; + pdata->dsp = byt; + pdata->ops = &sst_byt_ops; /* init SST shim */ - byt->dsp = sst_dsp_new(dev, &byt_dev, pdata); + byt->dsp = sst_dsp_new(dev, pdata); if (byt->dsp == NULL) { err = -ENODEV; goto dsp_new_err; @@ -741,7 +738,6 @@ int sst_byt_dsp_init(struct device *dev, struct sst_pdata *pdata) dev_info(byt->dev, "Build date: %s %s\n", init.build_info.date, init.build_info.time); - pdata->dsp = byt; byt->fw = byt_sst_fw; return 0; diff --git a/sound/soc/intel/common/sst-dsp-priv.h b/sound/soc/intel/common/sst-dsp-priv.h index 7ec477108948..8a7009937d59 100644 --- a/sound/soc/intel/common/sst-dsp-priv.h +++ b/sound/soc/intel/common/sst-dsp-priv.h @@ -259,7 +259,6 @@ struct sst_dsp { /* Shared for all platforms */ /* runtime */ - struct sst_dsp_device *sst_dev; spinlock_t spinlock; /* IPC locking */ struct mutex mutex; /* DSP FW lock */ struct device *dev; diff --git a/sound/soc/intel/common/sst-dsp.h b/sound/soc/intel/common/sst-dsp.h index 05fa1ca72f46..63c29bb45cf1 100644 --- a/sound/soc/intel/common/sst-dsp.h +++ b/sound/soc/intel/common/sst-dsp.h @@ -167,17 +167,6 @@ struct sst_dsp; -/* - * SST Device. - * - * This structure is populated by the SST core driver. - */ -struct sst_dsp_device { - /* Mandatory fields */ - struct sst_ops *ops; - void *thread_context; -}; - /* * SST Platform Data. */ @@ -203,13 +192,15 @@ struct sst_pdata { /* DSP */ u32 id; + const char *fw_name; + struct sst_ops *ops; + struct snd_soc_acpi_mach *boards; void *dsp; }; #if IS_ENABLED(CONFIG_DW_DMAC_CORE) /* Initialization */ -struct sst_dsp *sst_dsp_new(struct device *dev, - struct sst_dsp_device *sst_dev, struct sst_pdata *pdata); +struct sst_dsp *sst_dsp_new(struct device *dev, struct sst_pdata *pdata); void sst_dsp_free(struct sst_dsp *sst); #endif diff --git a/sound/soc/intel/common/sst-firmware.c b/sound/soc/intel/common/sst-firmware.c index c18236ca77f4..6b6af11c32c3 100644 --- a/sound/soc/intel/common/sst-firmware.c +++ b/sound/soc/intel/common/sst-firmware.c @@ -1200,8 +1200,7 @@ u32 sst_dsp_get_offset(struct sst_dsp *dsp, u32 offset, } EXPORT_SYMBOL_GPL(sst_dsp_get_offset); -struct sst_dsp *sst_dsp_new(struct device *dev, - struct sst_dsp_device *sst_dev, struct sst_pdata *pdata) +struct sst_dsp *sst_dsp_new(struct device *dev, struct sst_pdata *pdata) { struct sst_dsp *sst; int err; @@ -1216,11 +1215,10 @@ struct sst_dsp *sst_dsp_new(struct device *dev, mutex_init(&sst->mutex); sst->dev = dev; sst->dma_dev = pdata->dma_dev; - sst->thread_context = sst_dev->thread_context; - sst->sst_dev = sst_dev; + sst->thread_context = pdata->dsp; sst->id = pdata->id; sst->irq = pdata->irq; - sst->ops = sst_dev->ops; + sst->ops = pdata->ops; sst->pdata = pdata; INIT_LIST_HEAD(&sst->used_block_list); INIT_LIST_HEAD(&sst->free_block_list); diff --git a/sound/soc/intel/haswell/sst-haswell-ipc.c b/sound/soc/intel/haswell/sst-haswell-ipc.c index e25358d19aae..61c4d674940e 100644 --- a/sound/soc/intel/haswell/sst-haswell-ipc.c +++ b/sound/soc/intel/haswell/sst-haswell-ipc.c @@ -2045,10 +2045,6 @@ int sst_hsw_module_set_param(struct sst_hsw *hsw, return ret; } -static struct sst_dsp_device hsw_dev = { - .ops = &haswell_ops, -}; - static void hsw_tx_msg(struct sst_generic_ipc *ipc, struct ipc_message *msg) { /* send the message */ @@ -2126,10 +2122,11 @@ int sst_hsw_dsp_init(struct device *dev, struct sst_pdata *pdata) INIT_LIST_HEAD(&hsw->stream_list); init_waitqueue_head(&hsw->boot_wait); - hsw_dev.thread_context = hsw; + pdata->dsp = hsw; + pdata->ops = &haswell_ops; /* init SST shim */ - hsw->dsp = sst_dsp_new(dev, &hsw_dev, pdata); + hsw->dsp = sst_dsp_new(dev, pdata); if (hsw->dsp == NULL) { ret = -ENODEV; goto dsp_new_err; @@ -2189,7 +2186,6 @@ int sst_hsw_dsp_init(struct device *dev, struct sst_pdata *pdata) goto boot_err; } - pdata->dsp = hsw; return 0; boot_err: diff --git a/sound/soc/intel/skylake/bxt-sst.c b/sound/soc/intel/skylake/bxt-sst.c index 8faffec4e943..e3614acff34d 100644 --- a/sound/soc/intel/skylake/bxt-sst.c +++ b/sound/soc/intel/skylake/bxt-sst.c @@ -543,7 +543,7 @@ static struct sst_ops skl_ops = { .free = skl_dsp_free, }; -static struct sst_dsp_device skl_dev = { +static struct sst_pdata skl_dev = { .ops = &skl_ops, }; diff --git a/sound/soc/intel/skylake/cnl-sst-dsp.h b/sound/soc/intel/skylake/cnl-sst-dsp.h index f3d320b05eb5..30b586acc858 100644 --- a/sound/soc/intel/skylake/cnl-sst-dsp.h +++ b/sound/soc/intel/skylake/cnl-sst-dsp.h @@ -9,7 +9,7 @@ #define __CNL_SST_DSP_H__ struct sst_dsp; -struct sst_dsp_device; +struct sst_pdata; struct sst_generic_ipc; /* Intel HD Audio General DSP Registers */ diff --git a/sound/soc/intel/skylake/cnl-sst.c b/sound/soc/intel/skylake/cnl-sst.c index 02d8e72d2d5a..84dc6b82831d 100644 --- a/sound/soc/intel/skylake/cnl-sst.c +++ b/sound/soc/intel/skylake/cnl-sst.c @@ -419,7 +419,7 @@ static struct sst_ops cnl_ops = { .free = cnl_dsp_free, }; -static struct sst_dsp_device cnl_dev = { +static struct sst_pdata cnl_dev = { .ops = &cnl_ops, }; diff --git a/sound/soc/intel/skylake/skl-sst-dsp.c b/sound/soc/intel/skylake/skl-sst-dsp.c index 8d98089e3177..348e69226e46 100644 --- a/sound/soc/intel/skylake/skl-sst-dsp.c +++ b/sound/soc/intel/skylake/skl-sst-dsp.c @@ -419,7 +419,7 @@ int skl_dsp_sleep(struct sst_dsp *ctx) EXPORT_SYMBOL_GPL(skl_dsp_sleep); struct sst_dsp *skl_dsp_ctx_init(struct device *dev, - struct sst_dsp_device *sst_dev, int irq) + struct sst_pdata *pdata, int irq) { int ret; struct sst_dsp *sst; @@ -431,10 +431,10 @@ struct sst_dsp *skl_dsp_ctx_init(struct device *dev, spin_lock_init(&sst->spinlock); mutex_init(&sst->mutex); sst->dev = dev; - sst->sst_dev = sst_dev; + sst->pdata = pdata; sst->irq = irq; - sst->ops = sst_dev->ops; - sst->thread_context = sst_dev->thread_context; + sst->ops = pdata->ops; + sst->thread_context = pdata->dsp; /* Initialise SST Audio DSP */ if (sst->ops->init) { diff --git a/sound/soc/intel/skylake/skl-sst-dsp.h b/sound/soc/intel/skylake/skl-sst-dsp.h index 21d376692503..ba37433e4efa 100644 --- a/sound/soc/intel/skylake/skl-sst-dsp.h +++ b/sound/soc/intel/skylake/skl-sst-dsp.h @@ -15,7 +15,7 @@ #include "skl-sst-cldma.h" struct sst_dsp; -struct sst_dsp_device; +struct sst_pdata; struct skl_lib_info; struct skl_dev; @@ -197,7 +197,7 @@ int skl_cldma_wait_interruptible(struct sst_dsp *ctx); void skl_dsp_set_state_locked(struct sst_dsp *ctx, int state); struct sst_dsp *skl_dsp_ctx_init(struct device *dev, - struct sst_dsp_device *sst_dev, int irq); + struct sst_pdata *pdata, int irq); int skl_dsp_acquire_irq(struct sst_dsp *sst); bool is_skl_dsp_running(struct sst_dsp *ctx); @@ -243,7 +243,7 @@ void skl_dsp_set_astate_cfg(struct skl_dev *skl, u32 cnt, void *data); int skl_sst_ctx_init(struct device *dev, int irq, const char *fw_name, struct skl_dsp_loader_ops dsp_ops, struct skl_dev **dsp, - struct sst_dsp_device *skl_dev); + struct sst_pdata *pdata); int skl_prepare_lib_load(struct skl_dev *skl, struct skl_lib_info *linfo, struct firmware *stripped_fw, unsigned int hdr_offset, int index); diff --git a/sound/soc/intel/skylake/skl-sst-utils.c b/sound/soc/intel/skylake/skl-sst-utils.c index d43cbf4a71ef..9061a9b17ea0 100644 --- a/sound/soc/intel/skylake/skl-sst-utils.c +++ b/sound/soc/intel/skylake/skl-sst-utils.c @@ -355,15 +355,15 @@ int skl_dsp_strip_extended_manifest(struct firmware *fw) int skl_sst_ctx_init(struct device *dev, int irq, const char *fw_name, struct skl_dsp_loader_ops dsp_ops, struct skl_dev **dsp, - struct sst_dsp_device *skl_dev) + struct sst_pdata *pdata) { struct skl_dev *skl = *dsp; struct sst_dsp *sst; skl->dev = dev; - skl_dev->thread_context = skl; + pdata->dsp = skl; INIT_LIST_HEAD(&skl->uuid_list); - skl->dsp = skl_dsp_ctx_init(dev, skl_dev, irq); + skl->dsp = skl_dsp_ctx_init(dev, pdata, irq); if (!skl->dsp) { dev_err(skl->dev, "%s: no device\n", __func__); return -ENODEV; diff --git a/sound/soc/intel/skylake/skl-sst.c b/sound/soc/intel/skylake/skl-sst.c index 9fd3cf30e87c..72ee3d8a1d7d 100644 --- a/sound/soc/intel/skylake/skl-sst.c +++ b/sound/soc/intel/skylake/skl-sst.c @@ -512,7 +512,7 @@ static struct sst_ops skl_ops = { .free = skl_dsp_free, }; -static struct sst_dsp_device skl_dev = { +static struct sst_pdata skl_dev = { .ops = &skl_ops, }; From patchwork Thu Aug 22 19:04:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 11109855 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CCC231399 for ; Thu, 22 Aug 2019 19:13:02 +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 5EC8423402 for ; Thu, 22 Aug 2019 19:13:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="MeDB8cCN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5EC8423402 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-devel-bounces@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 842D21680; Thu, 22 Aug 2019 21:12:10 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 842D21680 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566501180; bh=YhivMD0SdCyibVd9pQDlqtqxIUwC3B3bb8KN7JRg6Cg=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=MeDB8cCN4e0qQO6hZMnBsHN/MooFceWVtIet+nFQwdRvnmJvO74nX5AXeEnczwquj HsOLcR0AU5RP0wCZCEgthtYSBUmH/St3RStrMJtwIhrEeXE5y89dc2D1zQPhsr1IBS ZvegwGwjMtenwTSXmxCNKYOwrjzMXgula7mu2P7M= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 597FBF8070B; Thu, 22 Aug 2019 21:05:47 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id EE7B3F80641; Thu, 22 Aug 2019 21:05:19 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 5DB69F803F3 for ; Thu, 22 Aug 2019 21:05:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5DB69F803F3 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 12:05:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,417,1559545200"; d="scan'208";a="203524290" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga004.fm.intel.com with ESMTP; 22 Aug 2019 12:04:59 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org Date: Thu, 22 Aug 2019 21:04:02 +0200 Message-Id: <20190822190425.23001-13-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190822190425.23001-1-cezary.rojewski@intel.com> References: <20190822190425.23001-1-cezary.rojewski@intel.com> Cc: lgirdwood@gmail.com, Cezary Rojewski , broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 12/35] ASoC: Intel: Skylake: Reuse sst_dsp_free 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Skylake is sst_dsp descendant. Rather than bypassing framework's flow, embrace it. sst_dsp_free invokes sst specific handler internally so nothing is missed. Signed-off-by: Cezary Rojewski --- sound/soc/intel/skylake/cnl-sst-dsp.c | 1 - sound/soc/intel/skylake/skl-sst-dsp.c | 1 - sound/soc/intel/skylake/skl-sst.c | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/intel/skylake/cnl-sst-dsp.c b/sound/soc/intel/skylake/cnl-sst-dsp.c index 189c1c7086e3..48b465939ef8 100644 --- a/sound/soc/intel/skylake/cnl-sst-dsp.c +++ b/sound/soc/intel/skylake/cnl-sst-dsp.c @@ -215,7 +215,6 @@ void cnl_dsp_free(struct sst_dsp *dsp) sst_ipc_fini(&skl->ipc); cnl_ipc_int_disable(dsp); - free_irq(dsp->irq, dsp); cnl_dsp_disable_core(dsp, SKL_DSP_CORE0_MASK); } EXPORT_SYMBOL_GPL(cnl_dsp_free); diff --git a/sound/soc/intel/skylake/skl-sst-dsp.c b/sound/soc/intel/skylake/skl-sst-dsp.c index 348e69226e46..1c4ecbcd7db7 100644 --- a/sound/soc/intel/skylake/skl-sst-dsp.c +++ b/sound/soc/intel/skylake/skl-sst-dsp.c @@ -468,7 +468,6 @@ void skl_dsp_free(struct sst_dsp *dsp) sst_ipc_fini(&skl->ipc); skl_ipc_int_disable(dsp); - free_irq(dsp->irq, dsp); skl_dsp_disable_core(dsp, SKL_DSP_CORE0_MASK); } EXPORT_SYMBOL_GPL(skl_dsp_free); diff --git a/sound/soc/intel/skylake/skl-sst.c b/sound/soc/intel/skylake/skl-sst.c index 72ee3d8a1d7d..e55523826346 100644 --- a/sound/soc/intel/skylake/skl-sst.c +++ b/sound/soc/intel/skylake/skl-sst.c @@ -622,7 +622,7 @@ void skl_sst_dsp_cleanup(struct skl_dev *skl) skl_clear_module_table(dsp); skl_freeup_uuid_list(skl); - dsp->ops->free(dsp); + sst_dsp_free(dsp); if (skl->boot_complete && dsp->cl_dev.bufsize) { dsp->cl_dev.ops.cl_cleanup_controller(dsp); From patchwork Thu Aug 22 19:04:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 11109857 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2279A174A for ; Thu, 22 Aug 2019 19:13:37 +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 AD69723401 for ; Thu, 22 Aug 2019 19:13:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="aS+VSF3D" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AD69723401 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-devel-bounces@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 D32F6167E; Thu, 22 Aug 2019 21:12:44 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D32F6167E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566501214; bh=ZLqZ5AV5PdGF89gySb6ZeayXopzZExUQ7/Ok3zLYlJo=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=aS+VSF3D6HdDnA5VDIsUns5e7A850/ria7FIaH26CcYYL4mSjwgTGkUv9lfoCXXMz akVzerZkzQZgzpOkJ5CLdrEHwpBodFigm3gVyZGVwfOoCQBgohub2RMdI7F+xHe61N w9NbEgsXW0wBEXYFZizcnkyYizoGEqPFmuZGXeDQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 360FAF8070E; Thu, 22 Aug 2019 21:05:51 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 42CE7F80649; Thu, 22 Aug 2019 21:05:23 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 1F422F805FA for ; Thu, 22 Aug 2019 21:05:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1F422F805FA X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 12:05:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,417,1559545200"; d="scan'208";a="203524318" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga004.fm.intel.com with ESMTP; 22 Aug 2019 12:05:00 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org Date: Thu, 22 Aug 2019 21:04:03 +0200 Message-Id: <20190822190425.23001-14-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190822190425.23001-1-cezary.rojewski@intel.com> References: <20190822190425.23001-1-cezary.rojewski@intel.com> Cc: lgirdwood@gmail.com, Cezary Rojewski , broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 13/35] ASoC: Intel: Skylake: Reuse sst_dsp_new 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" skl_dsp_ctx_init is dumplication of sst_dsp_new and usage of such bypasses natural DSP framework's flow. Remove it and reuse sst_dsp_new constructor which invokes sst specific init internally so nothing is missed. Skylake does not even define any sst_ops::init so portion of existing skl_dsp_ctx_init can be regarded as DEADCODE. Signed-off-by: Cezary Rojewski --- sound/soc/intel/skylake/bxt-sst.c | 2 +- sound/soc/intel/skylake/cnl-sst.c | 2 +- sound/soc/intel/skylake/skl-sst-dsp.c | 28 ------------------------- sound/soc/intel/skylake/skl-sst-dsp.h | 2 -- sound/soc/intel/skylake/skl-sst-utils.c | 6 +++++- sound/soc/intel/skylake/skl-sst.c | 2 +- 6 files changed, 8 insertions(+), 34 deletions(-) diff --git a/sound/soc/intel/skylake/bxt-sst.c b/sound/soc/intel/skylake/bxt-sst.c index e3614acff34d..a8a2783f9b37 100644 --- a/sound/soc/intel/skylake/bxt-sst.c +++ b/sound/soc/intel/skylake/bxt-sst.c @@ -588,7 +588,7 @@ int bxt_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, INIT_DELAYED_WORK(&skl->d0i3.work, bxt_set_dsp_D0i3); skl->d0i3.state = SKL_DSP_D0I3_NONE; - return skl_dsp_acquire_irq(sst); + return 0; } EXPORT_SYMBOL_GPL(bxt_sst_dsp_init); diff --git a/sound/soc/intel/skylake/cnl-sst.c b/sound/soc/intel/skylake/cnl-sst.c index 84dc6b82831d..0b0337f6ebff 100644 --- a/sound/soc/intel/skylake/cnl-sst.c +++ b/sound/soc/intel/skylake/cnl-sst.c @@ -460,7 +460,7 @@ int cnl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, cnl->boot_complete = false; init_waitqueue_head(&cnl->boot_wait); - return skl_dsp_acquire_irq(sst); + return 0; } EXPORT_SYMBOL_GPL(cnl_sst_dsp_init); diff --git a/sound/soc/intel/skylake/skl-sst-dsp.c b/sound/soc/intel/skylake/skl-sst-dsp.c index 1c4ecbcd7db7..9d8eb1af4798 100644 --- a/sound/soc/intel/skylake/skl-sst-dsp.c +++ b/sound/soc/intel/skylake/skl-sst-dsp.c @@ -418,34 +418,6 @@ int skl_dsp_sleep(struct sst_dsp *ctx) } EXPORT_SYMBOL_GPL(skl_dsp_sleep); -struct sst_dsp *skl_dsp_ctx_init(struct device *dev, - struct sst_pdata *pdata, int irq) -{ - int ret; - struct sst_dsp *sst; - - sst = devm_kzalloc(dev, sizeof(*sst), GFP_KERNEL); - if (sst == NULL) - return NULL; - - spin_lock_init(&sst->spinlock); - mutex_init(&sst->mutex); - sst->dev = dev; - sst->pdata = pdata; - sst->irq = irq; - sst->ops = pdata->ops; - sst->thread_context = pdata->dsp; - - /* Initialise SST Audio DSP */ - if (sst->ops->init) { - ret = sst->ops->init(sst, NULL); - if (ret < 0) - return NULL; - } - - return sst; -} - int skl_dsp_acquire_irq(struct sst_dsp *sst) { int ret; diff --git a/sound/soc/intel/skylake/skl-sst-dsp.h b/sound/soc/intel/skylake/skl-sst-dsp.h index ba37433e4efa..1d579d59de60 100644 --- a/sound/soc/intel/skylake/skl-sst-dsp.h +++ b/sound/soc/intel/skylake/skl-sst-dsp.h @@ -196,8 +196,6 @@ int skl_cldma_prepare(struct sst_dsp *ctx); int skl_cldma_wait_interruptible(struct sst_dsp *ctx); void skl_dsp_set_state_locked(struct sst_dsp *ctx, int state); -struct sst_dsp *skl_dsp_ctx_init(struct device *dev, - struct sst_pdata *pdata, int irq); int skl_dsp_acquire_irq(struct sst_dsp *sst); bool is_skl_dsp_running(struct sst_dsp *ctx); diff --git a/sound/soc/intel/skylake/skl-sst-utils.c b/sound/soc/intel/skylake/skl-sst-utils.c index 9061a9b17ea0..8e03a10855c4 100644 --- a/sound/soc/intel/skylake/skl-sst-utils.c +++ b/sound/soc/intel/skylake/skl-sst-utils.c @@ -6,6 +6,7 @@ */ #include +#include #include #include #include "../common/sst-dsp.h" @@ -360,10 +361,13 @@ int skl_sst_ctx_init(struct device *dev, int irq, const char *fw_name, struct skl_dev *skl = *dsp; struct sst_dsp *sst; + pdata->id = skl->pci->device; + pdata->irq = irq; + pdata->resindex_dma_base = -1; skl->dev = dev; pdata->dsp = skl; INIT_LIST_HEAD(&skl->uuid_list); - skl->dsp = skl_dsp_ctx_init(dev, pdata, irq); + skl->dsp = sst_dsp_new(dev, pdata); if (!skl->dsp) { dev_err(skl->dev, "%s: no device\n", __func__); return -ENODEV; diff --git a/sound/soc/intel/skylake/skl-sst.c b/sound/soc/intel/skylake/skl-sst.c index e55523826346..6bb003add9e2 100644 --- a/sound/soc/intel/skylake/skl-sst.c +++ b/sound/soc/intel/skylake/skl-sst.c @@ -550,7 +550,7 @@ int skl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, sst->fw_ops = skl_fw_ops; - return skl_dsp_acquire_irq(sst); + return 0; } EXPORT_SYMBOL_GPL(skl_sst_dsp_init); From patchwork Thu Aug 22 19:04:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 11109869 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A69C81399 for ; Thu, 22 Aug 2019 19:15:37 +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 3B97123400 for ; Thu, 22 Aug 2019 19:15:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="BXFE6zLF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3B97123400 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-devel-bounces@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 724161676; Thu, 22 Aug 2019 21:14:45 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 724161676 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566501335; bh=dBl/I4SybybrgHUDQAFs8LKc9qtZRHUQ46yJFdfgAxI=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=BXFE6zLFNzXxmu4mgKDyAZsDIx1R5KOjrEaQu2sNhrMPjjYHgBQrj/Jn4/EkvTVw6 0VNutYs8XIT6vjIOL7vGPX3RhBGppPXejrx5JJgKTjbsdWHAy3ZBXOCtCpAn86AbGJ V7onkwzTRacdHij4pyqPAolMmFLFTCc+i5bFA3cA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id F167CF8071C; Thu, 22 Aug 2019 21:06:08 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4DE2AF80672; Thu, 22 Aug 2019 21:05:27 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 7B64AF805F9 for ; Thu, 22 Aug 2019 21:05:03 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7B64AF805F9 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 12:05:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,417,1559545200"; d="scan'208";a="203524345" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga004.fm.intel.com with ESMTP; 22 Aug 2019 12:05:02 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org Date: Thu, 22 Aug 2019 21:04:04 +0200 Message-Id: <20190822190425.23001-15-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190822190425.23001-1-cezary.rojewski@intel.com> References: <20190822190425.23001-1-cezary.rojewski@intel.com> Cc: lgirdwood@gmail.com, Cezary Rojewski , broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 14/35] ASoC: Intel: Skylake: Remove skl_dsp_acquire_irq 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" With Skylake following the unified sst_dsp init and free flow, there is no need for custom _acquire_irq function. Framework takes care of this with constructor for us. Remove redundant handler. Signed-off-by: Cezary Rojewski --- sound/soc/intel/skylake/skl-sst-dsp.c | 14 -------------- sound/soc/intel/skylake/skl-sst-dsp.h | 1 - 2 files changed, 15 deletions(-) diff --git a/sound/soc/intel/skylake/skl-sst-dsp.c b/sound/soc/intel/skylake/skl-sst-dsp.c index 9d8eb1af4798..773b4b562a07 100644 --- a/sound/soc/intel/skylake/skl-sst-dsp.c +++ b/sound/soc/intel/skylake/skl-sst-dsp.c @@ -418,20 +418,6 @@ int skl_dsp_sleep(struct sst_dsp *ctx) } EXPORT_SYMBOL_GPL(skl_dsp_sleep); -int skl_dsp_acquire_irq(struct sst_dsp *sst) -{ - int ret; - - /* Register the ISR */ - ret = request_threaded_irq(sst->irq, sst->ops->irq_handler, - sst->ops->thread_fn, IRQF_SHARED, "AudioDSP", sst); - if (ret) - dev_err(sst->dev, "unable to grab threaded IRQ %d, disabling device\n", - sst->irq); - - return ret; -} - void skl_dsp_free(struct sst_dsp *dsp) { struct skl_dev *skl = dsp->thread_context; diff --git a/sound/soc/intel/skylake/skl-sst-dsp.h b/sound/soc/intel/skylake/skl-sst-dsp.h index 1d579d59de60..45d99b6b448e 100644 --- a/sound/soc/intel/skylake/skl-sst-dsp.h +++ b/sound/soc/intel/skylake/skl-sst-dsp.h @@ -196,7 +196,6 @@ int skl_cldma_prepare(struct sst_dsp *ctx); int skl_cldma_wait_interruptible(struct sst_dsp *ctx); void skl_dsp_set_state_locked(struct sst_dsp *ctx, int state); -int skl_dsp_acquire_irq(struct sst_dsp *sst); bool is_skl_dsp_running(struct sst_dsp *ctx); unsigned int skl_dsp_get_enabled_cores(struct sst_dsp *ctx); From patchwork Thu Aug 22 19:04:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 11109873 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3C04413A4 for ; Thu, 22 Aug 2019 19:17:04 +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 C430A23401 for ; Thu, 22 Aug 2019 19:17:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="MgT89yVD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C430A23401 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-devel-bounces@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 07F011674; Thu, 22 Aug 2019 21:16:12 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 07F011674 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566501422; bh=bZL/wIW37rT1eaGuQFxle/gPLrvYMWHExzbS236VBn0=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=MgT89yVDnLnqJIhhyvN9T92WgDnXVlsA8JWANEDr0/k++2UYm57KPWYlDoGPrd1pv +JgJAM5yhNJu1+9wreJuLWGmXB25KYQNp3d4jXliZ7BmiTrxUaFU5VDWd9OoSddnkU pNleM/IrpM5dTCWNHg1GlqDIqmmfSTfankP3DHB4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E1374F8074B; Thu, 22 Aug 2019 21:06:17 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1C0EDF806ED; Thu, 22 Aug 2019 21:05:38 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 1EA67F805FB for ; Thu, 22 Aug 2019 21:05:04 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1EA67F805FB X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 12:05:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,417,1559545200"; d="scan'208";a="203524358" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga004.fm.intel.com with ESMTP; 22 Aug 2019 12:05:04 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org Date: Thu, 22 Aug 2019 21:04:05 +0200 Message-Id: <20190822190425.23001-16-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190822190425.23001-1-cezary.rojewski@intel.com> References: <20190822190425.23001-1-cezary.rojewski@intel.com> Cc: lgirdwood@gmail.com, Cezary Rojewski , broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 15/35] ASoC: Intel: Skylake: Use dsp loading functions directly 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" None of skl_dsp_loader_ops are actually extended as any parameter that could be "extended" is already part of given function's parameter list. Rather than obfustace non-derived calls with ops and dereferences, make use of said operation directly. Takes part in remal of skl_dsp_loader_ops structure. Signed-off-by: Cezary Rojewski --- sound/soc/intel/skylake/bxt-sst.c | 18 +++++++++--------- sound/soc/intel/skylake/cnl-sst.c | 10 +++++----- sound/soc/intel/skylake/skl-messages.c | 10 +++++----- sound/soc/intel/skylake/skl-sst-cldma.c | 10 +++++----- sound/soc/intel/skylake/skl-sst-dsp.h | 9 +++++++++ 5 files changed, 33 insertions(+), 24 deletions(-) diff --git a/sound/soc/intel/skylake/bxt-sst.c b/sound/soc/intel/skylake/bxt-sst.c index a8a2783f9b37..1ca4fba0f35f 100644 --- a/sound/soc/intel/skylake/bxt-sst.c +++ b/sound/soc/intel/skylake/bxt-sst.c @@ -60,7 +60,7 @@ bxt_load_library(struct sst_dsp *ctx, struct skl_lib_info *linfo, int lib_count) if (ret < 0) goto load_library_failed; - stream_tag = ctx->dsp_ops.prepare(ctx->dev, 0x40, + stream_tag = skl_dsp_prepare(ctx->dev, 0x40, stripped_fw.size, &dmab); if (stream_tag <= 0) { dev_err(ctx->dev, "Lib prepare DMA err: %x\n", @@ -72,14 +72,14 @@ bxt_load_library(struct sst_dsp *ctx, struct skl_lib_info *linfo, int lib_count) dma_id = stream_tag - 1; memcpy(dmab.area, stripped_fw.data, stripped_fw.size); - ctx->dsp_ops.trigger(ctx->dev, true, stream_tag); + skl_dsp_trigger(ctx->dev, true, stream_tag); ret = skl_sst_ipc_load_library(&skl->ipc, dma_id, i, true); if (ret < 0) dev_err(ctx->dev, "IPC Load Lib for %s fail: %d\n", linfo[i].name, ret); - ctx->dsp_ops.trigger(ctx->dev, false, stream_tag); - ctx->dsp_ops.cleanup(ctx->dev, &dmab, stream_tag); + skl_dsp_trigger(ctx->dev, false, stream_tag); + skl_dsp_cleanup(ctx->dev, &dmab, stream_tag); } return ret; @@ -100,7 +100,7 @@ static int sst_bxt_prepare_fw(struct sst_dsp *ctx, { int stream_tag, ret; - stream_tag = ctx->dsp_ops.prepare(ctx->dev, 0x40, fwsize, &ctx->dmab); + stream_tag = skl_dsp_prepare(ctx->dev, 0x40, fwsize, &ctx->dmab); if (stream_tag <= 0) { dev_err(ctx->dev, "Failed to prepare DMA FW loading err: %x\n", stream_tag); @@ -162,7 +162,7 @@ static int sst_bxt_prepare_fw(struct sst_dsp *ctx, return ret; base_fw_load_failed: - ctx->dsp_ops.cleanup(ctx->dev, &ctx->dmab, stream_tag); + skl_dsp_cleanup(ctx->dev, &ctx->dmab, stream_tag); skl_dsp_core_power_down(ctx, SKL_DSP_CORE_MASK(1)); skl_dsp_disable_core(ctx, SKL_DSP_CORE0_MASK); return ret; @@ -172,12 +172,12 @@ static int sst_transfer_fw_host_dma(struct sst_dsp *ctx) { int ret; - ctx->dsp_ops.trigger(ctx->dev, true, ctx->dsp_ops.stream_tag); + skl_dsp_trigger(ctx->dev, true, ctx->dsp_ops.stream_tag); ret = sst_dsp_register_poll(ctx, BXT_ADSP_FW_STATUS, SKL_FW_STS_MASK, BXT_ROM_INIT, BXT_BASEFW_TIMEOUT, "Firmware boot"); - ctx->dsp_ops.trigger(ctx->dev, false, ctx->dsp_ops.stream_tag); - ctx->dsp_ops.cleanup(ctx->dev, &ctx->dmab, ctx->dsp_ops.stream_tag); + skl_dsp_trigger(ctx->dev, false, ctx->dsp_ops.stream_tag); + skl_dsp_cleanup(ctx->dev, &ctx->dmab, ctx->dsp_ops.stream_tag); return ret; } diff --git a/sound/soc/intel/skylake/cnl-sst.c b/sound/soc/intel/skylake/cnl-sst.c index 0b0337f6ebff..5ad34e9f51eb 100644 --- a/sound/soc/intel/skylake/cnl-sst.c +++ b/sound/soc/intel/skylake/cnl-sst.c @@ -48,7 +48,7 @@ static int cnl_prepare_fw(struct sst_dsp *ctx, const void *fwdata, u32 fwsize) int ret, stream_tag; - stream_tag = ctx->dsp_ops.prepare(ctx->dev, 0x40, fwsize, &ctx->dmab); + stream_tag = skl_dsp_prepare(ctx->dev, 0x40, fwsize, &ctx->dmab); if (stream_tag <= 0) { dev_err(ctx->dev, "dma prepare failed: 0%#x\n", stream_tag); return stream_tag; @@ -84,7 +84,7 @@ static int cnl_prepare_fw(struct sst_dsp *ctx, const void *fwdata, u32 fwsize) return 0; base_fw_load_failed: - ctx->dsp_ops.cleanup(ctx->dev, &ctx->dmab, stream_tag); + skl_dsp_cleanup(ctx->dev, &ctx->dmab, stream_tag); cnl_dsp_disable_core(ctx, SKL_DSP_CORE0_MASK); return ret; @@ -94,13 +94,13 @@ static int sst_transfer_fw_host_dma(struct sst_dsp *ctx) { int ret; - ctx->dsp_ops.trigger(ctx->dev, true, ctx->dsp_ops.stream_tag); + skl_dsp_trigger(ctx->dev, true, ctx->dsp_ops.stream_tag); ret = sst_dsp_register_poll(ctx, CNL_ADSP_FW_STATUS, CNL_FW_STS_MASK, CNL_FW_INIT, CNL_BASEFW_TIMEOUT, "firmware boot"); - ctx->dsp_ops.trigger(ctx->dev, false, ctx->dsp_ops.stream_tag); - ctx->dsp_ops.cleanup(ctx->dev, &ctx->dmab, ctx->dsp_ops.stream_tag); + skl_dsp_trigger(ctx->dev, false, ctx->dsp_ops.stream_tag); + skl_dsp_cleanup(ctx->dev, &ctx->dmab, ctx->dsp_ops.stream_tag); return ret; } diff --git a/sound/soc/intel/skylake/skl-messages.c b/sound/soc/intel/skylake/skl-messages.c index 8fd682872d0c..20ab980fe8a1 100644 --- a/sound/soc/intel/skylake/skl-messages.c +++ b/sound/soc/intel/skylake/skl-messages.c @@ -22,13 +22,13 @@ #include "../common/sst-dsp-priv.h" #include "skl-topology.h" -static int skl_alloc_dma_buf(struct device *dev, +int skl_alloc_dma_buf(struct device *dev, struct snd_dma_buffer *dmab, size_t size) { return snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, dev, size, dmab); } -static int skl_free_dma_buf(struct device *dev, struct snd_dma_buffer *dmab) +int skl_free_dma_buf(struct device *dev, struct snd_dma_buffer *dmab) { snd_dma_free_pages(dmab); return 0; @@ -66,7 +66,7 @@ static int skl_dsp_setup_spib(struct device *dev, unsigned int size, return 0; } -static int skl_dsp_prepare(struct device *dev, unsigned int format, +int skl_dsp_prepare(struct device *dev, unsigned int format, unsigned int size, struct snd_dma_buffer *dmab) { struct hdac_bus *bus = dev_get_drvdata(dev); @@ -98,7 +98,7 @@ static int skl_dsp_prepare(struct device *dev, unsigned int format, return stream->stream_tag; } -static int skl_dsp_trigger(struct device *dev, bool start, int stream_tag) +int skl_dsp_trigger(struct device *dev, bool start, int stream_tag) { struct hdac_bus *bus = dev_get_drvdata(dev); struct hdac_stream *stream; @@ -116,7 +116,7 @@ static int skl_dsp_trigger(struct device *dev, bool start, int stream_tag) return 0; } -static int skl_dsp_cleanup(struct device *dev, +int skl_dsp_cleanup(struct device *dev, struct snd_dma_buffer *dmab, int stream_tag) { struct hdac_bus *bus = dev_get_drvdata(dev); diff --git a/sound/soc/intel/skylake/skl-sst-cldma.c b/sound/soc/intel/skylake/skl-sst-cldma.c index 5a2c35f58fda..ca2e18666582 100644 --- a/sound/soc/intel/skylake/skl-sst-cldma.c +++ b/sound/soc/intel/skylake/skl-sst-cldma.c @@ -152,8 +152,8 @@ static void skl_cldma_cleanup(struct sst_dsp *ctx) skl_cldma_cleanup_spb(ctx); skl_cldma_stream_clear(ctx); - ctx->dsp_ops.free_dma_buf(ctx->dev, &ctx->cl_dev.dmab_data); - ctx->dsp_ops.free_dma_buf(ctx->dev, &ctx->cl_dev.dmab_bdl); + skl_free_dma_buf(ctx->dev, &ctx->cl_dev.dmab_data); + skl_free_dma_buf(ctx->dev, &ctx->cl_dev.dmab_bdl); } int skl_cldma_wait_interruptible(struct sst_dsp *ctx) @@ -337,18 +337,18 @@ int skl_cldma_prepare(struct sst_dsp *ctx) ctx->cl_dev.ops.cl_stop_dma = skl_cldma_stop; /* Allocate buffer*/ - ret = ctx->dsp_ops.alloc_dma_buf(ctx->dev, + ret = skl_alloc_dma_buf(ctx->dev, &ctx->cl_dev.dmab_data, ctx->cl_dev.bufsize); if (ret < 0) { dev_err(ctx->dev, "Alloc buffer for base fw failed: %x\n", ret); return ret; } /* Setup Code loader BDL */ - ret = ctx->dsp_ops.alloc_dma_buf(ctx->dev, + ret = skl_alloc_dma_buf(ctx->dev, &ctx->cl_dev.dmab_bdl, PAGE_SIZE); if (ret < 0) { dev_err(ctx->dev, "Alloc buffer for blde failed: %x\n", ret); - ctx->dsp_ops.free_dma_buf(ctx->dev, &ctx->cl_dev.dmab_data); + skl_free_dma_buf(ctx->dev, &ctx->cl_dev.dmab_data); return ret; } bdl = (__le32 *)ctx->cl_dev.dmab_bdl.area; diff --git a/sound/soc/intel/skylake/skl-sst-dsp.h b/sound/soc/intel/skylake/skl-sst-dsp.h index 45d99b6b448e..97e16a602331 100644 --- a/sound/soc/intel/skylake/skl-sst-dsp.h +++ b/sound/soc/intel/skylake/skl-sst-dsp.h @@ -190,6 +190,15 @@ struct skl_module_table { struct list_head list; }; +int skl_alloc_dma_buf(struct device *dev, + struct snd_dma_buffer *dmab, size_t size); +int skl_free_dma_buf(struct device *dev, struct snd_dma_buffer *dmab); +int skl_dsp_prepare(struct device *dev, unsigned int format, + unsigned int size, struct snd_dma_buffer *dmab); +int skl_dsp_trigger(struct device *dev, bool start, int stream_tag); +int skl_dsp_cleanup(struct device *dev, struct snd_dma_buffer *dmab, + int stream_tag); + void skl_cldma_process_intr(struct sst_dsp *ctx); void skl_cldma_int_disable(struct sst_dsp *ctx); int skl_cldma_prepare(struct sst_dsp *ctx); From patchwork Thu Aug 22 19:04:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 11109871 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 667AA14DE for ; Thu, 22 Aug 2019 19:16:28 +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 EE18D233FD for ; Thu, 22 Aug 2019 19:16:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="Cl1di7he" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EE18D233FD 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-devel-bounces@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 29C481679; Thu, 22 Aug 2019 21:15:36 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 29C481679 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566501386; bh=89uoc+Ft2GFtqz47Z9trE08p33iojDGI/it8DmPt/J4=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Cl1di7heMStnlZ8yFqzTbcYvH3mKUF/qTvbfmt77XP3e0Q48Ew7p5H0ka/XYGUc5K mYPW39WZlWjV8yOdDxZ7A8fRIADzvfmmO3Ehn1QGR1A62whzpQyaJ8UsnGjbtKY2ko hfkOIsbIvjqAUrYKlrqlyQmlIYMzaFvXNkGDuzzc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 7355EF80736; Thu, 22 Aug 2019 21:06:14 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id B0437F8068A; Thu, 22 Aug 2019 21:05:35 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 A959AF805FC for ; Thu, 22 Aug 2019 21:05:06 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A959AF805FC X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 12:05:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,417,1559545200"; d="scan'208";a="203524373" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga004.fm.intel.com with ESMTP; 22 Aug 2019 12:05:05 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org Date: Thu, 22 Aug 2019 21:04:06 +0200 Message-Id: <20190822190425.23001-17-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190822190425.23001-1-cezary.rojewski@intel.com> References: <20190822190425.23001-1-cezary.rojewski@intel.com> Cc: lgirdwood@gmail.com, Cezary Rojewski , broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 16/35] ASoC: Intel: Skylake: Make dsp_ops::stream_tag obsolete 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" stream_tag field is the last obstacle in removing skl_dsp_loader_ops structure. It is required only during fw load procedure and never lives outside of that process - prepare_fw functions take place directly before actual FW file transfer and once that's done, these are redundant. Update _prepare_fw routines to return stream_tag on success and use said return immediately in _transfer_fw_host_dma. Signed-off-by: Cezary Rojewski --- sound/soc/intel/skylake/bxt-sst.c | 14 ++++++-------- sound/soc/intel/skylake/cnl-sst.c | 13 ++++++------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/sound/soc/intel/skylake/bxt-sst.c b/sound/soc/intel/skylake/bxt-sst.c index 1ca4fba0f35f..45da02f74f4d 100644 --- a/sound/soc/intel/skylake/bxt-sst.c +++ b/sound/soc/intel/skylake/bxt-sst.c @@ -107,7 +107,6 @@ static int sst_bxt_prepare_fw(struct sst_dsp *ctx, return stream_tag; } - ctx->dsp_ops.stream_tag = stream_tag; memcpy(ctx->dmab.area, fwdata, fwsize); /* Step 1: Power up core 0 and core1 */ @@ -159,7 +158,7 @@ static int sst_bxt_prepare_fw(struct sst_dsp *ctx, goto base_fw_load_failed; } - return ret; + return stream_tag; base_fw_load_failed: skl_dsp_cleanup(ctx->dev, &ctx->dmab, stream_tag); @@ -168,16 +167,16 @@ static int sst_bxt_prepare_fw(struct sst_dsp *ctx, return ret; } -static int sst_transfer_fw_host_dma(struct sst_dsp *ctx) +static int sst_transfer_fw_host_dma(struct sst_dsp *ctx, int stream_tag) { int ret; - skl_dsp_trigger(ctx->dev, true, ctx->dsp_ops.stream_tag); + skl_dsp_trigger(ctx->dev, true, stream_tag); ret = sst_dsp_register_poll(ctx, BXT_ADSP_FW_STATUS, SKL_FW_STS_MASK, BXT_ROM_INIT, BXT_BASEFW_TIMEOUT, "Firmware boot"); - skl_dsp_trigger(ctx->dev, false, ctx->dsp_ops.stream_tag); - skl_dsp_cleanup(ctx->dev, &ctx->dmab, ctx->dsp_ops.stream_tag); + skl_dsp_trigger(ctx->dev, false, stream_tag); + skl_dsp_cleanup(ctx->dev, &ctx->dmab, stream_tag); return ret; } @@ -207,7 +206,6 @@ static int bxt_load_base_firmware(struct sst_dsp *ctx) stripped_fw.size = ctx->fw->size; skl_dsp_strip_extended_manifest(&stripped_fw); - for (i = 0; i < BXT_FW_ROM_INIT_RETRY; i++) { ret = sst_bxt_prepare_fw(ctx, stripped_fw.data, stripped_fw.size); if (ret == 0) @@ -223,7 +221,7 @@ static int bxt_load_base_firmware(struct sst_dsp *ctx) goto sst_load_base_firmware_failed; } - ret = sst_transfer_fw_host_dma(ctx); + ret = sst_transfer_fw_host_dma(ctx, ret); if (ret < 0) { dev_err(ctx->dev, "Transfer firmware failed %d\n", ret); dev_info(ctx->dev, "Error code=0x%x: FW status=0x%x\n", diff --git a/sound/soc/intel/skylake/cnl-sst.c b/sound/soc/intel/skylake/cnl-sst.c index 5ad34e9f51eb..4d9a4d5886f4 100644 --- a/sound/soc/intel/skylake/cnl-sst.c +++ b/sound/soc/intel/skylake/cnl-sst.c @@ -54,7 +54,6 @@ static int cnl_prepare_fw(struct sst_dsp *ctx, const void *fwdata, u32 fwsize) return stream_tag; } - ctx->dsp_ops.stream_tag = stream_tag; memcpy(ctx->dmab.area, fwdata, fwsize); /* purge FW request */ @@ -81,7 +80,7 @@ static int cnl_prepare_fw(struct sst_dsp *ctx, const void *fwdata, u32 fwsize) goto base_fw_load_failed; } - return 0; + return stream_tag; base_fw_load_failed: skl_dsp_cleanup(ctx->dev, &ctx->dmab, stream_tag); @@ -90,17 +89,17 @@ static int cnl_prepare_fw(struct sst_dsp *ctx, const void *fwdata, u32 fwsize) return ret; } -static int sst_transfer_fw_host_dma(struct sst_dsp *ctx) +static int sst_transfer_fw_host_dma(struct sst_dsp *ctx, int stream_tag) { int ret; - skl_dsp_trigger(ctx->dev, true, ctx->dsp_ops.stream_tag); + skl_dsp_trigger(ctx->dev, true, stream_tag); ret = sst_dsp_register_poll(ctx, CNL_ADSP_FW_STATUS, CNL_FW_STS_MASK, CNL_FW_INIT, CNL_BASEFW_TIMEOUT, "firmware boot"); - skl_dsp_trigger(ctx->dev, false, ctx->dsp_ops.stream_tag); - skl_dsp_cleanup(ctx->dev, &ctx->dmab, ctx->dsp_ops.stream_tag); + skl_dsp_trigger(ctx->dev, false, stream_tag); + skl_dsp_cleanup(ctx->dev, &ctx->dmab, stream_tag); return ret; } @@ -137,7 +136,7 @@ static int cnl_load_base_firmware(struct sst_dsp *ctx) goto cnl_load_base_firmware_failed; } - ret = sst_transfer_fw_host_dma(ctx); + ret = sst_transfer_fw_host_dma(ctx, ret); if (ret < 0) { dev_err(ctx->dev, "transfer firmware failed: %d\n", ret); cnl_dsp_disable_core(ctx, SKL_DSP_CORE0_MASK); From patchwork Thu Aug 22 19:04:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 11109875 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8FCD21864 for ; Thu, 22 Aug 2019 19:17:44 +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 22FC223400 for ; Thu, 22 Aug 2019 19:17:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="jcOpyTuW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 22FC223400 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-devel-bounces@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 5E9CE1687; Thu, 22 Aug 2019 21:16:52 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5E9CE1687 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566501462; bh=cThwNRfuZv3Ior0g/1Vs+C4KbTjOsXY8N6EYtD/UmqQ=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=jcOpyTuWvwRsnoAkC1rUWC4dbYtfVyqh54WQd9kQhD5nDZYXkIeppyL1xmn6CaPD5 JkkIxi7zTySfJWjq6afNPb0CfkZD/+Ky7xUvqaT2w3fTG+95EntIF4W1qPDoNrnkme sv3usENX+n6EhcnK0/rCeq0xxI08f92K/DqgZALs= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id BB72EF8067A; Thu, 22 Aug 2019 21:06:24 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id B6424F806E9; Thu, 22 Aug 2019 21:05:38 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 188D6F805A1 for ; Thu, 22 Aug 2019 21:05:09 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 188D6F805A1 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 12:05:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,417,1559545200"; d="scan'208";a="203524395" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga004.fm.intel.com with ESMTP; 22 Aug 2019 12:05:07 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org Date: Thu, 22 Aug 2019 21:04:07 +0200 Message-Id: <20190822190425.23001-18-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190822190425.23001-1-cezary.rojewski@intel.com> References: <20190822190425.23001-1-cezary.rojewski@intel.com> Cc: lgirdwood@gmail.com, Cezary Rojewski , broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 17/35] ASoC: Intel: Skylake: Remove skl_dsp_loader_ops 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" With all fields deprecated, yet another struct can be removed. Let's do so and don't forget about any functions or fields tied to its existence. Signed-off-by: Cezary Rojewski --- sound/soc/intel/common/sst-dsp-priv.h | 1 - sound/soc/intel/skylake/bxt-sst.c | 5 ++-- sound/soc/intel/skylake/cnl-sst-dsp.h | 3 +- sound/soc/intel/skylake/cnl-sst.c | 5 ++-- sound/soc/intel/skylake/skl-messages.c | 40 +------------------------ sound/soc/intel/skylake/skl-sst-dsp.h | 24 ++------------- sound/soc/intel/skylake/skl-sst-utils.c | 3 +- sound/soc/intel/skylake/skl-sst.c | 5 ++-- sound/soc/intel/skylake/skl.h | 2 -- 9 files changed, 12 insertions(+), 76 deletions(-) diff --git a/sound/soc/intel/common/sst-dsp-priv.h b/sound/soc/intel/common/sst-dsp-priv.h index 8a7009937d59..0fe9bebcfb38 100644 --- a/sound/soc/intel/common/sst-dsp-priv.h +++ b/sound/soc/intel/common/sst-dsp-priv.h @@ -306,7 +306,6 @@ struct sst_dsp { const char *fw_name; /* To allocate CL dma buffers */ - struct skl_dsp_loader_ops dsp_ops; struct skl_dsp_fw_ops fw_ops; int sst_state; struct skl_cl_dev cl_dev; diff --git a/sound/soc/intel/skylake/bxt-sst.c b/sound/soc/intel/skylake/bxt-sst.c index 45da02f74f4d..c7961050c2ee 100644 --- a/sound/soc/intel/skylake/bxt-sst.c +++ b/sound/soc/intel/skylake/bxt-sst.c @@ -546,14 +546,13 @@ static struct sst_pdata skl_dev = { }; int bxt_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, - const char *fw_name, struct skl_dsp_loader_ops dsp_ops, - struct skl_dev **dsp) + const char *fw_name, struct skl_dev **dsp) { struct skl_dev *skl; struct sst_dsp *sst; int ret; - ret = skl_sst_ctx_init(dev, irq, fw_name, dsp_ops, dsp, &skl_dev); + ret = skl_sst_ctx_init(dev, irq, fw_name, dsp, &skl_dev); if (ret < 0) { dev_err(dev, "%s: no device\n", __func__); return ret; diff --git a/sound/soc/intel/skylake/cnl-sst-dsp.h b/sound/soc/intel/skylake/cnl-sst-dsp.h index 30b586acc858..70da4f312f53 100644 --- a/sound/soc/intel/skylake/cnl-sst-dsp.h +++ b/sound/soc/intel/skylake/cnl-sst-dsp.h @@ -94,7 +94,6 @@ void cnl_ipc_op_int_disable(struct sst_dsp *ctx); bool cnl_ipc_int_status(struct sst_dsp *ctx); int cnl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, - const char *fw_name, struct skl_dsp_loader_ops dsp_ops, - struct skl_dev **dsp); + const char *fw_name, struct skl_dev **dsp); #endif /*__CNL_SST_DSP_H__*/ diff --git a/sound/soc/intel/skylake/cnl-sst.c b/sound/soc/intel/skylake/cnl-sst.c index 4d9a4d5886f4..2f10076cc906 100644 --- a/sound/soc/intel/skylake/cnl-sst.c +++ b/sound/soc/intel/skylake/cnl-sst.c @@ -423,14 +423,13 @@ static struct sst_pdata cnl_dev = { }; int cnl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, - const char *fw_name, struct skl_dsp_loader_ops dsp_ops, - struct skl_dev **dsp) + const char *fw_name, struct skl_dev **dsp) { struct skl_dev *cnl; struct sst_dsp *sst; int ret; - ret = skl_sst_ctx_init(dev, irq, fw_name, dsp_ops, dsp, &cnl_dev); + ret = skl_sst_ctx_init(dev, irq, fw_name, dsp, &cnl_dev); if (ret < 0) { dev_err(dev, "%s: no device\n", __func__); return ret; diff --git a/sound/soc/intel/skylake/skl-messages.c b/sound/soc/intel/skylake/skl-messages.c index 20ab980fe8a1..6fbceec67b53 100644 --- a/sound/soc/intel/skylake/skl-messages.c +++ b/sound/soc/intel/skylake/skl-messages.c @@ -140,72 +140,37 @@ int skl_dsp_cleanup(struct device *dev, return 0; } -static struct skl_dsp_loader_ops skl_get_loader_ops(void) -{ - struct skl_dsp_loader_ops loader_ops; - - memset(&loader_ops, 0, sizeof(struct skl_dsp_loader_ops)); - - loader_ops.alloc_dma_buf = skl_alloc_dma_buf; - loader_ops.free_dma_buf = skl_free_dma_buf; - - return loader_ops; -}; - -static struct skl_dsp_loader_ops bxt_get_loader_ops(void) -{ - struct skl_dsp_loader_ops loader_ops; - - memset(&loader_ops, 0, sizeof(loader_ops)); - - loader_ops.alloc_dma_buf = skl_alloc_dma_buf; - loader_ops.free_dma_buf = skl_free_dma_buf; - loader_ops.prepare = skl_dsp_prepare; - loader_ops.trigger = skl_dsp_trigger; - loader_ops.cleanup = skl_dsp_cleanup; - - return loader_ops; -}; - static const struct skl_dsp_ops dsp_ops[] = { { .id = 0x9d70, - .loader_ops = skl_get_loader_ops, .init = skl_sst_dsp_init, }, { .id = 0x9d71, - .loader_ops = skl_get_loader_ops, .init = skl_sst_dsp_init, }, { .id = 0x5a98, - .loader_ops = bxt_get_loader_ops, .init = bxt_sst_dsp_init, }, { .id = 0x3198, - .loader_ops = bxt_get_loader_ops, .init = bxt_sst_dsp_init, }, { .id = 0x9dc8, - .loader_ops = bxt_get_loader_ops, .init = cnl_sst_dsp_init, }, { .id = 0xa348, - .loader_ops = bxt_get_loader_ops, .init = cnl_sst_dsp_init, }, { .id = 0x02c8, - .loader_ops = bxt_get_loader_ops, .init = cnl_sst_dsp_init, }, { .id = 0x06c8, - .loader_ops = bxt_get_loader_ops, .init = cnl_sst_dsp_init, }, }; @@ -226,7 +191,6 @@ int skl_init_dsp(struct skl_dev *skl) { void __iomem *mmio_base; struct hdac_bus *bus = skl_to_bus(skl); - struct skl_dsp_loader_ops loader_ops; int irq = bus->irq; const struct skl_dsp_ops *ops; int ret; @@ -248,10 +212,8 @@ int skl_init_dsp(struct skl_dev *skl) goto unmap_mmio; } - loader_ops = ops->loader_ops(); ret = ops->init(bus->dev, mmio_base, irq, - skl->fw_name, loader_ops, - &skl); + skl->fw_name, &skl); if (ret < 0) goto unmap_mmio; diff --git a/sound/soc/intel/skylake/skl-sst-dsp.h b/sound/soc/intel/skylake/skl-sst-dsp.h index 97e16a602331..9f2dae92c1c9 100644 --- a/sound/soc/intel/skylake/skl-sst-dsp.h +++ b/sound/soc/intel/skylake/skl-sst-dsp.h @@ -150,22 +150,6 @@ struct skl_dsp_fw_ops { }; -struct skl_dsp_loader_ops { - int stream_tag; - - int (*alloc_dma_buf)(struct device *dev, - struct snd_dma_buffer *dmab, size_t size); - int (*free_dma_buf)(struct device *dev, - struct snd_dma_buffer *dmab); - int (*prepare)(struct device *dev, unsigned int format, - unsigned int byte_size, - struct snd_dma_buffer *bufp); - int (*trigger)(struct device *dev, bool start, int stream_tag); - - int (*cleanup)(struct device *dev, struct snd_dma_buffer *dmab, - int stream_tag); -}; - #define MAX_INSTANCE_BUFF 2 struct uuid_module { @@ -227,11 +211,9 @@ int skl_dsp_put_core(struct sst_dsp *ctx, unsigned int core_id); int skl_dsp_boot(struct sst_dsp *ctx); int skl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, - const char *fw_name, struct skl_dsp_loader_ops dsp_ops, - struct skl_dev **dsp); + const char *fw_name, struct skl_dev **dsp); int bxt_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, - const char *fw_name, struct skl_dsp_loader_ops dsp_ops, - struct skl_dev **dsp); + const char *fw_name, struct skl_dev **dsp); int bxt_load_library(struct sst_dsp *ctx, struct skl_lib_info *linfo, int lib_count); @@ -248,7 +230,7 @@ int skl_dsp_strip_extended_manifest(struct firmware *fw); void skl_dsp_set_astate_cfg(struct skl_dev *skl, u32 cnt, void *data); int skl_sst_ctx_init(struct device *dev, int irq, const char *fw_name, - struct skl_dsp_loader_ops dsp_ops, struct skl_dev **dsp, + struct skl_dev **dsp, struct sst_pdata *pdata); int skl_prepare_lib_load(struct skl_dev *skl, struct skl_lib_info *linfo, struct firmware *stripped_fw, diff --git a/sound/soc/intel/skylake/skl-sst-utils.c b/sound/soc/intel/skylake/skl-sst-utils.c index 8e03a10855c4..bbe67e298efe 100644 --- a/sound/soc/intel/skylake/skl-sst-utils.c +++ b/sound/soc/intel/skylake/skl-sst-utils.c @@ -355,7 +355,7 @@ int skl_dsp_strip_extended_manifest(struct firmware *fw) } int skl_sst_ctx_init(struct device *dev, int irq, const char *fw_name, - struct skl_dsp_loader_ops dsp_ops, struct skl_dev **dsp, + struct skl_dev **dsp, struct sst_pdata *pdata) { struct skl_dev *skl = *dsp; @@ -375,7 +375,6 @@ int skl_sst_ctx_init(struct device *dev, int irq, const char *fw_name, sst = skl->dsp; sst->fw_name = fw_name; - sst->dsp_ops = dsp_ops; init_waitqueue_head(&skl->mod_load_wait); INIT_LIST_HEAD(&sst->module_list); diff --git a/sound/soc/intel/skylake/skl-sst.c b/sound/soc/intel/skylake/skl-sst.c index 6bb003add9e2..e9a7b2509b35 100644 --- a/sound/soc/intel/skylake/skl-sst.c +++ b/sound/soc/intel/skylake/skl-sst.c @@ -517,14 +517,13 @@ static struct sst_pdata skl_dev = { }; int skl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, - const char *fw_name, struct skl_dsp_loader_ops dsp_ops, - struct skl_dev **dsp) + const char *fw_name, struct skl_dev **dsp) { struct skl_dev *skl; struct sst_dsp *sst; int ret; - ret = skl_sst_ctx_init(dev, irq, fw_name, dsp_ops, dsp, &skl_dev); + ret = skl_sst_ctx_init(dev, irq, fw_name, dsp, &skl_dev); if (ret < 0) { dev_err(dev, "%s: no device\n", __func__); return ret; diff --git a/sound/soc/intel/skylake/skl.h b/sound/soc/intel/skylake/skl.h index 62e2f2d450e4..beeef67cb55f 100644 --- a/sound/soc/intel/skylake/skl.h +++ b/sound/soc/intel/skylake/skl.h @@ -155,10 +155,8 @@ struct skl_machine_pdata { struct skl_dsp_ops { int id; - struct skl_dsp_loader_ops (*loader_ops)(void); int (*init)(struct device *dev, void __iomem *mmio_base, int irq, const char *fw_name, - struct skl_dsp_loader_ops loader_ops, struct skl_dev **skl_sst); }; From patchwork Thu Aug 22 19:04:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 11109877 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 703E413A4 for ; Thu, 22 Aug 2019 19:18:27 +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 057B323401 for ; Thu, 22 Aug 2019 19:18:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="RjzmBrrq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 057B323401 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-devel-bounces@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 44E051684; Thu, 22 Aug 2019 21:17:35 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 44E051684 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566501505; bh=2EK5LzuYyot0f9KifZeCEhW9jWBpLnY0TkZTIKFkGac=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=RjzmBrrqEsr81MmdskSNUcopK2qXMx9qtgqZk50mALHKA5iwYWG9Z3hMk65UZXYY9 bHvTZf1l2NYB7VcOUJVTq0GTRPZYmj60ilOwDtXedU4a4q3qbWjNR8+BBcruHf6sCV fRKRUtrQ/yk7lWbGNBp6ZxEn74ZoVoY1//uMh3Zw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2FC75F80759; Thu, 22 Aug 2019 21:06:27 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id AADAAF806E9; Thu, 22 Aug 2019 21:05:40 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 87DF7F805E0 for ; Thu, 22 Aug 2019 21:05:10 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 87DF7F805E0 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 12:05:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,417,1559545200"; d="scan'208";a="203524419" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga004.fm.intel.com with ESMTP; 22 Aug 2019 12:05:09 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org Date: Thu, 22 Aug 2019 21:04:08 +0200 Message-Id: <20190822190425.23001-19-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190822190425.23001-1-cezary.rojewski@intel.com> References: <20190822190425.23001-1-cezary.rojewski@intel.com> Cc: lgirdwood@gmail.com, Cezary Rojewski , broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 18/35] ASoC: Intel: Skylake: Remove window0 sst_addr fields 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" w0_stat_sz and w0_up_sz are Skylake-specific fields and should not be part of common sst framework. The latter is also completely unused. Remove both while declaring global FW register-area size, shared for all SKL+ platforms. Signed-off-by: Cezary Rojewski --- sound/soc/intel/common/sst-dsp-priv.h | 2 -- sound/soc/intel/skylake/bxt-sst.c | 2 -- sound/soc/intel/skylake/cnl-sst.c | 2 -- sound/soc/intel/skylake/skl-debug.c | 2 +- sound/soc/intel/skylake/skl-sst-dsp.h | 1 + sound/soc/intel/skylake/skl-sst.c | 2 -- 6 files changed, 2 insertions(+), 9 deletions(-) diff --git a/sound/soc/intel/common/sst-dsp-priv.h b/sound/soc/intel/common/sst-dsp-priv.h index 0fe9bebcfb38..53dcd87bab44 100644 --- a/sound/soc/intel/common/sst-dsp-priv.h +++ b/sound/soc/intel/common/sst-dsp-priv.h @@ -71,8 +71,6 @@ struct sst_addr { u32 dsp_dram_offset; u32 sram0_base; u32 sram1_base; - u32 w0_stat_sz; - u32 w0_up_sz; void __iomem *lpe; void __iomem *shim; void __iomem *pci_cfg; diff --git a/sound/soc/intel/skylake/bxt-sst.c b/sound/soc/intel/skylake/bxt-sst.c index c7961050c2ee..641d5cf4aeb1 100644 --- a/sound/soc/intel/skylake/bxt-sst.c +++ b/sound/soc/intel/skylake/bxt-sst.c @@ -565,8 +565,6 @@ int bxt_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, sst->addr.shim = mmio_base; sst->addr.sram0_base = BXT_ADSP_SRAM0_BASE; sst->addr.sram1_base = BXT_ADSP_SRAM1_BASE; - sst->addr.w0_stat_sz = SKL_ADSP_W0_STAT_SZ; - sst->addr.w0_up_sz = SKL_ADSP_W0_UP_SZ; sst_dsp_mailbox_init(sst, (BXT_ADSP_SRAM0_BASE + SKL_ADSP_W0_STAT_SZ), SKL_ADSP_W0_UP_SZ, BXT_ADSP_SRAM1_BASE, SKL_ADSP_W1_SZ); diff --git a/sound/soc/intel/skylake/cnl-sst.c b/sound/soc/intel/skylake/cnl-sst.c index 2f10076cc906..64971966af38 100644 --- a/sound/soc/intel/skylake/cnl-sst.c +++ b/sound/soc/intel/skylake/cnl-sst.c @@ -442,8 +442,6 @@ int cnl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, sst->addr.shim = mmio_base; sst->addr.sram0_base = CNL_ADSP_SRAM0_BASE; sst->addr.sram1_base = CNL_ADSP_SRAM1_BASE; - sst->addr.w0_stat_sz = CNL_ADSP_W0_STAT_SZ; - sst->addr.w0_up_sz = CNL_ADSP_W0_UP_SZ; sst_dsp_mailbox_init(sst, (CNL_ADSP_SRAM0_BASE + CNL_ADSP_W0_STAT_SZ), CNL_ADSP_W0_UP_SZ, CNL_ADSP_SRAM1_BASE, diff --git a/sound/soc/intel/skylake/skl-debug.c b/sound/soc/intel/skylake/skl-debug.c index 212370bf704c..6781eac13232 100644 --- a/sound/soc/intel/skylake/skl-debug.c +++ b/sound/soc/intel/skylake/skl-debug.c @@ -173,7 +173,7 @@ static ssize_t fw_softreg_read(struct file *file, char __user *user_buf, { struct skl_debug *d = file->private_data; struct sst_dsp *sst = d->skl->dsp; - size_t w0_stat_sz = sst->addr.w0_stat_sz; + size_t w0_stat_sz = SKL_FW_REGS_SIZE; void __iomem *in_base = sst->mailbox.in_base; void __iomem *fw_reg_addr; unsigned int offset; diff --git a/sound/soc/intel/skylake/skl-sst-dsp.h b/sound/soc/intel/skylake/skl-sst-dsp.h index 9f2dae92c1c9..5a0cb7f3d57e 100644 --- a/sound/soc/intel/skylake/skl-sst-dsp.h +++ b/sound/soc/intel/skylake/skl-sst-dsp.h @@ -63,6 +63,7 @@ struct skl_dev; #define SKL_ADSP_W1_SZ 0x1000 +#define SKL_FW_REGS_SIZE PAGE_SIZE #define SKL_FW_STS_MASK 0xf #define SKL_FW_INIT 0x1 diff --git a/sound/soc/intel/skylake/skl-sst.c b/sound/soc/intel/skylake/skl-sst.c index e9a7b2509b35..7e63c91cea54 100644 --- a/sound/soc/intel/skylake/skl-sst.c +++ b/sound/soc/intel/skylake/skl-sst.c @@ -535,8 +535,6 @@ int skl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, sst->addr.shim = mmio_base; sst->addr.sram0_base = SKL_ADSP_SRAM0_BASE; sst->addr.sram1_base = SKL_ADSP_SRAM1_BASE; - sst->addr.w0_stat_sz = SKL_ADSP_W0_STAT_SZ; - sst->addr.w0_up_sz = SKL_ADSP_W0_UP_SZ; sst_dsp_mailbox_init(sst, (SKL_ADSP_SRAM0_BASE + SKL_ADSP_W0_STAT_SZ), SKL_ADSP_W0_UP_SZ, SKL_ADSP_SRAM1_BASE, SKL_ADSP_W1_SZ); From patchwork Thu Aug 22 19:04:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 11109879 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 907981399 for ; Thu, 22 Aug 2019 19:19:04 +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 248CB23400 for ; Thu, 22 Aug 2019 19:19:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="aksQZ9h9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 248CB23400 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-devel-bounces@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 617BE1682; Thu, 22 Aug 2019 21:18:12 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 617BE1682 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566501542; bh=GSf6UaJyqn2nFwTZCNomjr9eI4YWKRaCKag7D+HOwfE=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=aksQZ9h9/np4jvzA7wU8aWhcO2LbUkgXju4dcop1yYiPmBNhGTiSxvFHT4YW4OWs8 VVHarCvO8hk2CSfsHT8GC7FD3UT84kwZFbq0prEsV6yGE2cmNmqFfCkiVCPPGOpAbY C9RJVYd5cRjzHpfIOkojmpuh9lbOkFwdaNlTHeBI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id A56F3F80760; Thu, 22 Aug 2019 21:06:29 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 37240F806E8; Thu, 22 Aug 2019 21:05:41 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 35157F8060D for ; Thu, 22 Aug 2019 21:05:12 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 35157F8060D X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 12:05:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,417,1559545200"; d="scan'208";a="203524437" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga004.fm.intel.com with ESMTP; 22 Aug 2019 12:05:11 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org Date: Thu, 22 Aug 2019 21:04:09 +0200 Message-Id: <20190822190425.23001-20-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190822190425.23001-1-cezary.rojewski@intel.com> References: <20190822190425.23001-1-cezary.rojewski@intel.com> Cc: lgirdwood@gmail.com, Cezary Rojewski , broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 19/35] ASoC: Intel: Skylake: Remove redundant W0 and W1 macros 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The existing upling, downling and FW register size macros are duplicates. Remove these and replace by global mailbox size macro - FW register-area size is represented by SKL_FW_REGS_SIZE added in precedding change. Signed-off-by: Cezary Rojewski --- sound/soc/intel/skylake/bxt-sst.c | 5 +++-- sound/soc/intel/skylake/cnl-sst-dsp.h | 6 ------ sound/soc/intel/skylake/cnl-sst.c | 10 +++++----- sound/soc/intel/skylake/skl-sst-dsp.h | 7 +------ sound/soc/intel/skylake/skl-sst-ipc.c | 12 ++++++------ sound/soc/intel/skylake/skl-sst.c | 5 +++-- 6 files changed, 18 insertions(+), 27 deletions(-) diff --git a/sound/soc/intel/skylake/bxt-sst.c b/sound/soc/intel/skylake/bxt-sst.c index 641d5cf4aeb1..fdd94711c3b4 100644 --- a/sound/soc/intel/skylake/bxt-sst.c +++ b/sound/soc/intel/skylake/bxt-sst.c @@ -566,8 +566,9 @@ int bxt_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, sst->addr.sram0_base = BXT_ADSP_SRAM0_BASE; sst->addr.sram1_base = BXT_ADSP_SRAM1_BASE; - sst_dsp_mailbox_init(sst, (BXT_ADSP_SRAM0_BASE + SKL_ADSP_W0_STAT_SZ), - SKL_ADSP_W0_UP_SZ, BXT_ADSP_SRAM1_BASE, SKL_ADSP_W1_SZ); + sst_dsp_mailbox_init(sst, + (BXT_ADSP_SRAM0_BASE + SKL_FW_REGS_SIZE), SKL_MAILBOX_SIZE, + BXT_ADSP_SRAM1_BASE, SKL_MAILBOX_SIZE); ret = skl_ipc_init(dev, skl); if (ret) { diff --git a/sound/soc/intel/skylake/cnl-sst-dsp.h b/sound/soc/intel/skylake/cnl-sst-dsp.h index 70da4f312f53..a465cc42b7e8 100644 --- a/sound/soc/intel/skylake/cnl-sst-dsp.h +++ b/sound/soc/intel/skylake/cnl-sst-dsp.h @@ -52,12 +52,6 @@ struct sst_generic_ipc; #define CNL_ADSP_MMIO_LEN 0x10000 -#define CNL_ADSP_W0_STAT_SZ 0x1000 - -#define CNL_ADSP_W0_UP_SZ 0x1000 - -#define CNL_ADSP_W1_SZ 0x1000 - #define CNL_FW_STS_MASK 0xf #define CNL_ADSPIC_IPC 0x1 diff --git a/sound/soc/intel/skylake/cnl-sst.c b/sound/soc/intel/skylake/cnl-sst.c index 64971966af38..d3da23e0ef05 100644 --- a/sound/soc/intel/skylake/cnl-sst.c +++ b/sound/soc/intel/skylake/cnl-sst.c @@ -390,8 +390,8 @@ static int cnl_ipc_init(struct device *dev, struct skl_dev *cnl) ipc->dsp = cnl->dsp; ipc->dev = dev; - ipc->tx_data_max_size = CNL_ADSP_W1_SZ; - ipc->rx_data_max_size = CNL_ADSP_W0_UP_SZ; + ipc->tx_data_max_size = SKL_MAILBOX_SIZE; + ipc->rx_data_max_size = SKL_MAILBOX_SIZE; err = sst_ipc_init(ipc); if (err) @@ -443,9 +443,9 @@ int cnl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, sst->addr.sram0_base = CNL_ADSP_SRAM0_BASE; sst->addr.sram1_base = CNL_ADSP_SRAM1_BASE; - sst_dsp_mailbox_init(sst, (CNL_ADSP_SRAM0_BASE + CNL_ADSP_W0_STAT_SZ), - CNL_ADSP_W0_UP_SZ, CNL_ADSP_SRAM1_BASE, - CNL_ADSP_W1_SZ); + sst_dsp_mailbox_init(sst, + (CNL_ADSP_SRAM0_BASE + SKL_FW_REGS_SIZE), SKL_MAILBOX_SIZE, + CNL_ADSP_SRAM1_BASE, SKL_MAILBOX_SIZE); ret = cnl_ipc_init(dev, cnl); if (ret) { diff --git a/sound/soc/intel/skylake/skl-sst-dsp.h b/sound/soc/intel/skylake/skl-sst-dsp.h index 5a0cb7f3d57e..3c92b1d849e4 100644 --- a/sound/soc/intel/skylake/skl-sst-dsp.h +++ b/sound/soc/intel/skylake/skl-sst-dsp.h @@ -57,12 +57,7 @@ struct skl_dev; #define SKL_ADSP_MMIO_LEN 0x10000 -#define SKL_ADSP_W0_STAT_SZ 0x1000 - -#define SKL_ADSP_W0_UP_SZ 0x1000 - -#define SKL_ADSP_W1_SZ 0x1000 - +#define SKL_MAILBOX_SIZE PAGE_SIZE #define SKL_FW_REGS_SIZE PAGE_SIZE #define SKL_FW_STS_MASK 0xf diff --git a/sound/soc/intel/skylake/skl-sst-ipc.c b/sound/soc/intel/skylake/skl-sst-ipc.c index 2700f882103d..72d7284d2fff 100644 --- a/sound/soc/intel/skylake/skl-sst-ipc.c +++ b/sound/soc/intel/skylake/skl-sst-ipc.c @@ -606,8 +606,8 @@ int skl_ipc_init(struct device *dev, struct skl_dev *skl) ipc->dsp = skl->dsp; ipc->dev = dev; - ipc->tx_data_max_size = SKL_ADSP_W1_SZ; - ipc->rx_data_max_size = SKL_ADSP_W0_UP_SZ; + ipc->tx_data_max_size = SKL_MAILBOX_SIZE; + ipc->rx_data_max_size = SKL_MAILBOX_SIZE; err = sst_ipc_init(ipc); if (err) @@ -922,8 +922,8 @@ int skl_ipc_set_large_config(struct sst_generic_ipc *ipc, sz_remaining = msg->param_data_size; data_offset = 0; while (sz_remaining != 0) { - tx_size = sz_remaining > SKL_ADSP_W1_SZ - ? SKL_ADSP_W1_SZ : sz_remaining; + tx_size = sz_remaining > SKL_MAILBOX_SIZE + ? SKL_MAILBOX_SIZE : sz_remaining; if (tx_size == sz_remaining) header.extension |= IPC_FINAL_BLOCK(1); @@ -965,7 +965,7 @@ int skl_ipc_get_large_config(struct sst_generic_ipc *ipc, unsigned int *buf; int ret; - reply.data = kzalloc(SKL_ADSP_W1_SZ, GFP_KERNEL); + reply.data = kzalloc(SKL_MAILBOX_SIZE, GFP_KERNEL); if (!reply.data) return -ENOMEM; @@ -983,7 +983,7 @@ int skl_ipc_get_large_config(struct sst_generic_ipc *ipc, request.header = *(u64 *)&header; request.data = *payload; request.size = *bytes; - reply.size = SKL_ADSP_W1_SZ; + reply.size = SKL_MAILBOX_SIZE; ret = sst_ipc_tx_message_wait(ipc, request, &reply); if (ret < 0) diff --git a/sound/soc/intel/skylake/skl-sst.c b/sound/soc/intel/skylake/skl-sst.c index 7e63c91cea54..191931578fd2 100644 --- a/sound/soc/intel/skylake/skl-sst.c +++ b/sound/soc/intel/skylake/skl-sst.c @@ -536,8 +536,9 @@ int skl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, sst->addr.sram0_base = SKL_ADSP_SRAM0_BASE; sst->addr.sram1_base = SKL_ADSP_SRAM1_BASE; - sst_dsp_mailbox_init(sst, (SKL_ADSP_SRAM0_BASE + SKL_ADSP_W0_STAT_SZ), - SKL_ADSP_W0_UP_SZ, SKL_ADSP_SRAM1_BASE, SKL_ADSP_W1_SZ); + sst_dsp_mailbox_init(sst, + (SKL_ADSP_SRAM0_BASE + SKL_FW_REGS_SIZE), SKL_MAILBOX_SIZE, + SKL_ADSP_SRAM1_BASE, SKL_MAILBOX_SIZE); ret = skl_ipc_init(dev, skl); if (ret) { From patchwork Thu Aug 22 19:04:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 11109893 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0025C1399 for ; Thu, 22 Aug 2019 19:19:55 +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 88D1E23400 for ; Thu, 22 Aug 2019 19:19:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="m/CyFpON" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 88D1E23400 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-devel-bounces@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 DAA3A1666; Thu, 22 Aug 2019 21:19:02 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DAA3A1666 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566501592; bh=KcZJmdHhAGjGlqoGHSTY/+rF1v57yTh0wHU7KBLFNiY=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=m/CyFpONlNp1DSiezOmCBrYgohyAICObY8jYBtGmMKQIPNRpMpOp6RKJ+/sCJrd6Z CxjOX8bWZgDK+6nomrpT0jIssNKwWb9z3q4XGI8b8rO8DTQgi5zlM1Rpo5rN9/4ms/ WAsO+obI4dleEQEwolISKru9lPtyjT2P6Yd33OEA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D1A10F80771; Thu, 22 Aug 2019 21:06:33 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 293CDF8070E; Thu, 22 Aug 2019 21:05:48 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 B8681F804CB for ; Thu, 22 Aug 2019 21:05:13 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B8681F804CB X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 12:05:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,417,1559545200"; d="scan'208";a="203524461" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga004.fm.intel.com with ESMTP; 22 Aug 2019 12:05:12 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org Date: Thu, 22 Aug 2019 21:04:10 +0200 Message-Id: <20190822190425.23001-21-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190822190425.23001-1-cezary.rojewski@intel.com> References: <20190822190425.23001-1-cezary.rojewski@intel.com> Cc: lgirdwood@gmail.com, Cezary Rojewski , broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 20/35] ASoC: Intel: Skylake: Remove redundant SRAM fields 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" sram0_base and sram1_base are Skylake-specific fields and should not be part of common sst framework. Moreover, these are completely unused, so remove them. Signed-off-by: Cezary Rojewski --- sound/soc/intel/common/sst-dsp-priv.h | 2 -- sound/soc/intel/skylake/bxt-sst.c | 2 -- sound/soc/intel/skylake/cnl-sst.c | 2 -- sound/soc/intel/skylake/skl-sst.c | 2 -- 4 files changed, 8 deletions(-) diff --git a/sound/soc/intel/common/sst-dsp-priv.h b/sound/soc/intel/common/sst-dsp-priv.h index 53dcd87bab44..a4628a89d47d 100644 --- a/sound/soc/intel/common/sst-dsp-priv.h +++ b/sound/soc/intel/common/sst-dsp-priv.h @@ -69,8 +69,6 @@ struct sst_addr { u32 dram_offset; u32 dsp_iram_offset; u32 dsp_dram_offset; - u32 sram0_base; - u32 sram1_base; void __iomem *lpe; void __iomem *shim; void __iomem *pci_cfg; diff --git a/sound/soc/intel/skylake/bxt-sst.c b/sound/soc/intel/skylake/bxt-sst.c index fdd94711c3b4..5b46215fbc0f 100644 --- a/sound/soc/intel/skylake/bxt-sst.c +++ b/sound/soc/intel/skylake/bxt-sst.c @@ -563,8 +563,6 @@ int bxt_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, sst->fw_ops = bxt_fw_ops; sst->addr.lpe = mmio_base; sst->addr.shim = mmio_base; - sst->addr.sram0_base = BXT_ADSP_SRAM0_BASE; - sst->addr.sram1_base = BXT_ADSP_SRAM1_BASE; sst_dsp_mailbox_init(sst, (BXT_ADSP_SRAM0_BASE + SKL_FW_REGS_SIZE), SKL_MAILBOX_SIZE, diff --git a/sound/soc/intel/skylake/cnl-sst.c b/sound/soc/intel/skylake/cnl-sst.c index d3da23e0ef05..47b991c03742 100644 --- a/sound/soc/intel/skylake/cnl-sst.c +++ b/sound/soc/intel/skylake/cnl-sst.c @@ -440,8 +440,6 @@ int cnl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, sst->fw_ops = cnl_fw_ops; sst->addr.lpe = mmio_base; sst->addr.shim = mmio_base; - sst->addr.sram0_base = CNL_ADSP_SRAM0_BASE; - sst->addr.sram1_base = CNL_ADSP_SRAM1_BASE; sst_dsp_mailbox_init(sst, (CNL_ADSP_SRAM0_BASE + SKL_FW_REGS_SIZE), SKL_MAILBOX_SIZE, diff --git a/sound/soc/intel/skylake/skl-sst.c b/sound/soc/intel/skylake/skl-sst.c index 191931578fd2..c823936ffd34 100644 --- a/sound/soc/intel/skylake/skl-sst.c +++ b/sound/soc/intel/skylake/skl-sst.c @@ -533,8 +533,6 @@ int skl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, sst = skl->dsp; sst->addr.lpe = mmio_base; sst->addr.shim = mmio_base; - sst->addr.sram0_base = SKL_ADSP_SRAM0_BASE; - sst->addr.sram1_base = SKL_ADSP_SRAM1_BASE; sst_dsp_mailbox_init(sst, (SKL_ADSP_SRAM0_BASE + SKL_FW_REGS_SIZE), SKL_MAILBOX_SIZE, From patchwork Thu Aug 22 19:04:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 11109895 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 134B613A4 for ; Thu, 22 Aug 2019 19:20:30 +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 9AF1523401 for ; Thu, 22 Aug 2019 19:20:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="ouj7oJHN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9AF1523401 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-devel-bounces@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 DEE851668; Thu, 22 Aug 2019 21:19:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DEE851668 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566501628; bh=DFCkarALHwTHLX7oTMBjtlZ6EN2+pJCWR0OBWFqxvtk=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=ouj7oJHNuJHhSwJV0QIZvCyucZsntN5/qlyzOrL+Xopw0maTPwwhsavxiC96Xneqg CIvQG/Kshd/9zK55+Wmtx2ZjEAArSjsN1vF8ACEfObPKtpjt+v9rvO3xSxPD7dJGnE BXOwt+xBp0LnxzEUcpLksOUUN2DU01v72cGf3JZU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 14FB4F8078F; Thu, 22 Aug 2019 21:06:36 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id B9560F8070E; Thu, 22 Aug 2019 21:05:48 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 A1925F80633 for ; Thu, 22 Aug 2019 21:05:15 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A1925F80633 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 12:05:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,417,1559545200"; d="scan'208";a="203524489" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga004.fm.intel.com with ESMTP; 22 Aug 2019 12:05:14 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org Date: Thu, 22 Aug 2019 21:04:11 +0200 Message-Id: <20190822190425.23001-22-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190822190425.23001-1-cezary.rojewski@intel.com> References: <20190822190425.23001-1-cezary.rojewski@intel.com> Cc: lgirdwood@gmail.com, Cezary Rojewski , broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 21/35] ASoC: Intel: Expose ACPI loading members 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" No framework should know upfront about specifics of its inheriting members. sst-acpi contains Baytrail and Haswell specific data. In order to prevent circular dependency, it's compiled into separate module. Let's do it right and obey inheritance rule. As a first step, elevate sst-acpi members so they could be shared by Haswell and Baytrail-specific handlers - this is to prevent code duplication. Signed-off-by: Cezary Rojewski --- sound/soc/intel/common/sst-acpi.c | 23 ++++------------------- sound/soc/intel/common/sst-dsp.h | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/sound/soc/intel/common/sst-acpi.c b/sound/soc/intel/common/sst-acpi.c index 0e8e0a7a11df..42f9b02f2ea3 100644 --- a/sound/soc/intel/common/sst-acpi.c +++ b/sound/soc/intel/common/sst-acpi.c @@ -19,23 +19,6 @@ #define SST_WPT_DSP_DMA_ADDR_OFFSET 0x0FE000 #define SST_LPT_DSP_DMA_SIZE (1024 - 1) -/* Descriptor for setting up SST platform data */ -struct sst_acpi_desc { - const char *drv_name; - struct snd_soc_acpi_mach *machines; - /* Platform resource indexes. Must set to -1 if not used */ - int resindex_lpe_base; - int resindex_pcicfg_base; - int resindex_fw_base; - int irqindex_host_ipc; - int resindex_dma_base; - /* Unique number identifying the SST core on platform */ - int sst_id; - /* DMA only valid when resindex_dma_base != -1*/ - int dma_engine; - int dma_size; -}; - struct sst_acpi_priv { struct platform_device *pdev_mach; struct platform_device *pdev_pcm; @@ -71,7 +54,7 @@ static void sst_acpi_fw_cb(const struct firmware *fw, void *context) return; } -static int sst_acpi_probe(struct platform_device *pdev) +int sst_acpi_probe(struct platform_device *pdev) { const struct acpi_device_id *id; struct device *dev = &pdev->dev; @@ -157,8 +140,9 @@ static int sst_acpi_probe(struct platform_device *pdev) return ret; } +EXPORT_SYMBOL_GPL(sst_acpi_probe); -static int sst_acpi_remove(struct platform_device *pdev) +int sst_acpi_remove(struct platform_device *pdev) { struct sst_acpi_priv *sst_acpi = platform_get_drvdata(pdev); struct sst_pdata *sst_pdata = &sst_acpi->sst_pdata; @@ -170,6 +154,7 @@ static int sst_acpi_remove(struct platform_device *pdev) return 0; } +EXPORT_SYMBOL_GPL(sst_acpi_remove); static struct sst_acpi_desc sst_acpi_haswell_desc = { .drv_name = "haswell-pcm-audio", diff --git a/sound/soc/intel/common/sst-dsp.h b/sound/soc/intel/common/sst-dsp.h index 63c29bb45cf1..a2ac7998fbdb 100644 --- a/sound/soc/intel/common/sst-dsp.h +++ b/sound/soc/intel/common/sst-dsp.h @@ -166,6 +166,27 @@ #define SST_PMCS_PS_MASK 0x3 struct sst_dsp; +struct platform_device; + +/* Descriptor for setting up SST platform data */ +struct sst_acpi_desc { + const char *drv_name; + struct snd_soc_acpi_mach *machines; + /* Platform resource indexes. Must set to -1 if not used */ + int resindex_lpe_base; + int resindex_pcicfg_base; + int resindex_fw_base; + int irqindex_host_ipc; + int resindex_dma_base; + /* Unique number identifying the SST core on platform */ + int sst_id; + /* DMA only valid when resindex_dma_base != -1*/ + int dma_engine; + int dma_size; +}; + +int sst_acpi_probe(struct platform_device *pdev); +int sst_acpi_remove(struct platform_device *pdev); /* * SST Platform Data. From patchwork Thu Aug 22 19:04:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 11109897 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BC5641399 for ; Thu, 22 Aug 2019 19:21:08 +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 5245B23401 for ; Thu, 22 Aug 2019 19:21:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="j/yXi8tC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5245B23401 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-devel-bounces@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 9AC0C165F; Thu, 22 Aug 2019 21:20:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9AC0C165F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566501666; bh=PVs6I+8A6DC3eGuhN3km52lNB53HxPpFWKP9Qklmai0=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=j/yXi8tCGtjKNBR6UzHYZ6xRpv4eZ2jeYXiJpEmtU7THRAr0JqPXqzZySv1eNb1O+ vfQm3z2l3sKcgFVC3cvSHiOLUhCX2sXqYnUjv1WrRXscqOZwYlHSYda6z+c1LJuRic SWbbZoq+kSD2HQENacWSwEp1pNfti9uBJxR7hr5o= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 3CA4AF80794; Thu, 22 Aug 2019 21:06:39 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 51E1BF80715; Thu, 22 Aug 2019 21:05:52 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 3B6AAF80636 for ; Thu, 22 Aug 2019 21:05:17 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3B6AAF80636 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 12:05:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,417,1559545200"; d="scan'208";a="203524511" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga004.fm.intel.com with ESMTP; 22 Aug 2019 12:05:16 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org Date: Thu, 22 Aug 2019 21:04:12 +0200 Message-Id: <20190822190425.23001-23-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190822190425.23001-1-cezary.rojewski@intel.com> References: <20190822190425.23001-1-cezary.rojewski@intel.com> Cc: lgirdwood@gmail.com, Cezary Rojewski , broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 22/35] ASoC: Intel: Haswell: Define separate ACPI loader 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" With common acpi code exposed, separate Haswell specific code from other legacy platforms. To reduce diff delta, it's still loaded with separate module called: hsw-acpi. This may be address later, once heavy hitters are gone. Signed-off-by: Cezary Rojewski --- sound/soc/intel/Kconfig | 6 ++- sound/soc/intel/common/sst-acpi.c | 32 ---------------- sound/soc/intel/haswell/Makefile | 2 + sound/soc/intel/haswell/acpi.c | 63 +++++++++++++++++++++++++++++++ 4 files changed, 70 insertions(+), 33 deletions(-) create mode 100644 sound/soc/intel/haswell/acpi.c diff --git a/sound/soc/intel/Kconfig b/sound/soc/intel/Kconfig index a3ec17fd63cd..9191773d203c 100644 --- a/sound/soc/intel/Kconfig +++ b/sound/soc/intel/Kconfig @@ -31,6 +31,10 @@ config SND_SST_IPC_ACPI # This option controls the ACPI-based IPC for HiFi2 platforms # (Baytrail, Cherrytrail) +config SND_SOC_INTEL_HASWELL_ACPI + tristate + # This option controls the ACPI-based on HSW/BDW platforms + config SND_SOC_INTEL_SST_ACPI tristate # This option controls ACPI-based probing on @@ -52,7 +56,7 @@ config SND_SOC_INTEL_HASWELL depends on SND_DMA_SGBUF depends on DMADEVICES && ACPI select SND_SOC_INTEL_SST - select SND_SOC_INTEL_SST_ACPI + select SND_SOC_INTEL_HASWELL_ACPI select SND_SOC_INTEL_SST_FIRMWARE select SND_SOC_ACPI_INTEL_MATCH help diff --git a/sound/soc/intel/common/sst-acpi.c b/sound/soc/intel/common/sst-acpi.c index 42f9b02f2ea3..7d2f04ff0479 100644 --- a/sound/soc/intel/common/sst-acpi.c +++ b/sound/soc/intel/common/sst-acpi.c @@ -15,10 +15,6 @@ #include #include -#define SST_LPT_DSP_DMA_ADDR_OFFSET 0x0F0000 -#define SST_WPT_DSP_DMA_ADDR_OFFSET 0x0FE000 -#define SST_LPT_DSP_DMA_SIZE (1024 - 1) - struct sst_acpi_priv { struct platform_device *pdev_mach; struct platform_device *pdev_pcm; @@ -156,32 +152,6 @@ int sst_acpi_remove(struct platform_device *pdev) } EXPORT_SYMBOL_GPL(sst_acpi_remove); -static struct sst_acpi_desc sst_acpi_haswell_desc = { - .drv_name = "haswell-pcm-audio", - .machines = snd_soc_acpi_intel_haswell_machines, - .resindex_lpe_base = 0, - .resindex_pcicfg_base = 1, - .resindex_fw_base = -1, - .irqindex_host_ipc = 0, - .sst_id = SST_DEV_ID_LYNX_POINT, - .dma_engine = SST_DMA_TYPE_DW, - .resindex_dma_base = SST_LPT_DSP_DMA_ADDR_OFFSET, - .dma_size = SST_LPT_DSP_DMA_SIZE, -}; - -static struct sst_acpi_desc sst_acpi_broadwell_desc = { - .drv_name = "haswell-pcm-audio", - .machines = snd_soc_acpi_intel_broadwell_machines, - .resindex_lpe_base = 0, - .resindex_pcicfg_base = 1, - .resindex_fw_base = -1, - .irqindex_host_ipc = 0, - .sst_id = SST_DEV_ID_WILDCAT_POINT, - .dma_engine = SST_DMA_TYPE_DW, - .resindex_dma_base = SST_WPT_DSP_DMA_ADDR_OFFSET, - .dma_size = SST_LPT_DSP_DMA_SIZE, -}; - #if !IS_ENABLED(CONFIG_SND_SST_IPC_ACPI) static struct sst_acpi_desc sst_acpi_baytrail_desc = { .drv_name = "baytrail-pcm-audio", @@ -196,8 +166,6 @@ static struct sst_acpi_desc sst_acpi_baytrail_desc = { #endif static const struct acpi_device_id sst_acpi_match[] = { - { "INT33C8", (unsigned long)&sst_acpi_haswell_desc }, - { "INT3438", (unsigned long)&sst_acpi_broadwell_desc }, #if !IS_ENABLED(CONFIG_SND_SST_IPC_ACPI) { "80860F28", (unsigned long)&sst_acpi_baytrail_desc }, #endif diff --git a/sound/soc/intel/haswell/Makefile b/sound/soc/intel/haswell/Makefile index ad2341aea8ae..0af852d0577b 100644 --- a/sound/soc/intel/haswell/Makefile +++ b/sound/soc/intel/haswell/Makefile @@ -1,5 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only snd-soc-sst-haswell-pcm-objs := \ sst-haswell-ipc.o sst-haswell-pcm.o sst-haswell-dsp.o +snd-soc-hsw-acpi-objs := acpi.o obj-$(CONFIG_SND_SOC_INTEL_HASWELL) += snd-soc-sst-haswell-pcm.o +obj-$(CONFIG_SND_SOC_INTEL_HASWELL_ACPI) += snd-soc-hsw-acpi.o diff --git a/sound/soc/intel/haswell/acpi.c b/sound/soc/intel/haswell/acpi.c new file mode 100644 index 000000000000..7bd8b03851c4 --- /dev/null +++ b/sound/soc/intel/haswell/acpi.c @@ -0,0 +1,63 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Intel HSW loader on ACPI systems + * + * Copyright (C) 2019, Intel Corporation. All rights reserved. + */ + +#include +#include +#include +#include +#include "../common/sst-dsp.h" + +#define SST_LPT_DSP_DMA_ADDR_OFFSET 0x0F0000 +#define SST_WPT_DSP_DMA_ADDR_OFFSET 0x0FE000 +#define SST_LPT_DSP_DMA_SIZE (1024 - 1) + +static struct sst_acpi_desc hsw_acpi_desc = { + .drv_name = "haswell-pcm-audio", + .machines = snd_soc_acpi_intel_haswell_machines, + .resindex_lpe_base = 0, + .resindex_pcicfg_base = 1, + .resindex_fw_base = -1, + .irqindex_host_ipc = 0, + .sst_id = SST_DEV_ID_LYNX_POINT, + .dma_engine = SST_DMA_TYPE_DW, + .resindex_dma_base = SST_LPT_DSP_DMA_ADDR_OFFSET, + .dma_size = SST_LPT_DSP_DMA_SIZE, +}; + +static struct sst_acpi_desc bdw_acpi_desc = { + .drv_name = "haswell-pcm-audio", + .machines = snd_soc_acpi_intel_broadwell_machines, + .resindex_lpe_base = 0, + .resindex_pcicfg_base = 1, + .resindex_fw_base = -1, + .irqindex_host_ipc = 0, + .sst_id = SST_DEV_ID_WILDCAT_POINT, + .dma_engine = SST_DMA_TYPE_DW, + .resindex_dma_base = SST_WPT_DSP_DMA_ADDR_OFFSET, + .dma_size = SST_LPT_DSP_DMA_SIZE, +}; + +static const struct acpi_device_id hsw_acpi_ids[] = { + { "INT33C8", (unsigned long)&hsw_acpi_desc }, + { "INT3438", (unsigned long)&bdw_acpi_desc }, + { } +}; +MODULE_DEVICE_TABLE(acpi, hsw_acpi_ids); + +static struct platform_driver hsw_acpi_driver = { + .probe = sst_acpi_probe, + .remove = sst_acpi_remove, + .driver = { + .name = "hsw-acpi", + .acpi_match_table = ACPI_PTR(hsw_acpi_ids), + }, +}; +module_platform_driver(hsw_acpi_driver); + +MODULE_AUTHOR("Cezary Rojewski "); +MODULE_DESCRIPTION("Intel HSW loader on ACPI systems"); +MODULE_LICENSE("GPL v2"); From patchwork Thu Aug 22 19:04:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 11109899 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E572813A4 for ; Thu, 22 Aug 2019 19:21:51 +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 7B6C923400 for ; Thu, 22 Aug 2019 19:21:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="pkI56+MF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7B6C923400 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-devel-bounces@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 CB5FB1695; Thu, 22 Aug 2019 21:20:59 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CB5FB1695 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566501709; bh=54KtqtLJSSJBCpOP9tIZhJ79CMcGjDk1iLfXyqCcAV8=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=pkI56+MFWd0RnK+V/VIWpVddym7F/SaMz9m67C1HOh/+++qyigdYbjOje14OFMz6F mGN8xAIG8RY1kYUlmPCmhxdgzXkAfpvdIUx2JPWozmW0j2vp2ZNVrHjbrrOO7COLfZ aKOqM2FypLiRvBv3fHyNaR7l9X0EpthaTslEZaU0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2A8B7F807B6; Thu, 22 Aug 2019 21:06:41 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 11FECF80714; Thu, 22 Aug 2019 21:05:53 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 9480AF803F3 for ; Thu, 22 Aug 2019 21:05:21 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9480AF803F3 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 12:05:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,417,1559545200"; d="scan'208";a="203524523" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga004.fm.intel.com with ESMTP; 22 Aug 2019 12:05:17 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org Date: Thu, 22 Aug 2019 21:04:13 +0200 Message-Id: <20190822190425.23001-24-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190822190425.23001-1-cezary.rojewski@intel.com> References: <20190822190425.23001-1-cezary.rojewski@intel.com> Cc: lgirdwood@gmail.com, Cezary Rojewski , broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 23/35] ASoC: Intel: Baytrail: Define separate ACPI loader 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" With common acpi code exposed, separate Baytrail specific code from other legacy platforms. To reduce diff delta, it's still loaded with separate module called: byt-acpi. This may be address later, once heavy hitters are gone. Since this is the second of two, separation carries removal of common sst-acpi module with it. Signed-off-by: Cezary Rojewski --- sound/soc/intel/Kconfig | 8 ++-- sound/soc/intel/baytrail/Makefile | 2 + sound/soc/intel/baytrail/acpi.c | 43 +++++++++++++++++++++ sound/soc/intel/baytrail/sst-baytrail-dsp.c | 1 - sound/soc/intel/common/Makefile | 4 +- sound/soc/intel/common/sst-acpi.c | 36 ----------------- 6 files changed, 49 insertions(+), 45 deletions(-) create mode 100644 sound/soc/intel/baytrail/acpi.c diff --git a/sound/soc/intel/Kconfig b/sound/soc/intel/Kconfig index 9191773d203c..baab845ea0ef 100644 --- a/sound/soc/intel/Kconfig +++ b/sound/soc/intel/Kconfig @@ -35,11 +35,9 @@ config SND_SOC_INTEL_HASWELL_ACPI tristate # This option controls the ACPI-based on HSW/BDW platforms -config SND_SOC_INTEL_SST_ACPI +config SND_SOC_INTEL_BAYTRAIL_ACPI tristate - # This option controls ACPI-based probing on - # Haswell/Broadwell/Baytrail legacy and will be set - # when these platforms are enabled + # This option controls the ACPI-based on BYT platforms config SND_SOC_INTEL_SST tristate @@ -68,7 +66,7 @@ config SND_SOC_INTEL_BAYTRAIL tristate "Baytrail (legacy) Platforms" depends on DMADEVICES && ACPI && SND_SST_ATOM_HIFI2_PLATFORM=n select SND_SOC_INTEL_SST - select SND_SOC_INTEL_SST_ACPI + select SND_SOC_INTEL_BAYTRAIL_ACPI select SND_SOC_INTEL_SST_FIRMWARE select SND_SOC_ACPI_INTEL_MATCH help diff --git a/sound/soc/intel/baytrail/Makefile b/sound/soc/intel/baytrail/Makefile index 4d0806aac6bd..b59d4893b46b 100644 --- a/sound/soc/intel/baytrail/Makefile +++ b/sound/soc/intel/baytrail/Makefile @@ -1,5 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only snd-soc-sst-baytrail-pcm-objs := \ sst-baytrail-ipc.o sst-baytrail-pcm.o sst-baytrail-dsp.o +snd-soc-byt-acpi-objs := acpi.o obj-$(CONFIG_SND_SOC_INTEL_BAYTRAIL) += snd-soc-sst-baytrail-pcm.o +obj-$(CONFIG_SND_SOC_INTEL_BAYTRAIL_ACPI) += snd-soc-byt-acpi.o diff --git a/sound/soc/intel/baytrail/acpi.c b/sound/soc/intel/baytrail/acpi.c new file mode 100644 index 000000000000..57d10a6e3be2 --- /dev/null +++ b/sound/soc/intel/baytrail/acpi.c @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Intel BYT loader on ACPI systems + * + * Copyright (C) 2019, Intel Corporation. All rights reserved. + */ + +#include +#include +#include +#include +#include "../common/sst-dsp.h" + +static struct sst_acpi_desc byt_acpi_desc = { + .drv_name = "baytrail-pcm-audio", + .machines = snd_soc_acpi_intel_baytrail_legacy_machines, + .resindex_lpe_base = 0, + .resindex_pcicfg_base = 1, + .resindex_fw_base = 2, + .irqindex_host_ipc = 5, + .sst_id = SST_DEV_ID_BYT, + .resindex_dma_base = -1, +}; + +static const struct acpi_device_id byt_acpi_ids[] = { + { "80860F28", (unsigned long)&byt_acpi_desc }, + { } +}; +MODULE_DEVICE_TABLE(acpi, byt_acpi_ids); + +static struct platform_driver byt_acpi_driver = { + .probe = sst_acpi_probe, + .remove = sst_acpi_remove, + .driver = { + .name = "byt-acpi", + .acpi_match_table = ACPI_PTR(byt_acpi_ids), + }, +}; +module_platform_driver(byt_acpi_driver); + +MODULE_AUTHOR("Cezary Rojewski "); +MODULE_DESCRIPTION("Intel BYT loader on ACPI systems"); +MODULE_LICENSE("GPL v2"); diff --git a/sound/soc/intel/baytrail/sst-baytrail-dsp.c b/sound/soc/intel/baytrail/sst-baytrail-dsp.c index 4869e18116eb..81bc05d62d5d 100644 --- a/sound/soc/intel/baytrail/sst-baytrail-dsp.c +++ b/sound/soc/intel/baytrail/sst-baytrail-dsp.c @@ -13,7 +13,6 @@ #include #include #include - #include "../common/sst-dsp.h" #include "../common/sst-dsp-priv.h" #include "sst-baytrail-ipc.h" diff --git a/sound/soc/intel/common/Makefile b/sound/soc/intel/common/Makefile index 56c81e20b5bf..65e0e66ab64f 100644 --- a/sound/soc/intel/common/Makefile +++ b/sound/soc/intel/common/Makefile @@ -1,6 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -snd-soc-sst-dsp-objs := sst-dsp.o -snd-soc-sst-acpi-objs := sst-acpi.o +snd-soc-sst-dsp-objs := sst-dsp.o sst-acpi.o snd-soc-sst-ipc-objs := sst-ipc.o snd-soc-sst-firmware-objs := sst-firmware.o snd-soc-acpi-intel-match-objs := soc-acpi-intel-byt-match.o soc-acpi-intel-cht-match.o \ @@ -11,6 +10,5 @@ snd-soc-acpi-intel-match-objs := soc-acpi-intel-byt-match.o soc-acpi-intel-cht-m soc-acpi-intel-hda-match.o obj-$(CONFIG_SND_SOC_INTEL_SST) += snd-soc-sst-dsp.o snd-soc-sst-ipc.o -obj-$(CONFIG_SND_SOC_INTEL_SST_ACPI) += snd-soc-sst-acpi.o obj-$(CONFIG_SND_SOC_INTEL_SST_FIRMWARE) += snd-soc-sst-firmware.o obj-$(CONFIG_SND_SOC_ACPI_INTEL_MATCH) += snd-soc-acpi-intel-match.o diff --git a/sound/soc/intel/common/sst-acpi.c b/sound/soc/intel/common/sst-acpi.c index 7d2f04ff0479..8e75126106ea 100644 --- a/sound/soc/intel/common/sst-acpi.c +++ b/sound/soc/intel/common/sst-acpi.c @@ -13,7 +13,6 @@ #include "sst-dsp.h" #include -#include struct sst_acpi_priv { struct platform_device *pdev_mach; @@ -151,38 +150,3 @@ int sst_acpi_remove(struct platform_device *pdev) return 0; } EXPORT_SYMBOL_GPL(sst_acpi_remove); - -#if !IS_ENABLED(CONFIG_SND_SST_IPC_ACPI) -static struct sst_acpi_desc sst_acpi_baytrail_desc = { - .drv_name = "baytrail-pcm-audio", - .machines = snd_soc_acpi_intel_baytrail_legacy_machines, - .resindex_lpe_base = 0, - .resindex_pcicfg_base = 1, - .resindex_fw_base = 2, - .irqindex_host_ipc = 5, - .sst_id = SST_DEV_ID_BYT, - .resindex_dma_base = -1, -}; -#endif - -static const struct acpi_device_id sst_acpi_match[] = { -#if !IS_ENABLED(CONFIG_SND_SST_IPC_ACPI) - { "80860F28", (unsigned long)&sst_acpi_baytrail_desc }, -#endif - { } -}; -MODULE_DEVICE_TABLE(acpi, sst_acpi_match); - -static struct platform_driver sst_acpi_driver = { - .probe = sst_acpi_probe, - .remove = sst_acpi_remove, - .driver = { - .name = "sst-acpi", - .acpi_match_table = ACPI_PTR(sst_acpi_match), - }, -}; -module_platform_driver(sst_acpi_driver); - -MODULE_AUTHOR("Jarkko Nikula "); -MODULE_DESCRIPTION("Intel SST loader on ACPI systems"); -MODULE_LICENSE("GPL v2"); From patchwork Thu Aug 22 19:04:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 11109901 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 02C2B1399 for ; Thu, 22 Aug 2019 19:22:30 +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 8DD6223401 for ; Thu, 22 Aug 2019 19:22:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="fb1xTE0X" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8DD6223401 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-devel-bounces@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 DAAC6168A; Thu, 22 Aug 2019 21:21:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DAAC6168A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566501747; bh=EAlL93jB1MuZH4trMq5PzvuD6EIub+kc7ik4CcF4FLA=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=fb1xTE0XcaEZh2ush2cYKP56ImbGuJbzveIrLZ+QbUkBFst0Ua5moo26x60xNkkSK flF9j1inGScfOn9IeesgcK7EIOy2EL6dTjwCwgSwxz5u0WmuaYgLRgHorHbz7BRLDl R54KQ1F3ilVooe/WvEx0qxoGIClmoeHrr1hQ4dmU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 12A2FF807C3; Thu, 22 Aug 2019 21:06:46 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id C36B6F8070D; Thu, 22 Aug 2019 21:05:53 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 45291F8064C for ; Thu, 22 Aug 2019 21:05:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 45291F8064C X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 12:05:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,417,1559545200"; d="scan'208";a="203524536" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga004.fm.intel.com with ESMTP; 22 Aug 2019 12:05:19 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org Date: Thu, 22 Aug 2019 21:04:14 +0200 Message-Id: <20190822190425.23001-25-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190822190425.23001-1-cezary.rojewski@intel.com> References: <20190822190425.23001-1-cezary.rojewski@intel.com> Cc: lgirdwood@gmail.com, Cezary Rojewski , broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 24/35] ASoC: Intel: Refactor probing of ACPI devices 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Baytrail and Haswell ACPI loading is now separated and no longer clutters common code. Let's improve the loading procedure and remove some superfluous members. This change removes sst_pdata::resindex_dma_base as it is a duplication of dma_base. dma_base field has had it's type changed to allow for -1 (not used) value. ACPI descriptor: sst_acpi_desc loses machines field and sst_id - now accessed via sst_pdata::boards and sst_pdata::id respectively. Cleanup consists mainly of legacy platform-specific probe routines being provided for each descendant. Prevents code duplications, especially for HSW/ BDW case while not losing any readability. Signed-off-by: Cezary Rojewski --- sound/soc/intel/baytrail/acpi.c | 43 +++++++++++----- sound/soc/intel/common/sst-acpi.c | 21 +++----- sound/soc/intel/common/sst-dsp.h | 8 +-- sound/soc/intel/common/sst-firmware.c | 2 +- sound/soc/intel/haswell/acpi.c | 65 +++++++++++++++---------- sound/soc/intel/skylake/skl-sst-utils.c | 2 +- 6 files changed, 82 insertions(+), 59 deletions(-) diff --git a/sound/soc/intel/baytrail/acpi.c b/sound/soc/intel/baytrail/acpi.c index 57d10a6e3be2..bf2560a8f3e2 100644 --- a/sound/soc/intel/baytrail/acpi.c +++ b/sound/soc/intel/baytrail/acpi.c @@ -11,25 +11,46 @@ #include #include "../common/sst-dsp.h" -static struct sst_acpi_desc byt_acpi_desc = { - .drv_name = "baytrail-pcm-audio", - .machines = snd_soc_acpi_intel_baytrail_legacy_machines, - .resindex_lpe_base = 0, - .resindex_pcicfg_base = 1, - .resindex_fw_base = 2, - .irqindex_host_ipc = 5, - .sst_id = SST_DEV_ID_BYT, - .resindex_dma_base = -1, +static struct sst_pdata byt_desc = { + .id = SST_DEV_ID_BYT, + .fw_name = "intel/fw_sst_0f28.bin-48kHz_i2s_master", + .boards = snd_soc_acpi_intel_baytrail_legacy_machines, + .dma_base = -1, }; static const struct acpi_device_id byt_acpi_ids[] = { - { "80860F28", (unsigned long)&byt_acpi_desc }, + { "80860F28", (unsigned long)&byt_desc }, { } }; MODULE_DEVICE_TABLE(acpi, byt_acpi_ids); +static int byt_acpi_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct sst_acpi_desc *acpi_desc; + const struct acpi_device_id *id; + + id = acpi_match_device(dev->driver->acpi_match_table, dev); + if (!id) + return -ENODEV; + + acpi_desc = devm_kzalloc(dev, sizeof(*acpi_desc), GFP_KERNEL); + if (!acpi_desc) + return -ENOMEM; + + acpi_desc->drv_name = "baytrail-pcm-audio"; + acpi_desc->pdata = (struct sst_pdata *)id->driver_data; + acpi_desc->resindex_lpe_base = 0; + acpi_desc->resindex_pcicfg_base = 1; + acpi_desc->resindex_fw_base = 2; + acpi_desc->irqindex_host_ipc = 5; + platform_set_drvdata(pdev, acpi_desc); + + return sst_acpi_probe(pdev); +} + static struct platform_driver byt_acpi_driver = { - .probe = sst_acpi_probe, + .probe = byt_acpi_probe, .remove = sst_acpi_remove, .driver = { .name = "byt-acpi", diff --git a/sound/soc/intel/common/sst-acpi.c b/sound/soc/intel/common/sst-acpi.c index 8e75126106ea..53ac23f05966 100644 --- a/sound/soc/intel/common/sst-acpi.c +++ b/sound/soc/intel/common/sst-acpi.c @@ -17,7 +17,6 @@ struct sst_acpi_priv { struct platform_device *pdev_mach; struct platform_device *pdev_pcm; - struct sst_pdata sst_pdata; struct sst_acpi_desc *desc; struct snd_soc_acpi_mach *mach; }; @@ -27,8 +26,8 @@ static void sst_acpi_fw_cb(const struct firmware *fw, void *context) struct platform_device *pdev = context; struct device *dev = &pdev->dev; struct sst_acpi_priv *sst_acpi = platform_get_drvdata(pdev); - struct sst_pdata *sst_pdata = &sst_acpi->sst_pdata; struct sst_acpi_desc *desc = sst_acpi->desc; + struct sst_pdata *sst_pdata = desc->pdata; struct snd_soc_acpi_mach *mach = sst_acpi->mach; sst_pdata->fw = fw; @@ -51,7 +50,6 @@ static void sst_acpi_fw_cb(const struct firmware *fw, void *context) int sst_acpi_probe(struct platform_device *pdev) { - const struct acpi_device_id *id; struct device *dev = &pdev->dev; struct sst_acpi_priv *sst_acpi; struct sst_pdata *sst_pdata; @@ -64,27 +62,20 @@ int sst_acpi_probe(struct platform_device *pdev) if (sst_acpi == NULL) return -ENOMEM; - id = acpi_match_device(dev->driver->acpi_match_table, dev); - if (!id) - return -ENODEV; - - desc = (struct sst_acpi_desc *)id->driver_data; - mach = snd_soc_acpi_find_machine(desc->machines); + desc = platform_get_drvdata(pdev); + sst_pdata = desc->pdata; + mach = snd_soc_acpi_find_machine(sst_pdata->boards); if (mach == NULL) { dev_err(dev, "No matching ASoC machine driver found\n"); return -ENODEV; } - sst_pdata = &sst_acpi->sst_pdata; - sst_pdata->id = desc->sst_id; sst_pdata->dma_dev = dev; sst_acpi->desc = desc; sst_acpi->mach = mach; - sst_pdata->resindex_dma_base = desc->resindex_dma_base; - if (desc->resindex_dma_base >= 0) { + if (sst_pdata->dma_base >= 0) { sst_pdata->dma_engine = desc->dma_engine; - sst_pdata->dma_base = desc->resindex_dma_base; sst_pdata->dma_size = desc->dma_size; } @@ -140,7 +131,7 @@ EXPORT_SYMBOL_GPL(sst_acpi_probe); int sst_acpi_remove(struct platform_device *pdev) { struct sst_acpi_priv *sst_acpi = platform_get_drvdata(pdev); - struct sst_pdata *sst_pdata = &sst_acpi->sst_pdata; + struct sst_pdata *sst_pdata = sst_acpi->desc->pdata; platform_device_unregister(sst_acpi->pdev_mach); if (!IS_ERR_OR_NULL(sst_acpi->pdev_pcm)) diff --git a/sound/soc/intel/common/sst-dsp.h b/sound/soc/intel/common/sst-dsp.h index a2ac7998fbdb..87d39b0e79c0 100644 --- a/sound/soc/intel/common/sst-dsp.h +++ b/sound/soc/intel/common/sst-dsp.h @@ -171,16 +171,13 @@ struct platform_device; /* Descriptor for setting up SST platform data */ struct sst_acpi_desc { const char *drv_name; - struct snd_soc_acpi_mach *machines; + struct sst_pdata *pdata; /* Platform resource indexes. Must set to -1 if not used */ int resindex_lpe_base; int resindex_pcicfg_base; int resindex_fw_base; int irqindex_host_ipc; int resindex_dma_base; - /* Unique number identifying the SST core on platform */ - int sst_id; - /* DMA only valid when resindex_dma_base != -1*/ int dma_engine; int dma_size; }; @@ -205,8 +202,7 @@ struct sst_pdata { const struct firmware *fw; /* DMA */ - int resindex_dma_base; /* other fields invalid if equals to -1 */ - u32 dma_base; + int dma_base; /* other fields invalid if equals to -1 */ u32 dma_size; int dma_engine; struct device *dma_dev; diff --git a/sound/soc/intel/common/sst-firmware.c b/sound/soc/intel/common/sst-firmware.c index 6b6af11c32c3..61d3e6e46b98 100644 --- a/sound/soc/intel/common/sst-firmware.c +++ b/sound/soc/intel/common/sst-firmware.c @@ -268,7 +268,7 @@ static int sst_dma_new(struct sst_dsp *sst) struct resource mem; int ret = 0; - if (sst->pdata->resindex_dma_base == -1) + if (sst->pdata->dma_base == -1) /* DMA is not used, return and squelsh error messages */ return 0; diff --git a/sound/soc/intel/haswell/acpi.c b/sound/soc/intel/haswell/acpi.c index 7bd8b03851c4..3c49ec257e56 100644 --- a/sound/soc/intel/haswell/acpi.c +++ b/sound/soc/intel/haswell/acpi.c @@ -15,41 +15,56 @@ #define SST_WPT_DSP_DMA_ADDR_OFFSET 0x0FE000 #define SST_LPT_DSP_DMA_SIZE (1024 - 1) -static struct sst_acpi_desc hsw_acpi_desc = { - .drv_name = "haswell-pcm-audio", - .machines = snd_soc_acpi_intel_haswell_machines, - .resindex_lpe_base = 0, - .resindex_pcicfg_base = 1, - .resindex_fw_base = -1, - .irqindex_host_ipc = 0, - .sst_id = SST_DEV_ID_LYNX_POINT, - .dma_engine = SST_DMA_TYPE_DW, - .resindex_dma_base = SST_LPT_DSP_DMA_ADDR_OFFSET, - .dma_size = SST_LPT_DSP_DMA_SIZE, +static struct sst_pdata hsw_desc = { + .id = SST_DEV_ID_LYNX_POINT, + .fw_name = "intel/IntcSST1.bin", + .boards = snd_soc_acpi_intel_haswell_machines, + .dma_base = SST_LPT_DSP_DMA_ADDR_OFFSET, }; -static struct sst_acpi_desc bdw_acpi_desc = { - .drv_name = "haswell-pcm-audio", - .machines = snd_soc_acpi_intel_broadwell_machines, - .resindex_lpe_base = 0, - .resindex_pcicfg_base = 1, - .resindex_fw_base = -1, - .irqindex_host_ipc = 0, - .sst_id = SST_DEV_ID_WILDCAT_POINT, - .dma_engine = SST_DMA_TYPE_DW, - .resindex_dma_base = SST_WPT_DSP_DMA_ADDR_OFFSET, - .dma_size = SST_LPT_DSP_DMA_SIZE, +static struct sst_pdata bdw_desc = { + .id = SST_DEV_ID_WILDCAT_POINT, + .fw_name = "intel/IntcSST2.bin", + .boards = snd_soc_acpi_intel_broadwell_machines, + .dma_base = SST_WPT_DSP_DMA_ADDR_OFFSET, }; static const struct acpi_device_id hsw_acpi_ids[] = { - { "INT33C8", (unsigned long)&hsw_acpi_desc }, - { "INT3438", (unsigned long)&bdw_acpi_desc }, + { "INT33C8", (unsigned long)&hsw_desc }, + { "INT3438", (unsigned long)&bdw_desc }, { } }; MODULE_DEVICE_TABLE(acpi, hsw_acpi_ids); +static int hsw_acpi_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct sst_acpi_desc *acpi_desc; + const struct acpi_device_id *id; + + id = acpi_match_device(dev->driver->acpi_match_table, dev); + if (!id) + return -ENODEV; + + acpi_desc = devm_kzalloc(dev, sizeof(*acpi_desc), GFP_KERNEL); + if (!acpi_desc) + return -ENOMEM; + + acpi_desc->drv_name = "haswell-pcm-audio"; + acpi_desc->pdata = (struct sst_pdata *)id->driver_data; + acpi_desc->resindex_lpe_base = 0; + acpi_desc->resindex_pcicfg_base = 1; + acpi_desc->resindex_fw_base = -1; + acpi_desc->irqindex_host_ipc = 0; + acpi_desc->dma_engine = SST_DMA_TYPE_DW; + acpi_desc->dma_size = SST_LPT_DSP_DMA_SIZE; + platform_set_drvdata(pdev, acpi_desc); + + return sst_acpi_probe(pdev); +} + static struct platform_driver hsw_acpi_driver = { - .probe = sst_acpi_probe, + .probe = hsw_acpi_probe, .remove = sst_acpi_remove, .driver = { .name = "hsw-acpi", diff --git a/sound/soc/intel/skylake/skl-sst-utils.c b/sound/soc/intel/skylake/skl-sst-utils.c index bbe67e298efe..ac0a0e4c2d68 100644 --- a/sound/soc/intel/skylake/skl-sst-utils.c +++ b/sound/soc/intel/skylake/skl-sst-utils.c @@ -363,7 +363,7 @@ int skl_sst_ctx_init(struct device *dev, int irq, const char *fw_name, pdata->id = skl->pci->device; pdata->irq = irq; - pdata->resindex_dma_base = -1; + pdata->dma_base = -1; skl->dev = dev; pdata->dsp = skl; INIT_LIST_HEAD(&skl->uuid_list); From patchwork Thu Aug 22 19:04:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 11109905 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4EB681399 for ; Thu, 22 Aug 2019 19:23:11 +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 DA19E23404 for ; Thu, 22 Aug 2019 19:23:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="PebaW8kR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DA19E23404 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-devel-bounces@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 1FAF61669; Thu, 22 Aug 2019 21:22:19 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1FAF61669 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566501789; bh=c1vDNIxr8lOirTn12nsDzLaeqWCETth9eOSDLsZaUS8=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=PebaW8kRWUbXzHrIUMD+BsX02VRt3RnxJ5podpm1d+RYrV+pedY37r+NrnBvkMpBn kxbzAxmaSn8Ansk7IrVmPDNHCNkFfOQUeu92zO7dn5LK9+r0fop21nNWPg9ayhA9m+ xaXc5xretsVKq8q39I29lxlwAG8EqxIhW8eETN44= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id DE44FF8085B; Thu, 22 Aug 2019 21:06:47 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id DAF07F80714; Thu, 22 Aug 2019 21:05:58 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 A59E1F8065A for ; Thu, 22 Aug 2019 21:05:23 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A59E1F8065A X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 12:05:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,417,1559545200"; d="scan'208";a="203524549" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga004.fm.intel.com with ESMTP; 22 Aug 2019 12:05:21 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org Date: Thu, 22 Aug 2019 21:04:15 +0200 Message-Id: <20190822190425.23001-26-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190822190425.23001-1-cezary.rojewski@intel.com> References: <20190822190425.23001-1-cezary.rojewski@intel.com> Cc: lgirdwood@gmail.com, Cezary Rojewski , broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 25/35] ASoC: Intel: Skylake: Simplify skl_sst_ctx_init declaration 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" 'irq' and 'dsp' are redundant parameters of skl_sst_ctx_init. Simplify its declaration and update each invokes. This yet another step In quest for simplification of Skylake initialization process. Signed-off-by: Cezary Rojewski --- sound/soc/intel/skylake/bxt-sst.c | 4 ++-- sound/soc/intel/skylake/cnl-sst.c | 4 ++-- sound/soc/intel/skylake/skl-sst-dsp.h | 3 +-- sound/soc/intel/skylake/skl-sst-utils.c | 18 +++++++----------- sound/soc/intel/skylake/skl-sst.c | 4 ++-- sound/soc/intel/skylake/skl.c | 1 + 6 files changed, 15 insertions(+), 19 deletions(-) diff --git a/sound/soc/intel/skylake/bxt-sst.c b/sound/soc/intel/skylake/bxt-sst.c index 5b46215fbc0f..e72cd63eb113 100644 --- a/sound/soc/intel/skylake/bxt-sst.c +++ b/sound/soc/intel/skylake/bxt-sst.c @@ -552,13 +552,13 @@ int bxt_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, struct sst_dsp *sst; int ret; - ret = skl_sst_ctx_init(dev, irq, fw_name, dsp, &skl_dev); + skl = *dsp; + ret = skl_sst_ctx_init(skl, fw_name, &skl_dev); if (ret < 0) { dev_err(dev, "%s: no device\n", __func__); return ret; } - skl = *dsp; sst = skl->dsp; sst->fw_ops = bxt_fw_ops; sst->addr.lpe = mmio_base; diff --git a/sound/soc/intel/skylake/cnl-sst.c b/sound/soc/intel/skylake/cnl-sst.c index 47b991c03742..93b98281083c 100644 --- a/sound/soc/intel/skylake/cnl-sst.c +++ b/sound/soc/intel/skylake/cnl-sst.c @@ -429,13 +429,13 @@ int cnl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, struct sst_dsp *sst; int ret; - ret = skl_sst_ctx_init(dev, irq, fw_name, dsp, &cnl_dev); + cnl = *dsp; + ret = skl_sst_ctx_init(cnl, fw_name, &cnl_dev); if (ret < 0) { dev_err(dev, "%s: no device\n", __func__); return ret; } - cnl = *dsp; sst = cnl->dsp; sst->fw_ops = cnl_fw_ops; sst->addr.lpe = mmio_base; diff --git a/sound/soc/intel/skylake/skl-sst-dsp.h b/sound/soc/intel/skylake/skl-sst-dsp.h index 3c92b1d849e4..e14d76ed0100 100644 --- a/sound/soc/intel/skylake/skl-sst-dsp.h +++ b/sound/soc/intel/skylake/skl-sst-dsp.h @@ -225,8 +225,7 @@ int skl_dsp_strip_extended_manifest(struct firmware *fw); void skl_dsp_set_astate_cfg(struct skl_dev *skl, u32 cnt, void *data); -int skl_sst_ctx_init(struct device *dev, int irq, const char *fw_name, - struct skl_dev **dsp, +int skl_sst_ctx_init(struct skl_dev *skl, const char *fw_name, struct sst_pdata *pdata); int skl_prepare_lib_load(struct skl_dev *skl, struct skl_lib_info *linfo, struct firmware *stripped_fw, diff --git a/sound/soc/intel/skylake/skl-sst-utils.c b/sound/soc/intel/skylake/skl-sst-utils.c index ac0a0e4c2d68..a4ad213d34e0 100644 --- a/sound/soc/intel/skylake/skl-sst-utils.c +++ b/sound/soc/intel/skylake/skl-sst-utils.c @@ -354,30 +354,26 @@ int skl_dsp_strip_extended_manifest(struct firmware *fw) return 0; } -int skl_sst_ctx_init(struct device *dev, int irq, const char *fw_name, - struct skl_dev **dsp, +int skl_sst_ctx_init(struct skl_dev *skl, const char *fw_name, struct sst_pdata *pdata) { - struct skl_dev *skl = *dsp; struct sst_dsp *sst; + struct device *dev = skl->dev; pdata->id = skl->pci->device; - pdata->irq = irq; + pdata->irq = skl->pci->irq; pdata->dma_base = -1; - skl->dev = dev; pdata->dsp = skl; INIT_LIST_HEAD(&skl->uuid_list); - skl->dsp = sst_dsp_new(dev, pdata); - if (!skl->dsp) { - dev_err(skl->dev, "%s: no device\n", __func__); + sst = sst_dsp_new(dev, pdata); + if (!sst) { + dev_err(dev, "%s: no device\n", __func__); return -ENODEV; } - sst = skl->dsp; + skl->dsp = sst; sst->fw_name = fw_name; init_waitqueue_head(&skl->mod_load_wait); - INIT_LIST_HEAD(&sst->module_list); - skl->is_first_boot = true; return 0; diff --git a/sound/soc/intel/skylake/skl-sst.c b/sound/soc/intel/skylake/skl-sst.c index c823936ffd34..f8aecd2ca8bb 100644 --- a/sound/soc/intel/skylake/skl-sst.c +++ b/sound/soc/intel/skylake/skl-sst.c @@ -523,13 +523,13 @@ int skl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, struct sst_dsp *sst; int ret; - ret = skl_sst_ctx_init(dev, irq, fw_name, dsp, &skl_dev); + skl = *dsp; + ret = skl_sst_ctx_init(skl, fw_name, &skl_dev); if (ret < 0) { dev_err(dev, "%s: no device\n", __func__); return ret; } - skl = *dsp; sst = skl->dsp; sst->addr.lpe = mmio_base; sst->addr.shim = mmio_base; diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c index 141dbbf975ac..54e1f957121d 100644 --- a/sound/soc/intel/skylake/skl.c +++ b/sound/soc/intel/skylake/skl.c @@ -890,6 +890,7 @@ static int skl_create(struct pci_dev *pci, snd_hdac_ext_bus_init(bus, &pci->dev, &bus_core_ops, ext_ops); bus->use_posbuf = 1; skl->pci = pci; + skl->dev = &pci->dev; INIT_WORK(&skl->probe_work, skl_probe_work); bus->bdl_pos_adj = 0; From patchwork Thu Aug 22 19:04:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 11109907 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EA2B913A4 for ; Thu, 22 Aug 2019 19:23:44 +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 7F1C923400 for ; Thu, 22 Aug 2019 19:23:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="CetsvB7P" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7F1C923400 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-devel-bounces@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 B687316A3; Thu, 22 Aug 2019 21:22:52 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B687316A3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566501822; bh=UvIagVZAOYwKB19MvbcVw5Dodx0e6vRTruxH8iFKTvw=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=CetsvB7P1iZInRmJljUTC0WfdAdF1DVdiIqEhwgcVKeTMEv3uXbYUuDZ2MDaTkjf7 zJOdFMh8tdfAMviAvriboK1naYCmkoSsnwNrfIu9fKIP0g679I/br4KHQf7fmM29zV VJhQdNrgG9Yz2NaiRYHP2FuxhWFCrX8pN7Ca6EtM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 0FC85F80863; Thu, 22 Aug 2019 21:06:50 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0CDB1F80715; Thu, 22 Aug 2019 21:05:59 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 35BADF8065B for ; Thu, 22 Aug 2019 21:05:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 35BADF8065B X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 12:05:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,417,1559545200"; d="scan'208";a="203524560" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga004.fm.intel.com with ESMTP; 22 Aug 2019 12:05:23 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org Date: Thu, 22 Aug 2019 21:04:16 +0200 Message-Id: <20190822190425.23001-27-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190822190425.23001-1-cezary.rojewski@intel.com> References: <20190822190425.23001-1-cezary.rojewski@intel.com> Cc: lgirdwood@gmail.com, Cezary Rojewski , broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 26/35] ASoC: Intel: Skylake: Simplify all sst_dsp_init declarations 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" SST initializers for Skylake, Apollolake and Cannonlake descendants have many redundant parameters within their declaration. Simplify them. Currently, this involves duplication the PCI ioremap code. This will be addresses on a later note, but is needed to keep SSTs sane during initialization overhaul. Signed-off-by: Cezary Rojewski --- sound/soc/intel/skylake/bxt-sst.c | 19 +++++++++---------- sound/soc/intel/skylake/cnl-sst-dsp.h | 3 +-- sound/soc/intel/skylake/cnl-sst.c | 19 +++++++++---------- sound/soc/intel/skylake/skl-messages.c | 26 ++++---------------------- sound/soc/intel/skylake/skl-sst-dsp.h | 6 ++---- sound/soc/intel/skylake/skl-sst.c | 22 ++++++++++------------ sound/soc/intel/skylake/skl.h | 5 ++--- 7 files changed, 37 insertions(+), 63 deletions(-) diff --git a/sound/soc/intel/skylake/bxt-sst.c b/sound/soc/intel/skylake/bxt-sst.c index e72cd63eb113..a547fb84eee9 100644 --- a/sound/soc/intel/skylake/bxt-sst.c +++ b/sound/soc/intel/skylake/bxt-sst.c @@ -545,30 +545,29 @@ static struct sst_pdata skl_dev = { .ops = &skl_ops, }; -int bxt_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, - const char *fw_name, struct skl_dev **dsp) +int bxt_sst_dsp_init(struct skl_dev *skl, const char *fw_name) { - struct skl_dev *skl; struct sst_dsp *sst; + void __iomem *mmio; int ret; - skl = *dsp; ret = skl_sst_ctx_init(skl, fw_name, &skl_dev); - if (ret < 0) { - dev_err(dev, "%s: no device\n", __func__); + if (ret) return ret; - } sst = skl->dsp; sst->fw_ops = bxt_fw_ops; - sst->addr.lpe = mmio_base; - sst->addr.shim = mmio_base; + mmio = pci_ioremap_bar(skl->pci, 4); + if (!mmio) + return -ENXIO; + sst->addr.lpe = mmio; + sst->addr.shim = mmio; sst_dsp_mailbox_init(sst, (BXT_ADSP_SRAM0_BASE + SKL_FW_REGS_SIZE), SKL_MAILBOX_SIZE, BXT_ADSP_SRAM1_BASE, SKL_MAILBOX_SIZE); - ret = skl_ipc_init(dev, skl); + ret = skl_ipc_init(skl->dev, skl); if (ret) { skl_dsp_free(sst); return ret; diff --git a/sound/soc/intel/skylake/cnl-sst-dsp.h b/sound/soc/intel/skylake/cnl-sst-dsp.h index a465cc42b7e8..02e070fae2ce 100644 --- a/sound/soc/intel/skylake/cnl-sst-dsp.h +++ b/sound/soc/intel/skylake/cnl-sst-dsp.h @@ -87,7 +87,6 @@ void cnl_ipc_op_int_enable(struct sst_dsp *ctx); void cnl_ipc_op_int_disable(struct sst_dsp *ctx); bool cnl_ipc_int_status(struct sst_dsp *ctx); -int cnl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, - const char *fw_name, struct skl_dev **dsp); +int cnl_sst_dsp_init(struct skl_dev *skl, const char *fw_name); #endif /*__CNL_SST_DSP_H__*/ diff --git a/sound/soc/intel/skylake/cnl-sst.c b/sound/soc/intel/skylake/cnl-sst.c index 93b98281083c..5be0a8eb154d 100644 --- a/sound/soc/intel/skylake/cnl-sst.c +++ b/sound/soc/intel/skylake/cnl-sst.c @@ -422,30 +422,29 @@ static struct sst_pdata cnl_dev = { .ops = &cnl_ops, }; -int cnl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, - const char *fw_name, struct skl_dev **dsp) +int cnl_sst_dsp_init(struct skl_dev *cnl, const char *fw_name) { - struct skl_dev *cnl; struct sst_dsp *sst; + void __iomem *mmio; int ret; - cnl = *dsp; ret = skl_sst_ctx_init(cnl, fw_name, &cnl_dev); - if (ret < 0) { - dev_err(dev, "%s: no device\n", __func__); + if (ret < 0) return ret; - } sst = cnl->dsp; sst->fw_ops = cnl_fw_ops; - sst->addr.lpe = mmio_base; - sst->addr.shim = mmio_base; + mmio = pci_ioremap_bar(cnl->pci, 4); + if (!mmio) + return -ENXIO; + sst->addr.lpe = mmio; + sst->addr.shim = mmio; sst_dsp_mailbox_init(sst, (CNL_ADSP_SRAM0_BASE + SKL_FW_REGS_SIZE), SKL_MAILBOX_SIZE, CNL_ADSP_SRAM1_BASE, SKL_MAILBOX_SIZE); - ret = cnl_ipc_init(dev, cnl); + ret = cnl_ipc_init(cnl->dev, cnl); if (ret) { skl_dsp_free(sst); return ret; diff --git a/sound/soc/intel/skylake/skl-messages.c b/sound/soc/intel/skylake/skl-messages.c index 6fbceec67b53..8c352255ff45 100644 --- a/sound/soc/intel/skylake/skl-messages.c +++ b/sound/soc/intel/skylake/skl-messages.c @@ -189,9 +189,7 @@ const struct skl_dsp_ops *skl_get_dsp_ops(int pci_id) int skl_init_dsp(struct skl_dev *skl) { - void __iomem *mmio_base; struct hdac_bus *bus = skl_to_bus(skl); - int irq = bus->irq; const struct skl_dsp_ops *ops; int ret; @@ -199,34 +197,18 @@ int skl_init_dsp(struct skl_dev *skl) snd_hdac_ext_bus_ppcap_enable(bus, true); snd_hdac_ext_bus_ppcap_int_enable(bus, true); - /* read the BAR of the ADSP MMIO */ - mmio_base = pci_ioremap_bar(skl->pci, 4); - if (mmio_base == NULL) { - dev_err(bus->dev, "ioremap error\n"); - return -ENXIO; - } - ops = skl_get_dsp_ops(skl->pci->device); - if (!ops) { - ret = -EIO; - goto unmap_mmio; - } - - ret = ops->init(bus->dev, mmio_base, irq, - skl->fw_name, &skl); + if (!ops) + return -EIO; + ret = ops->init(skl, skl->fw_name); if (ret < 0) - goto unmap_mmio; + return ret; skl->dsp_ops = ops; dev_dbg(bus->dev, "dsp registration status=%d\n", ret); return 0; - -unmap_mmio: - iounmap(mmio_base); - - return ret; } int skl_free_dsp(struct skl_dev *skl) diff --git a/sound/soc/intel/skylake/skl-sst-dsp.h b/sound/soc/intel/skylake/skl-sst-dsp.h index e14d76ed0100..b647e60d7a6d 100644 --- a/sound/soc/intel/skylake/skl-sst-dsp.h +++ b/sound/soc/intel/skylake/skl-sst-dsp.h @@ -206,10 +206,8 @@ int skl_dsp_get_core(struct sst_dsp *ctx, unsigned int core_id); int skl_dsp_put_core(struct sst_dsp *ctx, unsigned int core_id); int skl_dsp_boot(struct sst_dsp *ctx); -int skl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, - const char *fw_name, struct skl_dev **dsp); -int bxt_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, - const char *fw_name, struct skl_dev **dsp); +int skl_sst_dsp_init(struct skl_dev *skl, const char *fw_name); +int bxt_sst_dsp_init(struct skl_dev *skl, const char *fw_name); int bxt_load_library(struct sst_dsp *ctx, struct skl_lib_info *linfo, int lib_count); diff --git a/sound/soc/intel/skylake/skl-sst.c b/sound/soc/intel/skylake/skl-sst.c index f8aecd2ca8bb..8ae7fe73534e 100644 --- a/sound/soc/intel/skylake/skl-sst.c +++ b/sound/soc/intel/skylake/skl-sst.c @@ -516,36 +516,34 @@ static struct sst_pdata skl_dev = { .ops = &skl_ops, }; -int skl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, - const char *fw_name, struct skl_dev **dsp) +int skl_sst_dsp_init(struct skl_dev *skl, const char *fw_name) { - struct skl_dev *skl; struct sst_dsp *sst; + void __iomem *mmio; int ret; - skl = *dsp; ret = skl_sst_ctx_init(skl, fw_name, &skl_dev); - if (ret < 0) { - dev_err(dev, "%s: no device\n", __func__); + if (ret < 0) return ret; - } sst = skl->dsp; - sst->addr.lpe = mmio_base; - sst->addr.shim = mmio_base; + sst->fw_ops = skl_fw_ops; + mmio = pci_ioremap_bar(skl->pci, 4); + if (!mmio) + return -ENXIO; + sst->addr.lpe = mmio; + sst->addr.shim = mmio; sst_dsp_mailbox_init(sst, (SKL_ADSP_SRAM0_BASE + SKL_FW_REGS_SIZE), SKL_MAILBOX_SIZE, SKL_ADSP_SRAM1_BASE, SKL_MAILBOX_SIZE); - ret = skl_ipc_init(dev, skl); + ret = skl_ipc_init(skl->dev, skl); if (ret) { skl_dsp_free(sst); return ret; } - sst->fw_ops = skl_fw_ops; - return 0; } EXPORT_SYMBOL_GPL(skl_sst_dsp_init); diff --git a/sound/soc/intel/skylake/skl.h b/sound/soc/intel/skylake/skl.h index beeef67cb55f..9f5aa53df9f8 100644 --- a/sound/soc/intel/skylake/skl.h +++ b/sound/soc/intel/skylake/skl.h @@ -12,6 +12,7 @@ #ifndef __SOUND_SOC_SKL_H #define __SOUND_SOC_SKL_H +#include #include #include #include @@ -155,9 +156,7 @@ struct skl_machine_pdata { struct skl_dsp_ops { int id; - int (*init)(struct device *dev, void __iomem *mmio_base, - int irq, const char *fw_name, - struct skl_dev **skl_sst); + int (*init)(struct skl_dev *skl, const char *fw_name); }; int skl_platform_unregister(struct device *dev); From patchwork Thu Aug 22 19:04:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 11109909 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 38A8D1399 for ; Thu, 22 Aug 2019 19:24:51 +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 C2C0123400 for ; Thu, 22 Aug 2019 19:24:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="SxiUTEjk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C2C0123400 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-devel-bounces@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 E2C6F1688; Thu, 22 Aug 2019 21:23:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E2C6F1688 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566501889; bh=vRXzNXTRHf85IOE0wRs9Ba+m2+KtVG684uY4ObBDfwo=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=SxiUTEjkVqZMRmn5c+4PtY/Mh0eINjNNBYR4jkQ+m/PB87sYoLgory/SEG83+xQck 9yTJrTUyt2XCESsM7Pvhpo0tdbYpAcql6WssCxAswJa3eSBciwYiNQoWaVacMKW3G5 2lAD0ujohF+dEjibuWpsjbN1t3q/tJDNv2vfaRXA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E9679F80C08; Thu, 22 Aug 2019 21:06:53 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 17432F80715; Thu, 22 Aug 2019 21:06:04 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 17329F8036D for ; Thu, 22 Aug 2019 21:05:25 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 17329F8036D X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 12:05:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,417,1559545200"; d="scan'208";a="203524575" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga004.fm.intel.com with ESMTP; 22 Aug 2019 12:05:24 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org Date: Thu, 22 Aug 2019 21:04:17 +0200 Message-Id: <20190822190425.23001-28-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190822190425.23001-1-cezary.rojewski@intel.com> References: <20190822190425.23001-1-cezary.rojewski@intel.com> Cc: lgirdwood@gmail.com, Cezary Rojewski , broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 27/35] ASoC: Intel: Skylake: Define platform descriptors 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Make use of sst_pdata and declare platform descriptors for all existing cAVS platforms. Each carries information about base_fw filename, platform specific operations and boards supported. Signed-off-by: Cezary Rojewski --- sound/soc/intel/skylake/bxt-sst.c | 4 ++-- sound/soc/intel/skylake/cnl-sst.c | 4 ++-- sound/soc/intel/skylake/skl-sst.c | 4 ++-- sound/soc/intel/skylake/skl.c | 38 ++++++++++++++++++++++++++++++- sound/soc/intel/skylake/skl.h | 3 +++ 5 files changed, 46 insertions(+), 7 deletions(-) diff --git a/sound/soc/intel/skylake/bxt-sst.c b/sound/soc/intel/skylake/bxt-sst.c index a547fb84eee9..06da822790a5 100644 --- a/sound/soc/intel/skylake/bxt-sst.c +++ b/sound/soc/intel/skylake/bxt-sst.c @@ -531,7 +531,7 @@ static const struct skl_dsp_fw_ops bxt_fw_ops = { .load_library = bxt_load_library, }; -static struct sst_ops skl_ops = { +struct sst_ops apl_sst_ops = { .irq_handler = skl_dsp_sst_interrupt, .thread_fn = skl_dsp_irq_thread_handler, .write = sst_shim32_write, @@ -542,7 +542,7 @@ static struct sst_ops skl_ops = { }; static struct sst_pdata skl_dev = { - .ops = &skl_ops, + .ops = &apl_sst_ops, }; int bxt_sst_dsp_init(struct skl_dev *skl, const char *fw_name) diff --git a/sound/soc/intel/skylake/cnl-sst.c b/sound/soc/intel/skylake/cnl-sst.c index 5be0a8eb154d..c4dbf6655097 100644 --- a/sound/soc/intel/skylake/cnl-sst.c +++ b/sound/soc/intel/skylake/cnl-sst.c @@ -408,7 +408,7 @@ static int cnl_ipc_init(struct device *dev, struct skl_dev *cnl) return 0; } -static struct sst_ops cnl_ops = { +struct sst_ops cnl_sst_ops = { .irq_handler = cnl_dsp_sst_interrupt, .thread_fn = cnl_dsp_irq_thread_handler, .write = sst_shim32_write, @@ -419,7 +419,7 @@ static struct sst_ops cnl_ops = { }; static struct sst_pdata cnl_dev = { - .ops = &cnl_ops, + .ops = &cnl_sst_ops, }; int cnl_sst_dsp_init(struct skl_dev *cnl, const char *fw_name) diff --git a/sound/soc/intel/skylake/skl-sst.c b/sound/soc/intel/skylake/skl-sst.c index 8ae7fe73534e..122c07290440 100644 --- a/sound/soc/intel/skylake/skl-sst.c +++ b/sound/soc/intel/skylake/skl-sst.c @@ -503,7 +503,7 @@ static const struct skl_dsp_fw_ops skl_fw_ops = { .unload_mod = skl_unload_module, }; -static struct sst_ops skl_ops = { +struct sst_ops skl_sst_ops = { .irq_handler = skl_dsp_sst_interrupt, .write = sst_shim32_write, .read = sst_shim32_read, @@ -513,7 +513,7 @@ static struct sst_ops skl_ops = { }; static struct sst_pdata skl_dev = { - .ops = &skl_ops, + .ops = &skl_sst_ops, }; int skl_sst_dsp_init(struct skl_dev *skl, const char *fw_name) diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c index 54e1f957121d..d6d099aba834 100644 --- a/sound/soc/intel/skylake/skl.c +++ b/sound/soc/intel/skylake/skl.c @@ -27,6 +27,7 @@ #include #include #include +#include "../common/sst-dsp.h" #include "skl.h" #include "skl-sst-dsp.h" #include "skl-sst-ipc.h" @@ -1063,7 +1064,6 @@ static int skl_probe(struct pci_dev *pci, pci_set_drvdata(skl->pci, bus); - err = skl_find_machine(skl, (void *)pci_id->driver_data); if (err < 0) { dev_err(bus->dev, "skl_find_machine failed with err: %d\n", err); @@ -1153,6 +1153,42 @@ static void skl_remove(struct pci_dev *pci) dev_set_drvdata(&pci->dev, NULL); } +static struct sst_pdata skl_desc = { + .fw_name = "intel/dsp_fw_release.bin", + .ops = &skl_sst_ops, + .boards = snd_soc_acpi_intel_skl_machines, +}; + +static struct sst_pdata kbl_desc = { + .fw_name = "intel/dsp_fw_kbl.bin", + .ops = &skl_sst_ops, + .boards = snd_soc_acpi_intel_kbl_machines, +}; + +static struct sst_pdata apl_desc = { + .fw_name = "intel/dsp_fw_bxtn.bin", + .ops = &apl_sst_ops, + .boards = snd_soc_acpi_intel_bxt_machines, +}; + +static struct sst_pdata glk_desc = { + .fw_name = "intel/dsp_fw_glk.bin", + .ops = &apl_sst_ops, + .boards = snd_soc_acpi_intel_glk_machines, +}; + +static struct sst_pdata cnl_desc = { + .fw_name = "intel/dsp_fw_cnl.bin", + .ops = &cnl_sst_ops, + .boards = snd_soc_acpi_intel_cnl_machines, +}; + +static struct sst_pdata icl_desc = { + .fw_name = "intel/dsp_fw_icl.bin", + .ops = &cnl_sst_ops, + .boards = snd_soc_acpi_intel_icl_machines, +}; + /* PCI IDs */ static const struct pci_device_id skl_ids[] = { #if IS_ENABLED(CONFIG_SND_SOC_INTEL_SKL) diff --git a/sound/soc/intel/skylake/skl.h b/sound/soc/intel/skylake/skl.h index 9f5aa53df9f8..2f2b5a141abf 100644 --- a/sound/soc/intel/skylake/skl.h +++ b/sound/soc/intel/skylake/skl.h @@ -42,6 +42,9 @@ #define AZX_REG_VS_EM2_L1SEN BIT(13) struct skl_debug; +extern struct sst_ops skl_sst_ops; +extern struct sst_ops apl_sst_ops; +extern struct sst_ops cnl_sst_ops; struct skl_astate_param { u32 kcps; From patchwork Thu Aug 22 19:04:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 11109921 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8AD911399 for ; Thu, 22 Aug 2019 19:25:24 +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 20F7C23405 for ; Thu, 22 Aug 2019 19:25:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="ICTPam2U" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 20F7C23405 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-devel-bounces@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 55379169F; Thu, 22 Aug 2019 21:24:32 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 55379169F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566501922; bh=wgHcNYS00F594e5+X7PvGG3Xl2y63nxglVuaSLPpvzE=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=ICTPam2UQDmW6DNN+bCT5RScMGVq5fopN9M7UTD0aKksQjDoASend9XEaxlEr86sn Uwr9Tn7LWOJ1mrKxETb99yM63JTkFa5zBoVjEPv83zAeIoc0cehzSfWkKjrYE791pA 4LQ4gOF7jv3aRwhjIQ45Ir9rvdfubYe3tvYyWQeY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 600B6F80C17; Thu, 22 Aug 2019 21:06:55 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6A190F8071D; Thu, 22 Aug 2019 21:06:06 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 65366F80671 for ; Thu, 22 Aug 2019 21:05:27 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 65366F80671 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 12:05:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,417,1559545200"; d="scan'208";a="203524585" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga004.fm.intel.com with ESMTP; 22 Aug 2019 12:05:26 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org Date: Thu, 22 Aug 2019 21:04:18 +0200 Message-Id: <20190822190425.23001-29-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190822190425.23001-1-cezary.rojewski@intel.com> References: <20190822190425.23001-1-cezary.rojewski@intel.com> Cc: lgirdwood@gmail.com, Cezary Rojewski , broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 28/35] ASoC: Intel: Skylake: Update skl_ids table 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" With platform descriptors defined, update PCI ID table together with skl_probe to retrieve supported boards from saved sst_pdata objects instead. Signed-off-by: Cezary Rojewski --- sound/soc/intel/skylake/skl.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c index d6d099aba834..53a6befd5d68 100644 --- a/sound/soc/intel/skylake/skl.c +++ b/sound/soc/intel/skylake/skl.c @@ -985,6 +985,7 @@ static int skl_probe(struct pci_dev *pci, { struct skl_dev *skl; struct hdac_bus *bus = NULL; + struct sst_pdata *desc; int err; switch (skl_pci_binding) { @@ -1064,7 +1065,8 @@ static int skl_probe(struct pci_dev *pci, pci_set_drvdata(skl->pci, bus); - err = skl_find_machine(skl, (void *)pci_id->driver_data); + desc = (struct sst_pdata *)pci_id->driver_data; + err = skl_find_machine(skl, desc->boards); if (err < 0) { dev_err(bus->dev, "skl_find_machine failed with err: %d\n", err); goto out_nhlt_free; @@ -1194,42 +1196,42 @@ static const struct pci_device_id skl_ids[] = { #if IS_ENABLED(CONFIG_SND_SOC_INTEL_SKL) /* Sunrise Point-LP */ { PCI_DEVICE(0x8086, 0x9d70), - .driver_data = (unsigned long)&snd_soc_acpi_intel_skl_machines}, + .driver_data = (unsigned long)&skl_desc }, #endif #if IS_ENABLED(CONFIG_SND_SOC_INTEL_APL) /* BXT-P */ { PCI_DEVICE(0x8086, 0x5a98), - .driver_data = (unsigned long)&snd_soc_acpi_intel_bxt_machines}, + .driver_data = (unsigned long)&apl_desc }, #endif #if IS_ENABLED(CONFIG_SND_SOC_INTEL_KBL) /* KBL */ { PCI_DEVICE(0x8086, 0x9D71), - .driver_data = (unsigned long)&snd_soc_acpi_intel_kbl_machines}, + .driver_data = (unsigned long)&kbl_desc }, #endif #if IS_ENABLED(CONFIG_SND_SOC_INTEL_GLK) /* GLK */ { PCI_DEVICE(0x8086, 0x3198), - .driver_data = (unsigned long)&snd_soc_acpi_intel_glk_machines}, + .driver_data = (unsigned long)&glk_desc }, #endif #if IS_ENABLED(CONFIG_SND_SOC_INTEL_CNL) /* CNL */ { PCI_DEVICE(0x8086, 0x9dc8), - .driver_data = (unsigned long)&snd_soc_acpi_intel_cnl_machines}, + .driver_data = (unsigned long)&cnl_desc }, #endif #if IS_ENABLED(CONFIG_SND_SOC_INTEL_CFL) /* CFL */ { PCI_DEVICE(0x8086, 0xa348), - .driver_data = (unsigned long)&snd_soc_acpi_intel_cnl_machines}, + .driver_data = (unsigned long)&cnl_desc }, #endif #if IS_ENABLED(CONFIG_SND_SOC_INTEL_CML_LP) /* CML-LP */ { PCI_DEVICE(0x8086, 0x02c8), - .driver_data = (unsigned long)&snd_soc_acpi_intel_cnl_machines}, + .driver_data = (unsigned long)&cnl_desc }, #endif #if IS_ENABLED(CONFIG_SND_SOC_INTEL_CML_H) /* CML-H */ { PCI_DEVICE(0x8086, 0x06c8), - .driver_data = (unsigned long)&snd_soc_acpi_intel_cnl_machines}, + .driver_data = (unsigned long)&cnl_desc }, #endif { 0, } }; From patchwork Thu Aug 22 19:04:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 11109959 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 16A241399 for ; Thu, 22 Aug 2019 19:25:58 +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 A0B1D233FD for ; Thu, 22 Aug 2019 19:25:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="tNbQbm8k" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A0B1D233FD 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-devel-bounces@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 B9D38165D; Thu, 22 Aug 2019 21:25:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B9D38165D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566501955; bh=QbqmV5tY0IXDNtMlPIXQnWApr9ldg9WGyFjiEsXdCaA=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=tNbQbm8kvLWSXAEUs92vxuOAuLsGMfId8ftngPmcEyd6PaZ1iqmf40NWPrKd2KfAW 1pUzxQCwZ2BXjky7TiEt3DeRFMHssZHEgFO7QZ/drcLIzU6dOnemYjAemwb2b9NU2B NkTrKbfZCCuwbVixqi3ZZtaWob2EzOfxc97e2OvE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 818ADF80C32; Thu, 22 Aug 2019 21:06:57 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 04EF5F8071D; Thu, 22 Aug 2019 21:06:07 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 EDFCEF8065D for ; Thu, 22 Aug 2019 21:05:28 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz EDFCEF8065D X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 12:05:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,417,1559545200"; d="scan'208";a="203524597" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga004.fm.intel.com with ESMTP; 22 Aug 2019 12:05:27 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org Date: Thu, 22 Aug 2019 21:04:19 +0200 Message-Id: <20190822190425.23001-30-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190822190425.23001-1-cezary.rojewski@intel.com> References: <20190822190425.23001-1-cezary.rojewski@intel.com> Cc: lgirdwood@gmail.com, Cezary Rojewski , broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 29/35] ASoC: Intel: Skylake: Flip SST initialization order 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" To this date Skylake SST were following ill flow of initialization by bypassing sst_dsp_new -> sst_ops::init order. Fix that by flipping invocation order of handlers engaged in Skylake initialization. Signed-off-by: Cezary Rojewski --- sound/soc/intel/skylake/bxt-sst.c | 15 ++++----------- sound/soc/intel/skylake/cnl-sst-dsp.h | 2 +- sound/soc/intel/skylake/cnl-sst.c | 15 ++++----------- sound/soc/intel/skylake/skl-messages.c | 4 ++-- sound/soc/intel/skylake/skl-sst-dsp.h | 4 ++-- sound/soc/intel/skylake/skl-sst.c | 15 ++++----------- sound/soc/intel/skylake/skl.c | 2 +- sound/soc/intel/skylake/skl.h | 4 ++-- 8 files changed, 20 insertions(+), 41 deletions(-) diff --git a/sound/soc/intel/skylake/bxt-sst.c b/sound/soc/intel/skylake/bxt-sst.c index 06da822790a5..286da9fbc4de 100644 --- a/sound/soc/intel/skylake/bxt-sst.c +++ b/sound/soc/intel/skylake/bxt-sst.c @@ -538,24 +538,17 @@ struct sst_ops apl_sst_ops = { .read = sst_shim32_read, .ram_read = sst_memcpy_fromio_32, .ram_write = sst_memcpy_toio_32, + .init = bxt_sst_dsp_init, .free = skl_dsp_free, }; -static struct sst_pdata skl_dev = { - .ops = &apl_sst_ops, -}; - -int bxt_sst_dsp_init(struct skl_dev *skl, const char *fw_name) +int bxt_sst_dsp_init(struct sst_dsp *sst, struct sst_pdata *pdata) { - struct sst_dsp *sst; + struct skl_dev *skl = sst->thread_context; void __iomem *mmio; int ret; - ret = skl_sst_ctx_init(skl, fw_name, &skl_dev); - if (ret) - return ret; - - sst = skl->dsp; + skl->dsp = sst; sst->fw_ops = bxt_fw_ops; mmio = pci_ioremap_bar(skl->pci, 4); if (!mmio) diff --git a/sound/soc/intel/skylake/cnl-sst-dsp.h b/sound/soc/intel/skylake/cnl-sst-dsp.h index 02e070fae2ce..7810ae11954a 100644 --- a/sound/soc/intel/skylake/cnl-sst-dsp.h +++ b/sound/soc/intel/skylake/cnl-sst-dsp.h @@ -87,6 +87,6 @@ void cnl_ipc_op_int_enable(struct sst_dsp *ctx); void cnl_ipc_op_int_disable(struct sst_dsp *ctx); bool cnl_ipc_int_status(struct sst_dsp *ctx); -int cnl_sst_dsp_init(struct skl_dev *skl, const char *fw_name); +int cnl_sst_dsp_init(struct sst_dsp *sst, struct sst_pdata *pdata); #endif /*__CNL_SST_DSP_H__*/ diff --git a/sound/soc/intel/skylake/cnl-sst.c b/sound/soc/intel/skylake/cnl-sst.c index c4dbf6655097..a6113d8afcbb 100644 --- a/sound/soc/intel/skylake/cnl-sst.c +++ b/sound/soc/intel/skylake/cnl-sst.c @@ -415,24 +415,17 @@ struct sst_ops cnl_sst_ops = { .read = sst_shim32_read, .ram_read = sst_memcpy_fromio_32, .ram_write = sst_memcpy_toio_32, + .init = cnl_sst_dsp_init, .free = cnl_dsp_free, }; -static struct sst_pdata cnl_dev = { - .ops = &cnl_sst_ops, -}; - -int cnl_sst_dsp_init(struct skl_dev *cnl, const char *fw_name) +int cnl_sst_dsp_init(struct sst_dsp *sst, struct sst_pdata *pdata) { - struct sst_dsp *sst; + struct skl_dev *cnl = sst->thread_context; void __iomem *mmio; int ret; - ret = skl_sst_ctx_init(cnl, fw_name, &cnl_dev); - if (ret < 0) - return ret; - - sst = cnl->dsp; + cnl->dsp = sst; sst->fw_ops = cnl_fw_ops; mmio = pci_ioremap_bar(cnl->pci, 4); if (!mmio) diff --git a/sound/soc/intel/skylake/skl-messages.c b/sound/soc/intel/skylake/skl-messages.c index 8c352255ff45..372c5fb83ddb 100644 --- a/sound/soc/intel/skylake/skl-messages.c +++ b/sound/soc/intel/skylake/skl-messages.c @@ -187,7 +187,7 @@ const struct skl_dsp_ops *skl_get_dsp_ops(int pci_id) return NULL; } -int skl_init_dsp(struct skl_dev *skl) +int skl_init_dsp(struct skl_dev *skl, struct sst_pdata *pdata) { struct hdac_bus *bus = skl_to_bus(skl); const struct skl_dsp_ops *ops; @@ -201,7 +201,7 @@ int skl_init_dsp(struct skl_dev *skl) if (!ops) return -EIO; - ret = ops->init(skl, skl->fw_name); + ret = skl_sst_ctx_init(skl, skl->fw_name, pdata); if (ret < 0) return ret; diff --git a/sound/soc/intel/skylake/skl-sst-dsp.h b/sound/soc/intel/skylake/skl-sst-dsp.h index b647e60d7a6d..8483c60f29ba 100644 --- a/sound/soc/intel/skylake/skl-sst-dsp.h +++ b/sound/soc/intel/skylake/skl-sst-dsp.h @@ -206,8 +206,8 @@ int skl_dsp_get_core(struct sst_dsp *ctx, unsigned int core_id); int skl_dsp_put_core(struct sst_dsp *ctx, unsigned int core_id); int skl_dsp_boot(struct sst_dsp *ctx); -int skl_sst_dsp_init(struct skl_dev *skl, const char *fw_name); -int bxt_sst_dsp_init(struct skl_dev *skl, const char *fw_name); +int skl_sst_dsp_init(struct sst_dsp *sst, struct sst_pdata *pdata); +int bxt_sst_dsp_init(struct sst_dsp *sst, struct sst_pdata *pdata); int bxt_load_library(struct sst_dsp *ctx, struct skl_lib_info *linfo, int lib_count); diff --git a/sound/soc/intel/skylake/skl-sst.c b/sound/soc/intel/skylake/skl-sst.c index 122c07290440..e0f2bf828541 100644 --- a/sound/soc/intel/skylake/skl-sst.c +++ b/sound/soc/intel/skylake/skl-sst.c @@ -509,24 +509,17 @@ struct sst_ops skl_sst_ops = { .read = sst_shim32_read, .ram_read = sst_memcpy_fromio_32, .ram_write = sst_memcpy_toio_32, + .init = skl_sst_dsp_init, .free = skl_dsp_free, }; -static struct sst_pdata skl_dev = { - .ops = &skl_sst_ops, -}; - -int skl_sst_dsp_init(struct skl_dev *skl, const char *fw_name) +int skl_sst_dsp_init(struct sst_dsp *sst, struct sst_pdata *pdata) { - struct sst_dsp *sst; + struct skl_dev *skl = sst->thread_context; void __iomem *mmio; int ret; - ret = skl_sst_ctx_init(skl, fw_name, &skl_dev); - if (ret < 0) - return ret; - - sst = skl->dsp; + skl->dsp = sst; sst->fw_ops = skl_fw_ops; mmio = pci_ioremap_bar(skl->pci, 4); if (!mmio) diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c index 53a6befd5d68..39442c80a179 100644 --- a/sound/soc/intel/skylake/skl.c +++ b/sound/soc/intel/skylake/skl.c @@ -1072,7 +1072,7 @@ static int skl_probe(struct pci_dev *pci, goto out_nhlt_free; } - err = skl_init_dsp(skl); + err = skl_init_dsp(skl, desc); if (err < 0) { dev_dbg(bus->dev, "error failed to register dsp\n"); goto out_nhlt_free; diff --git a/sound/soc/intel/skylake/skl.h b/sound/soc/intel/skylake/skl.h index 2f2b5a141abf..f4cd5ccc1ff9 100644 --- a/sound/soc/intel/skylake/skl.h +++ b/sound/soc/intel/skylake/skl.h @@ -159,7 +159,7 @@ struct skl_machine_pdata { struct skl_dsp_ops { int id; - int (*init)(struct skl_dev *skl, const char *fw_name); + int (*init)(struct sst_dsp *dsp, struct sst_pdata *pdata); }; int skl_platform_unregister(struct device *dev); @@ -170,7 +170,7 @@ struct nhlt_specific_cfg *skl_get_ep_blob(struct skl_dev *skl, u32 instance, u32 s_rate, u8 dirn, u8 dev_type); int skl_nhlt_update_topology_bin(struct skl_dev *skl); -int skl_init_dsp(struct skl_dev *skl); +int skl_init_dsp(struct skl_dev *skl, struct sst_pdata *pdata); int skl_free_dsp(struct skl_dev *skl); int skl_sst_init_fw(struct skl_dev *skl); void skl_sst_dsp_cleanup(struct skl_dev *skl); From patchwork Thu Aug 22 19:04:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 11109963 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E82C913A4 for ; Thu, 22 Aug 2019 19:26:41 +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 801F5233FD for ; Thu, 22 Aug 2019 19:26:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="ax5mJWkY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 801F5233FD 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-devel-bounces@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 B605A16AF; Thu, 22 Aug 2019 21:25:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B605A16AF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566501999; bh=Ts+7SjCPUuCpZ7Ma+5Pd7lUxXncpUwI+DS3JoVcKoaM=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=ax5mJWkYD2IfrySrfsFQjs70B52kjBIoDyayV6pTCpxfhuP0PX2T1NSQPwRcRU0oO 1bn+ANYP19A+2d1eucpNbrl3MzcrA0T3ibF21XTovOGHPXjqgUL9MxP6d74Y1XC2yY 6/qt49HsshA5iHA7ChVOWk9QboIJhKQkivukiylU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 705C4F80CAA; Thu, 22 Aug 2019 21:06:59 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id D1504F80736; Thu, 22 Aug 2019 21:06:12 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 89C5FF80673 for ; Thu, 22 Aug 2019 21:05:30 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 89C5FF80673 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 12:05:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,417,1559545200"; d="scan'208";a="203524606" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga004.fm.intel.com with ESMTP; 22 Aug 2019 12:05:29 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org Date: Thu, 22 Aug 2019 21:04:20 +0200 Message-Id: <20190822190425.23001-31-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190822190425.23001-1-cezary.rojewski@intel.com> References: <20190822190425.23001-1-cezary.rojewski@intel.com> Cc: lgirdwood@gmail.com, Cezary Rojewski , broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 30/35] ASoC: Intel: Reuse sst_pdata::fw_name field 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" struct sst_pdata is equipped with fw_name field - a platform specific filename for basefw module. Usage of such allows for suther simplification of declaration of handlers directly involved with Skylake initialization procedure. This change invalidates mach::fw_filename field and skl::fw_name. Signed-off-by: Cezary Rojewski --- sound/soc/intel/common/sst-acpi.c | 5 ++--- sound/soc/intel/common/sst-firmware.c | 1 + sound/soc/intel/skylake/skl-messages.c | 2 +- sound/soc/intel/skylake/skl-sst-dsp.h | 3 +-- sound/soc/intel/skylake/skl-sst-utils.c | 4 +--- sound/soc/intel/skylake/skl.c | 4 ---- 6 files changed, 6 insertions(+), 13 deletions(-) diff --git a/sound/soc/intel/common/sst-acpi.c b/sound/soc/intel/common/sst-acpi.c index 53ac23f05966..15f2b27e643f 100644 --- a/sound/soc/intel/common/sst-acpi.c +++ b/sound/soc/intel/common/sst-acpi.c @@ -28,11 +28,10 @@ static void sst_acpi_fw_cb(const struct firmware *fw, void *context) struct sst_acpi_priv *sst_acpi = platform_get_drvdata(pdev); struct sst_acpi_desc *desc = sst_acpi->desc; struct sst_pdata *sst_pdata = desc->pdata; - struct snd_soc_acpi_mach *mach = sst_acpi->mach; sst_pdata->fw = fw; if (!fw) { - dev_err(dev, "Cannot load firmware %s\n", mach->fw_filename); + dev_err(dev, "Cannot load firmware %s\n", sst_pdata->fw_name); return; } @@ -119,7 +118,7 @@ int sst_acpi_probe(struct platform_device *pdev) return PTR_ERR(sst_acpi->pdev_mach); /* continue SST probing after firmware is loaded */ - ret = request_firmware_nowait(THIS_MODULE, true, mach->fw_filename, + ret = request_firmware_nowait(THIS_MODULE, true, sst_pdata->fw_name, dev, GFP_KERNEL, pdev, sst_acpi_fw_cb); if (ret) platform_device_unregister(sst_acpi->pdev_mach); diff --git a/sound/soc/intel/common/sst-firmware.c b/sound/soc/intel/common/sst-firmware.c index 61d3e6e46b98..cc88849eb10f 100644 --- a/sound/soc/intel/common/sst-firmware.c +++ b/sound/soc/intel/common/sst-firmware.c @@ -1218,6 +1218,7 @@ struct sst_dsp *sst_dsp_new(struct device *dev, struct sst_pdata *pdata) sst->thread_context = pdata->dsp; sst->id = pdata->id; sst->irq = pdata->irq; + sst->fw_name = pdata->fw_name; sst->ops = pdata->ops; sst->pdata = pdata; INIT_LIST_HEAD(&sst->used_block_list); diff --git a/sound/soc/intel/skylake/skl-messages.c b/sound/soc/intel/skylake/skl-messages.c index 372c5fb83ddb..e401edd8d44b 100644 --- a/sound/soc/intel/skylake/skl-messages.c +++ b/sound/soc/intel/skylake/skl-messages.c @@ -201,7 +201,7 @@ int skl_init_dsp(struct skl_dev *skl, struct sst_pdata *pdata) if (!ops) return -EIO; - ret = skl_sst_ctx_init(skl, skl->fw_name, pdata); + ret = skl_sst_ctx_init(skl, pdata); if (ret < 0) return ret; diff --git a/sound/soc/intel/skylake/skl-sst-dsp.h b/sound/soc/intel/skylake/skl-sst-dsp.h index 8483c60f29ba..a3714b706b8e 100644 --- a/sound/soc/intel/skylake/skl-sst-dsp.h +++ b/sound/soc/intel/skylake/skl-sst-dsp.h @@ -223,8 +223,7 @@ int skl_dsp_strip_extended_manifest(struct firmware *fw); void skl_dsp_set_astate_cfg(struct skl_dev *skl, u32 cnt, void *data); -int skl_sst_ctx_init(struct skl_dev *skl, const char *fw_name, - struct sst_pdata *pdata); +int skl_sst_ctx_init(struct skl_dev *skl, struct sst_pdata *pdata); int skl_prepare_lib_load(struct skl_dev *skl, struct skl_lib_info *linfo, struct firmware *stripped_fw, unsigned int hdr_offset, int index); diff --git a/sound/soc/intel/skylake/skl-sst-utils.c b/sound/soc/intel/skylake/skl-sst-utils.c index a4ad213d34e0..ea5419012312 100644 --- a/sound/soc/intel/skylake/skl-sst-utils.c +++ b/sound/soc/intel/skylake/skl-sst-utils.c @@ -354,8 +354,7 @@ int skl_dsp_strip_extended_manifest(struct firmware *fw) return 0; } -int skl_sst_ctx_init(struct skl_dev *skl, const char *fw_name, - struct sst_pdata *pdata) +int skl_sst_ctx_init(struct skl_dev *skl, struct sst_pdata *pdata) { struct sst_dsp *sst; struct device *dev = skl->dev; @@ -372,7 +371,6 @@ int skl_sst_ctx_init(struct skl_dev *skl, const char *fw_name, } skl->dsp = sst; - sst->fw_name = fw_name; init_waitqueue_head(&skl->mod_load_wait); skl->is_first_boot = true; diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c index 39442c80a179..3225f4f8793e 100644 --- a/sound/soc/intel/skylake/skl.c +++ b/sound/soc/intel/skylake/skl.c @@ -491,9 +491,6 @@ static struct snd_soc_acpi_mach *skl_find_hda_machine(struct skl_dev *skl, /* point to common table */ mach = snd_soc_acpi_intel_hda_machines; - /* all entries in the machine table use the same firmware */ - mach->fw_filename = machines->fw_filename; - return mach; } @@ -514,7 +511,6 @@ static int skl_find_machine(struct skl_dev *skl, void *driver_data) } skl->mach = mach; - skl->fw_name = mach->fw_filename; pdata = mach->pdata; if (pdata) { From patchwork Thu Aug 22 19:04:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 11109965 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 77C681399 for ; Thu, 22 Aug 2019 19:27:24 +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 0DF8B233FD for ; Thu, 22 Aug 2019 19:27:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="URMFvlfU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0DF8B233FD 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-devel-bounces@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 537AE16AC; Thu, 22 Aug 2019 21:26:32 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 537AE16AC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566502042; bh=kel+G/1locQ5d/oq3fsna8zy7M6XqK71O7qDMMNfgUI=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=URMFvlfUnr0Vc7Eo/xtEsUsNd0PSrhClr4h142EjvKASMf77KdnbE8wnghwO+78Km J888IUA2vGUIULQYbGGxOdSTHRKjJtAzNJUI0pSmvuFuynd4/9qA/lVlrV51Dcqnde zxD2oMCjBOQMP4FZIpxb3aYJ4n0mXjUIS5EwupWk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 6C251F80CB5; Thu, 22 Aug 2019 21:07:01 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7ABC0F8074D; Thu, 22 Aug 2019 21:06:17 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 6F182F80679 for ; Thu, 22 Aug 2019 21:05:32 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 6F182F80679 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 12:05:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,417,1559545200"; d="scan'208";a="203524614" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga004.fm.intel.com with ESMTP; 22 Aug 2019 12:05:31 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org Date: Thu, 22 Aug 2019 21:04:21 +0200 Message-Id: <20190822190425.23001-32-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190822190425.23001-1-cezary.rojewski@intel.com> References: <20190822190425.23001-1-cezary.rojewski@intel.com> Cc: lgirdwood@gmail.com, Cezary Rojewski , broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 31/35] ASoC: Intel: Reuse sst_pdata::fw field 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Similarly to fw_name, sst_pdata::fw can be used to unify usage of firmware objects for all SSTs. This change invalidates sst_dsp::fw field. Signed-off-by: Cezary Rojewski --- sound/soc/intel/skylake/bxt-sst.c | 16 +++++++++------- sound/soc/intel/skylake/cnl-sst.c | 15 ++++++++------- sound/soc/intel/skylake/skl-sst.c | 23 +++++++++++++---------- 3 files changed, 30 insertions(+), 24 deletions(-) diff --git a/sound/soc/intel/skylake/bxt-sst.c b/sound/soc/intel/skylake/bxt-sst.c index 286da9fbc4de..79728e418176 100644 --- a/sound/soc/intel/skylake/bxt-sst.c +++ b/sound/soc/intel/skylake/bxt-sst.c @@ -185,10 +185,11 @@ static int bxt_load_base_firmware(struct sst_dsp *ctx) { struct firmware stripped_fw; struct skl_dev *skl = ctx->thread_context; + struct sst_pdata *pdata = ctx->pdata; int ret, i; - if (ctx->fw == NULL) { - ret = request_firmware(&ctx->fw, ctx->fw_name, ctx->dev); + if (!pdata->fw) { + ret = request_firmware(&pdata->fw, ctx->fw_name, ctx->dev); if (ret < 0) { dev_err(ctx->dev, "Request firmware failed %d\n", ret); return ret; @@ -197,13 +198,14 @@ static int bxt_load_base_firmware(struct sst_dsp *ctx) /* prase uuids on first boot */ if (skl->is_first_boot) { - ret = snd_skl_parse_uuids(ctx, ctx->fw, BXT_ADSP_FW_BIN_HDR_OFFSET, 0); + ret = snd_skl_parse_uuids(ctx, pdata->fw, + BXT_ADSP_FW_BIN_HDR_OFFSET, 0); if (ret < 0) goto sst_load_base_firmware_failed; } - stripped_fw.data = ctx->fw->data; - stripped_fw.size = ctx->fw->size; + stripped_fw.data = pdata->fw->data; + stripped_fw.size = pdata->fw->size; skl_dsp_strip_extended_manifest(&stripped_fw); for (i = 0; i < BXT_FW_ROM_INIT_RETRY; i++) { @@ -246,8 +248,8 @@ static int bxt_load_base_firmware(struct sst_dsp *ctx) return ret; sst_load_base_firmware_failed: - release_firmware(ctx->fw); - ctx->fw = NULL; + release_firmware(pdata->fw); + pdata->fw = NULL; return ret; } diff --git a/sound/soc/intel/skylake/cnl-sst.c b/sound/soc/intel/skylake/cnl-sst.c index a6113d8afcbb..58efeb6c8a8a 100644 --- a/sound/soc/intel/skylake/cnl-sst.c +++ b/sound/soc/intel/skylake/cnl-sst.c @@ -108,10 +108,11 @@ static int cnl_load_base_firmware(struct sst_dsp *ctx) { struct firmware stripped_fw; struct skl_dev *cnl = ctx->thread_context; + struct sst_pdata *pdata = ctx->pdata; int ret; - if (!ctx->fw) { - ret = request_firmware(&ctx->fw, ctx->fw_name, ctx->dev); + if (!pdata->fw) { + ret = request_firmware(&pdata->fw, ctx->fw_name, ctx->dev); if (ret < 0) { dev_err(ctx->dev, "request firmware failed: %d\n", ret); goto cnl_load_base_firmware_failed; @@ -120,14 +121,14 @@ static int cnl_load_base_firmware(struct sst_dsp *ctx) /* parse uuids if first boot */ if (cnl->is_first_boot) { - ret = snd_skl_parse_uuids(ctx, ctx->fw, + ret = snd_skl_parse_uuids(ctx, pdata->fw, CNL_ADSP_FW_HDR_OFFSET, 0); if (ret < 0) goto cnl_load_base_firmware_failed; } - stripped_fw.data = ctx->fw->data; - stripped_fw.size = ctx->fw->size; + stripped_fw.data = pdata->fw->data; + stripped_fw.size = pdata->fw->size; skl_dsp_strip_extended_manifest(&stripped_fw); ret = cnl_prepare_fw(ctx, stripped_fw.data, stripped_fw.size); @@ -157,8 +158,8 @@ static int cnl_load_base_firmware(struct sst_dsp *ctx) return 0; cnl_load_base_firmware_failed: - release_firmware(ctx->fw); - ctx->fw = NULL; + release_firmware(pdata->fw); + pdata->fw = NULL; return ret; } diff --git a/sound/soc/intel/skylake/skl-sst.c b/sound/soc/intel/skylake/skl-sst.c index e0f2bf828541..8e1d02e29a32 100644 --- a/sound/soc/intel/skylake/skl-sst.c +++ b/sound/soc/intel/skylake/skl-sst.c @@ -67,14 +67,15 @@ static int skl_load_base_firmware(struct sst_dsp *ctx) { int ret = 0, i; struct skl_dev *skl = ctx->thread_context; + struct sst_pdata *pdata = ctx->pdata; struct firmware stripped_fw; u32 reg; skl->boot_complete = false; init_waitqueue_head(&skl->boot_wait); - if (ctx->fw == NULL) { - ret = request_firmware(&ctx->fw, ctx->fw_name, ctx->dev); + if (!pdata->fw) { + ret = request_firmware(&pdata->fw, ctx->fw_name, ctx->dev); if (ret < 0) { dev_err(ctx->dev, "Request firmware failed %d\n", ret); return -EIO; @@ -83,18 +84,19 @@ static int skl_load_base_firmware(struct sst_dsp *ctx) /* prase uuids on first boot */ if (skl->is_first_boot) { - ret = snd_skl_parse_uuids(ctx, ctx->fw, SKL_ADSP_FW_BIN_HDR_OFFSET, 0); + ret = snd_skl_parse_uuids(ctx, pdata->fw, + SKL_ADSP_FW_BIN_HDR_OFFSET, 0); if (ret < 0) { dev_err(ctx->dev, "UUID parsing err: %d\n", ret); - release_firmware(ctx->fw); + release_firmware(pdata->fw); skl_dsp_disable_core(ctx, SKL_DSP_CORE0_MASK); return ret; } } /* check for extended manifest */ - stripped_fw.data = ctx->fw->data; - stripped_fw.size = ctx->fw->size; + stripped_fw.data = pdata->fw->data; + stripped_fw.size = pdata->fw->size; skl_dsp_strip_extended_manifest(&stripped_fw); @@ -152,8 +154,8 @@ static int skl_load_base_firmware(struct sst_dsp *ctx) ctx->cl_dev.ops.cl_cleanup_controller(ctx); skl_load_base_firmware_failed: skl_dsp_disable_core(ctx, SKL_DSP_CORE0_MASK); - release_firmware(ctx->fw); - ctx->fw = NULL; + release_firmware(pdata->fw); + pdata->fw = NULL; return ret; } @@ -602,10 +604,11 @@ EXPORT_SYMBOL_GPL(skl_sst_init_fw); void skl_sst_dsp_cleanup(struct skl_dev *skl) { struct sst_dsp *dsp = skl->dsp; + struct sst_pdata *pdata = dsp->pdata; skl_release_library(skl->lib_info, skl->lib_count); - if (dsp->fw) - release_firmware(dsp->fw); + if (pdata->fw) + release_firmware(pdata->fw); skl_clear_module_table(dsp); skl_freeup_uuid_list(skl); From patchwork Thu Aug 22 19:04:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 11109967 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D0F921399 for ; Thu, 22 Aug 2019 19:28:01 +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 65CA6233FD for ; Thu, 22 Aug 2019 19:28:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="FO8ANUk+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 65CA6233FD 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-devel-bounces@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 9F50216A5; Thu, 22 Aug 2019 21:27:09 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9F50216A5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566502079; bh=pEOLldhfJTzMMXfL1eNedvXAjPHd2QaCPa9GGcXlaTs=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=FO8ANUk+fw0fjcLY3LhMuixY4HMr+Lm4ZGlHKgbhjaqNEcdxyM1LYQiAPUYQUpOsc cMqjZus4DsIQQvxxQvV4Z2tpbE0aObxHVd37ZUY1m7++HApNly9hGMwNnTChk4Lz1T nvJnE0vIXc7M6Ah5pcvYhFdvbX7LG7vjh2B5gFsY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 1E494F80CBA; Thu, 22 Aug 2019 21:07:04 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 22D76F80750; Thu, 22 Aug 2019 21:06:19 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 AA22DF80677 for ; Thu, 22 Aug 2019 21:05:33 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz AA22DF80677 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 12:05:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,417,1559545200"; d="scan'208";a="203524623" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga004.fm.intel.com with ESMTP; 22 Aug 2019 12:05:32 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org Date: Thu, 22 Aug 2019 21:04:22 +0200 Message-Id: <20190822190425.23001-33-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190822190425.23001-1-cezary.rojewski@intel.com> References: <20190822190425.23001-1-cezary.rojewski@intel.com> Cc: lgirdwood@gmail.com, Cezary Rojewski , broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 32/35] ASoC: Intel: Skylake: Remove skl_dsp_ops 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" All declaration simplication and addition of FIRMWARE_CONFIG and HARDWARE_CONFIG led to ultimate goal of removal of struct skl_dsp_ops. Strike it down, struct sst_pdata is more than enough is providing description for SST platforms. Signed-off-by: Cezary Rojewski --- sound/soc/intel/skylake/skl-messages.c | 53 -------------------------- sound/soc/intel/skylake/skl.h | 8 ---- 2 files changed, 61 deletions(-) diff --git a/sound/soc/intel/skylake/skl-messages.c b/sound/soc/intel/skylake/skl-messages.c index e401edd8d44b..5f63c3052db9 100644 --- a/sound/soc/intel/skylake/skl-messages.c +++ b/sound/soc/intel/skylake/skl-messages.c @@ -140,72 +140,19 @@ int skl_dsp_cleanup(struct device *dev, return 0; } -static const struct skl_dsp_ops dsp_ops[] = { - { - .id = 0x9d70, - .init = skl_sst_dsp_init, - }, - { - .id = 0x9d71, - .init = skl_sst_dsp_init, - }, - { - .id = 0x5a98, - .init = bxt_sst_dsp_init, - }, - { - .id = 0x3198, - .init = bxt_sst_dsp_init, - }, - { - .id = 0x9dc8, - .init = cnl_sst_dsp_init, - }, - { - .id = 0xa348, - .init = cnl_sst_dsp_init, - }, - { - .id = 0x02c8, - .init = cnl_sst_dsp_init, - }, - { - .id = 0x06c8, - .init = cnl_sst_dsp_init, - }, -}; - -const struct skl_dsp_ops *skl_get_dsp_ops(int pci_id) -{ - int i; - - for (i = 0; i < ARRAY_SIZE(dsp_ops); i++) { - if (dsp_ops[i].id == pci_id) - return &dsp_ops[i]; - } - - return NULL; -} - int skl_init_dsp(struct skl_dev *skl, struct sst_pdata *pdata) { struct hdac_bus *bus = skl_to_bus(skl); - const struct skl_dsp_ops *ops; int ret; /* enable ppcap interrupt */ snd_hdac_ext_bus_ppcap_enable(bus, true); snd_hdac_ext_bus_ppcap_int_enable(bus, true); - ops = skl_get_dsp_ops(skl->pci->device); - if (!ops) - return -EIO; - ret = skl_sst_ctx_init(skl, pdata); if (ret < 0) return ret; - skl->dsp_ops = ops; dev_dbg(bus->dev, "dsp registration status=%d\n", ret); return 0; diff --git a/sound/soc/intel/skylake/skl.h b/sound/soc/intel/skylake/skl.h index f4cd5ccc1ff9..218e8bda6cae 100644 --- a/sound/soc/intel/skylake/skl.h +++ b/sound/soc/intel/skylake/skl.h @@ -135,8 +135,6 @@ struct skl_dev { struct skl_d0i3_data d0i3; - const struct skl_dsp_ops *dsp_ops; - /* Callback to update dynamic clock and power gating registers */ void (*clock_power_gating)(struct device *dev, bool enable); }; @@ -157,11 +155,6 @@ struct skl_machine_pdata { bool use_tplg_pcm; /* use dais and dai links from topology */ }; -struct skl_dsp_ops { - int id; - int (*init)(struct sst_dsp *dsp, struct sst_pdata *pdata); -}; - int skl_platform_unregister(struct device *dev); int skl_platform_register(struct device *dev); @@ -178,7 +171,6 @@ int skl_suspend_late_dsp(struct skl_dev *skl); int skl_suspend_dsp(struct skl_dev *skl); int skl_resume_dsp(struct skl_dev *skl); void skl_cleanup_resources(struct skl_dev *skl); -const struct skl_dsp_ops *skl_get_dsp_ops(int pci_id); void skl_update_d0i3c(struct device *dev, bool enable); int skl_nhlt_create_sysfs(struct skl_dev *skl); void skl_nhlt_remove_sysfs(struct skl_dev *skl); From patchwork Thu Aug 22 19:04:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 11109971 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E56621399 for ; Thu, 22 Aug 2019 19:29:17 +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 79E9123400 for ; Thu, 22 Aug 2019 19:29:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="Xk7ZtHtz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 79E9123400 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-devel-bounces@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 B567E168E; Thu, 22 Aug 2019 21:28:25 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B567E168E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566502155; bh=HD/VPoOww6Rm7gQULEK40OFi7FEiYofqXpFrGB+9bpU=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Xk7ZtHtzhj3EU5zsAkz/FbWFsPaQFdttKYYxvu9MqdPthqQiLtNP2Ezi9Vgqn7moP UR7Z+BDcjQcFpgXv1euprZ0+OujOvCqTzHtskSarlQxQDIaiMu5mSDSY31dGBjJa+A 4mKq5AmuaQTk6/gNMcPjU2Fk+52rnBlCwPy9NnN4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2FB5BF80CC4; Thu, 22 Aug 2019 21:07:08 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id CD56BF80750; Thu, 22 Aug 2019 21:06:20 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 47302F8067A for ; Thu, 22 Aug 2019 21:05:35 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 47302F8067A X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 12:05:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,417,1559545200"; d="scan'208";a="203524629" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga004.fm.intel.com with ESMTP; 22 Aug 2019 12:05:34 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org Date: Thu, 22 Aug 2019 21:04:23 +0200 Message-Id: <20190822190425.23001-34-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190822190425.23001-1-cezary.rojewski@intel.com> References: <20190822190425.23001-1-cezary.rojewski@intel.com> Cc: lgirdwood@gmail.com, Cezary Rojewski , broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 33/35] ASoC: Intel: Skylake: Privatize SST init handlers 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" With initialization order repaired, sst_ops::init overloads can be privatized for Skylake platofmrs. Let's do so. Signed-off-by: Cezary Rojewski --- sound/soc/intel/skylake/bxt-sst.c | 25 ++++++++++++------------- sound/soc/intel/skylake/cnl-sst-dsp.h | 2 -- sound/soc/intel/skylake/cnl-sst.c | 25 ++++++++++++------------- sound/soc/intel/skylake/skl-sst-dsp.h | 2 -- sound/soc/intel/skylake/skl-sst.c | 23 +++++++++++------------ 5 files changed, 35 insertions(+), 42 deletions(-) diff --git a/sound/soc/intel/skylake/bxt-sst.c b/sound/soc/intel/skylake/bxt-sst.c index 79728e418176..1edc38069615 100644 --- a/sound/soc/intel/skylake/bxt-sst.c +++ b/sound/soc/intel/skylake/bxt-sst.c @@ -533,18 +533,7 @@ static const struct skl_dsp_fw_ops bxt_fw_ops = { .load_library = bxt_load_library, }; -struct sst_ops apl_sst_ops = { - .irq_handler = skl_dsp_sst_interrupt, - .thread_fn = skl_dsp_irq_thread_handler, - .write = sst_shim32_write, - .read = sst_shim32_read, - .ram_read = sst_memcpy_fromio_32, - .ram_write = sst_memcpy_toio_32, - .init = bxt_sst_dsp_init, - .free = skl_dsp_free, -}; - -int bxt_sst_dsp_init(struct sst_dsp *sst, struct sst_pdata *pdata) +static int bxt_sst_init(struct sst_dsp *sst, struct sst_pdata *pdata) { struct skl_dev *skl = sst->thread_context; void __iomem *mmio; @@ -578,7 +567,17 @@ int bxt_sst_dsp_init(struct sst_dsp *sst, struct sst_pdata *pdata) return 0; } -EXPORT_SYMBOL_GPL(bxt_sst_dsp_init); + +struct sst_ops apl_sst_ops = { + .irq_handler = skl_dsp_sst_interrupt, + .thread_fn = skl_dsp_irq_thread_handler, + .write = sst_shim32_write, + .read = sst_shim32_read, + .ram_read = sst_memcpy_fromio_32, + .ram_write = sst_memcpy_toio_32, + .init = bxt_sst_init, + .free = skl_dsp_free, +}; MODULE_LICENSE("GPL v2"); MODULE_DESCRIPTION("Intel Broxton IPC driver"); diff --git a/sound/soc/intel/skylake/cnl-sst-dsp.h b/sound/soc/intel/skylake/cnl-sst-dsp.h index 7810ae11954a..a1ea242e9539 100644 --- a/sound/soc/intel/skylake/cnl-sst-dsp.h +++ b/sound/soc/intel/skylake/cnl-sst-dsp.h @@ -87,6 +87,4 @@ void cnl_ipc_op_int_enable(struct sst_dsp *ctx); void cnl_ipc_op_int_disable(struct sst_dsp *ctx); bool cnl_ipc_int_status(struct sst_dsp *ctx); -int cnl_sst_dsp_init(struct sst_dsp *sst, struct sst_pdata *pdata); - #endif /*__CNL_SST_DSP_H__*/ diff --git a/sound/soc/intel/skylake/cnl-sst.c b/sound/soc/intel/skylake/cnl-sst.c index 58efeb6c8a8a..360e54d3c587 100644 --- a/sound/soc/intel/skylake/cnl-sst.c +++ b/sound/soc/intel/skylake/cnl-sst.c @@ -409,18 +409,7 @@ static int cnl_ipc_init(struct device *dev, struct skl_dev *cnl) return 0; } -struct sst_ops cnl_sst_ops = { - .irq_handler = cnl_dsp_sst_interrupt, - .thread_fn = cnl_dsp_irq_thread_handler, - .write = sst_shim32_write, - .read = sst_shim32_read, - .ram_read = sst_memcpy_fromio_32, - .ram_write = sst_memcpy_toio_32, - .init = cnl_sst_dsp_init, - .free = cnl_dsp_free, -}; - -int cnl_sst_dsp_init(struct sst_dsp *sst, struct sst_pdata *pdata) +static int cnl_sst_init(struct sst_dsp *sst, struct sst_pdata *pdata) { struct skl_dev *cnl = sst->thread_context; void __iomem *mmio; @@ -449,7 +438,17 @@ int cnl_sst_dsp_init(struct sst_dsp *sst, struct sst_pdata *pdata) return 0; } -EXPORT_SYMBOL_GPL(cnl_sst_dsp_init); + +struct sst_ops cnl_sst_ops = { + .irq_handler = cnl_dsp_sst_interrupt, + .thread_fn = cnl_dsp_irq_thread_handler, + .write = sst_shim32_write, + .read = sst_shim32_read, + .ram_read = sst_memcpy_fromio_32, + .ram_write = sst_memcpy_toio_32, + .init = cnl_sst_init, + .free = cnl_dsp_free, +}; MODULE_LICENSE("GPL v2"); MODULE_DESCRIPTION("Intel Cannonlake IPC driver"); diff --git a/sound/soc/intel/skylake/skl-sst-dsp.h b/sound/soc/intel/skylake/skl-sst-dsp.h index a3714b706b8e..3294826d5cf7 100644 --- a/sound/soc/intel/skylake/skl-sst-dsp.h +++ b/sound/soc/intel/skylake/skl-sst-dsp.h @@ -206,8 +206,6 @@ int skl_dsp_get_core(struct sst_dsp *ctx, unsigned int core_id); int skl_dsp_put_core(struct sst_dsp *ctx, unsigned int core_id); int skl_dsp_boot(struct sst_dsp *ctx); -int skl_sst_dsp_init(struct sst_dsp *sst, struct sst_pdata *pdata); -int bxt_sst_dsp_init(struct sst_dsp *sst, struct sst_pdata *pdata); int bxt_load_library(struct sst_dsp *ctx, struct skl_lib_info *linfo, int lib_count); diff --git a/sound/soc/intel/skylake/skl-sst.c b/sound/soc/intel/skylake/skl-sst.c index 8e1d02e29a32..209f45e3d5d0 100644 --- a/sound/soc/intel/skylake/skl-sst.c +++ b/sound/soc/intel/skylake/skl-sst.c @@ -505,17 +505,7 @@ static const struct skl_dsp_fw_ops skl_fw_ops = { .unload_mod = skl_unload_module, }; -struct sst_ops skl_sst_ops = { - .irq_handler = skl_dsp_sst_interrupt, - .write = sst_shim32_write, - .read = sst_shim32_read, - .ram_read = sst_memcpy_fromio_32, - .ram_write = sst_memcpy_toio_32, - .init = skl_sst_dsp_init, - .free = skl_dsp_free, -}; - -int skl_sst_dsp_init(struct sst_dsp *sst, struct sst_pdata *pdata) +static int skl_sst_init(struct sst_dsp *sst, struct sst_pdata *pdata) { struct skl_dev *skl = sst->thread_context; void __iomem *mmio; @@ -541,7 +531,16 @@ int skl_sst_dsp_init(struct sst_dsp *sst, struct sst_pdata *pdata) return 0; } -EXPORT_SYMBOL_GPL(skl_sst_dsp_init); + +struct sst_ops skl_sst_ops = { + .irq_handler = skl_dsp_sst_interrupt, + .write = sst_shim32_write, + .read = sst_shim32_read, + .ram_read = sst_memcpy_fromio_32, + .ram_write = sst_memcpy_toio_32, + .init = skl_sst_init, + .free = skl_dsp_free, +}; int skl_sst_init_fw(struct skl_dev *skl) { From patchwork Thu Aug 22 19:04:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 11109969 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 23AC91399 for ; Thu, 22 Aug 2019 19:28:39 +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 AE901233FD for ; Thu, 22 Aug 2019 19:28:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="hPCrdkx8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AE901233FD 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-devel-bounces@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 0DB3D1698; Thu, 22 Aug 2019 21:27:47 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0DB3D1698 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566502117; bh=JPvMTGYCUfmlWnRBtFWtFLYtVVZKQTHqVALOLaPJ92k=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=hPCrdkx8pi5G6z/R2ZwkyS1WZIKA18GRdcBVWKu1Pwrp9775d7FmvqOtRVpOrTJQs Z2T4bm4mV/ssJK1lR0d6Ab4sPqMzyyfaEKDb/Jd34Mf2ecF7teTFk+gviPLGhTLmjq KRN02fL+2YDbjTwMVCpZp3TIHTzq+r954zhC0zVo= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2DEA9F80CBC; Thu, 22 Aug 2019 21:07:06 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1E873F8074D; Thu, 22 Aug 2019 21:06:20 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 08B75F8068A for ; Thu, 22 Aug 2019 21:05:36 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 08B75F8068A X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 12:05:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,417,1559545200"; d="scan'208";a="203524636" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga004.fm.intel.com with ESMTP; 22 Aug 2019 12:05:35 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org Date: Thu, 22 Aug 2019 21:04:24 +0200 Message-Id: <20190822190425.23001-35-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190822190425.23001-1-cezary.rojewski@intel.com> References: <20190822190425.23001-1-cezary.rojewski@intel.com> Cc: lgirdwood@gmail.com, Cezary Rojewski , broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 34/35] ASoC: Intel: Skylake: Merge skl_sst_ctx_init into skl_init_dsp 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" skl_init_dsp and skl_sst_ctx_init share the exact same purpose: trigger for sst_dsp creation. Merge them together. While adding code, change reorders certain blocks, so skl_dev instance is always initialized before sst_dsp_new cascade begins. Signed-off-by: Cezary Rojewski --- sound/soc/intel/skylake/skl-messages.c | 21 +++++++++++++++------ sound/soc/intel/skylake/skl-sst-dsp.h | 1 - sound/soc/intel/skylake/skl-sst-utils.c | 23 ----------------------- 3 files changed, 15 insertions(+), 30 deletions(-) diff --git a/sound/soc/intel/skylake/skl-messages.c b/sound/soc/intel/skylake/skl-messages.c index 5f63c3052db9..7a161bbf8f26 100644 --- a/sound/soc/intel/skylake/skl-messages.c +++ b/sound/soc/intel/skylake/skl-messages.c @@ -142,18 +142,27 @@ int skl_dsp_cleanup(struct device *dev, int skl_init_dsp(struct skl_dev *skl, struct sst_pdata *pdata) { + struct sst_dsp *dsp; struct hdac_bus *bus = skl_to_bus(skl); - int ret; + struct device *dev = skl->dev; /* enable ppcap interrupt */ snd_hdac_ext_bus_ppcap_enable(bus, true); snd_hdac_ext_bus_ppcap_int_enable(bus, true); - ret = skl_sst_ctx_init(skl, pdata); - if (ret < 0) - return ret; - - dev_dbg(bus->dev, "dsp registration status=%d\n", ret); + skl->is_first_boot = true; + INIT_LIST_HEAD(&skl->uuid_list); + init_waitqueue_head(&skl->mod_load_wait); + + pdata->id = skl->pci->device; + pdata->irq = skl->pci->irq; + pdata->dma_base = -1; + pdata->dsp = skl; + dsp = sst_dsp_new(dev, pdata); + if (!dsp) { + dev_err(dev, "%s: no device\n", __func__); + return -ENODEV; + } return 0; } diff --git a/sound/soc/intel/skylake/skl-sst-dsp.h b/sound/soc/intel/skylake/skl-sst-dsp.h index 3294826d5cf7..eb8cc5606fc6 100644 --- a/sound/soc/intel/skylake/skl-sst-dsp.h +++ b/sound/soc/intel/skylake/skl-sst-dsp.h @@ -221,7 +221,6 @@ int skl_dsp_strip_extended_manifest(struct firmware *fw); void skl_dsp_set_astate_cfg(struct skl_dev *skl, u32 cnt, void *data); -int skl_sst_ctx_init(struct skl_dev *skl, struct sst_pdata *pdata); int skl_prepare_lib_load(struct skl_dev *skl, struct skl_lib_info *linfo, struct firmware *stripped_fw, unsigned int hdr_offset, int index); diff --git a/sound/soc/intel/skylake/skl-sst-utils.c b/sound/soc/intel/skylake/skl-sst-utils.c index ea5419012312..34ac21b85cd9 100644 --- a/sound/soc/intel/skylake/skl-sst-utils.c +++ b/sound/soc/intel/skylake/skl-sst-utils.c @@ -354,29 +354,6 @@ int skl_dsp_strip_extended_manifest(struct firmware *fw) return 0; } -int skl_sst_ctx_init(struct skl_dev *skl, struct sst_pdata *pdata) -{ - struct sst_dsp *sst; - struct device *dev = skl->dev; - - pdata->id = skl->pci->device; - pdata->irq = skl->pci->irq; - pdata->dma_base = -1; - pdata->dsp = skl; - INIT_LIST_HEAD(&skl->uuid_list); - sst = sst_dsp_new(dev, pdata); - if (!sst) { - dev_err(dev, "%s: no device\n", __func__); - return -ENODEV; - } - - skl->dsp = sst; - init_waitqueue_head(&skl->mod_load_wait); - skl->is_first_boot = true; - - return 0; -} - int skl_prepare_lib_load(struct skl_dev *skl, struct skl_lib_info *linfo, struct firmware *stripped_fw, unsigned int hdr_offset, int index) From patchwork Thu Aug 22 19:04:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 11109973 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9A67C1399 for ; Thu, 22 Aug 2019 19:30:00 +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 2EF68233FD for ; Thu, 22 Aug 2019 19:30:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="uef2sZCK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2EF68233FD 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-devel-bounces@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 6C68516BA; Thu, 22 Aug 2019 21:29:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6C68516BA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566502198; bh=grHdB133iQz6iiZw9mWhAohXALPQh45P+JkLlqHvquc=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=uef2sZCKlpJuZvgmi/XJEflL87iRyO4gezerBkBQWsdaw+iJgpnvRvwZIwQGahh3v khkM7hufkyJJ+fMyc6Fjb+hTRX99xrBrt2IFVhsQZyQ+dxbW0CvpHET+PajF9pqil/ la2aUilJy81kkDcZp1IX+gdKkt71OWzaferKaTN4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 46ADCF89616; Thu, 22 Aug 2019 21:07:10 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3A07FF8067A; Thu, 22 Aug 2019 21:06:24 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 0D0CBF805A1 for ; Thu, 22 Aug 2019 21:05:38 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0D0CBF805A1 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 12:05:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,417,1559545200"; d="scan'208";a="203524644" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga004.fm.intel.com with ESMTP; 22 Aug 2019 12:05:37 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org Date: Thu, 22 Aug 2019 21:04:25 +0200 Message-Id: <20190822190425.23001-36-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190822190425.23001-1-cezary.rojewski@intel.com> References: <20190822190425.23001-1-cezary.rojewski@intel.com> Cc: lgirdwood@gmail.com, Cezary Rojewski , broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 35/35] ASoC: Intel: Remove obsolete firmware fields 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" FW filename fields are now deprecated in favour of ones coming from platform descriptors. This aligns with paradigm of FW being platform specific, not board specific. Any remaining deprecated survivors of the precedding tidal wave are removed here too. Signed-off-by: Cezary Rojewski --- sound/soc/intel/common/soc-acpi-intel-bxt-match.c | 2 -- sound/soc/intel/common/soc-acpi-intel-byt-match.c | 2 -- sound/soc/intel/common/soc-acpi-intel-cnl-match.c | 1 - sound/soc/intel/common/soc-acpi-intel-glk-match.c | 3 --- sound/soc/intel/common/soc-acpi-intel-hda-match.c | 2 -- .../soc/intel/common/soc-acpi-intel-hsw-bdw-match.c | 4 ---- sound/soc/intel/common/soc-acpi-intel-icl-match.c | 1 - sound/soc/intel/common/soc-acpi-intel-kbl-match.c | 12 ------------ sound/soc/intel/common/soc-acpi-intel-skl-match.c | 3 --- sound/soc/intel/common/sst-dsp-priv.h | 1 - sound/soc/intel/skylake/skl.h | 1 - 11 files changed, 32 deletions(-) diff --git a/sound/soc/intel/common/soc-acpi-intel-bxt-match.c b/sound/soc/intel/common/soc-acpi-intel-bxt-match.c index 4a5adae1d785..eda799e49113 100644 --- a/sound/soc/intel/common/soc-acpi-intel-bxt-match.c +++ b/sound/soc/intel/common/soc-acpi-intel-bxt-match.c @@ -50,14 +50,12 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_bxt_machines[] = { { .id = "INT343A", .drv_name = "bxt_alc298s_i2s", - .fw_filename = "intel/dsp_fw_bxtn.bin", .sof_fw_filename = "sof-apl.ri", .sof_tplg_filename = "sof-apl-rt298.tplg", }, { .id = "DLGS7219", .drv_name = "bxt_da7219_max98357a", - .fw_filename = "intel/dsp_fw_bxtn.bin", .machine_quirk = snd_soc_acpi_codec_list, .quirk_data = &bxt_codecs, .sof_fw_filename = "sof-apl.ri", diff --git a/sound/soc/intel/common/soc-acpi-intel-byt-match.c b/sound/soc/intel/common/soc-acpi-intel-byt-match.c index 1cc801ba92eb..4d2ba663ee33 100644 --- a/sound/soc/intel/common/soc-acpi-intel-byt-match.c +++ b/sound/soc/intel/common/soc-acpi-intel-byt-match.c @@ -124,12 +124,10 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_baytrail_legacy_machines[] = { { .id = "10EC5640", .drv_name = "byt-rt5640", - .fw_filename = "intel/fw_sst_0f28.bin-48kHz_i2s_master", }, { .id = "193C9890", .drv_name = "byt-max98090", - .fw_filename = "intel/fw_sst_0f28.bin-48kHz_i2s_master", }, {} }; diff --git a/sound/soc/intel/common/soc-acpi-intel-cnl-match.c b/sound/soc/intel/common/soc-acpi-intel-cnl-match.c index 771b0ef21051..edc44a0dc96f 100644 --- a/sound/soc/intel/common/soc-acpi-intel-cnl-match.c +++ b/sound/soc/intel/common/soc-acpi-intel-cnl-match.c @@ -23,7 +23,6 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_cnl_machines[] = { { .id = "INT34C2", .drv_name = "cnl_rt274", - .fw_filename = "intel/dsp_fw_cnl.bin", .pdata = &cnl_pdata, .sof_fw_filename = "sof-cnl.ri", .sof_tplg_filename = "sof-cnl-rt274.tplg", diff --git a/sound/soc/intel/common/soc-acpi-intel-glk-match.c b/sound/soc/intel/common/soc-acpi-intel-glk-match.c index 60dea358fa04..370487d13c85 100644 --- a/sound/soc/intel/common/soc-acpi-intel-glk-match.c +++ b/sound/soc/intel/common/soc-acpi-intel-glk-match.c @@ -18,14 +18,12 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_glk_machines[] = { { .id = "INT343A", .drv_name = "glk_alc298s_i2s", - .fw_filename = "intel/dsp_fw_glk.bin", .sof_fw_filename = "sof-glk.ri", .sof_tplg_filename = "sof-glk-alc298.tplg", }, { .id = "DLGS7219", .drv_name = "glk_da7219_max98357a", - .fw_filename = "intel/dsp_fw_glk.bin", .machine_quirk = snd_soc_acpi_codec_list, .quirk_data = &glk_codecs, .sof_fw_filename = "sof-glk.ri", @@ -34,7 +32,6 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_glk_machines[] = { { .id = "10EC5682", .drv_name = "glk_rt5682_max98357a", - .fw_filename = "intel/dsp_fw_glk.bin", .machine_quirk = snd_soc_acpi_codec_list, .quirk_data = &glk_codecs, .sof_fw_filename = "sof-glk.ri", diff --git a/sound/soc/intel/common/soc-acpi-intel-hda-match.c b/sound/soc/intel/common/soc-acpi-intel-hda-match.c index cc972d2ac691..39827d2e8634 100644 --- a/sound/soc/intel/common/soc-acpi-intel-hda-match.c +++ b/sound/soc/intel/common/soc-acpi-intel-hda-match.c @@ -19,8 +19,6 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_hda_machines[] = { /* .id is not used in this file */ .drv_name = "skl_hda_dsp_generic", - /* .fw_filename is dynamically set in skylake driver */ - /* .sof_fw_filename is dynamically set in sof/intel driver */ .sof_tplg_filename = "sof-hda-generic.tplg", diff --git a/sound/soc/intel/common/soc-acpi-intel-hsw-bdw-match.c b/sound/soc/intel/common/soc-acpi-intel-hsw-bdw-match.c index 34eb0baaa951..6b113c32aff0 100644 --- a/sound/soc/intel/common/soc-acpi-intel-hsw-bdw-match.c +++ b/sound/soc/intel/common/soc-acpi-intel-hsw-bdw-match.c @@ -13,7 +13,6 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_haswell_machines[] = { { .id = "INT33CA", .drv_name = "haswell-audio", - .fw_filename = "intel/IntcSST1.bin", .sof_fw_filename = "sof-hsw.ri", .sof_tplg_filename = "sof-hsw.tplg", }, @@ -25,21 +24,18 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_broadwell_machines[] = { { .id = "INT343A", .drv_name = "broadwell-audio", - .fw_filename = "intel/IntcSST2.bin", .sof_fw_filename = "sof-bdw.ri", .sof_tplg_filename = "sof-bdw-rt286.tplg", }, { .id = "RT5677CE", .drv_name = "bdw-rt5677", - .fw_filename = "intel/IntcSST2.bin", .sof_fw_filename = "sof-bdw.ri", .sof_tplg_filename = "sof-bdw-rt5677.tplg", }, { .id = "INT33CA", .drv_name = "haswell-audio", - .fw_filename = "intel/IntcSST2.bin", .sof_fw_filename = "sof-bdw.ri", .sof_tplg_filename = "sof-bdw-rt5640.tplg", }, diff --git a/sound/soc/intel/common/soc-acpi-intel-icl-match.c b/sound/soc/intel/common/soc-acpi-intel-icl-match.c index 38977669b576..04a17da96f6a 100644 --- a/sound/soc/intel/common/soc-acpi-intel-icl-match.c +++ b/sound/soc/intel/common/soc-acpi-intel-icl-match.c @@ -18,7 +18,6 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_icl_machines[] = { { .id = "INT34C2", .drv_name = "icl_rt274", - .fw_filename = "intel/dsp_fw_icl.bin", .pdata = &icl_pdata, .sof_fw_filename = "sof-icl.ri", .sof_tplg_filename = "sof-icl-rt274.tplg", diff --git a/sound/soc/intel/common/soc-acpi-intel-kbl-match.c b/sound/soc/intel/common/soc-acpi-intel-kbl-match.c index e200baa11011..fe82d5472aa3 100644 --- a/sound/soc/intel/common/soc-acpi-intel-kbl-match.c +++ b/sound/soc/intel/common/soc-acpi-intel-kbl-match.c @@ -46,12 +46,10 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_kbl_machines[] = { { .id = "INT343A", .drv_name = "kbl_alc286s_i2s", - .fw_filename = "intel/dsp_fw_kbl.bin", }, { .id = "INT343B", .drv_name = "kbl_n88l25_s4567", - .fw_filename = "intel/dsp_fw_kbl.bin", .machine_quirk = snd_soc_acpi_codec_list, .quirk_data = &kbl_codecs, .pdata = &skl_dmic_data, @@ -59,7 +57,6 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_kbl_machines[] = { { .id = "MX98357A", .drv_name = "kbl_n88l25_m98357a", - .fw_filename = "intel/dsp_fw_kbl.bin", .machine_quirk = snd_soc_acpi_codec_list, .quirk_data = &kbl_codecs, .pdata = &skl_dmic_data, @@ -67,7 +64,6 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_kbl_machines[] = { { .id = "MX98927", .drv_name = "kbl_r5514_5663_max", - .fw_filename = "intel/dsp_fw_kbl.bin", .machine_quirk = snd_soc_acpi_codec_list, .quirk_data = &kbl_5663_5514_codecs, .pdata = &skl_dmic_data, @@ -75,7 +71,6 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_kbl_machines[] = { { .id = "MX98927", .drv_name = "kbl_rt5663_m98927", - .fw_filename = "intel/dsp_fw_kbl.bin", .machine_quirk = snd_soc_acpi_codec_list, .quirk_data = &kbl_poppy_codecs, .pdata = &skl_dmic_data, @@ -83,12 +78,10 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_kbl_machines[] = { { .id = "10EC5663", .drv_name = "kbl_rt5663", - .fw_filename = "intel/dsp_fw_kbl.bin", }, { .id = "DLGS7219", .drv_name = "kbl_da7219_max98357a", - .fw_filename = "intel/dsp_fw_kbl.bin", .machine_quirk = snd_soc_acpi_codec_list, .quirk_data = &kbl_7219_98357_codecs, .pdata = &skl_dmic_data, @@ -96,7 +89,6 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_kbl_machines[] = { { .id = "DLGS7219", .drv_name = "kbl_da7219_max98927", - .fw_filename = "intel/dsp_fw_kbl.bin", .machine_quirk = snd_soc_acpi_codec_list, .quirk_data = &kbl_7219_98927_codecs, .pdata = &skl_dmic_data @@ -104,17 +96,14 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_kbl_machines[] = { { .id = "10EC5660", .drv_name = "kbl_rt5660", - .fw_filename = "intel/dsp_fw_kbl.bin", }, { .id = "10EC3277", .drv_name = "kbl_rt5660", - .fw_filename = "intel/dsp_fw_kbl.bin", }, { .id = "DLGS7219", .drv_name = "kbl_da7219_max98373", - .fw_filename = "intel/dsp_fw_kbl.bin", .machine_quirk = snd_soc_acpi_codec_list, .quirk_data = &kbl_7219_98373_codecs, .pdata = &skl_dmic_data @@ -122,7 +111,6 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_kbl_machines[] = { { .id = "MX98373", .drv_name = "kbl_max98373", - .fw_filename = "intel/dsp_fw_kbl.bin", .pdata = &skl_dmic_data }, {}, diff --git a/sound/soc/intel/common/soc-acpi-intel-skl-match.c b/sound/soc/intel/common/soc-acpi-intel-skl-match.c index 42fa40a8d932..ec969044706c 100644 --- a/sound/soc/intel/common/soc-acpi-intel-skl-match.c +++ b/sound/soc/intel/common/soc-acpi-intel-skl-match.c @@ -21,12 +21,10 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_skl_machines[] = { { .id = "INT343A", .drv_name = "skl_alc286s_i2s", - .fw_filename = "intel/dsp_fw_release.bin", }, { .id = "INT343B", .drv_name = "skl_n88l25_s4567", - .fw_filename = "intel/dsp_fw_release.bin", .machine_quirk = snd_soc_acpi_codec_list, .quirk_data = &skl_codecs, .pdata = &skl_dmic_data, @@ -34,7 +32,6 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_skl_machines[] = { { .id = "MX98357A", .drv_name = "skl_n88l25_m98357a", - .fw_filename = "intel/dsp_fw_release.bin", .machine_quirk = snd_soc_acpi_codec_list, .quirk_data = &skl_codecs, .pdata = &skl_dmic_data, diff --git a/sound/soc/intel/common/sst-dsp-priv.h b/sound/soc/intel/common/sst-dsp-priv.h index a4628a89d47d..1a208ef65fa8 100644 --- a/sound/soc/intel/common/sst-dsp-priv.h +++ b/sound/soc/intel/common/sst-dsp-priv.h @@ -306,7 +306,6 @@ struct sst_dsp { int sst_state; struct skl_cl_dev cl_dev; u32 intr_status; - const struct firmware *fw; struct snd_dma_buffer dmab; }; diff --git a/sound/soc/intel/skylake/skl.h b/sound/soc/intel/skylake/skl.h index 218e8bda6cae..7b283c2bb7b5 100644 --- a/sound/soc/intel/skylake/skl.h +++ b/sound/soc/intel/skylake/skl.h @@ -76,7 +76,6 @@ struct skl_dev { struct list_head ppl_list; struct list_head bind_list; - const char *fw_name; char tplg_name[64]; unsigned short pci_id; const struct firmware *tplg;