Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp448845pxb; Thu, 9 Sep 2021 04:51:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTd+wpkU72955AWwbT3E6i0MiZ+Iml5P2ceN8fvcnlDTAM5owTd/LmFUpldG6PMMm43MW+ X-Received: by 2002:a92:c144:: with SMTP id b4mr2041375ilh.67.1631188263047; Thu, 09 Sep 2021 04:51:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631188263; cv=none; d=google.com; s=arc-20160816; b=pSIedXr80m4yvYYZj64wdW0cEeQyuYJiCNGmYE5dEjCLOLbZJHUPauz1chxDR8pygp KSG0SXtN8T0xbQQ5QLHcEXmvtGP3r6hfEWLZjcl83pCPrHkta2l+GV8rmMTIW+B5pIxc YVNN3hoqPx2rOMOE+nSAPr8TK9DvC9hAUoetqj5SRzrXw6ROtgzBpxHEzjUF/PO1IFJR ZRjVxHnAoBd3kAzm8OGl7s3WCVS+5tj2vTp5+7qNKPIBYt2OKsJAKta5SU/DY79FvYrg l0hpXEVKYUfSFVYtplVNVb1VCpwqwT9JHk9MQYhNu6nx2oSflxKvoHhMHZZ31jsvFMl8 eFHQ== 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=HBFMfrMLfK78eigoCkJhSKsEI1E6s+hwJ7+R8wGmBiU=; b=0n8xNfhDRGLtyfKXfTe2yhA7E5UGOoF4g7X4WZzWaQi11CxhW40Hz+9aqxr8nZjTUE cc0TTrZ7AfAK/sly5JM/zuLR+G+qX1LrBbvBZac6NAM2naGbSICaTPbfwOAPXLRYz8Te sPz6bDbK2QsXNgCxc4MeXRfET5vT1crCfx6nrO9zy7eU45gX+9E/7bQHl6SopbRpc5ai 5TZoDXcQpVuFrdOpnsJfcobNgzhVC2K+KLYbFFdx1g6qf7yNLzEAe3C2Q7bY2YiPdEj4 hLuLW5fC7gpUPin4sjiKdmk0wRQm3KMWheczPldQUd+k8AU0/WlMCZ7qT9/9qOOb0xiT WbcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=og0hKXgM; 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 p6si1419742ilj.154.2021.09.09.04.50.46; Thu, 09 Sep 2021 04:51:03 -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=og0hKXgM; 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 S240516AbhIILuY (ORCPT + 99 others); Thu, 9 Sep 2021 07:50:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:53688 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241716AbhIILrt (ORCPT ); Thu, 9 Sep 2021 07:47:49 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D574561261; Thu, 9 Sep 2021 11:43:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631187797; bh=T+pyGVuoVHBZhTxcuYfPVs9mekt2VTw41BaXw7jkxoc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=og0hKXgMKuUEVWYbZC6D1S9+6XwVZOEf+lMj6n4a6BDnJGOy+AgTzMcQgoiIqajg8 nN/ELCP31yWMNBtYRx+yKSdFSnv7DDrANBCx4PgE/49Li5eFLUiMIPyaen/WBogo7M vtv1B0iVkA35JZu00QedL0Tl1k2s3ub7BrZ6VmyTmin8maSdvM759VdZ9LCtAbVv47 aMvh9lHcIxY5hFQ35wmtD4zxUDTEntgwU605oBkid62r4wtnOkm1bOX7d5GgT4yTi9 oe28Lbu3TiHpQnkqesrGApCOoIOWOnxJHrdlmh3hcMvOm2dLQGKRLd/5N5/ZQNtwxF xUWlWGj6KMO+g== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Pierre-Louis Bossart , Guennadi Liakhovetski , Mark Brown , Sasha Levin , alsa-devel@alsa-project.org Subject: [PATCH AUTOSEL 5.14 102/252] ASoC: Intel: update sof_pcm512x quirks Date: Thu, 9 Sep 2021 07:38:36 -0400 Message-Id: <20210909114106.141462-102-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210909114106.141462-1-sashal@kernel.org> References: <20210909114106.141462-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 22414cade8dfec25ab94df52b3a4f7aa8edb6120 ] The default SOF topology enables SSP capture and DMICs, even though both of these hardware capabilities are not always available in hardware (specific versions of HiFiberry and DMIC kit needed). For the SSP capture, this leads to annoying "SP5-Codec: ASoC: no backend capture" and "streamSSP5-Codec: ASoC: no users capture at close - state 0" errors. Update the quirks to match what the topology needs, which also allows for the ability to remove SSP capture and DMIC support. BugLink: https://github.com/thesofproject/linux/issues/3061 Signed-off-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Link: https://lore.kernel.org/r/20210802152151.15832-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/intel/boards/sof_pcm512x.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sound/soc/intel/boards/sof_pcm512x.c b/sound/soc/intel/boards/sof_pcm512x.c index 2ec9c62366e2..6815204e58d5 100644 --- a/sound/soc/intel/boards/sof_pcm512x.c +++ b/sound/soc/intel/boards/sof_pcm512x.c @@ -26,11 +26,16 @@ #define SOF_PCM512X_SSP_CODEC(quirk) ((quirk) & GENMASK(3, 0)) #define SOF_PCM512X_SSP_CODEC_MASK (GENMASK(3, 0)) +#define SOF_PCM512X_ENABLE_SSP_CAPTURE BIT(4) +#define SOF_PCM512X_ENABLE_DMIC BIT(5) #define IDISP_CODEC_MASK 0x4 /* Default: SSP5 */ -static unsigned long sof_pcm512x_quirk = SOF_PCM512X_SSP_CODEC(5); +static unsigned long sof_pcm512x_quirk = + SOF_PCM512X_SSP_CODEC(5) | + SOF_PCM512X_ENABLE_SSP_CAPTURE | + SOF_PCM512X_ENABLE_DMIC; static bool is_legacy_cpu; @@ -244,8 +249,9 @@ static struct snd_soc_dai_link *sof_card_dai_links_create(struct device *dev, links[id].dpcm_playback = 1; /* * capture only supported with specific versions of the Hifiberry DAC+ - * links[id].dpcm_capture = 1; */ + if (sof_pcm512x_quirk & SOF_PCM512X_ENABLE_SSP_CAPTURE) + links[id].dpcm_capture = 1; links[id].no_pcm = 1; links[id].cpus = &cpus[id]; links[id].num_cpus = 1; @@ -380,6 +386,9 @@ static int sof_audio_probe(struct platform_device *pdev) ssp_codec = sof_pcm512x_quirk & SOF_PCM512X_SSP_CODEC_MASK; + if (!(sof_pcm512x_quirk & SOF_PCM512X_ENABLE_DMIC)) + dmic_be_num = 0; + /* compute number of dai links */ sof_audio_card_pcm512x.num_links = 1 + dmic_be_num + hdmi_num; -- 2.30.2