From patchwork Thu Jan 20 23:21:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 533597 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 1D800C4332F for ; Thu, 20 Jan 2022 23:23:41 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 270DE2DE9; Fri, 21 Jan 2022 00:22:49 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 270DE2DE9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1642721019; bh=xvB+7rqhEVX0DmbenZ2BGHsDCkqgzkoHzfUlr/KRcWc=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=UgDMjC4UHjxu8VCAP+pR2802OmF1sCXyqfs/fZE8XG10soCA2b201bDgoMjEvOfMk DN9lTQMPTuyBLL97G82MONz1JmD4RqDoSlm2tmdoZdlcv+XQ+Jbf/VBrPudVfapwbJ zvoF13Wz5GkYhaHqIVItg5NdVS7hDzapjaznX9EY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C2574F800F2; Fri, 21 Jan 2022 00:22:19 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 209B9F800F2; Fri, 21 Jan 2022 00:22:18 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 3C1EDF800F2 for ; Fri, 21 Jan 2022 00:22:11 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3C1EDF800F2 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="M4JniDK9" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1642720932; x=1674256932; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xvB+7rqhEVX0DmbenZ2BGHsDCkqgzkoHzfUlr/KRcWc=; b=M4JniDK9f3Boflj8pEqA8eDb1jCW0B2O7XJKG/GQbkIfzjCPn5EXyqNR V5wWDc+FQrR3aNIP4oO4k3MgQKYyd6PTaYDHcONsNmPCQsbjfiHv4R/PZ j6Fo302K6FTSMpW1XOV4ZbsGPaHDB0zAVmOItdJ7hS+lO88Fz7Zx9rZic 8f0gg5sEM8IVsmN1DonnqzES++1BG/hT2WMS2nroONn25Z9n2uIrVGwuK iY/JCZ/DstnGxacSKcW6WILwAPwJZ73xQ/nieludVBcN4DEuZskIhdUOC NCj0POblVS+Rmy95ABjaCw0YEZGwDoTvP1M+geAAvvVMrW9LISOZ3o180 Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10233"; a="269926951" X-IronPort-AV: E=Sophos;i="5.88,303,1635231600"; d="scan'208";a="269926951" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jan 2022 15:22:07 -0800 X-IronPort-AV: E=Sophos;i="5.88,303,1635231600"; d="scan'208";a="493637718" Received: from sthambit-mobl1.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.212.64.44]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jan 2022 15:22:06 -0800 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Subject: [PATCH 1/2] ASoC: SOF: Intel: match sdw version on link_slaves_found Date: Thu, 20 Jan 2022 17:21:56 -0600 Message-Id: <20220120232157.199919-2-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220120232157.199919-1-pierre-louis.bossart@linux.intel.com> References: <20220120232157.199919-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Cc: Pierre-Louis Bossart , tiwai@suse.de, Ranjani Sridharan , Rander Wang , vkoul@kernel.org, broonie@kernel.org, Reddy Muralidhar , Bard Liao X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Bard Liao Codecs with the same part id, manufacturer id and part id, but different sdw version should be treated as different codecs. For example, rt711 and rt711-sdca are different. So, we should match sdw version as well. Reported-by: Reddy Muralidhar Reviewed-by: Ranjani Sridharan Reviewed-by: Rander Wang Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart --- sound/soc/sof/intel/hda.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c index c8fb082209ce..67936be54ef7 100644 --- a/sound/soc/sof/intel/hda.c +++ b/sound/soc/sof/intel/hda.c @@ -1187,7 +1187,7 @@ static bool link_slaves_found(struct snd_sof_dev *sdev, struct hdac_bus *bus = sof_to_bus(sdev); struct sdw_intel_slave_id *ids = sdw->ids; int num_slaves = sdw->num_slaves; - unsigned int part_id, link_id, unique_id, mfg_id; + unsigned int part_id, link_id, unique_id, mfg_id, version; int i, j, k; for (i = 0; i < link->num_adr; i++) { @@ -1197,12 +1197,14 @@ static bool link_slaves_found(struct snd_sof_dev *sdev, mfg_id = SDW_MFG_ID(adr); part_id = SDW_PART_ID(adr); link_id = SDW_DISCO_LINK_ID(adr); + version = SDW_VERSION(adr); for (j = 0; j < num_slaves; j++) { /* find out how many identical parts were reported on that link */ if (ids[j].link_id == link_id && ids[j].id.part_id == part_id && - ids[j].id.mfg_id == mfg_id) + ids[j].id.mfg_id == mfg_id && + ids[j].id.sdw_version == version) reported_part_count++; } @@ -1211,21 +1213,24 @@ static bool link_slaves_found(struct snd_sof_dev *sdev, if (ids[j].link_id != link_id || ids[j].id.part_id != part_id || - ids[j].id.mfg_id != mfg_id) + ids[j].id.mfg_id != mfg_id || + ids[j].id.sdw_version != version) continue; /* find out how many identical parts are expected */ for (k = 0; k < link->num_adr; k++) { u64 adr2 = link->adr_d[k].adr; - unsigned int part_id2, link_id2, mfg_id2; + unsigned int part_id2, link_id2, mfg_id2, version2; mfg_id2 = SDW_MFG_ID(adr2); part_id2 = SDW_PART_ID(adr2); link_id2 = SDW_DISCO_LINK_ID(adr2); + version2 = SDW_VERSION(adr2); if (link_id2 == link_id && part_id2 == part_id && - mfg_id2 == mfg_id) + mfg_id2 == mfg_id && + version2 == version) expected_part_count++; } From patchwork Thu Jan 20 23:02:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 533601 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 2A3F5C433F5 for ; Thu, 20 Jan 2022 23:04:26 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 730A72DD9; Fri, 21 Jan 2022 00:03:34 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 730A72DD9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1642719864; bh=MQ7tRAEuDsU43Lwo9myEm8uJsKkl1M1kBamuKYy8aCo=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=E2uMdIu2Hh8i5niMxOS4GVd29NZtZ9gvfi+PCBLSCspFPxioMq0sX/bXrQaLXPdhZ KjQe85DdjX6Bx6CUgw953gHGIUEWZWWTlYSqCjR4w0kP4AzDeUsr1QhoYHZOCGdpaT 2EQ6WY1P/P0QluvFNGeYQyF4Yc8pi3+HG2PmDqic= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id AA6B1F8012E; Fri, 21 Jan 2022 00:02:47 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A1BF9F8012E; Fri, 21 Jan 2022 00:02:45 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 4D1FFF800F8 for ; Fri, 21 Jan 2022 00:02:40 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4D1FFF800F8 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Nx99iutc" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1642719761; x=1674255761; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=MQ7tRAEuDsU43Lwo9myEm8uJsKkl1M1kBamuKYy8aCo=; b=Nx99iutcqTXA5WIg3MeyJOLSHzlLrYnk2kArcxmqOnYcWFpPCoQtl+8M H08sheNniVRYntWGRb3z5qzwqLS1kf+LXxQFdTVaoj1dwWLDW+XK37in6 F8d+f9VrggEQVf7ZaRgey8HzQEaEL3gWWAuSN3wkHRfArjD4Xy0vRcCYl wnh4NilQK+xBqN/a+k6tnLa+/Ua/zwsdXIkE2eK3ePN843ZsOgt/0fDJw GpvelGnbnrDyymyNH0jVf+E+RNNEUcPZoU0Snr2dJDW3mF//d5lqeIv/V /5Rm6EZnhnwFQKsHCBhwy9JdXbMgzyaZGSFZ5t8ZWXCl51P+29Dz4jzyM A==; X-IronPort-AV: E=McAfee;i="6200,9189,10233"; a="306232009" X-IronPort-AV: E=Sophos;i="5.88,303,1635231600"; d="scan'208";a="306232009" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jan 2022 15:02:36 -0800 X-IronPort-AV: E=Sophos;i="5.88,303,1635231600"; d="scan'208";a="533014797" Received: from sthambit-mobl1.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.212.64.44]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jan 2022 15:02:35 -0800 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Subject: [PATCH 2/2] ASoC: Intel: sof_rt5682: Add support for platform without amplifier Date: Thu, 20 Jan 2022 17:02:26 -0600 Message-Id: <20220120230226.175906-3-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220120230226.175906-1-pierre-louis.bossart@linux.intel.com> References: <20220120230226.175906-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Cc: tiwai@suse.de, Pierre-Louis Bossart , Ranjani Sridharan , broonie@kernel.org, Ajye Huang , Brent Lu X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Ajye Huang Add a board config adl_rt5682 to support alc5682 headset codec without speaker amplifier. Follow Intel BT offload design by connecting alc5682 to SSP0. Reviewed-by: Ranjani Sridharan Signed-off-by: Ajye Huang Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_rt5682.c | 8 ++++++++ sound/soc/intel/common/soc-acpi-intel-adl-match.c | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/sound/soc/intel/boards/sof_rt5682.c b/sound/soc/intel/boards/sof_rt5682.c index 8391bea8ec79..70541caa7237 100644 --- a/sound/soc/intel/boards/sof_rt5682.c +++ b/sound/soc/intel/boards/sof_rt5682.c @@ -1045,6 +1045,14 @@ static const struct platform_device_id board_ids[] = { SOF_BT_OFFLOAD_SSP(2) | SOF_SSP_BT_OFFLOAD_PRESENT), }, + { + .name = "adl_rt5682", + .driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN | + SOF_RT5682_SSP_CODEC(0) | + SOF_RT5682_NUM_HDMIDEV(4) | + SOF_BT_OFFLOAD_SSP(2) | + SOF_SSP_BT_OFFLOAD_PRESENT), + }, { } }; MODULE_DEVICE_TABLE(platform, board_ids); 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 f32bcb2b2e09..20257f547275 100644 --- a/sound/soc/intel/common/soc-acpi-intel-adl-match.c +++ b/sound/soc/intel/common/soc-acpi-intel-adl-match.c @@ -447,6 +447,12 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_machines[] = { .sof_fw_filename = "sof-adl.ri", .sof_tplg_filename = "sof-adl-max98390-rt5682.tplg", }, + { + .comp_ids = &adl_rt5682_rt5682s_hp, + .drv_name = "adl_rt5682", + .sof_fw_filename = "sof-adl.ri", + .sof_tplg_filename = "sof-adl-rt5682.tplg", + }, {}, }; EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_adl_machines);