From patchwork Fri Apr 9 22:01:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ranjani Sridharan X-Patchwork-Id: 12195105 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B3CDC433ED for ; Fri, 9 Apr 2021 22:03:23 +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 BD95B610D0 for ; Fri, 9 Apr 2021 22:03:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BD95B610D0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.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 017D11681; Sat, 10 Apr 2021 00:02:30 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 017D11681 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1618005800; bh=XoW9dqcdfjMQfc4S1ogkBKlR2sQK3jnvH05YsG9mnck=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=IOthiDoAtgbs+nzcuHjLeUhs8wyfpEyGT+tnjE8bAqtO9pqkXdFOclUHSi5nJWZwl 8EpUixz1ENw9grQM3Xqlbgv5R6ut+nBwI9pcHpKke1FLOyQYoRx0SDu8ROEH2wpDeK 4zlnR0XTwSvly2A1k5rFQVHqKArBSQnbjqPaMihY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 17882F8025C; Sat, 10 Apr 2021 00:01:48 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B7A0FF8032D; Sat, 10 Apr 2021 00:01:45 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 689BEF8016A for ; Sat, 10 Apr 2021 00:01:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 689BEF8016A IronPort-SDR: z6x5EKPVZbkiFV0RoDvyRNcdy0X+ieuXiDFsBTGBw7HR3Fj1b5QsksjwdHdLHWp5YuzQ1IY/hr XF7Dk1o/s9hQ== X-IronPort-AV: E=McAfee;i="6000,8403,9949"; a="214284727" X-IronPort-AV: E=Sophos;i="5.82,210,1613462400"; d="scan'208";a="214284727" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Apr 2021 15:01:35 -0700 IronPort-SDR: DxB7GMmNUcx4RftwlK3T7zYdNrxUWCRnsOP3fuUyQU/Mn6kNV2AkcMQMez0tygPVLloJd/smv1 S1bqYlZMr24g== X-IronPort-AV: E=Sophos;i="5.82,210,1613462400"; d="scan'208";a="599290604" Received: from ukorat-mobl2.amr.corp.intel.com (HELO rsridh-mobl1.localdomain) ([10.212.104.152]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Apr 2021 15:01:33 -0700 From: Ranjani Sridharan To: alsa-devel@alsa-project.org Subject: [PATCH 1/6] ASoC: SOF: add Kconfig option for probe workqueues Date: Fri, 9 Apr 2021 15:01:16 -0700 Message-Id: <20210409220121.1542362-2-ranjani.sridharan@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210409220121.1542362-1-ranjani.sridharan@linux.intel.com> References: <20210409220121.1542362-1-ranjani.sridharan@linux.intel.com> MIME-Version: 1.0 Cc: Daniel Baluta , Kai Vehmanen , tiwai@suse.de, Pierre-Louis Bossart , Ranjani Sridharan , broonie@kernel.org 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: Pierre-Louis Bossart The probe workqueue is currently used in the HDaudio case, following the example of the snd-hda-intel driver. For development and validation, it's useful to enable the probe workqueue even with ACPI devices or NOCODEC mode. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Daniel Baluta Reviewed-by: Kai Vehmanen Signed-off-by: Ranjani Sridharan --- sound/soc/sof/Kconfig | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sound/soc/sof/Kconfig b/sound/soc/sof/Kconfig index 8dfc165c3690..cd659493b5df 100644 --- a/sound/soc/sof/Kconfig +++ b/sound/soc/sof/Kconfig @@ -68,6 +68,17 @@ config SND_SOC_SOF_DEVELOPER_SUPPORT if SND_SOC_SOF_DEVELOPER_SUPPORT +config SND_SOC_SOF_FORCE_PROBE_WORKQUEUE + bool "SOF force probe workqueue" + select SND_SOC_SOF_PROBE_WORK_QUEUE + help + This option forces the use of a probe workqueue, which is only used + when HDaudio is enabled due to module dependencies. Forcing this + option is intended for debug only, but this should not add any + functional issues in nominal cases. + Say Y if you are involved in SOF development and need this option. + If not, select N. + config SND_SOC_SOF_NOCODEC tristate From patchwork Fri Apr 9 22:01:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ranjani Sridharan X-Patchwork-Id: 12195107 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D452DC433B4 for ; Fri, 9 Apr 2021 22:03:26 +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 2BF88610A8 for ; Fri, 9 Apr 2021 22:03:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2BF88610A8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.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 642BC166F; Sat, 10 Apr 2021 00:02:34 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 642BC166F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1618005804; bh=KuTupBgI05Ma4/2bnXrtTVfEnWLOYcuRBOggjYi9BQ8=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=soTnl0HTDLThHNTrS2jw+nrsDbQRzvFT0Fyb1k9zA+PCzcA+8Rjbpu0IbA/UsA5uL 5sYloLGfy6jI95cOrRoh4AVowf73rGHC8OuFBli+c2mjFuYvgRsdt42IEWZskqxCDW 9aYt+ZqQtJpRiDuzPTKEal2D6zyTY3SRomw2X6Q4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 95B07F80424; Sat, 10 Apr 2021 00:01:49 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 33979F8032C; Sat, 10 Apr 2021 00:01:47 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 006D6F801F5 for ; Sat, 10 Apr 2021 00:01:39 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 006D6F801F5 IronPort-SDR: aUI6I1kIL5pe2aQBH3tm+TyUq+AICbQUffInDzQJ5JhbKweHX+9N75hzbDbjPPrHbCkhe18mwo RRFcEeolFMkA== X-IronPort-AV: E=McAfee;i="6000,8403,9949"; a="214284729" X-IronPort-AV: E=Sophos;i="5.82,210,1613462400"; d="scan'208";a="214284729" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Apr 2021 15:01:36 -0700 IronPort-SDR: 4ZuvmOdWxUDnQMLi/oaT2ryt7E2PupBp6zaWCSwcJTo/9drTSr4XR0NNZKOkLyRIX2T013qpko 8m+eJaUVNI7A== X-IronPort-AV: E=Sophos;i="5.82,210,1613462400"; d="scan'208";a="599290614" Received: from ukorat-mobl2.amr.corp.intel.com (HELO rsridh-mobl1.localdomain) ([10.212.104.152]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Apr 2021 15:01:34 -0700 From: Ranjani Sridharan To: alsa-devel@alsa-project.org Subject: [PATCH 2/6] ASoC: soc-acpi: add new fields for mach_params Date: Fri, 9 Apr 2021 15:01:17 -0700 Message-Id: <20210409220121.1542362-3-ranjani.sridharan@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210409220121.1542362-1-ranjani.sridharan@linux.intel.com> References: <20210409220121.1542362-1-ranjani.sridharan@linux.intel.com> MIME-Version: 1.0 Cc: Daniel Baluta , Kai Vehmanen , tiwai@suse.de, Pierre-Louis Bossart , Ranjani Sridharan , broonie@kernel.org 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: Pierre-Louis Bossart We currently have an ugly way of handling the SOF nocodec mode, with blatant violations between layers. To create the nocodec card, let's add two new fields and the existing mach_params structure, that way there will be no differences with regular cards. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Daniel Baluta Reviewed-by: Kai Vehmanen Signed-off-by: Ranjani Sridharan --- include/sound/soc-acpi.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/sound/soc-acpi.h b/include/sound/soc-acpi.h index c45075024c30..2f3fa385c092 100644 --- a/include/sound/soc-acpi.h +++ b/include/sound/soc-acpi.h @@ -63,6 +63,8 @@ static inline struct snd_soc_acpi_mach *snd_soc_acpi_codec_list(void *arg) * @common_hdmi_codec_drv: use commom HDAudio HDMI codec driver * @link_mask: links enabled on the board * @links: array of link _ADR descriptors, null terminated + * @num_dai_drivers: number of elements in @dai_drivers + * @dai_drivers: pointer to dai_drivers, used e.g. in nocodec mode */ struct snd_soc_acpi_mach_params { u32 acpi_ipc_irq_index; @@ -72,6 +74,8 @@ struct snd_soc_acpi_mach_params { bool common_hdmi_codec_drv; u32 link_mask; const struct snd_soc_acpi_link_adr *links; + u32 num_dai_drivers; + struct snd_soc_dai_driver *dai_drivers; }; /** From patchwork Fri Apr 9 22:01:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ranjani Sridharan X-Patchwork-Id: 12195109 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F023C433B4 for ; Fri, 9 Apr 2021 22:04: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 99981610CF for ; Fri, 9 Apr 2021 22:04:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 99981610CF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.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 EBE501694; Sat, 10 Apr 2021 00:03:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz EBE501694 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1618005839; bh=wFirM4FCTNolF1QVetF9b3zGBiumFy4+eU2wfJX+gRI=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Us9oF5/EjzO0n7yXsZgD8m0LaVfcIrY4pn9dn83jU8vtKImjy5//0xuk8ypwEwShN JBs5eIMG4SSCl1Oh3XmDtvCVkESaueYtd/QYCjJOEKYkHxau4w50WODg4axt8RdT6O uUgnHbwWA2E8IzNoZjwcCmqywQHHkErs1VuRsaQw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 32480F80260; Sat, 10 Apr 2021 00:01:53 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D2B64F80431; Sat, 10 Apr 2021 00:01:50 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 EE288F80162 for ; Sat, 10 Apr 2021 00:01:40 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz EE288F80162 IronPort-SDR: ogjBV2ATX2ozYEKBJKXae1zMu+o5B7hVeYMo9VFdbUqOYaxvhtzY3ZLCQuJjyIbKzVtOSkyXEX a7491gNjmbig== X-IronPort-AV: E=McAfee;i="6000,8403,9949"; a="214284730" X-IronPort-AV: E=Sophos;i="5.82,210,1613462400"; d="scan'208";a="214284730" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Apr 2021 15:01:37 -0700 IronPort-SDR: oTEMVFqbH0lsalEd4AqA7SL0rMXvxLk22Wpfy9/yxnqyXGytxEZMx6IdpkgWXSyHlQycWFcR9B 6cQL8F7MdiZQ== X-IronPort-AV: E=Sophos;i="5.82,210,1613462400"; d="scan'208";a="599290630" Received: from ukorat-mobl2.amr.corp.intel.com (HELO rsridh-mobl1.localdomain) ([10.212.104.152]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Apr 2021 15:01:36 -0700 From: Ranjani Sridharan To: alsa-devel@alsa-project.org Subject: [PATCH 3/6] ASoC: SOF: change signature of set_mach_params() callback Date: Fri, 9 Apr 2021 15:01:18 -0700 Message-Id: <20210409220121.1542362-4-ranjani.sridharan@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210409220121.1542362-1-ranjani.sridharan@linux.intel.com> References: <20210409220121.1542362-1-ranjani.sridharan@linux.intel.com> MIME-Version: 1.0 Cc: Daniel Baluta , Kai Vehmanen , tiwai@suse.de, Pierre-Louis Bossart , Ranjani Sridharan , broonie@kernel.org 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: Pierre-Louis Bossart To set additional parameters, we need to have access to sdev, not the plain vanilla struct device pointer. No functionality change. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Daniel Baluta Reviewed-by: Kai Vehmanen Signed-off-by: Ranjani Sridharan --- sound/soc/sof/intel/bdw.c | 4 ++-- sound/soc/sof/intel/byt.c | 18 +++++++++--------- sound/soc/sof/intel/hda.c | 4 ++-- sound/soc/sof/intel/hda.h | 2 +- sound/soc/sof/ops.h | 6 ++---- sound/soc/sof/sof-audio.c | 4 ++-- sound/soc/sof/sof-priv.h | 2 +- 7 files changed, 19 insertions(+), 21 deletions(-) diff --git a/sound/soc/sof/intel/bdw.c b/sound/soc/sof/intel/bdw.c index fd5ae628732d..28e049ac9c5e 100644 --- a/sound/soc/sof/intel/bdw.c +++ b/sound/soc/sof/intel/bdw.c @@ -559,12 +559,12 @@ static void bdw_machine_select(struct snd_sof_dev *sdev) } static void bdw_set_mach_params(const struct snd_soc_acpi_mach *mach, - struct device *dev) + struct snd_sof_dev *sdev) { struct snd_soc_acpi_mach_params *mach_params; mach_params = (struct snd_soc_acpi_mach_params *)&mach->mach_params; - mach_params->platform = dev_name(dev); + mach_params->platform = dev_name(sdev->dev); } /* Broadwell DAIs */ diff --git a/sound/soc/sof/intel/byt.c b/sound/soc/sof/intel/byt.c index 2846fdec9d95..bed26d96dc50 100644 --- a/sound/soc/sof/intel/byt.c +++ b/sound/soc/sof/intel/byt.c @@ -427,15 +427,6 @@ static void byt_machine_select(struct snd_sof_dev *sdev) sof_pdata->machine = mach; } -static void byt_set_mach_params(const struct snd_soc_acpi_mach *mach, - struct device *dev) -{ - struct snd_soc_acpi_mach_params *mach_params; - - mach_params = (struct snd_soc_acpi_mach_params *)&mach->mach_params; - mach_params->platform = dev_name(dev); -} - /* Baytrail DAIs */ static struct snd_soc_dai_driver byt_dai[] = { { @@ -506,6 +497,15 @@ static struct snd_soc_dai_driver byt_dai[] = { }, }; +static void byt_set_mach_params(const struct snd_soc_acpi_mach *mach, + struct snd_sof_dev *sdev) +{ + struct snd_soc_acpi_mach_params *mach_params; + + mach_params = (struct snd_soc_acpi_mach_params *)&mach->mach_params; + mach_params->platform = dev_name(sdev->dev); +} + /* * Probe and remove. */ diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c index 5317dfa4a4bf..065b85285450 100644 --- a/sound/soc/sof/intel/hda.c +++ b/sound/soc/sof/intel/hda.c @@ -1213,12 +1213,12 @@ static int hda_sdw_machine_select(struct snd_sof_dev *sdev) #endif void hda_set_mach_params(const struct snd_soc_acpi_mach *mach, - struct device *dev) + struct snd_sof_dev *sdev) { struct snd_soc_acpi_mach_params *mach_params; mach_params = (struct snd_soc_acpi_mach_params *)&mach->mach_params; - mach_params->platform = dev_name(dev); + mach_params->platform = dev_name(sdev->dev); } void hda_machine_select(struct snd_sof_dev *sdev) diff --git a/sound/soc/sof/intel/hda.h b/sound/soc/sof/intel/hda.h index ae80725b0e33..4d44f8910393 100644 --- a/sound/soc/sof/intel/hda.h +++ b/sound/soc/sof/intel/hda.h @@ -763,7 +763,7 @@ extern const struct sof_intel_dsp_desc adls_chip_info; /* machine driver select */ void hda_machine_select(struct snd_sof_dev *sdev); void hda_set_mach_params(const struct snd_soc_acpi_mach *mach, - struct device *dev); + struct snd_sof_dev *sdev); /* PCI driver selection and probe */ int hda_pci_intel_probe(struct pci_dev *pci, const struct pci_device_id *pci_id); diff --git a/sound/soc/sof/ops.h b/sound/soc/sof/ops.h index 5099ad03df72..323a0b3f561b 100644 --- a/sound/soc/sof/ops.h +++ b/sound/soc/sof/ops.h @@ -497,12 +497,10 @@ snd_sof_machine_select(struct snd_sof_dev *sdev) static inline void snd_sof_set_mach_params(const struct snd_soc_acpi_mach *mach, - struct device *dev) + struct snd_sof_dev *sdev) { - struct snd_sof_dev *sdev = dev_get_drvdata(dev); - if (sof_ops(sdev) && sof_ops(sdev)->set_mach_params) - sof_ops(sdev)->set_mach_params(mach, dev); + sof_ops(sdev)->set_mach_params(mach, sdev); } static inline const struct snd_sof_dsp_ops diff --git a/sound/soc/sof/sof-audio.c b/sound/soc/sof/sof-audio.c index 928d7a46d820..5d13bafd4736 100644 --- a/sound/soc/sof/sof-audio.c +++ b/sound/soc/sof/sof-audio.c @@ -475,7 +475,7 @@ int sof_machine_check(struct snd_sof_dev *sdev) /* find machine */ snd_sof_machine_select(sdev); if (sof_pdata->machine) { - snd_sof_set_mach_params(sof_pdata->machine, sdev->dev); + snd_sof_set_mach_params(sof_pdata->machine, sdev); return 0; } @@ -500,7 +500,7 @@ int sof_machine_check(struct snd_sof_dev *sdev) return ret; sof_pdata->machine = mach; - snd_sof_set_mach_params(sof_pdata->machine, sdev->dev); + snd_sof_set_mach_params(sof_pdata->machine, sdev); return 0; } diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h index ad0d7ba2708c..fd8423172d8f 100644 --- a/sound/soc/sof/sof-priv.h +++ b/sound/soc/sof/sof-priv.h @@ -259,7 +259,7 @@ struct snd_sof_dsp_ops { void *pdata); /* optional */ void (*machine_select)(struct snd_sof_dev *sdev); /* optional */ void (*set_mach_params)(const struct snd_soc_acpi_mach *mach, - struct device *dev); /* optional */ + struct snd_sof_dev *sdev); /* optional */ /* DAI ops */ struct snd_soc_dai_driver *drv; From patchwork Fri Apr 9 22:01:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ranjani Sridharan X-Patchwork-Id: 12195113 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B75FC433ED for ; Fri, 9 Apr 2021 22:04: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 06D0F610D0 for ; Fri, 9 Apr 2021 22:04:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 06D0F610D0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.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 6B8EC1679; Sat, 10 Apr 2021 00:03:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6B8EC1679 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1618005886; bh=c3YSePEGFC7S+qr7jf40HKsbqSOPQJEEIT7blFOURSM=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Srg0TxmfrwTcMKHN5wmyPhIQ/e71mbjC5j3gA2/Uip5EcZjF1IFRX0UZJcrdVb508 /BGMqewZbmjOhhYTFLXkDDMIO/qfHldBWtcO/LaN+gozJutnRKNrx84f5OEthjFZxZ OCZ2GojIYUIO1qTHcqxyr4A+wgWfViwva093MIUQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id A5CC2F80475; Sat, 10 Apr 2021 00:01:54 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5F84CF80425; Sat, 10 Apr 2021 00:01:52 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 C7F38F80245 for ; Sat, 10 Apr 2021 00:01:41 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C7F38F80245 IronPort-SDR: FoQsVf5BZcwPstayectz2RqQg3zQekGPweE8vhpWkO13AKdQ52KN8EoKBp46rcIm5RdOu82R4H CHhKVQ32JVlg== X-IronPort-AV: E=McAfee;i="6000,8403,9949"; a="214284731" X-IronPort-AV: E=Sophos;i="5.82,210,1613462400"; d="scan'208";a="214284731" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Apr 2021 15:01:39 -0700 IronPort-SDR: BKfVkOQ2YcPI4VvuOAwqV+Ijfn/pRpmuruG5GU4ddnxtf0bkNeybAOcXQFSdvlZ71Uke48WZ2V Yw3xJdZezh4g== X-IronPort-AV: E=Sophos;i="5.82,210,1613462400"; d="scan'208";a="599290635" Received: from ukorat-mobl2.amr.corp.intel.com (HELO rsridh-mobl1.localdomain) ([10.212.104.152]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Apr 2021 15:01:36 -0700 From: Ranjani Sridharan To: alsa-devel@alsa-project.org Subject: [PATCH 4/6] ASoC: SOF: Intel: update set_mach_params() Date: Fri, 9 Apr 2021 15:01:19 -0700 Message-Id: <20210409220121.1542362-5-ranjani.sridharan@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210409220121.1542362-1-ranjani.sridharan@linux.intel.com> References: <20210409220121.1542362-1-ranjani.sridharan@linux.intel.com> MIME-Version: 1.0 Cc: Daniel Baluta , Kai Vehmanen , tiwai@suse.de, Pierre-Louis Bossart , Ranjani Sridharan , broonie@kernel.org 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: Pierre-Louis Bossart Add information for num_dai_drivers and dai_drivers[], which will be used in the refactored nocodec implementation Signed-off-by: Pierre-Louis Bossart Reviewed-by: Daniel Baluta Reviewed-by: Kai Vehmanen Signed-off-by: Ranjani Sridharan --- sound/soc/sof/intel/bdw.c | 4 ++++ sound/soc/sof/intel/byt.c | 4 ++++ sound/soc/sof/intel/hda.c | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/sound/soc/sof/intel/bdw.c b/sound/soc/sof/intel/bdw.c index 28e049ac9c5e..89a6c1f04a55 100644 --- a/sound/soc/sof/intel/bdw.c +++ b/sound/soc/sof/intel/bdw.c @@ -561,10 +561,14 @@ static void bdw_machine_select(struct snd_sof_dev *sdev) static void bdw_set_mach_params(const struct snd_soc_acpi_mach *mach, struct snd_sof_dev *sdev) { + struct snd_sof_pdata *pdata = sdev->pdata; + const struct sof_dev_desc *desc = pdata->desc; struct snd_soc_acpi_mach_params *mach_params; mach_params = (struct snd_soc_acpi_mach_params *)&mach->mach_params; mach_params->platform = dev_name(sdev->dev); + mach_params->num_dai_drivers = desc->ops->num_drv; + mach_params->dai_drivers = desc->ops->drv; } /* Broadwell DAIs */ diff --git a/sound/soc/sof/intel/byt.c b/sound/soc/sof/intel/byt.c index bed26d96dc50..d9803e2ba67f 100644 --- a/sound/soc/sof/intel/byt.c +++ b/sound/soc/sof/intel/byt.c @@ -500,10 +500,14 @@ static struct snd_soc_dai_driver byt_dai[] = { static void byt_set_mach_params(const struct snd_soc_acpi_mach *mach, struct snd_sof_dev *sdev) { + struct snd_sof_pdata *pdata = sdev->pdata; + const struct sof_dev_desc *desc = pdata->desc; struct snd_soc_acpi_mach_params *mach_params; mach_params = (struct snd_soc_acpi_mach_params *)&mach->mach_params; mach_params->platform = dev_name(sdev->dev); + mach_params->num_dai_drivers = desc->ops->num_drv; + mach_params->dai_drivers = desc->ops->drv; } /* diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c index 065b85285450..b00e8fcb2312 100644 --- a/sound/soc/sof/intel/hda.c +++ b/sound/soc/sof/intel/hda.c @@ -1215,10 +1215,14 @@ static int hda_sdw_machine_select(struct snd_sof_dev *sdev) void hda_set_mach_params(const struct snd_soc_acpi_mach *mach, struct snd_sof_dev *sdev) { + struct snd_sof_pdata *pdata = sdev->pdata; + const struct sof_dev_desc *desc = pdata->desc; struct snd_soc_acpi_mach_params *mach_params; mach_params = (struct snd_soc_acpi_mach_params *)&mach->mach_params; mach_params->platform = dev_name(sdev->dev); + mach_params->num_dai_drivers = desc->ops->num_drv; + mach_params->dai_drivers = desc->ops->drv; } void hda_machine_select(struct snd_sof_dev *sdev) From patchwork Fri Apr 9 22:01:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ranjani Sridharan X-Patchwork-Id: 12195111 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F33E5C433B4 for ; Fri, 9 Apr 2021 22:04:12 +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 54135610CF for ; Fri, 9 Apr 2021 22:04:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 54135610CF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.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 EAEB01697; Sat, 10 Apr 2021 00:03:20 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz EAEB01697 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1618005851; bh=KDCGOo5AqndK0Ik4SnhT0ZpHAcLlPT5jH7aJ2r770ek=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Phgy8W5lzjRDTdlYUVxiUy8hum0OUPSgdBBDWz/1s2vc8cTZiK2x6ddLuA12CZtqW Csv6xrs4ITih6YRnoNqAqajcRRsEQpE8YrJUG2ItvU99hNzoTJa+miDpsTfjAT69JJ wpV3RqVYpkatvIoCXzmkMDsWcAVlUK63i3PEPLuc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id EE238F80431; Sat, 10 Apr 2021 00:01:53 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E1EFBF8042F; Sat, 10 Apr 2021 00:01:51 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 DB276F80260 for ; Sat, 10 Apr 2021 00:01:41 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz DB276F80260 IronPort-SDR: MQodrjbAEdTxceAXESrfWXzMbv9a9Dlf/yIPRge/Cla5Oe5Wzsr5CG7Xdu2XIS5VaxrrOxKnHL Ntnro1O+6hqQ== X-IronPort-AV: E=McAfee;i="6000,8403,9949"; a="214284734" X-IronPort-AV: E=Sophos;i="5.82,210,1613462400"; d="scan'208";a="214284734" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Apr 2021 15:01:39 -0700 IronPort-SDR: ev2Xmty/kfStGth8MxbM83LPaZyAm7G+hYnpeoerKK/SEsOoKPVTYE7VY/d0HVjMhyxXKM5cac 1lIEx8L17tmg== X-IronPort-AV: E=Sophos;i="5.82,210,1613462400"; d="scan'208";a="599290644" Received: from ukorat-mobl2.amr.corp.intel.com (HELO rsridh-mobl1.localdomain) ([10.212.104.152]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Apr 2021 15:01:38 -0700 From: Ranjani Sridharan To: alsa-devel@alsa-project.org Subject: [PATCH 5/6] ASoC: SOF: pcm: export snd_pcm_dai_link_fixup Date: Fri, 9 Apr 2021 15:01:20 -0700 Message-Id: <20210409220121.1542362-6-ranjani.sridharan@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210409220121.1542362-1-ranjani.sridharan@linux.intel.com> References: <20210409220121.1542362-1-ranjani.sridharan@linux.intel.com> MIME-Version: 1.0 Cc: Daniel Baluta , Kai Vehmanen , tiwai@suse.de, Pierre-Louis Bossart , Ranjani Sridharan , broonie@kernel.org 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: Pierre-Louis Bossart In preparation of the nocodec refactoring, export the dai-link fixup. This will also be required when we have more clients and platform drivers. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Daniel Baluta Reviewed-by: Kai Vehmanen Signed-off-by: Ranjani Sridharan --- sound/soc/sof/pcm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/sof/pcm.c b/sound/soc/sof/pcm.c index d6b1c8b7bdfb..9893b182da43 100644 --- a/sound/soc/sof/pcm.c +++ b/sound/soc/sof/pcm.c @@ -775,6 +775,7 @@ int sof_pcm_dai_link_fixup(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_pa return 0; } +EXPORT_SYMBOL(sof_pcm_dai_link_fixup); static int sof_pcm_probe(struct snd_soc_component *component) { From patchwork Fri Apr 9 22:01:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ranjani Sridharan X-Patchwork-Id: 12195115 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A89CC433ED for ; Fri, 9 Apr 2021 22:04:54 +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 A949C610CF for ; Fri, 9 Apr 2021 22:04:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A949C610CF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.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 3D9A01681; Sat, 10 Apr 2021 00:04:02 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3D9A01681 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1618005892; bh=5YDSdjSqFjV/5k4IUgoKxkZ0WuQ4XpHiX1Lna2hiq8E=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=MnIeu9X4KrwifZiY5qIrc+rW1/eayB2mXmH/wmR7Exv5CxM/TH5n/QW6MyUYHpSZm tJrZkNd2Q3GYR7DtzHAqyTShGjcdlYcz6ABcN10vP4oUpxOuvqoYDdTkIpv11mDyqH cksOBHb6eJvNjvP/0ZynIgdtCjKHVOXE7ssxW4Nk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C819EF804AC; Sat, 10 Apr 2021 00:01:55 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B29C7F80245; Sat, 10 Apr 2021 00:01:52 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 01588F802C9 for ; Sat, 10 Apr 2021 00:01:42 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 01588F802C9 IronPort-SDR: iEuSDxj8eORvyDpS6qjOUEtFeYvUp1I/zVg2P4qC+JlMTJMhRe9yo2ajsCFqhwrOq1IwVfuqdw Z8dRt4xlwhKw== X-IronPort-AV: E=McAfee;i="6000,8403,9949"; a="214284737" X-IronPort-AV: E=Sophos;i="5.82,210,1613462400"; d="scan'208";a="214284737" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Apr 2021 15:01:41 -0700 IronPort-SDR: 3STFujXkU87WWze1gUnrsZQj5YF2sLZVOcSv3ximKGIKy/hEHBcxLMVpgNbDD8kvT6fqodFfG1 lkFCvJeJ9yyA== X-IronPort-AV: E=Sophos;i="5.82,210,1613462400"; d="scan'208";a="599290648" Received: from ukorat-mobl2.amr.corp.intel.com (HELO rsridh-mobl1.localdomain) ([10.212.104.152]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Apr 2021 15:01:39 -0700 From: Ranjani Sridharan To: alsa-devel@alsa-project.org Subject: [PATCH 6/6] ASOC: SOF: simplify nocodec mode Date: Fri, 9 Apr 2021 15:01:21 -0700 Message-Id: <20210409220121.1542362-7-ranjani.sridharan@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210409220121.1542362-1-ranjani.sridharan@linux.intel.com> References: <20210409220121.1542362-1-ranjani.sridharan@linux.intel.com> MIME-Version: 1.0 Cc: Daniel Baluta , Kai Vehmanen , tiwai@suse.de, Pierre-Louis Bossart , Ranjani Sridharan , broonie@kernel.org 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: Pierre-Louis Bossart Replace ugly #if (!IS_ENABLED) by if (!IS_ENABLED), remove cross-module dependencies and use classic mechanism to pass information to the machine driver. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Daniel Baluta Reviewed-by: Kai Vehmanen Signed-off-by: Ranjani Sridharan --- include/sound/sof.h | 3 --- sound/soc/sof/nocodec.c | 39 +++++++++++++++++++++------------------ sound/soc/sof/sof-audio.c | 32 ++++++++++++++------------------ 3 files changed, 35 insertions(+), 39 deletions(-) diff --git a/include/sound/sof.h b/include/sound/sof.h index b93bb8038080..502ed9b8d6a1 100644 --- a/include/sound/sof.h +++ b/include/sound/sof.h @@ -100,9 +100,6 @@ struct sof_dev_desc { const struct snd_sof_dsp_ops *ops; }; -int sof_nocodec_setup(struct device *dev, const struct snd_sof_dsp_ops *ops, - int (*pcm_dai_link_fixup)(struct snd_soc_pcm_runtime *rtd, - struct snd_pcm_hw_params *params)); int sof_dai_get_mclk(struct snd_soc_pcm_runtime *rtd); #endif diff --git a/sound/soc/sof/nocodec.c b/sound/soc/sof/nocodec.c index 3b9bb2e83a86..356497fe4f4c 100644 --- a/sound/soc/sof/nocodec.c +++ b/sound/soc/sof/nocodec.c @@ -20,16 +20,14 @@ static struct snd_soc_card sof_nocodec_card = { }; static int sof_nocodec_bes_setup(struct device *dev, - const struct snd_sof_dsp_ops *ops, + struct snd_soc_dai_driver *drv, struct snd_soc_dai_link *links, - int link_num, struct snd_soc_card *card, - int (*pcm_dai_link_fixup)(struct snd_soc_pcm_runtime *rtd, - struct snd_pcm_hw_params *params)) + int link_num, struct snd_soc_card *card) { struct snd_soc_dai_link_component *dlc; int i; - if (!ops || !links || !card) + if (!drv || !links || !card) return -EINVAL; /* set up BE dai_links */ @@ -55,16 +53,16 @@ static int sof_nocodec_bes_setup(struct device *dev, links[i].id = i; links[i].no_pcm = 1; - links[i].cpus->dai_name = ops->drv[i].name; - links[i].platforms->name = dev_name(dev); + links[i].cpus->dai_name = drv[i].name; + links[i].platforms->name = dev_name(dev->parent); links[i].codecs->dai_name = "snd-soc-dummy-dai"; links[i].codecs->name = "snd-soc-dummy"; - if (ops->drv[i].playback.channels_min) + if (drv[i].playback.channels_min) links[i].dpcm_playback = 1; - if (ops->drv[i].capture.channels_min) + if (drv[i].capture.channels_min) links[i].dpcm_capture = 1; - links[i].be_hw_params_fixup = pcm_dai_link_fixup; + links[i].be_hw_params_fixup = sof_pcm_dai_link_fixup; } card->dai_link = links; @@ -73,29 +71,34 @@ static int sof_nocodec_bes_setup(struct device *dev, return 0; } -int sof_nocodec_setup(struct device *dev, const struct snd_sof_dsp_ops *ops, - int (*pcm_dai_link_fixup)(struct snd_soc_pcm_runtime *rtd, - struct snd_pcm_hw_params *params)) +static int sof_nocodec_setup(struct device *dev, + u32 num_dai_drivers, + struct snd_soc_dai_driver *dai_drivers) { struct snd_soc_dai_link *links; /* create dummy BE dai_links */ - links = devm_kzalloc(dev, sizeof(struct snd_soc_dai_link) * - ops->num_drv, GFP_KERNEL); + links = devm_kzalloc(dev, sizeof(struct snd_soc_dai_link) * num_dai_drivers, GFP_KERNEL); if (!links) return -ENOMEM; - return sof_nocodec_bes_setup(dev, ops, links, ops->num_drv, - &sof_nocodec_card, pcm_dai_link_fixup); + return sof_nocodec_bes_setup(dev, dai_drivers, links, num_dai_drivers, &sof_nocodec_card); } -EXPORT_SYMBOL(sof_nocodec_setup); static int sof_nocodec_probe(struct platform_device *pdev) { struct snd_soc_card *card = &sof_nocodec_card; + struct snd_soc_acpi_mach *mach; + int ret; card->dev = &pdev->dev; card->topology_shortname_created = true; + mach = pdev->dev.platform_data; + + ret = sof_nocodec_setup(card->dev, mach->mach_params.num_dai_drivers, + mach->mach_params.dai_drivers); + if (ret < 0) + return ret; return devm_snd_soc_register_card(&pdev->dev, card); } diff --git a/sound/soc/sof/sof-audio.c b/sound/soc/sof/sof-audio.c index 5d13bafd4736..0d0d47dc0246 100644 --- a/sound/soc/sof/sof-audio.c +++ b/sound/soc/sof/sof-audio.c @@ -468,24 +468,24 @@ int sof_machine_check(struct snd_sof_dev *sdev) struct snd_sof_pdata *sof_pdata = sdev->pdata; const struct sof_dev_desc *desc = sof_pdata->desc; struct snd_soc_acpi_mach *mach; - int ret; -#if !IS_ENABLED(CONFIG_SND_SOC_SOF_FORCE_NOCODEC_MODE) + if (!IS_ENABLED(CONFIG_SND_SOC_SOF_FORCE_NOCODEC_MODE)) { - /* find machine */ - snd_sof_machine_select(sdev); - if (sof_pdata->machine) { - snd_sof_set_mach_params(sof_pdata->machine, sdev); - return 0; + /* find machine */ + snd_sof_machine_select(sdev); + if (sof_pdata->machine) { + snd_sof_set_mach_params(sof_pdata->machine, sdev); + return 0; + } + + if (!IS_ENABLED(CONFIG_SND_SOC_SOF_NOCODEC)) { + dev_err(sdev->dev, "error: no matching ASoC machine driver found - aborting probe\n"); + return -ENODEV; + } + } else { + dev_warn(sdev->dev, "Force to use nocodec mode\n"); } -#if !IS_ENABLED(CONFIG_SND_SOC_SOF_NOCODEC) - dev_err(sdev->dev, "error: no matching ASoC machine driver found - aborting probe\n"); - return -ENODEV; -#endif -#else - dev_warn(sdev->dev, "Force to use nocodec mode\n"); -#endif /* select nocodec mode */ dev_warn(sdev->dev, "Using nocodec machine driver\n"); mach = devm_kzalloc(sdev->dev, sizeof(*mach), GFP_KERNEL); @@ -495,10 +495,6 @@ int sof_machine_check(struct snd_sof_dev *sdev) mach->drv_name = "sof-nocodec"; sof_pdata->tplg_filename = desc->nocodec_tplg_filename; - ret = sof_nocodec_setup(sdev->dev, desc->ops, sof_pcm_dai_link_fixup); - if (ret < 0) - return ret; - sof_pdata->machine = mach; snd_sof_set_mach_params(sof_pdata->machine, sdev);