From patchwork Thu Mar 31 00:04:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Martin_Povi=C5=A1er?= X-Patchwork-Id: 555385 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83371C4332F for ; Thu, 31 Mar 2022 00:05:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351955AbiCaAHX (ORCPT ); Wed, 30 Mar 2022 20:07:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229731AbiCaAHV (ORCPT ); Wed, 30 Mar 2022 20:07:21 -0400 Received: from hutie.ust.cz (hutie.ust.cz [185.8.165.127]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6A0C2BB18; Wed, 30 Mar 2022 17:05:33 -0700 (PDT) From: =?utf-8?q?Martin_Povi=C5=A1er?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cutebit.org; s=mail; t=1648685132; bh=SeiIUiZeJW/WU1eEvgOIqMuWCeT5CiLubwaCNwTIB44=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=aN/8a0qfTlacb8dkUsL9qNzNhslN5RAhSevBw6Ynn92QaDWLBR/+XW0cT6sDqo6Mk E2/xOWMdeUhPjHnUAIK+KYx93csU11L+jqfr5v7cswdYDU5sktP9sBxD8hG1hNDJkl I7PW6+g6HIA4W7v9ejkAvnTSXoyvnLB22q6pz2To= To: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Jaroslav Kysela , Takashi Iwai Cc: =?utf-8?q?Martin_Povi=C5=A1er?= , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Mark Kettenis , Hector Martin , Sven Peter Subject: [RFC PATCH 3/5] HACK: ASoC: Tolerate N-cpus-to-M-codecs links Date: Thu, 31 Mar 2022 02:04:47 +0200 Message-Id: <20220331000449.41062-4-povik+lin@cutebit.org> In-Reply-To: <20220331000449.41062-1-povik+lin@cutebit.org> References: <20220331000449.41062-1-povik+lin@cutebit.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Tolerate N-to-M DAI links while using the first CPU DAI to decide playback/capture abilities. Signed-off-by: Martin PoviĊĦer --- sound/soc/soc-pcm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 9a954680d492..770cf367a147 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -2781,9 +2781,12 @@ static int soc_get_playback_capture(struct snd_soc_pcm_runtime *rtd, } else if (rtd->num_cpus == rtd->num_codecs) { cpu_dai = asoc_rtd_to_cpu(rtd, i); } else { +#if 0 dev_err(rtd->card->dev, "N cpus to M codecs link is not supported yet\n"); return -EINVAL; +#endif + cpu_dai = asoc_rtd_to_cpu(rtd, 0); } if (snd_soc_dai_stream_valid(codec_dai, SNDRV_PCM_STREAM_PLAYBACK) &&