Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1143022pxv; Fri, 9 Jul 2021 19:22:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyD4YPCf3/WAcpbl/X2y0A5j7/HSiUG+e6tYBlLvGdvMjOj0BUebc0EQ/KDkRj71pAsM/93 X-Received: by 2002:a17:906:33c7:: with SMTP id w7mr18836696eja.430.1625883624340; Fri, 09 Jul 2021 19:20:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625883624; cv=none; d=google.com; s=arc-20160816; b=KObZ8+di0CIGHpNR2n/baNDrsXaLnQyMPTj/y+bZduaFTd0yuFVuTVQrLTZ+EZvndc XJsS+KVqAsfBey5PJIqYlaJIrCr27Z1qHZhYaeTwb005no1vz6lUauy2SsG4oX3XYguU n3g6mGcYLj94EC8VnNAH5n2PFt/J1kqsVW3RviVCAr92k3lpUz6tkLy6hS+dDiooSvTc 123+raSP3lcAs9DBAGqwByz9UuL39aKq6+KB6TGAWWEY3oOyr6otjSDpvLMip60SdyYL hV2bEBmAC7uiAwOexJI7IdUOTA4NCCtCGf8WdSfHli9MbrQUqpYrjXpE4X9QgdUImFdi j14Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=I+w+7PpggZGDgBEiVlkKH0hWF1Jg2FoyeqGUs7m6WmM=; b=WvoZgbAb8EFa5GH8NaVhdzZa90X7BDDq4J/ztr0TWVyw4CjcdgTIVjWi/zqBtcT7yz 5AFdL1i3vnbIOFzCXEKNlK8QZN9M4aIpdkrJZHMiIrDzPdLi0Oo3u+0xySlEeSqT7Vs7 8fh1Coz68r0+n6gCO3PisJfXSOwdlu31bD0i+tqCu/gYMW0LhlKWm41GRSEFzOCosp9s biLA4qzEnZBXzmrMUisECCPwBCjcfyEEB3+TYE3HnNPO/o0M1ou0eD3dZDDqtUb96mAK AEyRnR53sPqawZ+yfJWYJZwE267DHmXdVyed7YlkzII7pmzSjFcb8wNYTQZLztegFhO6 GGrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fWPhrfwG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dt9si9097897ejc.65.2021.07.09.19.19.46; Fri, 09 Jul 2021 19:20:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fWPhrfwG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231487AbhGJCUk (ORCPT + 99 others); Fri, 9 Jul 2021 22:20:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:36948 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231344AbhGJCUg (ORCPT ); Fri, 9 Jul 2021 22:20:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8B252613C3; Sat, 10 Jul 2021 02:17:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625883472; bh=V17iZAtlDJtdmfky34MKjTT9SgYihWsXZKBHvFlFewE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fWPhrfwG63lQ76vVhSvZIRy9g6o71J5zxmCcqH1WECsct04/4AvJQiyMq9j5HQ1LI JUU1SJIlm5h0wRjq6IxwB9MNjZUULIE83/Jemc8HKPdXB16SdWi6PNVVqq+bJX+9yL nc+mK4Z5L4UgnRYdh1DJ5KK78CfxWtyMETvOLmgvx4h2V+nvnB5FN5L9elOjIcJ9ZC W7oCIz6kZ2ntgZT07lIp8geez8lGPy32TYC1u55e8J2ylqKiRALySBMlApgoyWF4c8 2IwGIYuW+Uj0vew/+sj/zhwgMahyYfWWA1ZE7Bpgxag/IZAaW7HODKcgSI8b9fSkJN dYHSwPmGc+1qg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Pierre-Louis Bossart , Kai Vehmanen , Libin Yang , Mark Brown , Sasha Levin , alsa-devel@alsa-project.org Subject: [PATCH AUTOSEL 5.13 002/114] ASoC: Intel: sof_sdw: add mutual exclusion between PCH DMIC and RT715 Date: Fri, 9 Jul 2021 22:15:56 -0400 Message-Id: <20210710021748.3167666-2-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710021748.3167666-1-sashal@kernel.org> References: <20210710021748.3167666-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pierre-Louis Bossart [ Upstream commit 35564e2bf94611c3eb51d35362addb3cb394ad54 ] When external RT714/715 devices are used for capture, we don't want the PCH DMICs to be used. Any information provided by the SOF platform driver or DMI quirks will be overridden. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Reviewed-by: Libin Yang Link: https://lore.kernel.org/r/20210505163705.305616-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/intel/boards/sof_sdw.c | 19 +++++++++++++++++-- sound/soc/intel/boards/sof_sdw_common.h | 1 + 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index ecd3f90f4bbe..85a2797c2550 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -353,6 +353,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .part_id = 0x714, .version_id = 3, .direction = {false, true}, + .ignore_pch_dmic = true, .dai_name = "rt715-aif2", .init = sof_sdw_rt715_sdca_init, }, @@ -360,6 +361,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .part_id = 0x715, .version_id = 3, .direction = {false, true}, + .ignore_pch_dmic = true, .dai_name = "rt715-aif2", .init = sof_sdw_rt715_sdca_init, }, @@ -367,6 +369,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .part_id = 0x714, .version_id = 2, .direction = {false, true}, + .ignore_pch_dmic = true, .dai_name = "rt715-aif2", .init = sof_sdw_rt715_init, }, @@ -374,6 +377,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .part_id = 0x715, .version_id = 2, .direction = {false, true}, + .ignore_pch_dmic = true, .dai_name = "rt715-aif2", .init = sof_sdw_rt715_init, }, @@ -729,7 +733,8 @@ static int create_sdw_dailink(struct device *dev, int *be_index, int *cpu_id, bool *group_generated, struct snd_soc_codec_conf *codec_conf, int codec_count, - int *codec_conf_index) + int *codec_conf_index, + bool *ignore_pch_dmic) { const struct snd_soc_acpi_link_adr *link_next; struct snd_soc_dai_link_component *codecs; @@ -782,6 +787,9 @@ static int create_sdw_dailink(struct device *dev, int *be_index, if (codec_index < 0) return codec_index; + if (codec_info_list[codec_index].ignore_pch_dmic) + *ignore_pch_dmic = true; + cpu_dai_index = *cpu_id; for_each_pcm_streams(stream) { char *name, *cpu_name; @@ -913,6 +921,7 @@ static int sof_card_dai_links_create(struct device *dev, const struct snd_soc_acpi_link_adr *adr_link; struct snd_soc_dai_link_component *cpus; struct snd_soc_codec_conf *codec_conf; + bool ignore_pch_dmic = false; int codec_conf_count; int codec_conf_index = 0; bool group_generated[SDW_MAX_GROUPS]; @@ -1019,7 +1028,8 @@ static int sof_card_dai_links_create(struct device *dev, sdw_cpu_dai_num, cpus, adr_link, &cpu_id, group_generated, codec_conf, codec_conf_count, - &codec_conf_index); + &codec_conf_index, + &ignore_pch_dmic); if (ret < 0) { dev_err(dev, "failed to create dai link %d", be_id); return -ENOMEM; @@ -1087,6 +1097,10 @@ static int sof_card_dai_links_create(struct device *dev, DMIC: /* dmic */ if (dmic_num > 0) { + if (ignore_pch_dmic) { + dev_warn(dev, "Ignoring PCH DMIC\n"); + goto HDMI; + } cpus[cpu_id].dai_name = "DMIC01 Pin"; init_dai_link(dev, links + link_id, be_id, "dmic01", 0, 1, // DMIC only supports capture @@ -1105,6 +1119,7 @@ static int sof_card_dai_links_create(struct device *dev, INC_ID(be_id, cpu_id, link_id); } +HDMI: /* HDMI */ if (hdmi_num > 0) { idisp_components = devm_kcalloc(dev, hdmi_num, diff --git a/sound/soc/intel/boards/sof_sdw_common.h b/sound/soc/intel/boards/sof_sdw_common.h index f3cb6796363e..ea60e8ed215c 100644 --- a/sound/soc/intel/boards/sof_sdw_common.h +++ b/sound/soc/intel/boards/sof_sdw_common.h @@ -56,6 +56,7 @@ struct sof_sdw_codec_info { int amp_num; const u8 acpi_id[ACPI_ID_LEN]; const bool direction[2]; // playback & capture support + const bool ignore_pch_dmic; const char *dai_name; const struct snd_soc_ops *ops; -- 2.30.2