From patchwork Fri Aug 2 12:40:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 13751522 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3B0ED1E3CA8; Fri, 2 Aug 2024 12:40:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722602440; cv=none; b=dBe0ls8JeLXcYNj9T/eMKaO2ffyEHjv/HILuoogIFqgekyxGSXAmfGUtAWFyO/OSyK+G/N028s3tw1YFn1+59LWnXsa1cmfcYZSnwJTEKbem3c+80Jf0cllJLUE0UyxV2WgETPugaErqjXVLBo6MDaDkUzwJ6Dvl529r6BEpec8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722602440; c=relaxed/simple; bh=mtFKuhyQeNzNy8a+g0FAegLrBIwnHu2UGV1sPslRM+w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=WavAYi8kmNV0zn+2V4ByW8Nd9tjRQi2q2bupf6aYSPh/qJrHA7P2oIZQKUMJbgqLXRgzLhx4D3L5WmEg6j/RscJEg+X/fqd6s3Sl55JH2Z7JBU6q252lM/YfdFz2FuUijzxGefNk1eAQpjC69oCn0ic1e9js/gxNuyW7mS1Iy/A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=GBvoumXz; arc=none smtp.client-ip=192.198.163.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="GBvoumXz" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1722602439; x=1754138439; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=mtFKuhyQeNzNy8a+g0FAegLrBIwnHu2UGV1sPslRM+w=; b=GBvoumXzwNy3Fgzx3qjDAQ7PgWXLniQAaes9qEsfUEq6uvdvtmBZXncR u5vFWYYm9U4IFG9jzGxd7XY9O00gE9nWMzBwvne6gpPGJPb7Zzga+MZGL JSe1Hj8NaqL1bmnd7bp+EpLgewIghclBJ6xF9HGf2RZCe0R+TiKPAM41Z xQi3J2g6riXjxSOy2cSRxD/PblNOwtTspOZVvenrm9khyrf36ldJLgOOe 6rpRlQKOyebQjTZe+1X8Y6lj4a5czHvaOrhIfGJfXWQHmarKVwdp1Ip5+ 4KOSr6ajVZcFpquhars67nilDX1EmiMRjdLNcgQW347wPpInZJtH8UNuh w==; X-CSE-ConnectionGUID: +Dv8VYHxRaOA8UizugsA4w== X-CSE-MsgGUID: XQ1d+fvuSzedWor+0AiPXA== X-IronPort-AV: E=McAfee;i="6700,10204,11152"; a="24488253" X-IronPort-AV: E=Sophos;i="6.09,257,1716274800"; d="scan'208";a="24488253" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2024 05:40:39 -0700 X-CSE-ConnectionGUID: 94okQ6MnRACX1tWXNjf9mQ== X-CSE-MsgGUID: v1+G18eSS6yoI7e+W7pycA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,257,1716274800"; d="scan'208";a="55024844" Received: from ltuz-desk.ger.corp.intel.com (HELO pbossart-mobl6.intel.com) ([10.245.246.89]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2024 05:40:36 -0700 From: Pierre-Louis Bossart To: linux-sound@vger.kernel.org Cc: alsa-devel@alsa-project.org, tiwai@suse.de, broonie@kernel.org, Bjorn Helgaas , linux-pci@vger.kernel.org, Bard Liao , Ranjani Sridharan , =?utf-8?q?P=C3=A9ter?= =?utf-8?q?_Ujfalusi?= , Pierre-Louis Bossart Subject: [PATCH v4 5/5] ASoC: Intel: soc-acpi-intel-ptl-match: Add rt722 support Date: Fri, 2 Aug 2024 14:40:11 +0200 Message-ID: <20240802124011.173820-6-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240802124011.173820-1-pierre-louis.bossart@linux.intel.com> References: <20240802124011.173820-1-pierre-louis.bossart@linux.intel.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Bard Liao This patch adds match table for rt722 multiple function codec on link 0 and link3. The topology does not internally refer to link0 or link3, so we can simplify and use the same topology file name. We do need different tables though. Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart --- .../intel/common/soc-acpi-intel-ptl-match.c | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/sound/soc/intel/common/soc-acpi-intel-ptl-match.c b/sound/soc/intel/common/soc-acpi-intel-ptl-match.c index ce4234fd3895..90f97a44b607 100644 --- a/sound/soc/intel/common/soc-acpi-intel-ptl-match.c +++ b/sound/soc/intel/common/soc-acpi-intel-ptl-match.c @@ -22,6 +22,31 @@ static const struct snd_soc_acpi_endpoint single_endpoint = { .group_id = 0, }; +/* + * RT722 is a multi-function codec, three endpoints are created for + * its headset, amp and dmic functions. + */ +static const struct snd_soc_acpi_endpoint rt722_endpoints[] = { + { + .num = 0, + .aggregated = 0, + .group_position = 0, + .group_id = 0, + }, + { + .num = 1, + .aggregated = 0, + .group_position = 0, + .group_id = 0, + }, + { + .num = 2, + .aggregated = 0, + .group_position = 0, + .group_id = 0, + }, +}; + static const struct snd_soc_acpi_adr_device rt711_sdca_0_adr[] = { { .adr = 0x000030025D071101ull, @@ -31,6 +56,42 @@ static const struct snd_soc_acpi_adr_device rt711_sdca_0_adr[] = { } }; +static const struct snd_soc_acpi_adr_device rt722_0_single_adr[] = { + { + .adr = 0x000030025d072201ull, + .num_endpoints = ARRAY_SIZE(rt722_endpoints), + .endpoints = rt722_endpoints, + .name_prefix = "rt722" + } +}; + +static const struct snd_soc_acpi_adr_device rt722_3_single_adr[] = { + { + .adr = 0x000330025d072201ull, + .num_endpoints = ARRAY_SIZE(rt722_endpoints), + .endpoints = rt722_endpoints, + .name_prefix = "rt722" + } +}; + +static const struct snd_soc_acpi_link_adr ptl_rt722_only[] = { + { + .mask = BIT(0), + .num_adr = ARRAY_SIZE(rt722_0_single_adr), + .adr_d = rt722_0_single_adr, + }, + {} +}; + +static const struct snd_soc_acpi_link_adr ptl_rt722_l3[] = { + { + .mask = BIT(3), + .num_adr = ARRAY_SIZE(rt722_3_single_adr), + .adr_d = rt722_3_single_adr, + }, + {} +}; + static const struct snd_soc_acpi_link_adr ptl_rvp[] = { { .mask = BIT(0), @@ -67,6 +128,18 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_ptl_sdw_machines[] = { .drv_name = "sof_sdw", .sof_tplg_filename = "sof-ptl-rt711.tplg", }, + { + .link_mask = BIT(0), + .links = ptl_rt722_only, + .drv_name = "sof_sdw", + .sof_tplg_filename = "sof-ptl-rt722.tplg", + }, + { + .link_mask = BIT(3), + .links = ptl_rt722_l3, + .drv_name = "sof_sdw", + .sof_tplg_filename = "sof-ptl-rt722.tplg", + }, {}, }; EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_ptl_sdw_machines);