From patchwork Mon Jul 31 21:42:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 708780 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 18D70C04A94 for ; Mon, 31 Jul 2023 21:45:02 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 58CCA84C; Mon, 31 Jul 2023 23:44:10 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 58CCA84C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1690839900; bh=WlBkdJ5rj3Uxr5UhH7SCr+UPDc07GDEHpAY59moUBwU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=dxWZQzi1FLcVCgGKkjN0+cfmMTtqzPqrwYAyUJpkjWO/dyv8iqoGgPgqznhTyvkFY NDidnEiGVuSiUwpL8wIqs0k+j5P3jaBsXyIUjXrTXpweDv0QzBcpvta7SajqmsV6mE S7LqzFcEKK2hqENe+Ql30G/I+5hqWuYpsZzrK8Fk= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7DDC7F80568; Mon, 31 Jul 2023 23:43:20 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 14051F8055C; Mon, 31 Jul 2023 23:43:20 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id BFC6CF8015B; Mon, 31 Jul 2023 23:43:15 +0200 (CEST) Received: from mgamail.intel.com (unknown [134.134.136.100]) (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 34403F8015B for ; Mon, 31 Jul 2023 23:43:11 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 34403F8015B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=ae8ESqY3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690839793; x=1722375793; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WlBkdJ5rj3Uxr5UhH7SCr+UPDc07GDEHpAY59moUBwU=; b=ae8ESqY3RUlVNCk91dC/r+AxY8ssMffraTaxnHzAXKyR8MafbYYAIq5T Bi9IXDVXdirGQ1IN/+KeXNhD1ry9ysZJMHDSRojqHq3DltXfIUvGxgzKl MlkfXx8AY0kJbq62DICikivwiZxmwXXtosr+aDGhYckZUVVYIZyrMB3/M 6MDbJRmUZa4Bg2wFPuO1aTPoRZ7iRljpVVPlzIi55AQIDy+y/5tvcIDvL QEMbRgEar7oE0Tfm2fuifpFkq2JdUUGH2yWaBl7ioG8eRIDZXRpCCJ8yN ui7zjpwIJkA1nClzy76QktSwvPw71kss61kIxu85MU2qqE4uxr/7A6N6e w==; X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="435449729" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="435449729" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="763523519" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="763523519" Received: from youngnic-mobl1.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.209.180.66]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:07 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Cc: tiwai@suse.de, broonie@kernel.org, Balamurugan C , Bard Liao , Pierre-Louis Bossart Subject: [PATCH 01/23] ASoC: Intel: soc-acpi: Add entry for rt711-sdca-sdw at link 0 in RPL match table Date: Mon, 31 Jul 2023 16:42:35 -0500 Message-Id: <20230731214257.444605-2-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> References: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: BK4FQWLE7LZUUA7D62JVOKACYNZ5ED5H X-Message-ID-Hash: BK4FQWLE7LZUUA7D62JVOKACYNZ5ED5H X-MailFrom: pierre-louis.bossart@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Balamurugan C Adding RT711 sdca SDW codec support with SDW0 link for RPL RVP platforms Reviewed-by: Bard Liao Signed-off-by: Balamurugan C Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/common/soc-acpi-intel-rpl-match.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sound/soc/intel/common/soc-acpi-intel-rpl-match.c b/sound/soc/intel/common/soc-acpi-intel-rpl-match.c index 302a08018572..99dc76c99f0d 100644 --- a/sound/soc/intel/common/soc-acpi-intel-rpl-match.c +++ b/sound/soc/intel/common/soc-acpi-intel-rpl-match.c @@ -308,6 +308,15 @@ static const struct snd_soc_acpi_link_adr rpl_sdw_rt1316_link12_rt714_link0[] = {} }; +static const struct snd_soc_acpi_link_adr rpl_sdca_rvp[] = { + { + .mask = BIT(0), + .num_adr = ARRAY_SIZE(rt711_sdca_0_adr), + .adr_d = rt711_sdca_0_adr, + }, + {} +}; + static const struct snd_soc_acpi_link_adr rplp_crb[] = { { .mask = BIT(2), @@ -413,6 +422,12 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_rpl_sdw_machines[] = { .drv_name = "sof_sdw", .sof_tplg_filename = "sof-rpl-rt711-l0.tplg", }, + { + .link_mask = 0x1, /* link0 required */ + .links = rpl_sdca_rvp, + .drv_name = "sof_sdw", + .sof_tplg_filename = "sof-rpl-rt711-l0.tplg", + }, { .link_mask = 0x4, /* link2 required */ .links = rplp_crb, From patchwork Mon Jul 31 21:42:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 708779 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id EBDE8C001DE for ; Mon, 31 Jul 2023 21:45:23 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 5D929DEE; Mon, 31 Jul 2023 23:44:32 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5D929DEE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1690839922; bh=aA9Ehm7wWJqwjJD3ouu/0FyX0BMaApF/VsxrtiUtTOE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=WT9u/UnNH/5/leDw7wQOwNhmuWmSCzDKrpmiDToNNsq7qBrA2eSAVlbrCWQ1GgVJL 4OqLjnNPDS8Rt8j3MvluvyyizrFlvYIoSx0wVw9WmWrK76+IpKXbKsiqx5omPLI/C3 4Yui4dFW79VM6hz+EKs/6ABEUxfkFwPz6zNUZ/wU= Received: by alsa1.perex.cz (Postfix, from userid 50401) id A965AF80425; Mon, 31 Jul 2023 23:43:26 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id D6438F805A8; Mon, 31 Jul 2023 23:43:25 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 81185F8055A; Mon, 31 Jul 2023 23:43:19 +0200 (CEST) Received: from mgamail.intel.com (unknown [134.134.136.100]) (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 211BDF8016D for ; Mon, 31 Jul 2023 23:43:12 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 211BDF8016D Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=S8RS3drb DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690839794; x=1722375794; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=aA9Ehm7wWJqwjJD3ouu/0FyX0BMaApF/VsxrtiUtTOE=; b=S8RS3drbQDYGpoDUjqS3y1xNXzZVt8IKK504JI013U/Wd0wJZsC4a99c 1pco+X0D2S2Xa1o0C60J2G1EcDIh6yG73sdOGCpoAJzSnZW0MGbFbGPmx PUHHiZv0kiI9EbV0FPZOmsg5FR6EaaTtZqqX1zNROfjeXk4yJypn3oY1r 1RM2hxo7pPTBmW7l/ZWIqsnWvqZbroIkuvSDet7hAB973dF8OA4rzwE+k OF+6Xabpzj+9C4wtrg8B6dcJshzs3ctTidIfe10us2kE9cP0VziS/fD6k U1PQU+AjH7Lq7WLQKmODfUMpocW72yLQHfeJrqDsCxA8fPOLMOQpXG0tc Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="435449732" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="435449732" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="763523520" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="763523520" Received: from youngnic-mobl1.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.209.180.66]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:08 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Cc: tiwai@suse.de, broonie@kernel.org, Terry Cheong , Bard Liao , Pierre-Louis Bossart Subject: [PATCH 02/23] ASoC: Intel: sof_rt5682: add RPL support for MAX98357A speaker Date: Mon, 31 Jul 2023 16:42:36 -0500 Message-Id: <20230731214257.444605-3-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> References: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: UITMHFCBVI3VL3EOB7ZF2HF7CIQK2W72 X-Message-ID-Hash: UITMHFCBVI3VL3EOB7ZF2HF7CIQK2W72 X-MailFrom: pierre-louis.bossart@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Terry Cheong Adding support back to RPL devices that lost audio after the RPL/ADL split. The hardware configuration is: SSP0: 10EC5682/RTL5682 codec SSP2: MAX98357A amplifier Reviewed-by: Bard Liao Signed-off-by: Terry Cheong Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_rt5682.c | 8 ++++++++ sound/soc/intel/common/soc-acpi-intel-rpl-match.c | 12 ++++++++++++ 2 files changed, 20 insertions(+) diff --git a/sound/soc/intel/boards/sof_rt5682.c b/sound/soc/intel/boards/sof_rt5682.c index b4f07bdcf8b4..5e29853ae4f1 100644 --- a/sound/soc/intel/boards/sof_rt5682.c +++ b/sound/soc/intel/boards/sof_rt5682.c @@ -1196,6 +1196,14 @@ static const struct platform_device_id board_ids[] = { SOF_BT_OFFLOAD_SSP(2) | SOF_SSP_BT_OFFLOAD_PRESENT), }, + { + .name = "rpl_mx98357_rt5682", + .driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN | + SOF_RT5682_SSP_CODEC(0) | + SOF_SPEAKER_AMP_PRESENT | + SOF_RT5682_SSP_AMP(2) | + SOF_RT5682_NUM_HDMIDEV(4)), + }, { .name = "rpl_mx98360_rt5682", .driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN | diff --git a/sound/soc/intel/common/soc-acpi-intel-rpl-match.c b/sound/soc/intel/common/soc-acpi-intel-rpl-match.c index 99dc76c99f0d..4eefdb2dd45c 100644 --- a/sound/soc/intel/common/soc-acpi-intel-rpl-match.c +++ b/sound/soc/intel/common/soc-acpi-intel-rpl-match.c @@ -331,6 +331,11 @@ static const struct snd_soc_acpi_codecs rpl_rt5682_hp = { .codecs = {"10EC5682", "RTL5682"}, }; +static const struct snd_soc_acpi_codecs rpl_max98357a_amp = { + .num_codecs = 1, + .codecs = {"MX98357A"} +}; + static const struct snd_soc_acpi_codecs rpl_max98360a_amp = { .num_codecs = 1, .codecs = {"MX98360A"}, @@ -347,6 +352,13 @@ static const struct snd_soc_acpi_codecs rpl_rt1019p_amp = { }; struct snd_soc_acpi_mach snd_soc_acpi_intel_rpl_machines[] = { + { + .comp_ids = &rpl_rt5682_hp, + .drv_name = "rpl_mx98357_rt5682", + .machine_quirk = snd_soc_acpi_codec_list, + .quirk_data = &rpl_max98357a_amp, + .sof_tplg_filename = "sof-rpl-max98357a-rt5682.tplg", + }, { .comp_ids = &rpl_rt5682_hp, .drv_name = "rpl_mx98360_rt5682", From patchwork Mon Jul 31 21:42:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 708436 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id AA36EC001DE for ; Mon, 31 Jul 2023 21:45:47 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id DB019823; Mon, 31 Jul 2023 23:44:55 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DB019823 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1690839945; bh=VsiZmhINio/NVDO0AijMJGUfKJp2g5mtREObtxVR7Ls=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=VVdl++BAiHOVDcLKOy1NXFNQdv7yireC+rTiacmNRdeofihimgLFGPvv+lIJtT1qd t4ud0BaqPOU0l0TfB66PqptY3mX9o9C/pLWXdaUrw4v+SADWX3pFmiP96Zy97C/hhw aouszeup0jFkm8bHZbfzyckWBfuZLz7OUSj5N38U= Received: by alsa1.perex.cz (Postfix, from userid 50401) id C25CDF8059F; Mon, 31 Jul 2023 23:43:31 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id F285BF8059F; Mon, 31 Jul 2023 23:43:30 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2ADC6F80579; Mon, 31 Jul 2023 23:43:23 +0200 (CEST) Received: from mgamail.intel.com (unknown [134.134.136.100]) (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 AF894F80163 for ; Mon, 31 Jul 2023 23:43:12 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz AF894F80163 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=hJ/YkXQk DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690839793; x=1722375793; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=VsiZmhINio/NVDO0AijMJGUfKJp2g5mtREObtxVR7Ls=; b=hJ/YkXQkuUyexhdmYjXhXCtpRfj/2c4ZngF9Zza0m1bPN6k4FZeCM1+k jftVAl5ygSjydNlZDMzj57fqjKJZW+zotls4ugI5Z0qYIyC2SME16H2LX rMqFjhzgCmC8hggg6gzZZIoRaGgpuX4vkQKGz0IAfHTZRt2Q4p3x0xkNs SayaIVE3a1tmOoFN9R2T5b1pzIyKqX2uhse7D+iknkfzm7uQ7wZCK/Lj5 8OsWodtNC+rjkSwBKk/I436oChjICIm1gffXnNPvrpJwtCO1kE/mEWq+e Q4c8EuzzAY1qcWcEdXN3xBZpJZC8TnLkLjM/A/G0WRAXsvqjYEHUctxBi Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="435449736" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="435449736" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="763523524" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="763523524" Received: from youngnic-mobl1.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.209.180.66]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:09 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Cc: tiwai@suse.de, broonie@kernel.org, apoorv , CBM , Bard Liao , Pierre-Louis Bossart Subject: [PATCH 03/23] ASoC: Intel: sof_rt5682 add support for HDMI_In capture Date: Mon, 31 Jul 2023 16:42:37 -0500 Message-Id: <20230731214257.444605-4-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> References: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: ODQTWGEOS6643HSGOVZRZPDLUBCXOFPZ X-Message-ID-Hash: ODQTWGEOS6643HSGOVZRZPDLUBCXOFPZ X-MailFrom: pierre-louis.bossart@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: apoorv Adding support for 2 streams of HDMI-In capture via I2S with rt5682s codec variant Reviewed-by: CBM Reviewed-by: Bard Liao Signed-off-by: apoorv Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_rt5682.c | 47 +++++++++++++++++++ .../intel/common/soc-acpi-intel-adl-match.c | 7 +++ 2 files changed, 54 insertions(+) diff --git a/sound/soc/intel/boards/sof_rt5682.c b/sound/soc/intel/boards/sof_rt5682.c index 5e29853ae4f1..febf3a5bae95 100644 --- a/sound/soc/intel/boards/sof_rt5682.c +++ b/sound/soc/intel/boards/sof_rt5682.c @@ -63,6 +63,11 @@ #define SOF_RT1019_SPEAKER_AMP_PRESENT BIT(26) #define SOF_RT5650_HEADPHONE_CODEC_PRESENT BIT(27) +/* HDMI capture*/ +#define SOF_NO_OF_HDMI_CAPTURE_SSP_SHIFT 27 +#define SOF_SSP_HDMI_CAPTURE_PRESENT_MASK (GENMASK(30, 27)) +#define SOF_HDMI_CAPTURE_SSP_MASK(quirk) \ + (((quirk) << SOF_NO_OF_HDMI_CAPTURE_SSP_SHIFT) & SOF_SSP_HDMI_CAPTURE_PRESENT_MASK) /* Default: MCLK on, MCLK 19.2M, SSP0 */ static unsigned long sof_rt5682_quirk = SOF_RT5682_MCLK_EN | @@ -688,6 +693,7 @@ static struct snd_soc_dai_link *sof_card_dai_links_create(struct device *dev, struct snd_soc_dai_link_component *cpus; struct snd_soc_dai_link *links; int i, id = 0; + int hdmi_id_offset = 0; links = devm_kcalloc(dev, sof_audio_card_rt5682.num_links, sizeof(struct snd_soc_dai_link), GFP_KERNEL); @@ -919,6 +925,34 @@ static struct snd_soc_dai_link *sof_card_dai_links_create(struct device *dev, links[id].num_cpus = 1; } + /* HDMI-In SSP */ + if (sof_rt5682_quirk & SOF_SSP_HDMI_CAPTURE_PRESENT_MASK) { + unsigned long hdmi_in_ssp = (sof_rt5682_quirk & + SOF_SSP_HDMI_CAPTURE_PRESENT_MASK) >> + SOF_NO_OF_HDMI_CAPTURE_SSP_SHIFT; + int port = 0; + + for_each_set_bit(port, &hdmi_in_ssp, 32) { + links[id].cpus = &cpus[id]; + links[id].cpus->dai_name = devm_kasprintf(dev, GFP_KERNEL, + "SSP%d Pin", port); + if (!links[id].cpus->dai_name) + return NULL; + links[id].name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d-HDMI", port); + if (!links[id].name) + return NULL; + links[id].id = id + hdmi_id_offset; + links[id].codecs = &asoc_dummy_dlc; + links[id].num_codecs = 1; + links[id].platforms = platform_component; + links[id].num_platforms = ARRAY_SIZE(platform_component); + links[id].dpcm_capture = 1; + links[id].no_pcm = 1; + links[id].num_cpus = 1; + id++; + } + } + return links; devm_err: return NULL; @@ -1030,6 +1064,11 @@ static int sof_audio_probe(struct platform_device *pdev) if (sof_rt5682_quirk & SOF_SSP_BT_OFFLOAD_PRESENT) sof_audio_card_rt5682.num_links++; + if (sof_rt5682_quirk & SOF_SSP_HDMI_CAPTURE_PRESENT_MASK) + sof_audio_card_rt5682.num_links += + hweight32((sof_rt5682_quirk & SOF_SSP_HDMI_CAPTURE_PRESENT_MASK) >> + SOF_NO_OF_HDMI_CAPTURE_SSP_SHIFT); + dai_links = sof_card_dai_links_create(&pdev->dev, ssp_codec, ssp_amp, dmic_be_num, hdmi_num, ctx->idisp_codec); if (!dai_links) @@ -1196,6 +1235,14 @@ static const struct platform_device_id board_ids[] = { SOF_BT_OFFLOAD_SSP(2) | SOF_SSP_BT_OFFLOAD_PRESENT), }, + { + .name = "adl_rt5682_c1_h02", + .driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN | + SOF_RT5682_SSP_CODEC(1) | + SOF_RT5682_NUM_HDMIDEV(3) | + /* SSP 0 and SSP 2 are used for HDMI IN */ + SOF_HDMI_CAPTURE_SSP_MASK(0x5)), + }, { .name = "rpl_mx98357_rt5682", .driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN | diff --git a/sound/soc/intel/common/soc-acpi-intel-adl-match.c b/sound/soc/intel/common/soc-acpi-intel-adl-match.c index bcd66e0094b4..8e995edf4c10 100644 --- a/sound/soc/intel/common/soc-acpi-intel-adl-match.c +++ b/sound/soc/intel/common/soc-acpi-intel-adl-match.c @@ -568,6 +568,13 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_machines[] = { .quirk_data = &adl_max98390_amp, .sof_tplg_filename = "sof-adl-max98390-rt5682.tplg", }, + { + .comp_ids = &adl_rt5682_rt5682s_hp, + .drv_name = "adl_rt5682_c1_h02", + .machine_quirk = snd_soc_acpi_codec_list, + .quirk_data = &adl_lt6911_hdmi, + .sof_tplg_filename = "sof-adl-rt5682-ssp1-hdmi-ssp02.tplg", + }, { .comp_ids = &adl_rt5682_rt5682s_hp, .drv_name = "adl_rt5682", From patchwork Mon Jul 31 21:42:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 708437 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 2DAD0C001DE for ; Mon, 31 Jul 2023 21:45:17 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 56C4CAE8; Mon, 31 Jul 2023 23:44:25 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 56C4CAE8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1690839915; bh=gtdv4nHdaOR2QJJXm5cXuuEj0CAvYWedkMd0SvGyKHw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=UbDDX7oHqMUBm5fqO+BBf2nxWG/hGPOPlvLiOR6Pans02XHWopv5s5GIZp6Pr8q2d h+JybTc3lNZM/p5rLLQWdfvGR+1hWvU+g0I5K79siJPOs2/1DpWsi2PhaUiVI+kucd 5akidMPgTspdWTRD7Pk/QVqy5upS5sFuEPYjbQyU= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 13F05F8058C; Mon, 31 Jul 2023 23:43:23 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 09AA9F8057E; Mon, 31 Jul 2023 23:43:23 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A4F69F80535; Mon, 31 Jul 2023 23:43:17 +0200 (CEST) Received: from mgamail.intel.com (unknown [134.134.136.100]) (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 44D08F80153 for ; Mon, 31 Jul 2023 23:43:14 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 44D08F80153 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=lY0e/EXY DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690839795; x=1722375795; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=gtdv4nHdaOR2QJJXm5cXuuEj0CAvYWedkMd0SvGyKHw=; b=lY0e/EXYPAqJ+QCkjbCGlUlD+DBJmeZx/PVupvz5GjlhcDt/bgUKlviB vE5g0IAgXaCyumfg4eW45wvG8d4dp/sqYnCJTvQANQJWYj8UphSqbOo04 m2isRcDPig3MxUlUBU1TnfCAV2zNt3kQ9sN4rNoC8FOu3W+rA73JNuAIx uGZ1py2GOmS5UvlgcpnaZOnc07tVplooER3wbyDBAChfkHdzJKJHWSaj4 NNR1kJ7XU6wBGJLH7SF8dCJU1UGOTX2/0Zg7R3n9v3HH7Ij39BcQqCuOR pPQHN4ITkHOxgZSpQdF9sOlq/x/TZi7iWqqwmcSUTVcNOm7RM/xzkiJie w==; X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="435449740" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="435449740" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="763523528" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="763523528" Received: from youngnic-mobl1.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.209.180.66]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:09 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Cc: tiwai@suse.de, broonie@kernel.org, Uday M Bhat , Kai Vehmanen , Ranjani Sridharan , Bard Liao , Jairaj Arava , Pierre-Louis Bossart Subject: [PATCH 04/23] ASoC: Intel: sof_sdw: Update BT offload config for soundwire config Date: Mon, 31 Jul 2023 16:42:38 -0500 Message-Id: <20230731214257.444605-5-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> References: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: OI76WFOTPEGHIHJ3CJB33JFUUXTNDGN4 X-Message-ID-Hash: OI76WFOTPEGHIHJ3CJB33JFUUXTNDGN4 X-MailFrom: pierre-louis.bossart@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Uday M Bhat For soundwire config, SSP1 is used for BT offload. This is enabled in sof_sdw_quirk_table Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan Reviewed-by: Bard Liao Signed-off-by: Uday M Bhat Signed-off-by: Jairaj Arava Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_sdw.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index dbee8c98ff01..b811446be4cd 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -467,7 +467,9 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = { DMI_MATCH(DMI_SYS_VENDOR, "Google"), DMI_MATCH(DMI_PRODUCT_NAME, "Rex"), }, - .driver_data = (void *)(SOF_SDW_PCH_DMIC), + .driver_data = (void *)(SOF_SDW_PCH_DMIC | + SOF_BT_OFFLOAD_SSP(1) | + SOF_SSP_BT_OFFLOAD_PRESENT), }, /* LunarLake devices */ { From patchwork Mon Jul 31 21:42:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 708777 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 5FF24C001DE for ; Mon, 31 Jul 2023 21:46:38 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 80BE7820; Mon, 31 Jul 2023 23:45:46 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 80BE7820 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1690839996; bh=yqVF/bVG/uHDk11u4SX8tAYg6rmI6nvqQtzEy6ojGdQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=XbjBqfaT2wzE/7RgfxJRLrn+8OvKxX2FcaOKV0PZBInw/ExabRJKTffzO+TVwpfhx 17rGTl4we4VyXwKjTQrA3DLUssGubYB4ZRgzK/e63/vAsZdfRXEeMVNu3/qcZ4M7yR lqVORBOXRSplB1kNqw5O6lklTVS/KKSY1GS0MVEc= Received: by alsa1.perex.cz (Postfix, from userid 50401) id B6E19F805C2; Mon, 31 Jul 2023 23:43:45 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 10E5EF805C2; Mon, 31 Jul 2023 23:43:45 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 843B0F8059F; Mon, 31 Jul 2023 23:43:26 +0200 (CEST) Received: from mgamail.intel.com (unknown [134.134.136.100]) (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 BC501F80425 for ; Mon, 31 Jul 2023 23:43:14 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz BC501F80425 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=EMXRsRiX DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690839795; x=1722375795; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yqVF/bVG/uHDk11u4SX8tAYg6rmI6nvqQtzEy6ojGdQ=; b=EMXRsRiXE7EJ4GwO0Aqatbfp8J7hlPq1G2r6NYBK0gVQJuY7Dm4dpvtb IU5o6lL6SPqm3wADNekSMt/kdTHb5LTA6X+uKtGdQ7x1UvtLV8/aWK+7c VpnzNiHKp4J4SVUvna6zpMpOklmLfIbLw3TlhkMMK9MWaEMj6xTibxz0/ 7ItpPYNpSQLAaT3WtRq+FWwJv1tM5FTaVaOaTylQ4x1cHt++qdZeffywU UqpJ1/wPP6f0sU9oI0E26Bd1XZ1C8uOpCeBj1lCsjtro1UskPPhkmNL6Y /ncQpZPNEcKQOCOBttULsFBmxqFLN7NWApMJr+HqiHAFnTEZrACMwmGLg A==; X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="435449745" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="435449745" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="763523531" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="763523531" Received: from youngnic-mobl1.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.209.180.66]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:10 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Cc: tiwai@suse.de, broonie@kernel.org, Pierre-Louis Bossart , Ranjani Sridharan , Rander Wang , Bard Liao Subject: [PATCH 05/23] ASoC: Intel: sof_sdw: reorder SoundWire codecs in Kconfig Date: Mon, 31 Jul 2023 16:42:39 -0500 Message-Id: <20230731214257.444605-6-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> References: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: IBCVWHUVRKKFKD7WJM2XDJI4IJZEOC7K X-Message-ID-Hash: IBCVWHUVRKKFKD7WJM2XDJI4IJZEOC7K X-MailFrom: pierre-louis.bossart@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: No functionality change, just sort Realtek codecs using increasing part IDs. Reviewed-by: Ranjani Sridharan Reviewed-by: Rander Wang Reviewed-by: Bard Liao Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/intel/boards/Kconfig b/sound/soc/intel/boards/Kconfig index 1fe830af2b84..141fba0f8c70 100644 --- a/sound/soc/intel/boards/Kconfig +++ b/sound/soc/intel/boards/Kconfig @@ -671,12 +671,12 @@ config SND_SOC_INTEL_SOUNDWIRE_SOF_MACH select SND_SOC_RT711_SDCA_SDW select SND_SOC_RT712_SDCA_SDW select SND_SOC_RT712_SDCA_DMIC_SDW + select SND_SOC_RT715_SDW + select SND_SOC_RT715_SDCA_SDW select SND_SOC_RT1308_SDW select SND_SOC_RT1308 select SND_SOC_RT1316_SDW select SND_SOC_RT1318_SDW - select SND_SOC_RT715_SDW - select SND_SOC_RT715_SDCA_SDW select SND_SOC_RT5682_SDW select SND_SOC_CS42L42_SDW select SND_SOC_DMIC From patchwork Mon Jul 31 21:42:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 708435 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id D4638C001E0 for ; Mon, 31 Jul 2023 21:46:14 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id DBA83AEA; Mon, 31 Jul 2023 23:45:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DBA83AEA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1690839972; bh=tnLINPijn4O9CvkI3DyjWwv8HmZpb3SZanOkC0r+AuY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=eykSqlfEejpe99jE1Ln3TRc3diM1tDa8CAwNopLU27WjlAdPNyv4H+kQad+SM43eW CqhbyjCuiFucFgq/DCY6hLG+TXxl+aGq+jf+FWhE1tIMvnNH/Dz4JQk40W8kqUA7e1 QbnM53TNE6/A5MVqZf3mMBnM6+MvdzBQCV9quWPM= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 481C0F805BD; Mon, 31 Jul 2023 23:43:41 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id C3883F805AA; Mon, 31 Jul 2023 23:43:40 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 40CB9F8059F; Mon, 31 Jul 2023 23:43:25 +0200 (CEST) Received: from mgamail.intel.com (unknown [134.134.136.100]) (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 1A39DF8015B for ; Mon, 31 Jul 2023 23:43:14 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1A39DF8015B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=l5TEbVjk DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690839796; x=1722375796; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=tnLINPijn4O9CvkI3DyjWwv8HmZpb3SZanOkC0r+AuY=; b=l5TEbVjkhNSxDuLBF1wbJzhYzHuvTSeKm8UoPgPP2GeAcGYdSD0fu2wy JJ7JrxvpONazEMUdn9aSPZ33p64ZymAAbDZXeFCxMUVRmUZbP2RPL/6Xx 2ajE/eQ4N+US605/sdP6n50ixURRhe13x3W6PI9kjPSP0BpUXRTVbaQHw As028m9wQrhQOIozElJGmn4QYIVT/Kv1cWBtmZ9u+q2SWHiIYMadeQMdI GEzIhwg8g3Z2OSb6XMWf7GSW1QcvdPIX0I6l01nAdrK2Ziqk0uYIRmDju JyUHwJVdC0RV+8YiH87DhENFhaDOe02aD78n/M4+gQ3sUSDEABvPytbEv w==; X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="435449750" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="435449750" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="763523532" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="763523532" Received: from youngnic-mobl1.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.209.180.66]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:11 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Cc: tiwai@suse.de, broonie@kernel.org, Pierre-Louis Bossart , Bard Liao , Ranjani Sridharan Subject: [PATCH 06/23] ASoC: Intel: sof_sdw: allow mockup amplifier to provide feedback Date: Mon, 31 Jul 2023 16:42:40 -0500 Message-Id: <20230731214257.444605-7-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> References: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: WOQBW7M2IWSI7CZ75ISJTXPE46FCTUBU X-Message-ID-Hash: WOQBW7M2IWSI7CZ75ISJTXPE46FCTUBU X-MailFrom: pierre-louis.bossart@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The capture setting are missing and preventing topologies with feedback from loading. Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_sdw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index b811446be4cd..7e43be46cfa8 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -942,10 +942,10 @@ static struct sof_sdw_codec_info codec_info_list[] = { .version_id = 0, .dais = { { - .direction = {true, false}, + .direction = {true, true}, .dai_name = "sdw-mockup-aif1", .dai_type = SOF_SDW_DAI_TYPE_AMP, - .dailink = {SDW_AMP_OUT_DAI_ID, SDW_UNUSED_DAI_ID}, + .dailink = {SDW_AMP_OUT_DAI_ID, SDW_AMP_IN_DAI_ID}, .init = NULL, }, }, From patchwork Mon Jul 31 21:42:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 708778 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 203CBC001E0 for ; Mon, 31 Jul 2023 21:45:58 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 4725C85D; Mon, 31 Jul 2023 23:45:06 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4725C85D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1690839956; bh=XhFb8HPXCtI8GJ2CUPoxt6HyksVXJHAZVG6unoEcZRQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=h7xSm0VfXkMGEsdLuje19EBgYxcVLlSdiWTgX0FnR6Pw8mXKXmRC1Tqng51n1OUH5 ys2f9vQaQ/hP3U7NmsNLDzqVKtfidLeb7sdI1hB6+szDHMuXaxgBRt/CCw1icLxBXd zydSss8xHYlXdrmnOYGTTGH3pt2hOc7BBkKyqOWk= Received: by alsa1.perex.cz (Postfix, from userid 50401) id BE322F805B6; Mon, 31 Jul 2023 23:43:35 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 7557AF805BA; Mon, 31 Jul 2023 23:43:35 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C68A7F8059F; Mon, 31 Jul 2023 23:43:24 +0200 (CEST) Received: from mgamail.intel.com (unknown [134.134.136.100]) (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 3175FF8025A for ; Mon, 31 Jul 2023 23:43:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3175FF8025A Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=KLM8JaiD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690839797; x=1722375797; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XhFb8HPXCtI8GJ2CUPoxt6HyksVXJHAZVG6unoEcZRQ=; b=KLM8JaiDs7gIOX2KOOXE1zFfUV83IyethJS6i2oTCmGBVmPXznnwlOdP UPC9KH5++c62J6xHtWpeYN8ZTOy0yF9biq+rY1KhLR8uIN6ETxzUwjxLl 8bbYhwdCF1IBSg1i1SDDTnuDOC0W1QGxMJrLyJwD9E0ihufZO9LbZB0Ii MVPBf1QeguXztCq4Dge7nWYd+0CwMhY2yeHgb4/AvSVLV2dPXjDzjZur6 lH9wAcpv5t8PchTD56glXmTFJylSLkKQyf/PJImswWj9zqRgFeRw1mqUC d+bxCtPzR0HTaGYHc6qiFva4SfKzsQKqQZpz0LqGxt3+pwuQ2niichiMb A==; X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="435449754" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="435449754" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="763523535" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="763523535" Received: from youngnic-mobl1.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.209.180.66]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:11 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Cc: tiwai@suse.de, broonie@kernel.org, Bard Liao , Rander Wang , Pierre-Louis Bossart Subject: [PATCH 07/23] ASoC: Intel: sof_sdw: rename link_id to be_id Date: Mon, 31 Jul 2023 16:42:41 -0500 Message-Id: <20230731214257.444605-8-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> References: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: XTFVFGCCM5NCPXSJAMN4Z27PVSAB4XMX X-Message-ID-Hash: XTFVFGCCM5NCPXSJAMN4Z27PVSAB4XMX X-MailFrom: pierre-louis.bossart@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Bard Liao The link_id parameter in create_sdw_dailink is actually the BE link id. Rename it to be_id to be consistent with the caller and less confusion. No functionality change. Reviewed-by: Rander Wang Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_sdw.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index 7e43be46cfa8..acaedd3b2224 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -1354,7 +1354,7 @@ static int create_sdw_dailink(struct snd_soc_card *card, const struct snd_soc_acpi_link_adr *link, int *cpu_id, bool *group_generated, struct snd_soc_codec_conf *codec_conf, - int codec_count, int *link_id, + int codec_count, int *be_id, int *codec_conf_index, bool *ignore_pch_dmic, bool append_dai_type, @@ -1433,9 +1433,9 @@ static int create_sdw_dailink(struct snd_soc_card *card, if (!codec_info->dais[dai_index].direction[stream]) continue; - *link_id = codec_info->dais[dai_index].dailink[stream]; - if (*link_id < 0) { - dev_err(dev, "Invalid dailink id %d\n", *link_id); + *be_id = codec_info->dais[dai_index].dailink[stream]; + if (*be_id < 0) { + dev_err(dev, "Invalid dailink id %d\n", *be_id); return -EINVAL; } @@ -1492,7 +1492,7 @@ static int create_sdw_dailink(struct snd_soc_card *card, playback = (stream == SNDRV_PCM_STREAM_PLAYBACK); capture = (stream == SNDRV_PCM_STREAM_CAPTURE); - init_dai_link(dev, dai_links + *link_index, (*link_id)++, name, + init_dai_link(dev, dai_links + *link_index, (*be_id)++, name, playback, capture, cpus + *cpu_id, cpu_dai_num, codecs, codec_num, From patchwork Mon Jul 31 21:42:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 708776 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 3EBA3C001DE for ; Mon, 31 Jul 2023 21:47:09 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 6C98B857; Mon, 31 Jul 2023 23:46:17 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6C98B857 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1690840027; bh=bfAsfdR1m5rNV6IDYq+veLT3EdgKfQPCNjNFFcD+vmY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=deGUps/cnYGa8aqZCp441kEFSD9Zoi5qyC6XcqRpQ84gAEWzjvPc3PVBdDobu4DPL ApwvDAlDJqW9Vw7wnz/xzrvZ2GwAadgwx1AWlBnoSvr1RdoU19doRcFjCOFGocZkXC LJZDmoPnNT+tt/OxUQKtsP51mGtrCZi6ZUzOJUUQ= Received: by alsa1.perex.cz (Postfix, from userid 50401) id C695DF805E1; Mon, 31 Jul 2023 23:43:51 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id DFCA1F805E1; Mon, 31 Jul 2023 23:43:50 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 045BBF805B1; Mon, 31 Jul 2023 23:43:28 +0200 (CEST) Received: from mgamail.intel.com (unknown [134.134.136.100]) (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 A79A8F80153 for ; Mon, 31 Jul 2023 23:43:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A79A8F80153 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=nozE3Svz DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690839797; x=1722375797; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=bfAsfdR1m5rNV6IDYq+veLT3EdgKfQPCNjNFFcD+vmY=; b=nozE3SvzemflQtrGMhk7FDj5f/gBuzjwfhW9icNM4QhbALVcddIJXCTP 8oZtWcw8rXTHRyt+Mp9BqsViIxsvKln68WCyFz6bNWqlWEa7nz4B9xrUV GmWoe+4NHrf6ttxMV6uLdfd0PRTA4AYjSg8vmg05UBIaIHF8y58qLDmkd iubmx4GHLJLbSv6tvl26eqhABWxaojm1VKq6vchedDY0KIUto0f2u3FoY m4iz25bK2R2oX3ybnUfAXNTg6PT213W0Yw7O6yk0iMQpPB9r0h2nMolTa ifP4jQQeyrc0R7+Gwep3BagyZpO1+l8HLXH1iLOxXwp8zk0KroHbT2SBG Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="435449757" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="435449757" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="763523536" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="763523536" Received: from youngnic-mobl1.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.209.180.66]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:12 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Cc: tiwai@suse.de, broonie@kernel.org, Pierre-Louis Bossart , Bard Liao Subject: [PATCH 08/23] ASoC: Intel: sof_sdw: add support for SKU 0AFE Date: Mon, 31 Jul 2023 16:42:42 -0500 Message-Id: <20230731214257.444605-9-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> References: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: LKBKWEVR4STFVG7T5EKFU7JH4YED25OI X-Message-ID-Hash: LKBKWEVR4STFVG7T5EKFU7JH4YED25OI X-MailFrom: pierre-louis.bossart@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Yet another missing configuration, with the standard configuration link0: rt711-sdca link 1 and 2: rt1316-sdca link3: rt714-sdca Link: https://github.com/thesofproject/sof/issues/7799 Reviewed-by: Bard Liao Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_sdw.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index acaedd3b2224..ffb0cd0700c4 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -307,6 +307,16 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = { .driver_data = (void *)(SOF_SDW_TGL_HDMI | SOF_SDW_FOUR_SPK), }, + { + .callback = sof_sdw_quirk_cb, + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"), + DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0AFE") + }, + .driver_data = (void *)(SOF_SDW_TGL_HDMI | + RT711_JD2 | + SOF_SDW_FOUR_SPK), + }, { .callback = sof_sdw_quirk_cb, .matches = { From patchwork Mon Jul 31 21:42:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 708429 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 421B7C001DE for ; Mon, 31 Jul 2023 21:49:28 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 85D17E85; Mon, 31 Jul 2023 23:48:36 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 85D17E85 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1690840166; bh=/W11xp7F8atWHeOawi4w/wG5hKRsAAvegMWkPEhTRlg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=GEbWJj7gJMFE6mcd8LZOTA/jsjrWP5xlUTbuaz7TD+jV68wWX4TCHeyXN9g6Bw5db RBaJjuBu/oBFZiddh0+duy8u8nvPfBVfgFeLi1gyhnkHboCioYDHJlRgIKxhTTYjb1 hQ0MIS9/3kNpb+SkpBxHYyDG4Y3oo3gsvGWLNE6Y= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9A4D0F80558; Mon, 31 Jul 2023 23:44:18 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id DD68EF8063D; Mon, 31 Jul 2023 23:44:17 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 02E2DF805B5; Mon, 31 Jul 2023 23:43:36 +0200 (CEST) Received: from mgamail.intel.com (unknown [134.134.136.100]) (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 14E10F80520 for ; Mon, 31 Jul 2023 23:43:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 14E10F80520 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=OjA9oR89 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690839798; x=1722375798; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/W11xp7F8atWHeOawi4w/wG5hKRsAAvegMWkPEhTRlg=; b=OjA9oR897FAw6U5xz3r+kSakzol0Lk5CZXIygZO9QQq8LFZMhEZ9/wMq YgcqVFLFRcCSY0RQ6izKWCo+8tyf+U5oxDUc0BTK39M2o0LGgHKQsivoH Nbh3wjH3pHL3RfBO6ShN37LLR2itVfs0X1VgIbj0V8nVjBtEI9f4psmdo FCE8vmGm7wDsvtA3+k6P7WNjy1uX6ZNUoaQsxRrCudhHZyhtMKtEcLauQ EybrWFFZGFKjHdI4CujKh8zmELWFL5VysZC6JNGwq9M2kejWNt/rjOS4K PBa9RgmEdd54gFz5cQJOm0pBuKMzu6dRNsKej0+Yi2+WySisCkNn3Gzor A==; X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="435449762" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="435449762" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="763523539" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="763523539" Received: from youngnic-mobl1.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.209.180.66]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:12 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Cc: tiwai@suse.de, broonie@kernel.org, Charles Keepax , Bard Liao , Ranjani Sridharan , Rander Wang , Pierre-Louis Bossart Subject: [PATCH 09/23] ASoC: intel: sof_sdw: Use consistent variable naming for links Date: Mon, 31 Jul 2023 16:42:43 -0500 Message-Id: <20230731214257.444605-10-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> References: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: DYFDRDJCH6X4DYLN7CGFNOFIZHPUQBUX X-Message-ID-Hash: DYFDRDJCH6X4DYLN7CGFNOFIZHPUQBUX X-MailFrom: pierre-louis.bossart@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Charles Keepax The driver makes extensive use of both ACPI link and ASoC DAI link structs, often referring to both with the variable name link. Make the code a little easier to follow by consistently using adr_link for the ACPI bits and dai_links for the ASoC bits. Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Reviewed-by: Rander Wang Signed-off-by: Charles Keepax Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_sdw.c | 118 ++++++++++++++++--------------- 1 file changed, 60 insertions(+), 58 deletions(-) diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index ffb0cd0700c4..6f65f45bded6 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -1021,10 +1021,10 @@ static inline int find_codec_info_acpi(const u8 *acpi_id) * Since some sdw slaves may be aggregated, the CPU DAI number * may be larger than the number of BE dailinks. */ -static int get_sdw_dailink_info(struct device *dev, const struct snd_soc_acpi_link_adr *links, +static int get_sdw_dailink_info(struct device *dev, + const struct snd_soc_acpi_link_adr *adr_link, int *sdw_be_num, int *sdw_cpu_dai_num) { - const struct snd_soc_acpi_link_adr *link; bool group_visited[SDW_MAX_GROUPS]; bool no_aggregation; int i; @@ -1034,27 +1034,27 @@ static int get_sdw_dailink_info(struct device *dev, const struct snd_soc_acpi_li *sdw_cpu_dai_num = 0; *sdw_be_num = 0; - if (!links) + if (!adr_link) return -EINVAL; for (i = 0; i < SDW_MAX_GROUPS; i++) group_visited[i] = false; - for (link = links; link->num_adr; link++) { + for (; adr_link->num_adr; adr_link++) { const struct snd_soc_acpi_endpoint *endpoint; struct sof_sdw_codec_info *codec_info; int codec_index; int stream; u64 adr; - for (i = 0; i < link->num_adr; i++) { - adr = link->adr_d[i].adr; + for (i = 0; i < adr_link->num_adr; i++) { + adr = adr_link->adr_d[i].adr; codec_index = find_codec_info_part(adr); if (codec_index < 0) return codec_index; codec_info = &codec_info_list[codec_index]; - endpoint = link->adr_d[i].endpoints; + endpoint = adr_link->adr_d[i].endpoints; for (j = 0; j < codec_info->dai_num; j++) { /* count DAI number for playback and capture */ @@ -1102,7 +1102,7 @@ static void init_dai_link(struct device *dev, struct snd_soc_dai_link *dai_links dai_links->ops = ops; } -static bool is_unique_device(const struct snd_soc_acpi_link_adr *link, +static bool is_unique_device(const struct snd_soc_acpi_link_adr *adr_link, unsigned int sdw_version, unsigned int mfg_id, unsigned int part_id, @@ -1112,7 +1112,7 @@ static bool is_unique_device(const struct snd_soc_acpi_link_adr *link, { int i; - for (i = 0; i < link->num_adr; i++) { + for (i = 0; i < adr_link->num_adr; i++) { unsigned int sdw1_version, mfg1_id, part1_id, class1_id; u64 adr; @@ -1120,7 +1120,7 @@ static bool is_unique_device(const struct snd_soc_acpi_link_adr *link, if (i == index_in_link) continue; - adr = link->adr_d[i].adr; + adr = adr_link->adr_d[i].adr; sdw1_version = SDW_VERSION(adr); mfg1_id = SDW_MFG_ID(adr); @@ -1138,7 +1138,7 @@ static bool is_unique_device(const struct snd_soc_acpi_link_adr *link, } static int create_codec_dai_name(struct device *dev, - const struct snd_soc_acpi_link_adr *link, + const struct snd_soc_acpi_link_adr *adr_link, struct snd_soc_dai_link_component *codec, int offset, struct snd_soc_codec_conf *codec_conf, @@ -1151,19 +1151,19 @@ static int create_codec_dai_name(struct device *dev, int i; /* sanity check */ - if (*codec_conf_index + link->num_adr - adr_index > codec_count) { + if (*codec_conf_index + adr_link->num_adr - adr_index > codec_count) { dev_err(dev, "codec_conf: out-of-bounds access requested\n"); return -EINVAL; } - for (i = adr_index; i < link->num_adr; i++) { + for (i = adr_index; i < adr_link->num_adr; i++) { unsigned int sdw_version, unique_id, mfg_id; unsigned int link_id, part_id, class_id; int codec_index, comp_index; char *codec_str; u64 adr; - adr = link->adr_d[i].adr; + adr = adr_link->adr_d[i].adr; sdw_version = SDW_VERSION(adr); link_id = SDW_DISCO_LINK_ID(adr); @@ -1173,7 +1173,7 @@ static int create_codec_dai_name(struct device *dev, class_id = SDW_CLASS_ID(adr); comp_index = i - adr_index + offset; - if (is_unique_device(link, sdw_version, mfg_id, part_id, + if (is_unique_device(adr_link, sdw_version, mfg_id, part_id, class_id, i)) { codec_str = "sdw:%01x:%04x:%04x:%02x"; codec[comp_index].name = @@ -1204,7 +1204,7 @@ static int create_codec_dai_name(struct device *dev, codec_info_list[codec_index].dais[dai_index].dai_name; codec_conf[*codec_conf_index].dlc = codec[comp_index]; - codec_conf[*codec_conf_index].name_prefix = link->adr_d[i].name_prefix; + codec_conf[*codec_conf_index].name_prefix = adr_link->adr_d[i].name_prefix; ++*codec_conf_index; } @@ -1213,7 +1213,7 @@ static int create_codec_dai_name(struct device *dev, } static int set_codec_init_func(struct snd_soc_card *card, - const struct snd_soc_acpi_link_adr *link, + const struct snd_soc_acpi_link_adr *adr_link, struct snd_soc_dai_link *dai_links, bool playback, int group_id, int adr_index, int dai_index) { @@ -1224,34 +1224,35 @@ static int set_codec_init_func(struct snd_soc_card *card, * Initialize the codec. If codec is part of an aggregated * group (group_id>0), initialize all codecs belonging to * same group. - * The first link should start with link->adr_d[adr_index] + * The first link should start with adr_link->adr_d[adr_index] * because that is the device that we want to initialize and * we should end immediately if it is not aggregated (group_id=0) */ - for ( ; i < link->num_adr; i++) { + for ( ; i < adr_link->num_adr; i++) { int codec_index; - codec_index = find_codec_info_part(link->adr_d[i].adr); + codec_index = find_codec_info_part(adr_link->adr_d[i].adr); if (codec_index < 0) return codec_index; /* The group_id is > 0 iff the codec is aggregated */ - if (link->adr_d[i].endpoints->group_id != group_id) + if (adr_link->adr_d[i].endpoints->group_id != group_id) continue; if (codec_info_list[codec_index].dais[dai_index].init) codec_info_list[codec_index].dais[dai_index].init(card, - link, + adr_link, dai_links, &codec_info_list[codec_index], playback); if (!group_id) return 0; } + i = 0; - link++; - } while (link->mask); + adr_link++; + } while (adr_link->mask); return 0; } @@ -1361,7 +1362,7 @@ static int create_sdw_dailink(struct snd_soc_card *card, struct snd_soc_dai_link *dai_links, int sdw_be_num, int sdw_cpu_dai_num, struct snd_soc_dai_link_component *cpus, - const struct snd_soc_acpi_link_adr *link, + const struct snd_soc_acpi_link_adr *adr_link, int *cpu_id, bool *group_generated, struct snd_soc_codec_conf *codec_conf, int codec_count, int *be_id, @@ -1371,7 +1372,7 @@ static int create_sdw_dailink(struct snd_soc_card *card, int adr_index, int dai_index) { - const struct snd_soc_acpi_link_adr *link_next; + const struct snd_soc_acpi_link_adr *adr_link_next; struct snd_soc_dai_link_component *codecs; struct sof_sdw_codec_info *codec_info; int cpu_dai_id[SDW_MAX_CPU_DAIS]; @@ -1385,7 +1386,7 @@ static int create_sdw_dailink(struct snd_soc_card *card, int ret; int k; - ret = get_slave_info(link, dev, cpu_dai_id, &cpu_dai_num, &codec_num, + ret = get_slave_info(adr_link, dev, cpu_dai_id, &cpu_dai_num, &codec_num, &group_id, group_generated, adr_index); if (ret) return ret; @@ -1395,20 +1396,20 @@ static int create_sdw_dailink(struct snd_soc_card *card, return -ENOMEM; /* generate codec name on different links in the same group */ - for (link_next = link; link_next && link_next->num_adr && - i < cpu_dai_num; link_next++) { + for (adr_link_next = adr_link; adr_link_next && adr_link_next->num_adr && + i < cpu_dai_num; adr_link_next++) { const struct snd_soc_acpi_endpoint *endpoints; - endpoints = link_next->adr_d->endpoints; + endpoints = adr_link_next->adr_d->endpoints; if (group_id && (!endpoints->aggregated || endpoints->group_id != group_id)) continue; /* skip the link excluded by this processed group */ - if (cpu_dai_id[i] != ffs(link_next->mask) - 1) + if (cpu_dai_id[i] != ffs(adr_link_next->mask) - 1) continue; - ret = create_codec_dai_name(dev, link_next, codecs, codec_idx, + ret = create_codec_dai_name(dev, adr_link_next, codecs, codec_idx, codec_conf, codec_count, codec_conf_index, adr_index, dai_index); if (ret < 0) @@ -1416,11 +1417,11 @@ static int create_sdw_dailink(struct snd_soc_card *card, /* check next link to create codec dai in the processed group */ i++; - codec_idx += link_next->num_adr; + codec_idx += adr_link_next->num_adr; } /* find codec info to create BE DAI */ - codec_index = find_codec_info_part(link->adr_d[adr_index].adr); + codec_index = find_codec_info_part(adr_link->adr_d[adr_index].adr); if (codec_index < 0) return codec_index; codec_info = &codec_info_list[codec_index]; @@ -1516,7 +1517,7 @@ static int create_sdw_dailink(struct snd_soc_card *card, set_dailink_map(sdw_codec_ch_maps, codec_num, cpu_dai_num); dai_links[*link_index].codec_ch_maps = sdw_codec_ch_maps; - ret = set_codec_init_func(card, link, dai_links + (*link_index)++, + ret = set_codec_init_func(card, adr_link, dai_links + (*link_index)++, playback, group_id, adr_index, dai_index); if (ret < 0) { dev_err(dev, "failed to init codec %d", codec_index); @@ -1589,7 +1590,7 @@ static int sof_card_dai_links_create(struct device *dev, int codec_conf_index = 0; bool group_generated[SDW_MAX_GROUPS]; int ssp_codec_index, ssp_mask; - struct snd_soc_dai_link *links; + struct snd_soc_dai_link *dai_links; int num_links, link_index = 0; char *name, *cpu_name; int total_cpu_dai_num; @@ -1650,14 +1651,14 @@ static int sof_card_dai_links_create(struct device *dev, /* allocate BE dailinks */ num_links = comp_num + sdw_be_num; - links = devm_kcalloc(dev, num_links, sizeof(*links), GFP_KERNEL); + dai_links = devm_kcalloc(dev, num_links, sizeof(*dai_links), GFP_KERNEL); /* allocated CPU DAIs */ total_cpu_dai_num = comp_num + sdw_cpu_dai_num; cpus = devm_kcalloc(dev, total_cpu_dai_num, sizeof(*cpus), GFP_KERNEL); - if (!links || !cpus) + if (!dai_links || !cpus) return -ENOMEM; /* SDW */ @@ -1731,9 +1732,9 @@ static int sof_card_dai_links_create(struct device *dev, return codec_index; for (j = 0; j < codec_info_list[codec_index].dai_num ; j++) { - ret = create_sdw_dailink(card, dev, &link_index, links, sdw_be_num, - sdw_cpu_dai_num, cpus, adr_link, - &cpu_id, group_generated, + ret = create_sdw_dailink(card, dev, &link_index, dai_links, + sdw_be_num, sdw_cpu_dai_num, cpus, + adr_link, &cpu_id, group_generated, codec_conf, codec_conf_count, &be_id, &codec_conf_index, &ignore_pch_dmic, append_dai_type, i, j); @@ -1785,13 +1786,13 @@ static int sof_card_dai_links_create(struct device *dev, playback = info->dais[0].direction[SNDRV_PCM_STREAM_PLAYBACK]; capture = info->dais[0].direction[SNDRV_PCM_STREAM_CAPTURE]; - init_dai_link(dev, links + link_index, be_id, name, + init_dai_link(dev, dai_links + link_index, be_id, name, playback, capture, cpus + cpu_id, 1, ssp_components, 1, NULL, info->ops); - ret = info->dais[0].init(card, NULL, links + link_index, info, 0); + ret = info->dais[0].init(card, NULL, dai_links + link_index, info, 0); if (ret < 0) return ret; @@ -1806,7 +1807,7 @@ static int sof_card_dai_links_create(struct device *dev, goto HDMI; } cpus[cpu_id].dai_name = "DMIC01 Pin"; - init_dai_link(dev, links + link_index, be_id, "dmic01", + init_dai_link(dev, dai_links + link_index, be_id, "dmic01", 0, 1, // DMIC only supports capture cpus + cpu_id, 1, dmic_component, 1, @@ -1814,7 +1815,7 @@ static int sof_card_dai_links_create(struct device *dev, INC_ID(be_id, cpu_id, link_index); cpus[cpu_id].dai_name = "DMIC16k Pin"; - init_dai_link(dev, links + link_index, be_id, "dmic16k", + init_dai_link(dev, dai_links + link_index, be_id, "dmic16k", 0, 1, // DMIC only supports capture cpus + cpu_id, 1, dmic_component, 1, @@ -1857,7 +1858,7 @@ static int sof_card_dai_links_create(struct device *dev, return -ENOMEM; cpus[cpu_id].dai_name = cpu_name; - init_dai_link(dev, links + link_index, be_id, name, + init_dai_link(dev, dai_links + link_index, be_id, name, 1, 0, // HDMI only supports playback cpus + cpu_id, 1, idisp_components + i, 1, @@ -1878,11 +1879,11 @@ static int sof_card_dai_links_create(struct device *dev, return -ENOMEM; cpus[cpu_id].dai_name = cpu_name; - init_dai_link(dev, links + link_index, be_id, name, 1, 1, - cpus + cpu_id, 1, &asoc_dummy_dlc, 1, NULL, NULL); + init_dai_link(dev, dai_links + link_index, be_id, name, 1, 1, + cpus + cpu_id, 1, &asoc_dummy_dlc, 1, NULL, NULL); } - card->dai_link = links; + card->dai_link = dai_links; card->num_links = num_links; card->codec_conf = codec_conf; @@ -1925,15 +1926,15 @@ static struct snd_soc_card card_sof_sdw = { static struct snd_soc_dai_link *mc_find_codec_dai_used(struct snd_soc_card *card, const char *dai_name) { - struct snd_soc_dai_link *link; + struct snd_soc_dai_link *dai_link; int i; int j; - for_each_card_prelinks(card, i, link) { - for (j = 0; j < link->num_codecs; j++) { + for_each_card_prelinks(card, i, dai_link) { + for (j = 0; j < dai_link->num_codecs; j++) { /* Check each codec in a link */ - if (!strcmp(link->codecs[j].dai_name, dai_name)) - return link; + if (!strcmp(dai_link->codecs[j].dai_name, dai_name)) + return dai_link; } } return NULL; @@ -1941,7 +1942,7 @@ static struct snd_soc_dai_link *mc_find_codec_dai_used(struct snd_soc_card *card static void mc_dailink_exit_loop(struct snd_soc_card *card) { - struct snd_soc_dai_link *link; + struct snd_soc_dai_link *dai_link; int ret; int i, j; @@ -1954,10 +1955,11 @@ static void mc_dailink_exit_loop(struct snd_soc_card *card) * We don't need to call .exit function if there is no matched * dai link found. */ - link = mc_find_codec_dai_used(card, codec_info_list[i].dais[j].dai_name); - if (link) { + dai_link = mc_find_codec_dai_used(card, + codec_info_list[i].dais[j].dai_name); + if (dai_link) { /* Do the .exit function if the codec dai is used in the link */ - ret = codec_info_list[i].dais[j].exit(card, link); + ret = codec_info_list[i].dais[j].exit(card, dai_link); if (ret) dev_warn(card->dev, "codec exit failed %d\n", From patchwork Mon Jul 31 21:42:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 708434 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 84B6CC001DE for ; Mon, 31 Jul 2023 21:46:50 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id E41EDDEB; Mon, 31 Jul 2023 23:45:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E41EDDEB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1690840009; bh=fWMbDhYR/IvhITeoJNg9l6cw/koUVxG6y+RPsc2UKiM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=lvHlczIT3SBzI3a+4S4RF38PxSX6VXWHPLlO2XnkR0F0v+UuEt3fHoamXvv1in413 LmKcZatWRCPZNfmVMQLI1+1EWBg+vQqRdjQrICZIM558Tiw8caS6uZJXSCRKC3L3Ci s2EAqYrOIhQemI4vXd3PeA7WUbwTQj0lfUhVAq3c= Received: by alsa1.perex.cz (Postfix, from userid 50401) id B9391F80553; Mon, 31 Jul 2023 23:43:48 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 0B894F805D5; Mon, 31 Jul 2023 23:43:48 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5C310F805B1; Mon, 31 Jul 2023 23:43:27 +0200 (CEST) Received: from mgamail.intel.com (unknown [134.134.136.100]) (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 1BE04F80557 for ; Mon, 31 Jul 2023 23:43:17 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1BE04F80557 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=ae6HLj67 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690839799; x=1722375799; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=fWMbDhYR/IvhITeoJNg9l6cw/koUVxG6y+RPsc2UKiM=; b=ae6HLj67yoQWhB/PilNjklA+GuFb6K9/auP45v6Fv/0Lzd93ejuTHmoo h2y5uzPHXhYDFqGQ76OJKPfjh00mJYRv1RLstd16+yKL1AT9dhWplsKIK Obo8jy9RnI4ynt5QUzsTvAzZ82g83JhJ5VwyFlubuWzObC0+BaG6Zhk3T 5VVwsWyTuaTXJY8Uwx8ajTVHK2LemT5H7MAkH7FMfubj8GEgTrWxrIvQ/ 1oIK7G6dAsUMlKRkX6fSzU/yhw1If3aFjFI86cNV/l/CoRgCgoMvL3Rjc X6qjTeKzCR69rHJatx0XBPz52GQk3Vzv8t+cwCkaMTStHSVfH06si7F4o A==; X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="435449766" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="435449766" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="763523542" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="763523542" Received: from youngnic-mobl1.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.209.180.66]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:13 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Cc: tiwai@suse.de, broonie@kernel.org, Charles Keepax , Bard Liao , Ranjani Sridharan , Rander Wang , Pierre-Louis Bossart Subject: [PATCH 10/23] ASoC: intel: sof_sdw: Rename codec_idx to codec_dlc_index Date: Mon, 31 Jul 2023 16:42:44 -0500 Message-Id: <20230731214257.444605-11-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> References: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: 3YQA7L5WVU3VEE6XWUOTHUNDSSDSCJMS X-Message-ID-Hash: 3YQA7L5WVU3VEE6XWUOTHUNDSSDSCJMS X-MailFrom: pierre-louis.bossart@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Charles Keepax Having two local variables called codec_idx and codec_index, that refer to different things is a little confusing. Rename codec_idx to codec_dlc_index to indicate it points into the dai_link_component array. Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Reviewed-by: Rander Wang Signed-off-by: Charles Keepax Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_sdw.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index 6f65f45bded6..0743bf04aa88 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -1378,7 +1378,7 @@ static int create_sdw_dailink(struct snd_soc_card *card, int cpu_dai_id[SDW_MAX_CPU_DAIS]; int cpu_dai_num, cpu_dai_index; unsigned int group_id; - int codec_idx = 0; + int codec_dlc_index = 0; int codec_index; int codec_num; int stream; @@ -1409,7 +1409,7 @@ static int create_sdw_dailink(struct snd_soc_card *card, if (cpu_dai_id[i] != ffs(adr_link_next->mask) - 1) continue; - ret = create_codec_dai_name(dev, adr_link_next, codecs, codec_idx, + ret = create_codec_dai_name(dev, adr_link_next, codecs, codec_dlc_index, codec_conf, codec_count, codec_conf_index, adr_index, dai_index); if (ret < 0) @@ -1417,7 +1417,7 @@ static int create_sdw_dailink(struct snd_soc_card *card, /* check next link to create codec dai in the processed group */ i++; - codec_idx += adr_link_next->num_adr; + codec_dlc_index += adr_link_next->num_adr; } /* find codec info to create BE DAI */ From patchwork Mon Jul 31 21:42:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 708433 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id EA41FC001DE for ; Mon, 31 Jul 2023 21:47:17 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 0A48FE72; Mon, 31 Jul 2023 23:46:26 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0A48FE72 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1690840036; bh=QSZEaFY8AMkVL52kcnerQ3L5icJby/JL1zgARxHQ/Fc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=SlIdfnUpUv+GnCdCOSI7CyZxTwM8CsMMmVwYzkqKV4x4W2paFomlc2wAwExMDMprY n71uzzASQc4PRdL8iPsZT/0OqFTiMKxuHs2dOpX5TCYJijZc715ZQCurI603zc3Oaj 8aNxOaXoqYCY5mtexWmZZtU5+wI0SAB3jhe8zD+4= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9EF77F805F2; Mon, 31 Jul 2023 23:43:53 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id EF98EF805ED; Mon, 31 Jul 2023 23:43:52 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5C929F8059F; Mon, 31 Jul 2023 23:43:28 +0200 (CEST) Received: from mgamail.intel.com (unknown [134.134.136.100]) (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 A7667F8016D for ; Mon, 31 Jul 2023 23:43:18 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A7667F8016D Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=iXeYwbII DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690839799; x=1722375799; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=QSZEaFY8AMkVL52kcnerQ3L5icJby/JL1zgARxHQ/Fc=; b=iXeYwbIImHIgbAJGIgwdxfLcRDqKvKll1CCVWSBft7toCh5cNVHmJait 9DQEFn+y7xHeUzPxXwz+Eq5RJTV0r8mPzPYa4NTR4khEGjHMWb6kgudos dZaDNAbztxRpNof58t9JpFUNhj9Nj4RvuXLnPitTJcH4N+MM3Afz6tdfc a89bZcOc+sBxnI94EMhvdoOdr3bbST8dgRFxkmxOU1eMOZELqxJxt0EnO RWDIvlF9fgrNYJd/ZsgDnelRk2psYLuvQ0kmPLp7UdDN00k1oAkhHJcrW mkxWvnMgl0H9kQAmQ568EsqnegPQEJBGgSWqKWZ0mMoOEVxNCK+oSfMZ3 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="435449770" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="435449770" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="763523545" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="763523545" Received: from youngnic-mobl1.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.209.180.66]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:14 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Cc: tiwai@suse.de, broonie@kernel.org, Charles Keepax , Bard Liao , Ranjani Sridharan , Rander Wang , Pierre-Louis Bossart Subject: [PATCH 11/23] ASoC: intel: sof_sdw: Remove some extra line breaks Date: Mon, 31 Jul 2023 16:42:45 -0500 Message-Id: <20230731214257.444605-12-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> References: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: NJKFQJ6U6JEJXAI7EHEPDIEOYQTZX4N7 X-Message-ID-Hash: NJKFQJ6U6JEJXAI7EHEPDIEOYQTZX4N7 X-MailFrom: pierre-louis.bossart@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: <> List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Charles Keepax Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Reviewed-by: Rander Wang Signed-off-by: Charles Keepax Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_sdw.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index 0743bf04aa88..4f7ef83c21c5 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -523,7 +523,6 @@ int sdw_prepare(struct snd_pcm_substream *substream) dai = asoc_rtd_to_cpu(rtd, 0); sdw_stream = snd_soc_dai_get_stream(dai, substream->stream); - if (IS_ERR(sdw_stream)) { dev_err(rtd->dev, "no stream found for DAI %s", dai->name); return PTR_ERR(sdw_stream); @@ -543,7 +542,6 @@ int sdw_trigger(struct snd_pcm_substream *substream, int cmd) dai = asoc_rtd_to_cpu(rtd, 0); sdw_stream = snd_soc_dai_get_stream(dai, substream->stream); - if (IS_ERR(sdw_stream)) { dev_err(rtd->dev, "no stream found for DAI %s", dai->name); return PTR_ERR(sdw_stream); @@ -631,7 +629,6 @@ int sdw_hw_free(struct snd_pcm_substream *substream) dai = asoc_rtd_to_cpu(rtd, 0); sdw_stream = snd_soc_dai_get_stream(dai, substream->stream); - if (IS_ERR(sdw_stream)) { dev_err(rtd->dev, "no stream found for DAI %s", dai->name); return PTR_ERR(sdw_stream); @@ -1107,8 +1104,7 @@ static bool is_unique_device(const struct snd_soc_acpi_link_adr *adr_link, unsigned int mfg_id, unsigned int part_id, unsigned int class_id, - int index_in_link - ) + int index_in_link) { int i; @@ -1232,7 +1228,6 @@ static int set_codec_init_func(struct snd_soc_card *card, int codec_index; codec_index = find_codec_info_part(adr_link->adr_d[i].adr); - if (codec_index < 0) return codec_index; From patchwork Mon Jul 31 21:42:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 708432 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 741B7C04FE0 for ; Mon, 31 Jul 2023 21:47:50 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id AF0EADE5; Mon, 31 Jul 2023 23:46:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz AF0EADE5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1690840068; bh=slYSQ1zk9zLf+x6fzq0FvAhOUxuCFVa63EqUyleJmk4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=dWAifaANbLp4e2p8VfFz/SaLtEUXK0GRYVAnCJ9uRsX4Z0qYh9lDKZW4R+0uRJ0gx OPQmbx9vL7obkCwg5E52iKRqRIpnTVD3hR9Sxmm2L6GIxZoFbnCNjZ3YC8bnTeLG+A dWH2rC4skW9ACkqL6wVrhTsUtjxUAqsnPJ208f2k= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1378EF805FF; Mon, 31 Jul 2023 23:44:00 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 437DCF805FA; Mon, 31 Jul 2023 23:44:00 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 49A03F8016D; Mon, 31 Jul 2023 23:43:30 +0200 (CEST) Received: from mgamail.intel.com (unknown [134.134.136.100]) (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 4272DF80578 for ; Mon, 31 Jul 2023 23:43:18 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4272DF80578 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=TaiLVjfO DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690839800; x=1722375800; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=slYSQ1zk9zLf+x6fzq0FvAhOUxuCFVa63EqUyleJmk4=; b=TaiLVjfOudac75bug3b6q0OxEj16CYat8T7zoUIBhRBTxV7y0sAmPgao ny07Ac5LDPz0ox6r3B52gUQpiwv0er4/0VsdHsA6543u1rMnYFWZoUhTk ncRPeyVJHEZcp62NQJs9EB2SKqpbN0Dl21fd7eL+Imyf8WIWiXYwRWg08 JbH6Saa0uPyJYxKDZn9Q5S12S4fnJSx2j2YXcvZCEx+gym1QZfGk3TAw5 Z9Q1klKoxfVpRWw4t8i0a3xh8ggLiy2Hhayducs9Ciuycy9ex/WCDyJiu 4pRBh1I4QqaPOEL4TBIs0duWht+Q61IBk6avVc3t1K+lyGNepe265odsD g==; X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="435449775" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="435449775" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="763523548" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="763523548" Received: from youngnic-mobl1.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.209.180.66]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:15 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Cc: tiwai@suse.de, broonie@kernel.org, Charles Keepax , Bard Liao , Ranjani Sridharan , Rander Wang , Pierre-Louis Bossart Subject: [PATCH 12/23] ASoC: intel: sof_sdw: Use a module device table Date: Mon, 31 Jul 2023 16:42:46 -0500 Message-Id: <20230731214257.444605-13-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> References: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: JJDWTRJA5AGRIBBLPRH4NNPGLJP5YYSI X-Message-ID-Hash: JJDWTRJA5AGRIBBLPRH4NNPGLJP5YYSI X-MailFrom: pierre-louis.bossart@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: <> List-Archive: <> List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Charles Keepax A module device table is generally preferred over hard coding a MODULE_ALIAS. Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Reviewed-by: Rander Wang Signed-off-by: Charles Keepax Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_sdw.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index 4f7ef83c21c5..6b55bcdccccc 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -2045,6 +2045,12 @@ static void mc_remove(struct platform_device *pdev) mc_dailink_exit_loop(card); } +static const struct platform_device_id mc_id_table[] = { + { "sof_sdw", }, + {} +}; +MODULE_DEVICE_TABLE(platform, mc_id_table); + static struct platform_driver sof_sdw_driver = { .driver = { .name = "sof_sdw", @@ -2052,6 +2058,7 @@ static struct platform_driver sof_sdw_driver = { }, .probe = mc_probe, .remove_new = mc_remove, + .id_table = mc_id_table, }; module_platform_driver(sof_sdw_driver); @@ -2061,6 +2068,5 @@ MODULE_AUTHOR("Bard Liao "); MODULE_AUTHOR("Rander Wang "); MODULE_AUTHOR("Pierre-Louis Bossart "); MODULE_LICENSE("GPL v2"); -MODULE_ALIAS("platform:sof_sdw"); MODULE_IMPORT_NS(SND_SOC_INTEL_HDA_DSP_COMMON); MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_MAXIM_COMMON); From patchwork Mon Jul 31 21:42:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 708773 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 0744DC001DE for ; Mon, 31 Jul 2023 21:48:39 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 3BAA4AE9; Mon, 31 Jul 2023 23:47:47 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3BAA4AE9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1690840117; bh=s/h/nHDpyPDzg5v9orQjSPWTTnDelCpj81jdq4JEjHY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=oy8ne440+SwD917vdDKe10QuHWAoD/4X+KHVagP/d1p/YX9APPiEUBStNyI/FQRWc M3oi1/nvaxj2XD2SBJ2ux/BM23tSZQMoSo7ipYtxuWTYNfC0mtg91WTsxDMk8BcmbV Nb0fEfH1FOXep4raa5evW1adoPZlqfDV2hKlptK4= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 907DAF80621; Mon, 31 Jul 2023 23:44:09 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id D2335F8061F; Mon, 31 Jul 2023 23:44:08 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2C4A3F805B4; Mon, 31 Jul 2023 23:43:33 +0200 (CEST) Received: from mgamail.intel.com (unknown [134.134.136.100]) (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 09830F8055C for ; Mon, 31 Jul 2023 23:43:19 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 09830F8055C Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=b/+9ULOX DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690839801; x=1722375801; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=s/h/nHDpyPDzg5v9orQjSPWTTnDelCpj81jdq4JEjHY=; b=b/+9ULOXU9CYN6Yqhj2lOODEDP31Fu1zL8fRmBrHbxpx39qK/p79a2aV GbjuNZbVzUdupymeaj29NeecP8nTuXVgYXM+0N8XhIA1nShCvu67/CuuS 9WKJC+3R9zUbGwGS4o+ZxSn3N/JuyvHQhn1ce/q3a5FnxEf+e6J3jfndf PJmgQjnl6Fcf7pIMX5ZOV0dQXy5ktif1xF4jwDn1mapTDs7Q8q31FFcZH uJO+9SrY5LYCsM1Imtn6StKbD5oxaN9dW5NwBhu26nWHrCF+7z/gMuxgy LPVL2nAL/GUxTqlYFZk6o1ZkUrtAYiyPF2kt8VLfcy7gEH8Z3PQcxp20Q A==; X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="435449779" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="435449779" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="763523552" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="763523552" Received: from youngnic-mobl1.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.209.180.66]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:15 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Cc: tiwai@suse.de, broonie@kernel.org, Charles Keepax , Bard Liao , Ranjani Sridharan , Rander Wang , Pierre-Louis Bossart Subject: [PATCH 13/23] ASoC: intel: sof_sdw: Simplify find_codec_info_acpi Date: Mon, 31 Jul 2023 16:42:47 -0500 Message-Id: <20230731214257.444605-14-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> References: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: DLWWOH5HAVEU6TLYPOX4ZBTJSONYZE64 X-Message-ID-Hash: DLWWOH5HAVEU6TLYPOX4ZBTJSONYZE64 X-MailFrom: pierre-louis.bossart@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Charles Keepax Use a return rather than a break and an additional range check. Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Reviewed-by: Rander Wang Signed-off-by: Charles Keepax Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_sdw.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index 6b55bcdccccc..d3222f40d798 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -1003,14 +1003,10 @@ static inline int find_codec_info_acpi(const u8 *acpi_id) return -EINVAL; for (i = 0; i < ARRAY_SIZE(codec_info_list); i++) - if (!memcmp(codec_info_list[i].acpi_id, acpi_id, - ACPI_ID_LEN)) - break; + if (!memcmp(codec_info_list[i].acpi_id, acpi_id, ACPI_ID_LEN)) + return i; - if (i == ARRAY_SIZE(codec_info_list)) - return -EINVAL; - - return i; + return -EINVAL; } /* From patchwork Mon Jul 31 21:42:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 708775 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id DD5BBC001E0 for ; Mon, 31 Jul 2023 21:47:33 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 15FABE0F; Mon, 31 Jul 2023 23:46:42 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 15FABE0F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1690840052; bh=Sl+JnvzvCZ2oRoZq5fmpGrYfOIUrPUnGbPnSvBgk4R0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=aYuxtRHlsk+/qZH2y8E8oHY27fqpOq+xb+u0V+ePdVg/WIXzobT4bLbHtKXu7xygI tUtIQF1DvLXEpCElLGC0ShcKK4dh2v/goTBykNam+S8Pn2tVMSDlwFX2NHh7+8UFDO bll4SgHct9IQusMOyv8K6HjJNGnJJ/+gCychhCfY= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9F02CF805F1; Mon, 31 Jul 2023 23:43:56 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 1F3C4F805FA; Mon, 31 Jul 2023 23:43:56 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D271CF80557; Mon, 31 Jul 2023 23:43:28 +0200 (CEST) Received: from mgamail.intel.com (unknown [134.134.136.100]) (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 9F094F80567 for ; Mon, 31 Jul 2023 23:43:20 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9F094F80567 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=XmXE2Dqj DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690839801; x=1722375801; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Sl+JnvzvCZ2oRoZq5fmpGrYfOIUrPUnGbPnSvBgk4R0=; b=XmXE2DqjqzyKaaho92d4aHZMSjK+9Z0K7CNhXPYtMRmeOqNfcb5+w6Ur LFUhbVuGEg8ytfeVH/V+S9NsT3hxt3Am/sWR2ND3FogvN659l9fB66wXK EvWZ0JSqQFBv/hIqsWbslv5paeoHUzQxae66LMHNXNm1EasRWNBjex8eX 9kreWGRueYiYrsMK4raNJ8qiCjGWdj54t4E2Tkals1lFNUCpilbq9qX78 5pFY2U14RN/z09cyhauGQaESa/31tNjMJSuNu81ZZKtziqz2dgij/lFgJ FBC9jLySEzJ7z3UwNeFJMXcK3ozdMrzg+ehInCI6JsG6diXqePDNWuKrz g==; X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="435449784" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="435449784" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="763523555" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="763523555" Received: from youngnic-mobl1.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.209.180.66]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:16 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Cc: tiwai@suse.de, broonie@kernel.org, Charles Keepax , Bard Liao , Ranjani Sridharan , Rander Wang , Pierre-Louis Bossart Subject: [PATCH 14/23] ASoC: intel: sof_sdw: Constify parameter to find_codec_part_info Date: Mon, 31 Jul 2023 16:42:48 -0500 Message-Id: <20230731214257.444605-15-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> References: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: IUJMRV55TGEOBWCRMXZSBYT5YP4H5TE7 X-Message-ID-Hash: IUJMRV55TGEOBWCRMXZSBYT5YP4H5TE7 X-MailFrom: pierre-louis.bossart@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Charles Keepax The address passed to find_codec_part_info should be const. Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Reviewed-by: Rander Wang Signed-off-by: Charles Keepax Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_sdw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index d3222f40d798..fc67029b3a64 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -974,7 +974,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { }, }; -static inline int find_codec_info_part(u64 adr) +static inline int find_codec_info_part(const u64 adr) { unsigned int part_id, sdw_version; int i; From patchwork Mon Jul 31 21:42:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 708774 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id AE41EC001DE for ; Mon, 31 Jul 2023 21:48:10 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id B566DE81; Mon, 31 Jul 2023 23:47:18 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B566DE81 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1690840088; bh=sQGtw6GQ9GXlM3MjpOd1aSFiPgo5LMH/TthGebdxyv4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ngCKAEqDMvqsyv274+4uDx1TfmKr9M9OS9QO3+q/bZYQx9OqmEd3qypByxV1dsT3a 3wpBi1J3La8sSC5ezAQF2Mi1nN19oaPHiA3ZbLxnnqZnYV98vDtJaNKlrFHsWbtC0y S7X3aAVirxK6kaUXq2e5lMsc7AF8RJQdZQNzdXyI= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4B173F80610; Mon, 31 Jul 2023 23:44:03 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 97319F80612; Mon, 31 Jul 2023 23:44:02 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 06EEFF805B1; Mon, 31 Jul 2023 23:43:31 +0200 (CEST) Received: from mgamail.intel.com (unknown [134.134.136.100]) (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 31717F8057A for ; Mon, 31 Jul 2023 23:43:21 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 31717F8057A Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=I2/N7Pj0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690839802; x=1722375802; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sQGtw6GQ9GXlM3MjpOd1aSFiPgo5LMH/TthGebdxyv4=; b=I2/N7Pj08hFM2UjO6W4o3NJLswvaY04Ds9E/QAMCSOfqTPnx+p6TfdAN p9HfG4Ut2WNEowN/X0mlqqpLrZIbaWPo9J8T1361aZCIUvTndGm88giDs nvFIym3psJcdi/1PqB4sefmKjAM5brgYnVRP0WhPa9w3BuBvNPLjkJDS8 XiFzNeI1hN43ad3SdENo2cFpWnjRxJxINlgFZZg3I+a+E3xymHTq707Gw TF/iqUxASnG+g23rSuKl6ZYJUOx1vHylQIa51cYsB1JqPoECbCwsQHg4i R7awTw/z2rpYlH5F8pkqYWjUKKZ8YD4ywJdvMKGTW8KB/49EFYhJyplKi g==; X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="435449788" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="435449788" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="763523558" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="763523558" Received: from youngnic-mobl1.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.209.180.66]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:17 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Cc: tiwai@suse.de, broonie@kernel.org, Charles Keepax , Bard Liao , Ranjani Sridharan , Rander Wang , Pierre-Louis Bossart Subject: [PATCH 15/23] ASoC: intel: sof_sdw: Minor tidy up of mc_probe Date: Mon, 31 Jul 2023 16:42:49 -0500 Message-Id: <20230731214257.444605-16-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> References: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: ZQEIW4MEXSPEK7U4DO6KNK7H3KPSFH7O X-Message-ID-Hash: ZQEIW4MEXSPEK7U4DO6KNK7H3KPSFH7O X-MailFrom: pierre-louis.bossart@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Charles Keepax Shuffle things around to group operations a little more, and consistently use card->dev. Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Reviewed-by: Rander Wang Signed-off-by: Charles Keepax Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_sdw.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index fc67029b3a64..d4f2711b6f26 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -1964,34 +1964,34 @@ static void mc_dailink_exit_loop(struct snd_soc_card *card) static int mc_probe(struct platform_device *pdev) { struct snd_soc_card *card = &card_sof_sdw; - struct snd_soc_acpi_mach *mach; + struct snd_soc_acpi_mach *mach = dev_get_platdata(&pdev->dev); struct mc_private *ctx; int amp_num = 0, i; int ret; - dev_dbg(&pdev->dev, "Entry\n"); + card->dev = &pdev->dev; - ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); + dev_dbg(card->dev, "Entry\n"); + + ctx = devm_kzalloc(card->dev, sizeof(*ctx), GFP_KERNEL); if (!ctx) return -ENOMEM; + INIT_LIST_HEAD(&ctx->hdmi_pcm_list); + + snd_soc_card_set_drvdata(card, ctx); + dmi_check_system(sof_sdw_quirk_table); if (quirk_override != -1) { - dev_info(&pdev->dev, "Overriding quirk 0x%lx => 0x%x\n", + dev_info(card->dev, "Overriding quirk 0x%lx => 0x%x\n", sof_sdw_quirk, quirk_override); sof_sdw_quirk = quirk_override; } - log_quirks(&pdev->dev); - INIT_LIST_HEAD(&ctx->hdmi_pcm_list); + log_quirks(card->dev); - card->dev = &pdev->dev; - snd_soc_card_set_drvdata(card, ctx); - - mach = pdev->dev.platform_data; - ret = sof_card_dai_links_create(&pdev->dev, mach, - card); + ret = sof_card_dai_links_create(card->dev, mach, card); if (ret < 0) return ret; @@ -2022,7 +2022,7 @@ static int mc_probe(struct platform_device *pdev) card->long_name = sdw_card_long_name; /* Register the card */ - ret = devm_snd_soc_register_card(&pdev->dev, card); + ret = devm_snd_soc_register_card(card->dev, card); if (ret) { dev_err(card->dev, "snd_soc_register_card failed %d\n", ret); mc_dailink_exit_loop(card); From patchwork Mon Jul 31 21:42:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 708428 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 311ABC001DE for ; Mon, 31 Jul 2023 21:49:59 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 0A795E79; Mon, 31 Jul 2023 23:49:07 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0A795E79 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1690840197; bh=VOg2y9kMbxP64SqeJhnseY+asSF8IgRfVRngUHkThY0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=NwO4arJyVu3Uvdhhn2hBQbYJZlWjhNUcavUH7tgHk32M4JMnvafJ5xGAZcFGml0Zc LxuHOYiAWWKj9F9Q82TOl30wOP469185R9FYn4lx8xO/mIazGjgbAwiCHcoo7p7fNo 8X//CHeuCgTjwTtocnGJ0JwmUwa58I5whkZlwZOA= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 76BDFF80676; Mon, 31 Jul 2023 23:44:24 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 6DDCDF80672; Mon, 31 Jul 2023 23:44:23 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 917AFF805AA; Mon, 31 Jul 2023 23:43:38 +0200 (CEST) Received: from mgamail.intel.com (unknown [134.134.136.100]) (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 F3F0CF8057C for ; Mon, 31 Jul 2023 23:43:21 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz F3F0CF8057C Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=Xonbpgp/ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690839803; x=1722375803; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=VOg2y9kMbxP64SqeJhnseY+asSF8IgRfVRngUHkThY0=; b=Xonbpgp/IIV8kRuTTGcS03MdEm4ePZyYOVF6mqYJLPG1ohwAhsGP23CJ JlPEUckt9Y2dQvP1KN5b+yI21zTgKXDi+ncX0zSe0mbvyBrltowiN6PBw E+/NgkkeHMbDQ+kIc6PmyglxQ2HUe/xLw1MtG8z1omsv1CHnPLtfMcGMu IDEkwdF2alXE4z6LD/oJ1FmXsl3LrxI8sGmYfd/PCYJ5nzKZ85DD3MyIY kJibv6glwGuPK+nw3LWsmf04jlEL0yH7pvOyKxY0/GUI92um5exlzs8cp 01qgSU2d9Jj7BTLoLRfpvJvIvnKKTqqFEPRgXFL4P0U+BiPN9alju/Eqj w==; X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="435449792" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="435449792" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="763523561" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="763523561" Received: from youngnic-mobl1.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.209.180.66]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:18 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Cc: tiwai@suse.de, broonie@kernel.org, Charles Keepax , Bard Liao , Ranjani Sridharan , Rander Wang , Pierre-Louis Bossart Subject: [PATCH 16/23] ASoC: intel: sof_sdw: Remove redundant parameters in dai creation Date: Mon, 31 Jul 2023 16:42:50 -0500 Message-Id: <20230731214257.444605-17-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> References: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: SLQUKND7T3EKUFTXCKLBA4GPOAS5Q7TV X-Message-ID-Hash: SLQUKND7T3EKUFTXCKLBA4GPOAS5Q7TV X-MailFrom: pierre-louis.bossart@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Charles Keepax Pull the device and mach struct out of the card rather than explicitly passing to sof_card_dai_links_create. Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Reviewed-by: Rander Wang Signed-off-by: Charles Keepax Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_sdw.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index d4f2711b6f26..dc5337ea75da 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -1348,8 +1348,7 @@ static void set_dailink_map(struct snd_soc_dai_link_codec_ch_map *sdw_codec_ch_m static const char * const type_strings[] = {"SimpleJack", "SmartAmp", "SmartMic"}; -static int create_sdw_dailink(struct snd_soc_card *card, - struct device *dev, int *link_index, +static int create_sdw_dailink(struct snd_soc_card *card, int *link_index, struct snd_soc_dai_link *dai_links, int sdw_be_num, int sdw_cpu_dai_num, struct snd_soc_dai_link_component *cpus, @@ -1363,6 +1362,7 @@ static int create_sdw_dailink(struct snd_soc_card *card, int adr_index, int dai_index) { + struct device *dev = card->dev; const struct snd_soc_acpi_link_adr *adr_link_next; struct snd_soc_dai_link_component *codecs; struct sof_sdw_codec_info *codec_info; @@ -1563,10 +1563,10 @@ static int sof_card_codec_conf_alloc(struct device *dev, return 0; } -static int sof_card_dai_links_create(struct device *dev, - struct snd_soc_acpi_mach *mach, - struct snd_soc_card *card) +static int sof_card_dai_links_create(struct snd_soc_card *card) { + struct device *dev = card->dev; + struct snd_soc_acpi_mach *mach = dev_get_platdata(card->dev); int ssp_num, sdw_be_num = 0, hdmi_num = 0, dmic_num; struct mc_private *ctx = snd_soc_card_get_drvdata(card); struct snd_soc_dai_link_component *idisp_components; @@ -1723,7 +1723,7 @@ static int sof_card_dai_links_create(struct device *dev, return codec_index; for (j = 0; j < codec_info_list[codec_index].dai_num ; j++) { - ret = create_sdw_dailink(card, dev, &link_index, dai_links, + ret = create_sdw_dailink(card, &link_index, dai_links, sdw_be_num, sdw_cpu_dai_num, cpus, adr_link, &cpu_id, group_generated, codec_conf, codec_conf_count, @@ -1991,7 +1991,7 @@ static int mc_probe(struct platform_device *pdev) log_quirks(card->dev); - ret = sof_card_dai_links_create(card->dev, mach, card); + ret = sof_card_dai_links_create(card); if (ret < 0) return ret; From patchwork Mon Jul 31 21:42:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 708431 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id EBAA6C001DE for ; Mon, 31 Jul 2023 21:48:31 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D0C0DE10; Mon, 31 Jul 2023 23:47:39 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D0C0DE10 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1690840109; bh=RI33WpAAA+EOpdqoqvrmLpLVwloHUcbzIZbRm1IPer4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=cVZOCFkCd63tK/YPAfN675zmbSf9FwSkQhncp6b59v5blLze/bvULygFPA4J5uNid ZnIPMDaQ3sHYvo6GITiVDvbQNrWOv710J16Q6jdgqFe+NxIhRXtqLcS1V74hWxuhuV vAn4K02vj9lmaKyeuyWbRplGWr97VNDZPwhRoMx8= Received: by alsa1.perex.cz (Postfix, from userid 50401) id AC675F8061C; Mon, 31 Jul 2023 23:44:07 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 555F6F80616; Mon, 31 Jul 2023 23:44:06 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 81B3EF805B5; Mon, 31 Jul 2023 23:43:32 +0200 (CEST) Received: from mgamail.intel.com (unknown [134.134.136.100]) (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 A57B6F805A1 for ; Mon, 31 Jul 2023 23:43:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A57B6F805A1 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=Wd+xg/h3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690839803; x=1722375803; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RI33WpAAA+EOpdqoqvrmLpLVwloHUcbzIZbRm1IPer4=; b=Wd+xg/h3Y6YY9FXks2e8p/CwxyiV4hj0tsmgXq6Lach8O8smBQ+igDwY JqGK0yX/x5waiVG4LLDOT+OGhaoZk8NCsw9dUUSMLocfhqNSusQG0/nGL rFPu9rY0kw9JmTWOz3fye62lxOK2TWKTg+W2GSfXSoJctg25Km1O3ebAj G85bbi/xA9qtuSUwCd4sojjhqeIey6yO0dp5ExZo7EfljyPgFPzmTcETw 8GSJLb0X9sKl5Zs0U1Ojctv9m+tjU2r/guKkBqtdd1MoYHd/aiq9hcLsH eQ1HQLX+Rvn4RB0rynXsWUpVU7OqsxipUnbF/itn+o7MDY7jw+2R6k0NU A==; X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="435449798" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="435449798" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="763523564" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="763523564" Received: from youngnic-mobl1.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.209.180.66]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:18 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Cc: tiwai@suse.de, broonie@kernel.org, Charles Keepax , Bard Liao , Ranjani Sridharan , Rander Wang , Pierre-Louis Bossart Subject: [PATCH 17/23] ASoC: intel: sof_sdw: Move amp_num initialisation to mc_probe Date: Mon, 31 Jul 2023 16:42:51 -0500 Message-Id: <20230731214257.444605-18-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> References: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: Z2ICJK46T4GA46YYCFPHVPSB4TFTLK2H X-Message-ID-Hash: Z2ICJK46T4GA46YYCFPHVPSB4TFTLK2H X-MailFrom: pierre-louis.bossart@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: <> List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Charles Keepax The amp_num member of the info struct is zeroed at the start of sof_card_dai_links_create, but then summed in mc_probe after sof_card_dai_links_create is called. It is a little clearer to hoist the initialisation out of sof_card_dai_links_create so it is on the same level as the summation. Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Reviewed-by: Rander Wang Signed-off-by: Charles Keepax Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_sdw.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index dc5337ea75da..1a60965439dd 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -1599,10 +1599,6 @@ static int sof_card_dai_links_create(struct snd_soc_card *card) if (ret < 0) return ret; - /* reset amp_num to ensure amp_num++ starts from 0 in each probe */ - for (i = 0; i < ARRAY_SIZE(codec_info_list); i++) - codec_info_list[i].amp_num = 0; - if (mach_params->codec_mask & IDISP_CODEC_MASK) { ctx->idisp_codec = true; @@ -1991,6 +1987,10 @@ static int mc_probe(struct platform_device *pdev) log_quirks(card->dev); + /* reset amp_num to ensure amp_num++ starts from 0 in each probe */ + for (i = 0; i < ARRAY_SIZE(codec_info_list); i++) + codec_info_list[i].amp_num = 0; + ret = sof_card_dai_links_create(card); if (ret < 0) return ret; From patchwork Mon Jul 31 21:42:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 708427 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 26EE1C001E0 for ; Mon, 31 Jul 2023 21:50:36 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 352FCE8D; Mon, 31 Jul 2023 23:49:44 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 352FCE8D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1690840234; bh=Qa2CQYIzfYLynYqQHzT6LtxK/Ao+xvbnNkcPEaIfXkU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=JwoDn7uzBRS2r+qsBJOoC4pSBpohrbftePEFQRMQwGPCNFGxJ/gZ1dUciYHjREw23 yooVrw1gzSCKsVyxyjebGz71616bk1/8s7DjhxoYRBRNSzeWTTEwbuI0N8bwNXPKl0 KHv9EGXJij6meuwA9s/5WHFkyI0UQKhnTiMAa64A= Received: by alsa1.perex.cz (Postfix, from userid 50401) id CC461F8068A; Mon, 31 Jul 2023 23:44:30 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 0DB75F80687; Mon, 31 Jul 2023 23:44:30 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B60A5F8057C; Mon, 31 Jul 2023 23:43:39 +0200 (CEST) Received: from mgamail.intel.com (unknown [134.134.136.100]) (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 1F3BDF805A0 for ; Mon, 31 Jul 2023 23:43:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1F3BDF805A0 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=NGSzEtJx DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690839804; x=1722375804; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Qa2CQYIzfYLynYqQHzT6LtxK/Ao+xvbnNkcPEaIfXkU=; b=NGSzEtJxxqnENveA+l0RN/PxQ3r0k7+zd580D/9CyOU69Rxn/yT8ijgS 6AZTkqfzn4i/eSIZI+F2nkD0KTi5XMTp3xpeCdqbCCYDn9Y0esg7T42fA st8Yd1Gwm5T60klw8ReP3e8z3QDWgOCu/jKoJpE23TLDpthCN89LpNlMt +KjC3YwEbHp2zaBXyj1S4xti/lefFZoAKTQu1PnjEIukrLgUXhHtTncrL L9ybAJUbw9UX6xZxvNfDeu667WbziyyuzcA2+vjJpLPUFU23/3Yf2fgdM NRz48XrPVjJ6UBE9urVRIIGvvpanNvtFHqtyF7XMuY1qWPSYx9pNpwMns Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="435449802" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="435449802" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="763523565" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="763523565" Received: from youngnic-mobl1.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.209.180.66]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:19 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Cc: tiwai@suse.de, broonie@kernel.org, Bard Liao , Pierre-Louis Bossart Subject: [PATCH 18/23] ASoC: Intel: sof_sdw: break earlier when a adr link contains different codecs Date: Mon, 31 Jul 2023 16:42:52 -0500 Message-Id: <20230731214257.444605-19-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> References: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: VPG2UZY3FXASI3OQFJRZHATDHLX63JOB X-Message-ID-Hash: VPG2UZY3FXASI3OQFJRZHATDHLX63JOB X-MailFrom: pierre-louis.bossart@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Bard Liao create_codec_dai_name() is used to create codec component's information in different adr links. We can and should break before we do anything. Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_sdw.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index 1a60965439dd..846ba8e1515c 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -1157,6 +1157,15 @@ static int create_codec_dai_name(struct device *dev, adr = adr_link->adr_d[i].adr; + codec_index = find_codec_info_part(adr); + if (codec_index < 0) + return codec_index; + if (_codec_index != -1 && codec_index != _codec_index) { + dev_dbg(dev, "Different devices on the same sdw link\n"); + break; + } + _codec_index = codec_index; + sdw_version = SDW_VERSION(adr); link_id = SDW_DISCO_LINK_ID(adr); unique_id = SDW_UNIQUE_ID(adr); @@ -1183,15 +1192,6 @@ static int create_codec_dai_name(struct device *dev, if (!codec[comp_index].name) return -ENOMEM; - codec_index = find_codec_info_part(adr); - if (codec_index < 0) - return codec_index; - if (_codec_index != -1 && codec_index != _codec_index) { - dev_dbg(dev, "Different devices on the same sdw link\n"); - break; - } - _codec_index = codec_index; - codec[comp_index].dai_name = codec_info_list[codec_index].dais[dai_index].dai_name; From patchwork Mon Jul 31 21:42:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 708430 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 5D4D9C001E0 for ; Mon, 31 Jul 2023 21:48:53 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 8B3B1850; Mon, 31 Jul 2023 23:48:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8B3B1850 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1690840131; bh=ZSDWJHntUt2uNuQEDwc3u3RCmyZQu3SHjuHoOKgKr9M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=kSnWlN5YBTjpDW7krOibpv2XSfpxVmmeJpO2DkL7WV5jt3jhh2otkHxjh2HwEM95j isPpbe5l8ksWlvfKsxjZ8g3Drcr0wyfSxX/vAVOa7KNlFcTU+4/nuk70rI4icsKq04 y8Bo35eSx3mcJRnVjz4l9tXfuoRKlMbj/URhnsRk= Received: by alsa1.perex.cz (Postfix, from userid 50401) id DFE07F80620; Mon, 31 Jul 2023 23:44:11 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 3148CF80620; Mon, 31 Jul 2023 23:44:11 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 13A64F805B1; Mon, 31 Jul 2023 23:43:34 +0200 (CEST) Received: from mgamail.intel.com (unknown [134.134.136.100]) (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 DE947F80163 for ; Mon, 31 Jul 2023 23:43:23 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz DE947F80163 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=moL92I9u DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690839805; x=1722375805; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ZSDWJHntUt2uNuQEDwc3u3RCmyZQu3SHjuHoOKgKr9M=; b=moL92I9ucxXKr0IatON4YWo4UEDcnxxNClPN2CyUORfZ40+U/kx5IXpn SjPCbOp/Nh5YJ6I/c6FSrl9vAdHj/pmxhgUI+4R/W8Agl/voINvcCR8yI /IfGEnqbjGl1tp48Aypa8+SJKfLjguOWbqygvrdmoo0ennAV2/2APbLXT Ky66GKH8frpjb3e5GF3CzTL8fPUpeX/FeK6sJLU2BWQVxE2XfA/Mnz1I2 woJoaPJrQAssYfgurjnmEYnQyY2POfCg+miM3NBGGUgGaSPmPevxprX9s jCw6gpaF5V/5MeXuGxWH6HupOUs1Tc42pDXbowqMFzqxXmYDjUTRTjEAi Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="435449805" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="435449805" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="763523566" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="763523566" Received: from youngnic-mobl1.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.209.180.66]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:20 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Cc: tiwai@suse.de, broonie@kernel.org, Charles Keepax , Bard Liao , Pierre-Louis Bossart Subject: [PATCH 19/23] ASoC: intel: sof_sdw: Allow direct specification of CODEC name Date: Mon, 31 Jul 2023 16:42:53 -0500 Message-Id: <20230731214257.444605-20-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> References: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: 7N3Y7UZIY2WPT7FXE25Q66GMXODM6GUI X-Message-ID-Hash: 7N3Y7UZIY2WPT7FXE25Q66GMXODM6GUI X-MailFrom: pierre-louis.bossart@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: <> List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Charles Keepax Add support for MFD based CODEC drivers, by allowing the CODEC name to not be the SoundWire device directly. Signed-off-by: Charles Keepax Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_sdw.c | 6 +++++- sound/soc/intel/boards/sof_sdw_common.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index 846ba8e1515c..e6faed2b99b2 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -1174,7 +1174,11 @@ static int create_codec_dai_name(struct device *dev, class_id = SDW_CLASS_ID(adr); comp_index = i - adr_index + offset; - if (is_unique_device(adr_link, sdw_version, mfg_id, part_id, + if (codec_info_list[codec_index].codec_name) { + codec[comp_index].name = + devm_kstrdup(dev, codec_info_list[codec_index].codec_name, + GFP_KERNEL); + } else if (is_unique_device(adr_link, sdw_version, mfg_id, part_id, class_id, i)) { codec_str = "sdw:%01x:%04x:%04x:%02x"; codec[comp_index].name = diff --git a/sound/soc/intel/boards/sof_sdw_common.h b/sound/soc/intel/boards/sof_sdw_common.h index 37402170d5f9..fe234b98eb64 100644 --- a/sound/soc/intel/boards/sof_sdw_common.h +++ b/sound/soc/intel/boards/sof_sdw_common.h @@ -80,6 +80,7 @@ struct sof_sdw_dai_info { struct sof_sdw_codec_info { const int part_id; const int version_id; + const char *codec_name; int amp_num; const u8 acpi_id[ACPI_ID_LEN]; const bool ignore_pch_dmic; From patchwork Mon Jul 31 21:42:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 708772 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 7AC39C001E0 for ; Mon, 31 Jul 2023 21:49:04 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D632FDF1; Mon, 31 Jul 2023 23:48:12 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D632FDF1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1690840142; bh=eJooDVkxS8hYi9+dZ2YHgjPvUIV7g3uhKja0RQ/txVA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=DcFYyT43Vhly0FB+huNGexZWPu7prE75H0kWCijGp/Th5DBPImc6koGY3n4YNTHRJ swwqUWSslcVDhRG1OkmFnldR44XXCla8euoWl3ulzeg0FjbY7zXQQLBtZvPWomOfY0 6L09FquEapQsflDwnTFSXTR0k6oZ63QZWjbZFQwk= Received: by alsa1.perex.cz (Postfix, from userid 50401) id BDFA6F80634; Mon, 31 Jul 2023 23:44:14 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 175BFF80635; Mon, 31 Jul 2023 23:44:14 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 21908F805BD; Mon, 31 Jul 2023 23:43:36 +0200 (CEST) Received: from mgamail.intel.com (unknown [134.134.136.100]) (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 91FC1F80579 for ; Mon, 31 Jul 2023 23:43:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 91FC1F80579 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=TbY+z55s DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690839805; x=1722375805; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eJooDVkxS8hYi9+dZ2YHgjPvUIV7g3uhKja0RQ/txVA=; b=TbY+z55sKIOybmKLzV9WJOflGnrY2rM/8zM4OmXAXTKIxGJcNgmxdEU8 EFnC/Llc6VXRMLdsXB89VNEP2/Nv8i6nxjAQqQo6AMt0Hf6UESB8h561s edYoveTfvvurfIq7uhBc3nfHW6QY5NL2uFeoZrGEP7ixZPbbu6CM970Rq gBrfa7I1fszdLbUXQeSQyGpih4i/Gl0X6xQBrQdjBX3903bqAU3hppKkM Gta/Tc9XDaXi7ejikpgXgbxZw1pCIM5kB+SL9KkaOlSWjeFqWrFWexh+T hpkej2+mSPO43nCaQHKxa1JAjXOiu7mnaNQwTCiFSgdDXpm1lsbWTsd1R Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="435449811" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="435449811" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="763523569" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="763523569" Received: from youngnic-mobl1.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.209.180.66]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:20 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Cc: tiwai@suse.de, broonie@kernel.org, Chao Song , Rander Wang , Bard Liao , Pierre-Louis Bossart Subject: [PATCH 20/23] ASoC: Intel: sof_sdw: add cs35l56 codec info Date: Mon, 31 Jul 2023 16:42:54 -0500 Message-Id: <20230731214257.444605-21-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> References: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: 5TGUQRRUE56POF5TTSCD5WIU2D5NRHQA X-Message-ID-Hash: 5TGUQRRUE56POF5TTSCD5WIU2D5NRHQA X-MailFrom: pierre-louis.bossart@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Chao Song Add cs35l56 support in sof_sdw machine driver. Reviewed-by: Rander Wang Signed-off-by: Chao Song Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/Kconfig | 1 + sound/soc/intel/boards/Makefile | 2 +- sound/soc/intel/boards/sof_sdw.c | 13 +++++++ sound/soc/intel/boards/sof_sdw_common.h | 6 ++++ sound/soc/intel/boards/sof_sdw_cs_amp.c | 47 +++++++++++++++++++++++++ 5 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 sound/soc/intel/boards/sof_sdw_cs_amp.c diff --git a/sound/soc/intel/boards/Kconfig b/sound/soc/intel/boards/Kconfig index 141fba0f8c70..0ae6eecc8851 100644 --- a/sound/soc/intel/boards/Kconfig +++ b/sound/soc/intel/boards/Kconfig @@ -679,6 +679,7 @@ config SND_SOC_INTEL_SOUNDWIRE_SOF_MACH select SND_SOC_RT1318_SDW select SND_SOC_RT5682_SDW select SND_SOC_CS42L42_SDW + select SND_SOC_CS35L56_SDW select SND_SOC_DMIC select SND_SOC_INTEL_HDA_DSP_COMMON select SND_SOC_INTEL_SOF_MAXIM_COMMON diff --git a/sound/soc/intel/boards/Makefile b/sound/soc/intel/boards/Makefile index 931415d9cf6f..a570b5b40f22 100644 --- a/sound/soc/intel/boards/Makefile +++ b/sound/soc/intel/boards/Makefile @@ -42,7 +42,7 @@ snd-soc-sof-sdw-objs += sof_sdw.o \ sof_sdw_rt711.o sof_sdw_rt_sdca_jack_common.o \ sof_sdw_rt712_sdca.o sof_sdw_rt715.o \ sof_sdw_rt715_sdca.o sof_sdw_dmic.o \ - sof_sdw_cs42l42.o \ + sof_sdw_cs42l42.o sof_sdw_cs_amp.o \ sof_sdw_hdmi.o obj-$(CONFIG_SND_SOC_INTEL_SOF_RT5682_MACH) += snd-soc-sof_rt5682.o obj-$(CONFIG_SND_SOC_INTEL_SOF_CS42L42_MACH) += snd-soc-sof_cs42l42.o diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index e6faed2b99b2..5dbfcd88ab3c 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -903,6 +903,19 @@ static struct sof_sdw_codec_info codec_info_list[] = { }, .dai_num = 1, }, + { + .part_id = 0x3556, + .dais = { + { + .direction = {true, true}, + .dai_name = "cs35l56-sdw1", + .dai_type = SOF_SDW_DAI_TYPE_AMP, + .dailink = {SDW_AMP_OUT_DAI_ID, SDW_AMP_IN_DAI_ID}, + .init = sof_sdw_cs_amp_init, + }, + }, + .dai_num = 1, + }, { .part_id = 0x4242, .dais = { diff --git a/sound/soc/intel/boards/sof_sdw_common.h b/sound/soc/intel/boards/sof_sdw_common.h index fe234b98eb64..2f4fe6bc3d5d 100644 --- a/sound/soc/intel/boards/sof_sdw_common.h +++ b/sound/soc/intel/boards/sof_sdw_common.h @@ -206,4 +206,10 @@ int sof_sdw_cs42l42_init(struct snd_soc_card *card, struct sof_sdw_codec_info *info, bool playback); +/* CS AMP support */ +int sof_sdw_cs_amp_init(struct snd_soc_card *card, + const struct snd_soc_acpi_link_adr *link, + struct snd_soc_dai_link *dai_links, + struct sof_sdw_codec_info *info, + bool playback); #endif diff --git a/sound/soc/intel/boards/sof_sdw_cs_amp.c b/sound/soc/intel/boards/sof_sdw_cs_amp.c new file mode 100644 index 000000000000..98f6546f484b --- /dev/null +++ b/sound/soc/intel/boards/sof_sdw_cs_amp.c @@ -0,0 +1,47 @@ +// SPDX-License-Identifier: GPL-2.0-only +// Copyright (c) 2023 Intel Corporation + +/* + * sof_sdw_cs_amp - Helpers to handle CS35L56 from generic machine driver + */ + +#include +#include +#include +#include +#include "sof_sdw_common.h" + +#define CODEC_NAME_SIZE 8 + +static int cs_spk_init(struct snd_soc_pcm_runtime *rtd) +{ + const char *dai_name = rtd->dai_link->codecs->dai_name; + struct snd_soc_card *card = rtd->card; + char codec_name[CODEC_NAME_SIZE]; + + snprintf(codec_name, CODEC_NAME_SIZE, "%s", dai_name); + card->components = devm_kasprintf(card->dev, GFP_KERNEL, + "%s spk:%s", + card->components, codec_name); + if (!card->components) + return -ENOMEM; + + return 0; +} + + +int sof_sdw_cs_amp_init(struct snd_soc_card *card, + const struct snd_soc_acpi_link_adr *link, + struct snd_soc_dai_link *dai_links, + struct sof_sdw_codec_info *info, + bool playback) +{ + /* Count amp number and do init on playback link only. */ + if (!playback) + return 0; + + info->amp_num++; + dai_links->init = cs_spk_init; + + return 0; +} From patchwork Mon Jul 31 21:42:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 708771 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 6828DC001DE for ; Mon, 31 Jul 2023 21:49:45 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 85517E7B; Mon, 31 Jul 2023 23:48:53 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 85517E7B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1690840183; bh=TWPeDSFtjxZ+wUab1fzlSuHbCYApsuTvzh3mUc+DhQE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=JODf08UAk3OHDcbzZGBey+etQZ27NNK2FAzhLWLihPCIklhYufBgohSt3QrlNs5/C VE+9nM3GJVKpCoLhuZsKIs2VShARS+KSqGfHQD5VVP+gWEdcROqN/i/Gnao80CuUrq 4Rye7UR6sE4v/ySxkskYuqOad8FUYmzkX3rhZ0ZM= Received: by alsa1.perex.cz (Postfix, from userid 50401) id A0FF3F80659; Mon, 31 Jul 2023 23:44:21 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id E56FBF80659; Mon, 31 Jul 2023 23:44:20 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 635AAF805B5; Mon, 31 Jul 2023 23:43:37 +0200 (CEST) Received: from mgamail.intel.com (unknown [134.134.136.100]) (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 29195F805AA for ; Mon, 31 Jul 2023 23:43:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 29195F805AA Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=k6EXT8Ns DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690839806; x=1722375806; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=TWPeDSFtjxZ+wUab1fzlSuHbCYApsuTvzh3mUc+DhQE=; b=k6EXT8NsH/zkiWf8cQhv0UThKfb/2ypEw97Qj4B+p4VZr4hNVvbc6sUR Isu1YSAnsrqFrtBO4XTXQXY8uu8LPvXF5tJH+78WTSw3DXLODxp25zLVS GuzQNQJUGNC/TovUIewtFw3Vk6Vm/ukwDLkdidpPQs8yR3ozh3pdUepmT /5apE0wlS+H21OVMloovZnvCtQFd+/B2G/jkLXLF+q/iTvm3rBnFl5b/i 6hEWUPYzdjtj2fe0YRwDmuq0NjBRVcjXpwGL2hAc1skTkPbGM08k2gqtp nTdSpCSK9yCYitQMG62kfekM0jtKYeRaLMguTX0a4nC1tT2rXt6lkmGoO Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="435449815" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="435449815" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="763523570" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="763523570" Received: from youngnic-mobl1.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.209.180.66]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:21 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Cc: tiwai@suse.de, broonie@kernel.org, Charles Keepax , Ranjani Sridharan , Bard Liao , Pierre-Louis Bossart Subject: [PATCH 21/23] ASoC: intel: sof_sdw: Clean up DAI link counting Date: Mon, 31 Jul 2023 16:42:55 -0500 Message-Id: <20230731214257.444605-22-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> References: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: HU2QS6TUBPTH6NZDB3HHIKMNZZP7D73H X-Message-ID-Hash: HU2QS6TUBPTH6NZDB3HHIKMNZZP7D73H X-MailFrom: pierre-louis.bossart@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Charles Keepax The counting of each of the types of DAI link is a bit messy with things added onto an intermediate variable as it goes along. Re-order things a little to keep the order consistent with the rest of the function and simplify the process down to a variable for each type of DAI and then sum them at the end. Reviewed-by: Ranjani Sridharan Reviewed-by: Bard Liao Signed-off-by: Charles Keepax Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_sdw.c | 67 +++++++++++++++----------------- 1 file changed, 32 insertions(+), 35 deletions(-) diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index 5dbfcd88ab3c..dc6ea21b3341 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -1584,12 +1584,12 @@ static int sof_card_dai_links_create(struct snd_soc_card *card) { struct device *dev = card->dev; struct snd_soc_acpi_mach *mach = dev_get_platdata(card->dev); - int ssp_num, sdw_be_num = 0, hdmi_num = 0, dmic_num; + int sdw_be_num = 0, ssp_num = 0, dmic_num = 0, hdmi_num = 0, bt_num = 0; struct mc_private *ctx = snd_soc_card_get_drvdata(card); struct snd_soc_dai_link_component *idisp_components; struct snd_soc_dai_link_component *ssp_components; - struct snd_soc_acpi_mach_params *mach_params; - const struct snd_soc_acpi_link_adr *adr_link; + struct snd_soc_acpi_mach_params *mach_params = &mach->mach_params; + const struct snd_soc_acpi_link_adr *adr_link = mach_params->links; struct snd_soc_dai_link_component *cpus; struct snd_soc_codec_conf *codec_conf; bool append_dai_type = false; @@ -1606,16 +1606,31 @@ static int sof_card_dai_links_create(struct snd_soc_card *card) int i, j, be_id = 0; int codec_index; int cpu_id = 0; - int comp_num; int ret; - mach_params = &mach->mach_params; - /* allocate codec conf, will be populated when dailinks are created */ ret = sof_card_codec_conf_alloc(dev, mach_params, &codec_conf, &codec_conf_count); if (ret < 0) return ret; + ret = get_sdw_dailink_info(dev, adr_link, &sdw_be_num, &sdw_cpu_dai_num); + if (ret < 0) { + dev_err(dev, "failed to get sdw link info %d\n", ret); + return ret; + } + + /* + * on generic tgl platform, I2S or sdw mode is supported + * based on board rework. A ACPI device is registered in + * system only when I2S mode is supported, not sdw mode. + * Here check ACPI ID to confirm I2S is supported. + */ + ssp_codec_index = find_codec_info_acpi(mach->id); + if (ssp_codec_index >= 0) { + ssp_mask = SOF_SSP_GET_PORT(sof_sdw_quirk); + ssp_num = hweight_long(ssp_mask); + } + if (mach_params->codec_mask & IDISP_CODEC_MASK) { ctx->idisp_codec = true; @@ -1625,44 +1640,26 @@ static int sof_card_dai_links_create(struct snd_soc_card *card) hdmi_num = SOF_PRE_TGL_HDMI_COUNT; } - ssp_mask = SOF_SSP_GET_PORT(sof_sdw_quirk); - /* - * on generic tgl platform, I2S or sdw mode is supported - * based on board rework. A ACPI device is registered in - * system only when I2S mode is supported, not sdw mode. - * Here check ACPI ID to confirm I2S is supported. - */ - ssp_codec_index = find_codec_info_acpi(mach->id); - ssp_num = ssp_codec_index >= 0 ? hweight_long(ssp_mask) : 0; - comp_num = hdmi_num + ssp_num; - - ret = get_sdw_dailink_info(dev, mach_params->links, - &sdw_be_num, &sdw_cpu_dai_num); - if (ret < 0) { - dev_err(dev, "failed to get sdw link info %d", ret); - return ret; - } - /* enable dmic01 & dmic16k */ - dmic_num = (sof_sdw_quirk & SOF_SDW_PCH_DMIC || mach_params->dmic_num) ? 2 : 0; - comp_num += dmic_num; + if (sof_sdw_quirk & SOF_SDW_PCH_DMIC || mach_params->dmic_num) + dmic_num = 2; if (sof_sdw_quirk & SOF_SSP_BT_OFFLOAD_PRESENT) - comp_num++; + bt_num = 1; - dev_dbg(dev, "sdw %d, ssp %d, dmic %d, hdmi %d", sdw_be_num, ssp_num, - dmic_num, ctx->idisp_codec ? hdmi_num : 0); + dev_dbg(dev, "sdw %d, ssp %d, dmic %d, hdmi %d, bt: %d\n", + sdw_be_num, ssp_num, dmic_num, hdmi_num, bt_num); /* allocate BE dailinks */ - num_links = comp_num + sdw_be_num; + num_links = sdw_be_num + ssp_num + dmic_num + hdmi_num + bt_num; dai_links = devm_kcalloc(dev, num_links, sizeof(*dai_links), GFP_KERNEL); + if (!dai_links) + return -ENOMEM; /* allocated CPU DAIs */ - total_cpu_dai_num = comp_num + sdw_cpu_dai_num; - cpus = devm_kcalloc(dev, total_cpu_dai_num, sizeof(*cpus), - GFP_KERNEL); - - if (!dai_links || !cpus) + total_cpu_dai_num = sdw_cpu_dai_num + ssp_num + dmic_num + hdmi_num + bt_num; + cpus = devm_kcalloc(dev, total_cpu_dai_num, sizeof(*cpus), GFP_KERNEL); + if (!cpus) return -ENOMEM; /* SDW */ From patchwork Mon Jul 31 21:42:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 708770 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 72EC3C001DE for ; Mon, 31 Jul 2023 21:50:18 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id A1BB0DFA; Mon, 31 Jul 2023 23:49:26 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A1BB0DFA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1690840216; bh=f1XRoUR5OQs7kIKgmqGrQ4p+W2AL3vXJ5sq97FSKeNg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ncPzIQQWNBfOTkdu7uoeFw4Zp877H7u6Kr1aNrE2C7xE92JYTGk37ctku+yrK+iOU tNlZFrxHpTwG6nCOM3O+L1mdSaixf7YvkABeqg4/ZOYaA0d2zBObmFieWMSLL9bDaK 1mng5PvOYLxucbuSV2mu6mJMBF2ImV3/nIgbscq0= Received: by alsa1.perex.cz (Postfix, from userid 50401) id B6428F8067C; Mon, 31 Jul 2023 23:44:27 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 046BAF8067B; Mon, 31 Jul 2023 23:44:27 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 202CBF8057C; Mon, 31 Jul 2023 23:43:39 +0200 (CEST) Received: from mgamail.intel.com (unknown [134.134.136.100]) (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 D1568F805B0 for ; Mon, 31 Jul 2023 23:43:25 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D1568F805B0 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=mxtUBR3w DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690839807; x=1722375807; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=f1XRoUR5OQs7kIKgmqGrQ4p+W2AL3vXJ5sq97FSKeNg=; b=mxtUBR3w7w7pGvI5cvSkLYtBLXuaKhlPzxwSzwM27egO/ciuO8sjv28Z 4uC7KNDWwCh7MT1qvgkn7l2rogHwC21vDhV+f9RO3VcwjNQz5LC/l7cxo B5K14nSVVujPRVBIM4f6G9gUO20WZVbH46CIaxpEExpZndOlRkOOqIMkg x4szvGufvlN7ZCOP6YzT715N5p+unoebcy6kLCnHPVOAZ9trf0oCKYdNq SwZuCuk9xRdVkVQkTIZKc5MZBGrzHO0eqO3tYXZ+ueo77iJNke/JBJTq3 idZX7YNvi6Juh6NvaYPGgBuPl7BQoBrTuhVNsWj48oXF1jOqQ6yYVguAS A==; X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="435449819" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="435449819" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="763523571" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="763523571" Received: from youngnic-mobl1.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.209.180.66]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:22 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Cc: tiwai@suse.de, broonie@kernel.org, Charles Keepax , Ranjani Sridharan , Bard Liao , Pierre-Louis Bossart Subject: [PATCH 22/23] ASoC: intel: sof_sdw: Merge codec_conf_alloc into dailink_info Date: Mon, 31 Jul 2023 16:42:56 -0500 Message-Id: <20230731214257.444605-23-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> References: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: VKUVOCKJLLJSQVIF42HHRA6767N3GSFW X-Message-ID-Hash: VKUVOCKJLLJSQVIF42HHRA6767N3GSFW X-MailFrom: pierre-louis.bossart@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Charles Keepax Rename get_sdw_dailink_info to simply get_dailink_info and have it also return the number of codecs present. Then hoist the allocation of the codec conf structure up into sof_card_dai_links_create. This saves an extra loop through the adr_link array, allows us to get rid of sof_card_codec_conf_alloc and makes the allocation more explicit. Reviewed-by: Ranjani Sridharan Reviewed-by: Bard Liao Signed-off-by: Charles Keepax Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_sdw.c | 75 ++++++++++---------------------- 1 file changed, 23 insertions(+), 52 deletions(-) diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index dc6ea21b3341..25644eff5251 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -1027,9 +1027,9 @@ static inline int find_codec_info_acpi(const u8 *acpi_id) * Since some sdw slaves may be aggregated, the CPU DAI number * may be larger than the number of BE dailinks. */ -static int get_sdw_dailink_info(struct device *dev, - const struct snd_soc_acpi_link_adr *adr_link, - int *sdw_be_num, int *sdw_cpu_dai_num) +static int get_dailink_info(struct device *dev, + const struct snd_soc_acpi_link_adr *adr_link, + int *sdw_be_num, int *sdw_cpu_dai_num, int *codecs_num) { bool group_visited[SDW_MAX_GROUPS]; bool no_aggregation; @@ -1058,8 +1058,17 @@ static int get_sdw_dailink_info(struct device *dev, codec_index = find_codec_info_part(adr); if (codec_index < 0) return codec_index; + codec_info = &codec_info_list[codec_index]; + *codecs_num += codec_info->dai_num; + + if (!adr_link->adr_d[i].name_prefix) { + dev_err(dev, "codec 0x%llx does not have a name prefix\n", + adr_link->adr_d[i].adr); + return -EINVAL; + } + endpoint = adr_link->adr_d[i].endpoints; for (j = 0; j < codec_info->dai_num; j++) { @@ -1540,46 +1549,6 @@ static int create_sdw_dailink(struct snd_soc_card *card, int *link_index, #define IDISP_CODEC_MASK 0x4 -static int sof_card_codec_conf_alloc(struct device *dev, - struct snd_soc_acpi_mach_params *mach_params, - struct snd_soc_codec_conf **codec_conf, - int *codec_conf_count) -{ - const struct snd_soc_acpi_link_adr *adr_link; - struct snd_soc_codec_conf *c_conf; - int num_codecs = 0; - int codec_index; - int i; - - adr_link = mach_params->links; - if (!adr_link) - return -EINVAL; - - /* generate DAI links by each sdw link */ - for (; adr_link->num_adr; adr_link++) { - for (i = 0; i < adr_link->num_adr; i++) { - if (!adr_link->adr_d[i].name_prefix) { - dev_err(dev, "codec 0x%llx does not have a name prefix\n", - adr_link->adr_d[i].adr); - return -EINVAL; - } - codec_index = find_codec_info_part(adr_link->adr_d[i].adr); - if (codec_index < 0) - return codec_index; - num_codecs += codec_info_list[codec_index].dai_num; - } - } - - c_conf = devm_kzalloc(dev, num_codecs * sizeof(*c_conf), GFP_KERNEL); - if (!c_conf) - return -ENOMEM; - - *codec_conf = c_conf; - *codec_conf_count = num_codecs; - - return 0; -} - static int sof_card_dai_links_create(struct snd_soc_card *card) { struct device *dev = card->dev; @@ -1594,7 +1563,7 @@ static int sof_card_dai_links_create(struct snd_soc_card *card) struct snd_soc_codec_conf *codec_conf; bool append_dai_type = false; bool ignore_pch_dmic = false; - int codec_conf_count; + int codec_conf_num = 0; int codec_conf_index = 0; bool group_generated[SDW_MAX_GROUPS]; int ssp_codec_index, ssp_mask; @@ -1608,12 +1577,8 @@ static int sof_card_dai_links_create(struct snd_soc_card *card) int cpu_id = 0; int ret; - /* allocate codec conf, will be populated when dailinks are created */ - ret = sof_card_codec_conf_alloc(dev, mach_params, &codec_conf, &codec_conf_count); - if (ret < 0) - return ret; - - ret = get_sdw_dailink_info(dev, adr_link, &sdw_be_num, &sdw_cpu_dai_num); + ret = get_dailink_info(dev, adr_link, &sdw_be_num, &sdw_cpu_dai_num, + &codec_conf_num); if (ret < 0) { dev_err(dev, "failed to get sdw link info %d\n", ret); return ret; @@ -1662,6 +1627,12 @@ static int sof_card_dai_links_create(struct snd_soc_card *card) if (!cpus) return -ENOMEM; + /* allocate codec conf, will be populated when dailinks are created */ + codec_conf = devm_kcalloc(dev, codec_conf_num, sizeof(*codec_conf), + GFP_KERNEL); + if (!codec_conf) + return -ENOMEM; + /* SDW */ if (!sdw_be_num) goto SSP; @@ -1736,7 +1707,7 @@ static int sof_card_dai_links_create(struct snd_soc_card *card) ret = create_sdw_dailink(card, &link_index, dai_links, sdw_be_num, sdw_cpu_dai_num, cpus, adr_link, &cpu_id, group_generated, - codec_conf, codec_conf_count, + codec_conf, codec_conf_num, &be_id, &codec_conf_index, &ignore_pch_dmic, append_dai_type, i, j); if (ret < 0) { @@ -1888,7 +1859,7 @@ static int sof_card_dai_links_create(struct snd_soc_card *card) card->num_links = num_links; card->codec_conf = codec_conf; - card->num_configs = codec_conf_count; + card->num_configs = codec_conf_num; return 0; } From patchwork Mon Jul 31 21:42:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 708769 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id E4B3EC001E0 for ; Mon, 31 Jul 2023 21:50:44 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 1DD11E87; Mon, 31 Jul 2023 23:49:53 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1DD11E87 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1690840243; bh=/TagfDVU0TLm3gr7iCGJbeN27AeppC0ae/wkfPgtC2E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=hkHatJuet63ogiI8DkXDOjF1fLQKR8dkakKFcwRWBWNtNfgZg/rXxzH0Vy8CUISOd rUzVjY7ZOHoxi2O2qDW9mqxOVuW75kRaE0Zb2eJ8NhiB/9D311fOd0uH9zLz4Kx739 qTrfbTDOJjZsY4SgW8QJQqHcQMFVS/266TgFxS7o= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 77F84F80692; Mon, 31 Jul 2023 23:44:33 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id D5803F8068E; Mon, 31 Jul 2023 23:44:32 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3A8B9F805A0; Mon, 31 Jul 2023 23:43:40 +0200 (CEST) Received: from mgamail.intel.com (unknown [134.134.136.100]) (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 8158DF8015B for ; Mon, 31 Jul 2023 23:43:26 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8158DF8015B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=Tknx6SXI DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690839807; x=1722375807; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/TagfDVU0TLm3gr7iCGJbeN27AeppC0ae/wkfPgtC2E=; b=Tknx6SXIDQsAZbKxctx0mOD6HsVU1azPJ3Kd56bLyejqjIj06W1+10DH 1pcil70h65sBEa0eG+kOMGjqXlYcPFbEmxEFpHuY/ANYjAsDJE17TSe1M Yl3WNxqSqlZSYgpyO5tirzO6xI0sdxqfO6XFJDWTf76LcEB2ktT6TaoTL iBwtiEP+L9Ao1MqWJx8QRBaRKbTJVAlB7tTgCL5QpioNUgr8mlRZ44Tu8 G768pvtF5LvQRgkD7Z8gUaYUu79NpnNmav/zlion8v4XD7uCB+yUrchnv seXjaeJerWfaPOq6sUilOTxKra112/mpAGbO6etHAkZ4dgGkL0Qm7Usoa A==; X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="435449823" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="435449823" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="763523572" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="763523572" Received: from youngnic-mobl1.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.209.180.66]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:43:22 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Cc: tiwai@suse.de, broonie@kernel.org, Charles Keepax , Ranjani Sridharan , Bard Liao , Pierre-Louis Bossart Subject: [PATCH 23/23] ASoC: intel: sof_sdw: Move group_generated logic Date: Mon, 31 Jul 2023 16:42:57 -0500 Message-Id: <20230731214257.444605-24-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> References: <20230731214257.444605-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: 4XYEO2ZVA3HR6N4FFOYEN4SQCMHO5DFS X-Message-ID-Hash: 4XYEO2ZVA3HR6N4FFOYEN4SQCMHO5DFS X-MailFrom: pierre-louis.bossart@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Charles Keepax Hoist the handling logic for group_generated up to the sof_card_dai_links_create level. This avoids the need to pass the array through multiple levels of functions. Reviewed-by: Ranjani Sridharan Reviewed-by: Bard Liao Signed-off-by: Charles Keepax Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_sdw.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index 25644eff5251..fd27e211211b 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -1291,7 +1291,7 @@ static int set_codec_init_func(struct snd_soc_card *card, static int get_slave_info(const struct snd_soc_acpi_link_adr *adr_link, struct device *dev, int *cpu_dai_id, int *cpu_dai_num, int *codec_num, unsigned int *group_id, - bool *group_generated, int adr_index) + int adr_index) { const struct snd_soc_acpi_adr_device *adr_d; const struct snd_soc_acpi_link_adr *adr_next; @@ -1351,11 +1351,6 @@ static int get_slave_info(const struct snd_soc_acpi_link_adr *adr_link, } } - /* - * indicate CPU DAIs for this group have been generated - * to avoid generating CPU DAIs for this group again. - */ - group_generated[*group_id] = true; *cpu_dai_num = index; return 0; @@ -1379,8 +1374,7 @@ static int create_sdw_dailink(struct snd_soc_card *card, int *link_index, int sdw_be_num, int sdw_cpu_dai_num, struct snd_soc_dai_link_component *cpus, const struct snd_soc_acpi_link_adr *adr_link, - int *cpu_id, bool *group_generated, - struct snd_soc_codec_conf *codec_conf, + int *cpu_id, struct snd_soc_codec_conf *codec_conf, int codec_count, int *be_id, int *codec_conf_index, bool *ignore_pch_dmic, @@ -1404,7 +1398,7 @@ static int create_sdw_dailink(struct snd_soc_card *card, int *link_index, int k; ret = get_slave_info(adr_link, dev, cpu_dai_id, &cpu_dai_num, &codec_num, - &group_id, group_generated, adr_index); + &group_id, adr_index); if (ret) return ret; @@ -1559,13 +1553,14 @@ static int sof_card_dai_links_create(struct snd_soc_card *card) struct snd_soc_dai_link_component *ssp_components; struct snd_soc_acpi_mach_params *mach_params = &mach->mach_params; const struct snd_soc_acpi_link_adr *adr_link = mach_params->links; + bool aggregation = !(sof_sdw_quirk & SOF_SDW_NO_AGGREGATION); struct snd_soc_dai_link_component *cpus; struct snd_soc_codec_conf *codec_conf; bool append_dai_type = false; bool ignore_pch_dmic = false; int codec_conf_num = 0; int codec_conf_index = 0; - bool group_generated[SDW_MAX_GROUPS]; + bool group_generated[SDW_MAX_GROUPS] = { }; int ssp_codec_index, ssp_mask; struct snd_soc_dai_link *dai_links; int num_links, link_index = 0; @@ -1641,14 +1636,6 @@ static int sof_card_dai_links_create(struct snd_soc_card *card) if (!adr_link) return -EINVAL; - /* - * SoundWire Slaves aggregated in the same group may be - * located on different hardware links. Clear array to indicate - * CPU DAIs for this group have not been generated. - */ - for (i = 0; i < SDW_MAX_GROUPS; i++) - group_generated[i] = false; - for (i = 0; i < SDW_MAX_LINKS; i++) sdw_pin_index[i] = SDW_INTEL_BIDIR_PDI_BASE; @@ -1706,7 +1693,7 @@ static int sof_card_dai_links_create(struct snd_soc_card *card) for (j = 0; j < codec_info_list[codec_index].dai_num ; j++) { ret = create_sdw_dailink(card, &link_index, dai_links, sdw_be_num, sdw_cpu_dai_num, cpus, - adr_link, &cpu_id, group_generated, + adr_link, &cpu_id, codec_conf, codec_conf_num, &be_id, &codec_conf_index, &ignore_pch_dmic, append_dai_type, i, j); @@ -1715,6 +1702,9 @@ static int sof_card_dai_links_create(struct snd_soc_card *card) return ret; } } + + if (aggregation && endpoint->aggregated) + group_generated[endpoint->group_id] = true; } }