From nobody Fri Sep 25 16:51:03 2026 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) (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 827CA459AED; Thu, 10 Sep 2026 11:45:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=67.231.152.168 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789040714; cv=fail; b=qtLavUUJxkGsH7Ok86M735Q5dlHSkqF9KONhQiEiXJSd0X6WHBDr5bFqI79JyJLhdzpU3ceUfOqDtbGBT/XxbyVOazozXdS3mWJIdwQv7Gczaee8h+eM+fcNdD84W8P3xqeEPwCTDQG5dyxkksM9uaVvMWLy1wiHGmx3SjbV1aM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789040714; c=relaxed/simple; bh=L7ozkqi3dgU5n47eUKucBBIMX/Tvw01SF8sYplnoHRU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=jjYWzy8pU3uDU9q+qFIVtqbr9mSyBHk8XKV0TIQ5xL9qfSjymw/FPrxarSctJ1upr7P3AbvEv2Vf7R/4ca8kAivHQWmNSoXtqy19R7d4dB5vkSJH1iOiK6r54PrEFCiLSxPJw4HEMTKvzQC1tjyM4johDpyLjHuB4No6bdvO55Q= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com; spf=pass smtp.mailfrom=opensource.cirrus.com; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b=ZEfviTHR; dkim=pass (1024-bit key) header.d=cirrus4.onmicrosoft.com header.i=@cirrus4.onmicrosoft.com header.b=0F8XN70L; arc=fail smtp.client-ip=67.231.152.168 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="ZEfviTHR"; dkim=pass (1024-bit key) header.d=cirrus4.onmicrosoft.com header.i=@cirrus4.onmicrosoft.com header.b="0F8XN70L" Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 689IgkGo2106863; Thu, 10 Sep 2026 06:45:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= PODMain02222019; bh=RN4XQ8jcBx0tvqDNMTKatutCqBJrQjmiaVWtQD/7upw=; b= ZEfviTHR7TdqtX5zN7p5PmEuYBnGl9bz3D2TOVVKWQZemgHwdSkRpqBrhFvY+4TF kA+AfYXlTDjEyrLncDMzUhAuvh6Ra1RBRzTUQYX/B3N8GntmDLin2xzyz+KIChUz lp8LXpn3TaVLAXHC1AYBVzWVbW0d9Zt06RkWc0scn/DIe+6NrxKDFiXIFJ9YVZ9a n0/2WMSfjNgNqK+1U5UV8tG7cxLFBU+zMB5fsWO5+axsFwL+SE2zCygqLk+3D6pg tfEHevch/cia1Fzk4I68w127u8u8FFrr8rsp2YgUW38CHijcqL152wdc4Q+mJLOM FRdUDwlQrmkTi7KwdVBanA== Received: from cy3pr05cu001.outbound.protection.outlook.com (mail-westcentralusazon11023104.outbound.protection.outlook.com [40.93.201.104]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 4gkcyms0ke-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 10 Sep 2026 06:45:06 -0500 (CDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=WEXipSqB7Ql1/gVAfD5y3x+2w3tOfBuZ8kzYloUAgo4zAtfqg6DGb3DEBajpnQc6uafPPN1FCMT5xbxM68jdXkPvee1EOUXg0/SZYakqbyMwo2C/tM6Zr7PC+UF5BJD0MUJx96wS1qcqaveSPn4JcvtkLHs2sQ0jajIAxVX8xnXGI17iVAAFedhq+d1oPjxOLWkoB1/oTeHKc39XrL+Cs+R+mREBmhepI6nAj9OCLxK/K3BPLUfPTo4Jtke5Si3FGat+8OFCQcvkffjSF1DpZDLp2JjzR+jDetjYo508EwqSFbqx6TZzo+xyRSDpashmUeo6ugfwrXp5wJlhaEHtvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RN4XQ8jcBx0tvqDNMTKatutCqBJrQjmiaVWtQD/7upw=; b=r8S8DQTkKyUmDkFMje2ILz0n+vPLgydKnkcDojG5sgOcPDc8QKEDmvWnRVgCmlAmDqC7W6YmIp156ML0sbneViRKHOaxCdAEjeWjv9XrBd/Bw8YF56wBLqJcYnmzr0cbkoFkon7wDtyPNXxS1DVipoXN4gl2h6RlruEaWi168+WIJrTWI1fHNBzpLeFvOi+hRYUTah1zfeLuO1GGHXTZhn1GiVdJCqekAuIFMZXM9DmBth0raU4C7VANzFeHAcOOW5UmCCiN7RAIS88dwyYXT+UugdryCvs21i6kTES6IpBb/XrQQw/FYtVr/YhSEeg78OgauD35xsw8tZpcbp+NWg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=softfail (sender ip is 84.19.233.75) smtp.rcpttodomain=cirrus.com smtp.mailfrom=opensource.cirrus.com; dmarc=fail (p=reject sp=reject pct=100) action=oreject header.from=opensource.cirrus.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus4.onmicrosoft.com; s=selector2-cirrus4-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RN4XQ8jcBx0tvqDNMTKatutCqBJrQjmiaVWtQD/7upw=; b=0F8XN70L18Z47unnC1o55oAQLZ2zejDczU0a3gL0dEuM3357ieBX7wKLRwcYBwEM0bZ8ucWCjsmfUPnjEsTZU6p9Jy22asFHGpF9qpyqdpQQeH6xSPgSS7o01bEptPZ9H/r3NFTB7yYe+Z5UWX8sqOndnoDK1KGjqE42V4vSsz4= Received: from SJ0PR03CA0299.namprd03.prod.outlook.com (2603:10b6:a03:39e::34) by EA3PR19MB9567.namprd19.prod.outlook.com (2603:10b6:303:2b1::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.382.15; Thu, 10 Sep 2026 11:45:03 +0000 Received: from CO1PEPF00012E83.namprd03.prod.outlook.com (2603:10b6:a03:39e:cafe::9e) by SJ0PR03CA0299.outlook.office365.com (2603:10b6:a03:39e::34) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.406.9 via Frontend Transport; Thu, 10 Sep 2026 11:45:03 +0000 X-MS-Exchange-Authentication-Results: spf=softfail (sender IP is 84.19.233.75) smtp.mailfrom=opensource.cirrus.com; dkim=none (message not signed) header.d=none;dmarc=fail action=oreject header.from=opensource.cirrus.com; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning opensource.cirrus.com discourages use of 84.19.233.75 as permitted sender) Received: from edirelay1.ad.cirrus.com (84.19.233.75) by CO1PEPF00012E83.mail.protection.outlook.com (10.167.249.58) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.406.5 via Frontend Transport; Thu, 10 Sep 2026 11:45:02 +0000 Received: from ediswmail9.ad.cirrus.com (ediswmail9.ad.cirrus.com [198.61.86.93]) by edirelay1.ad.cirrus.com (Postfix) with ESMTPS id 46F8240655D; Thu, 10 Sep 2026 11:45:01 +0000 (UTC) Received: from ediswws06.ad.cirrus.com (ediswws06.ad.cirrus.com [198.90.208.11]) by ediswmail9.ad.cirrus.com (Postfix) with ESMTPSA id 20A0C822563; Thu, 10 Sep 2026 11:45:01 +0000 (UTC) From: Richard Fitzgerald To: broonie@kernel.org Cc: yung-chuan.liao@linux.intel.com, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com Subject: [PATCH 1/5] ASoC: Rename snd_soc_dai_link_ch_map.ch_mask to cpu_ch_mask Date: Thu, 10 Sep 2026 12:44:56 +0100 Message-ID: <20260910114500.1586637-2-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260910114500.1586637-1-rf@opensource.cirrus.com> References: <20260910114500.1586637-1-rf@opensource.cirrus.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF00012E83:EE_|EA3PR19MB9567:EE_ X-MS-Office365-Filtering-Correlation-Id: 291468f6-feee-48dd-b0f5-08df0f30f398 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|23010399003|36860700016|376014|61400799027|10067099003|11063799006|56012099006|18002099003|16102099003|22082099003; X-Microsoft-Antispam-Message-Info: 5JedYuoKQyLb8l797z89P2sfRirhe8lljTIEP838Xv5u2YtNESSflLD7xLwXoLT5c17VNS64HX5r3m16wMyF4XRIZtq9NTNz1Bt3J2rqRJ31rv/c8ZIwY8xkcZrxgmnsb5AKDuiyroUWTNin7xrJD4LqOte65TTF06BEfsyjJ4ggQcJPmMd23yfIfWJ4xAAG25yMzL66nvvoSB/33IehJ7GPp711XFVcRzUk+RvVkdnp1aRXdd2ZueVOoWMMQ0KgZozmztBEnj1miQ3HFpjzj2YbG2znRfH3g/9Q9TIIyZz/lu/H114qXtH2ZLPO2wn8s4w1HddXnC2ChMOFxEoWQt+/yXL2FEJOZpATs8PpYlgwZqf4xYGlbfw95upxjwh/av7LGXlG/rlVnxPdyIzLe8ctF4QTm5X/HZwgbvIaOZntH57PIl8p9QnyFiJxkWFdVXFwP8ycqq2Qz2nSx0uynzxApgQrIB4oweHa6v46e1d2nrgtyrj7/TUcM+CSCJAv+SiO063IIjTUqlIDhfvseLmoddVtd8rNd3cGnOnDnV0rgtR1GxGYJG/z2aefEvvgANO9SoaNekpRQocBhboJT2y4KEtdxP8Mx7UyVu8psDSAFRlR0MObfq/Hr4OTWocCwItUnDg9O2KUWLTrHqRTTlu5hj42ehyfppylfeA1EgTOpP10bmy2/1+fVdYhmWuPej9Zg6ILnXeWL6xnmidQRA== X-Forefront-Antispam-Report: CIP:84.19.233.75;CTRY:GB;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:edirelay1.ad.cirrus.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(23010399003)(36860700016)(376014)(61400799027)(10067099003)(11063799006)(56012099006)(18002099003)(16102099003)(22082099003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: LKaHicZ8rI3Kadh2WbDwezeTxjCfre6YZUMAVDcS8URzu06FTe9ntXSwU5zzRmAhGWdJ2IAnr3bkwDn9kDC0Kw7L+JEux2SxJ7jN6ExDOg0Lpi7nEDHYWUvTbkEF4i/P/ckYhGu2R97iULsOIta2te6wRr+8E4UKg6M5jGxISHw2QU+O0Gma0f5W9gUlNFD8+h4rP39/vJG5CoDCv9HiQsCXJM6nXgObdsQBHoGVoHOoTMA8MQaKZvNu6hq6JGxP98h4RET61P3bF++13g2mMY+rCQ+7IjaV63WWPwdpHwb8bTUN5PESmyGmwchazyDn0Ksrg1JyRBft+rN2dstor+cfP2W/rqln8Te0vCVeXyu/HXXBDdt2xtz4IEM1Uf8DzxD6GN/BNyriCC241AWmgK13HVoAMoarSCaMgnu0/IooEmQzdWsZaj9BBuEyQfma X-Exchange-RoutingPolicyChecked: tJlt4yqPezF+xsW2W6ap6wmp/ZQ2Pfdti/YLpc5ODXSCoaFZNJAHouBQKx45XqnfuPY/sILXyE9KmSGgYiUu9iL5HmGirjD5RLS4X6lMmTBDxyZIplHidKWaKvHXG6TXU3eXUhEB1Um+FuYnqsNgfIzsBXgdda5TUMa+IRh9zkc1EOx+8x+5j2HeuuvsOan+Kh/JcZjCSuoufGZQRzbYWg16FsGxKIJHXr2A389pAxJO7CmzOb9vjl/U580Gv+YojSgWMjTzbHZpgQaSMDJCNPIE6eJHNguo0uwbL65CE4/GMY9Q/hIVivMs4aLALLFqe19BPJUWz+mGirrPvIioFA== X-OriginatorOrg: opensource.cirrus.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2026 11:45:02.6268 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 291468f6-feee-48dd-b0f5-08df0f30f398 X-MS-Exchange-CrossTenant-Id: bec09025-e5bc-40d1-a355-8e955c307de8 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bec09025-e5bc-40d1-a355-8e955c307de8;Ip=[84.19.233.75];Helo=[edirelay1.ad.cirrus.com] X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TreatMessagesAsInternal-CO1PEPF00012E83.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: EA3PR19MB9567 X-Proofpoint-ORIG-GUID: 1ndfweWE3GGUSU-ZNLExd4OWcwyr6792 X-Proofpoint-GUID: 1ndfweWE3GGUSU-ZNLExd4OWcwyr6792 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTEwMDEzOCBTYWx0ZWRfX3zxOari8yGvb igcA1CFF4rBaACtQ8bJ5j+Oh7UJubAL7pb3zeA5jahKyATAnm0CHNOH2DcveVSkZtKWlDMf5wzx UgCkjTD36VFglJbQR1/UXMGLAk7eF3w= X-Authority-Analysis: v=2.4 cv=OKiyTiaB c=1 sm=1 tr=0 ts=6aa29842 cx=c_pps a=0zbhqlog1HYD7RdPDvTXcw==:117 a=h1hSm8JtM9GN1ddwPAif2w==:17 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=VdqzKS8jKosA:10 a=s63m1ICgrNkA:10 a=RWc_ulEos4gA:10 a=VkNPw1HP01LnGYTKEx00:22 a=iX4cTi3TZMoOKdANLEfx:22 a=KfkQE9S9VqCBgivYGm0O:22 a=w1d2syhTAAAA:8 a=vyt6Wrf2iDEc68905z4A:9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTEwMDEzOCBTYWx0ZWRfX69G4fNKaZWyb nBGA8EqSb/+ELS4Hr7zYAilkPk29Ei8NeNyown9G1vcIjoej7nEQpAKSyQZQm+3zH4NXp9gU/ui EDn1shLxuk+9Ev5UGOuMCxbl/6aZVccsL97k0gYfLsU6ZXMtn8b4OPyoWaY4Xc7NZHE4GOhpOvp kGlVrqqw+QHGN1fso+8JgsGxkNnz9486e3SsybAdvr5DEIGvZYjMNLY2z9zAhSpA10u1iTy6LfC Wrb0AlS1RjPXrZ9e+90d+3z12uhQS+jdgVKtLKg2NrcMmNvdkF+hBgKSqYY9LFQFYrgjJx4V5GY uVuymSLJisasdFJlURZVN/VlRZFNf/cs3rhaLFrg9JIdxXIktHjNXZqY+qulSAnK5ghZID//3bt aaaE3P8YxT04l1xSD7IClEbYaJWHP/tRHxhUVn67Cm9IedYN5nQeMRe1js7gGy5yDpKQ/S9jBte 6QIkYs51KjXNRKCcP3w== X-Proofpoint-Spam-Reason: safe Content-Type: text/plain; charset="utf-8" Rename the ch_mask member of snd_soc_dai_link_ch_map to cpu_ch_mask, as that is what it is used for. The CPU and codec channel masks are not necessarily the same, and are quite likely different. SoundWire and I2S/TDM both support assigning different sample slots to each codec, so for example channel 0 on each codec could map to different channels at the CPU. So it's quite normal that the channel mask at the CPU end is different for each codec, but the codec channel masks are the same for each codec. Signed-off-by: Richard Fitzgerald --- include/sound/soc.h | 2 +- sound/soc/sdw_utils/soc_sdw_utils.c | 2 +- sound/soc/soc-pcm.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/sound/soc.h b/include/sound/soc.h index f46b2bc2a022..94c9b75e27e3 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -699,7 +699,7 @@ struct snd_soc_dai_link_component { struct snd_soc_dai_link_ch_map { unsigned int cpu; unsigned int codec; - unsigned int ch_mask; + unsigned int cpu_ch_mask; }; =20 struct snd_soc_dai_link { diff --git a/sound/soc/sdw_utils/soc_sdw_utils.c b/sound/soc/sdw_utils/soc_= sdw_utils.c index 88031238c04e..cab1578b893d 100644 --- a/sound/soc/sdw_utils/soc_sdw_utils.c +++ b/sound/soc/sdw_utils/soc_sdw_utils.c @@ -1762,7 +1762,7 @@ int asoc_sdw_hw_params(struct snd_pcm_substream *subs= tream, * ASoC will set the corresponding channel numbers for each cpu dai. */ for_each_link_ch_maps(rtd->dai_link, i, ch_maps) - ch_maps->ch_mask =3D ch_mask << (i * step); + ch_maps->cpu_ch_mask =3D ch_mask << (i * step); =20 return 0; } diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 0e49290a8c90..cb64ced21149 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -1264,7 +1264,7 @@ static int __soc_pcm_hw_params(struct snd_pcm_substre= am *substream, */ for_each_rtd_ch_maps(rtd, j, ch_maps) if (ch_maps->cpu =3D=3D i) - ch_mask |=3D ch_maps->ch_mask; + ch_mask |=3D ch_maps->cpu_ch_mask; =20 /* fixup cpu channel number */ if (ch_mask) --=20 2.47.3 From nobody Fri Sep 25 16:51:04 2026 Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) (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 BA9A8478E39; Thu, 10 Sep 2026 11:45:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=67.231.149.25 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789040726; cv=fail; b=tZL5cDJBEwcqmsCcyPnTRWurr9zGyp0psZTrL9UrjDj9XqS2PF6pRhy+GS6/ZZW188xSBerWcuwxrsaXz7dtLPBq1GthzVzRn4sU1d847g0P9PPIg8Sfj0K69iImlJwY5iQLQXvZ3ajwJdfK2puddGjS3uP0t2JJmgzz8RktGhk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789040726; c=relaxed/simple; bh=BRrnixfA0E9bDGsB/cS73GRRL2K332EMUgeep8yoLYQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=T51Rf/QfCG4Rl4MEnxRHToqI/YXtCMlwMffSVrlOW9KJYexzOqICdU4NSLEUEh7ReFmcLBylPWkrNNxXDESEshkhsrDWHLVprLtBY2pPvci7NI8sVEw9zJBXlVF1Ke/jYJG207xPXFZIQHh3rSp2MOxX7RcC9mv9KYOE+nTm18o= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com; spf=pass smtp.mailfrom=opensource.cirrus.com; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b=cjVewWUu; dkim=pass (1024-bit key) header.d=cirrus4.onmicrosoft.com header.i=@cirrus4.onmicrosoft.com header.b=rgKe1Dpi; arc=fail smtp.client-ip=67.231.149.25 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="cjVewWUu"; dkim=pass (1024-bit key) header.d=cirrus4.onmicrosoft.com header.i=@cirrus4.onmicrosoft.com header.b="rgKe1Dpi" Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 689IggaR3050653; Thu, 10 Sep 2026 06:45:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= PODMain02222019; bh=XwlrEwxsucUF2KNqB3ACYSCcpSzRRvt8BS08D1njyP8=; b= cjVewWUuqgMXLu0s7VqMexaYXoTrX3lQpcXBKI1Zs9ZeEgW5ReuQOc+hyXh+uEzk KyGsDipWLxAJslbEyLS3YjMHKs3KmeCKGYqEc3aYNSSJ6K8AxP+fDD35ZG638enC WdjcfIsG6Kc6E5oAvMzYtkgk7oCRKdtuvqw7K8vLzSlUFgmPLzVc88b5WDoFvEq3 FRJBxB720JKCSZfaSpUhY0tFvGcYcDYT09zPt5cZWy/xf5VdJ5EHr6lW/NjICQhH 2q6u6VbEQCzcVjE7rVgDJF+F1aQtjhOY50Gnr/XFe8eGiPA3QByDIZOFPg4Ce29Y Y5P/CHmmuhf4yP/LHk9pNg== Received: from sj2pr03cu001.outbound.protection.outlook.com (mail-westusazon11022083.outbound.protection.outlook.com [52.101.43.83]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 4gkcyp92fw-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 10 Sep 2026 06:45:08 -0500 (CDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=UVI1U4BC175+bzZCc3qaKLmLsB7PVWfeoKyiDFjtANu+cmlGqcjFlXksBrbUT8B8MX/LCTEkkJ9UpwXJnUwWZYximnHNSz/O5j/8fGtOkvFGNGl5ztI4ke9OwguVMQAUlvAR90xw4Qxb+q+MAY8+jibF8zqWwclXLQi9Wftcn43hssJorxQfpr1XS09ClLxShlk3ddmfO94/Rqhi6AztNMZtwkNP9+UlIJNtRUt5d6O8jN1ruUCZFPfiUscBMrLKh06CYb3mlEk2F5O7yZ5k2DJWJ6MeeLvNBxbqAfhxzWq+FHzLtJKRcs0P2jeKQ+Z78BxoYBV5fGzh+uvdnRXCvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XwlrEwxsucUF2KNqB3ACYSCcpSzRRvt8BS08D1njyP8=; b=KOoPxWl0CJ5FvNyzascAo8iwrdZLveIk8u6Q7RHsIa97n6DEifalBzRZVA2r+BuumDjlwkFZdHZ3/w0+NHmbMYQpNf2ZHIRAS0jYRe1WINkxpZMU6mR/MneloSfFTCpXWSWpAhnH/6BlAb2nWnhDPghpDBpAbvWBmCk5XQN46Yyd6LYpfEul2H+0BF/DUzmmtBgkzlwCqUXnfBLoW9zZdr+SqRBmfvXBEJ0FlTOjV/mG2ksopLg/f/NqSq0tedvS3typIM9PbKxMllWqDZqkkkn9Fk5fKgWN9PDsf2Me37mIX04qq249AIAyTPVl3OG3swuiITjZ5nBUrmel7ZPO1g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=softfail (sender ip is 84.19.233.75) smtp.rcpttodomain=cirrus.com smtp.mailfrom=opensource.cirrus.com; dmarc=fail (p=reject sp=reject pct=100) action=oreject header.from=opensource.cirrus.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus4.onmicrosoft.com; s=selector2-cirrus4-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XwlrEwxsucUF2KNqB3ACYSCcpSzRRvt8BS08D1njyP8=; b=rgKe1DpioK8BS5DE0uqqYknZeegMQsR4KvjfT949aVMBZd5W7+vWmPBQTT0GxTcgCdjDeIlLIzXj3f9uasDEPtSqnqdEwF9Ddk+bOQiawqUyPebir+0ekArrYKLXQXF3l+n7g2XAlPvRj/zsWUYPkO+a+uuCarF3QlIQWS+EYGc= Received: from SJ0PR03CA0137.namprd03.prod.outlook.com (2603:10b6:a03:33c::22) by SJ0PR19MB4827.namprd19.prod.outlook.com (2603:10b6:a03:2cb::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.406.9; Thu, 10 Sep 2026 11:45:03 +0000 Received: from CO1PEPF00012E7D.namprd03.prod.outlook.com (2603:10b6:a03:33c:cafe::42) by SJ0PR03CA0137.outlook.office365.com (2603:10b6:a03:33c::22) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.406.8 via Frontend Transport; Thu, 10 Sep 2026 11:45:03 +0000 X-MS-Exchange-Authentication-Results: spf=softfail (sender IP is 84.19.233.75) smtp.mailfrom=opensource.cirrus.com; dkim=none (message not signed) header.d=none;dmarc=fail action=oreject header.from=opensource.cirrus.com; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning opensource.cirrus.com discourages use of 84.19.233.75 as permitted sender) Received: from edirelay1.ad.cirrus.com (84.19.233.75) by CO1PEPF00012E7D.mail.protection.outlook.com (10.167.249.52) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.406.5 via Frontend Transport; Thu, 10 Sep 2026 11:45:03 +0000 Received: from ediswmail9.ad.cirrus.com (ediswmail9.ad.cirrus.com [198.61.86.93]) by edirelay1.ad.cirrus.com (Postfix) with ESMTPS id 4D4C9406560; Thu, 10 Sep 2026 11:45:01 +0000 (UTC) Received: from ediswws06.ad.cirrus.com (ediswws06.ad.cirrus.com [198.90.208.11]) by ediswmail9.ad.cirrus.com (Postfix) with ESMTPSA id 2DB17822564; Thu, 10 Sep 2026 11:45:01 +0000 (UTC) From: Richard Fitzgerald To: broonie@kernel.org Cc: yung-chuan.liao@linux.intel.com, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com Subject: [PATCH 2/5] ASoC: Add codec_ch_mask to snd_soc_dai_link_ch_map Date: Thu, 10 Sep 2026 12:44:57 +0100 Message-ID: <20260910114500.1586637-3-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260910114500.1586637-1-rf@opensource.cirrus.com> References: <20260910114500.1586637-1-rf@opensource.cirrus.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF00012E7D:EE_|SJ0PR19MB4827:EE_ X-MS-Office365-Filtering-Correlation-Id: 39c06387-08d8-44d6-9475-08df0f30f3e9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|23010399003|61400799027|36860700016|10067099003|56012099006|11063799006|16102099003|22082099003|18002099003; X-Microsoft-Antispam-Message-Info: ETfubdhSn1ELCtPuVbKdoNfsE8BTZlXLR7iW7mSK6fR/+Y5gmztmkNJk8W9kH1+WzV28QHIX80gqbZDHkIR0gfxV4ilYnriyIqek9tVI5tvmDazBysn/Y58ogNtwfSwLqTH401FMfqX/LD56VyBtW++Zi3d15DDXBySHU1WfMV863AiL3b2EszHqRgPEUQEx6QiHucuCXttIsXpgo2aFpakJ95MHetqVFuIN/tCD/qGvlrWw3i8z8ta21CHxuJ4Y4jfMLaJJMc3R7eRYv1l0DxivR7LYIsYT9nm4pLj+oXUrEfJHS4BYhHkqfwPLvfYjpRe2ibV7kD/L4uln1MKWHQm8PGzdZvx0uK4f+urdVAhadkpC6CvFVXHWQuZwzMQIosfPkBo5s7DeSIvB/f6EYAgaVNkGjvvfdwYODKjxNToLgS96nR13ssCqdVKwy67ck26v8OuXh1+RTzAnG3bvCrcr1jC635c/f57H+Slw3ilUBuylE0iGCEwD0Dr0xPSXMd3ajbq8furCfklsS5Wjg55nJUfhNO8fB21Hksj5iN1e4WWFtgirRkju5z964tJzWGJ5uZlKHHVVD3YeQVkXZgvf29CU8tVvAby8Ji+t+rB8qCiu/HXpOJL6ydsnwaQAqaHmbkYlB8BmZ7FD+pmP9zNRSHzRmZeI9UYpaZpVuwzlkzRE/1aYq60SGPhZuC428zGRCEI9Tzk/1N60fib1zw== X-Forefront-Antispam-Report: CIP:84.19.233.75;CTRY:GB;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:edirelay1.ad.cirrus.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(82310400026)(23010399003)(61400799027)(36860700016)(10067099003)(56012099006)(11063799006)(16102099003)(22082099003)(18002099003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: czc2vNl/t6QwkzfmD64M+oYWg9cn/uVJHGQrZUvHs9aqx1ebnsqJxUCVE2vzgNXeuF9z6iLGDrDSqFnwdewpWO35THgiEqAXwm3obiDKT+b3VKT2qBb5PPUhwMEaNEDb/UhGWj+pT7WwgcCNLhIs14GPEZV1b1RbKy+OcR3pYt+kR+jADoi3RVIbnJ2UaUSZU3Xk+RhWhY/AXTGacNi7icUmKx5O5RrKF+GvXip0Am0uWZW+ENanzsphLkNu7UG+X3lB4z8jk7DJT8Tj+3eEQMV77bw8gdlW9GqeSvO9IPOYOxOT0Ec+209AvA0qIUnHC3gqT89PEJRXR3sXcetnEvIC7NhAVCLtUsdaa/u27LN7iVfgDGhod/PuiGaq4CJPX6HTvvwMiL4FHEvMJ7bSNy8DspLIvePRgKDJj9NxTMXPrqGG4gJDfRxQQr7G9KBx X-Exchange-RoutingPolicyChecked: KEVCT8r2BpO5Az6i8L5P7WNKdJFSvETeKlgDMvLfugKjujatJIl6BXuj5jQoOARzzHBc32LrTYX0KoUEfe5tAqh2E87eF3Vgil6Zc+VIFVUoHMluWbk1hkg+RIjoQ71LHPq0rLTiyw2Lyq70eg8lOq/f/vkAhVh/koPPW3bLF2PGC1i8Cm6bt8J2rKiXiu8HCheZWon+Kf2+tkg2SudJHuERCB7M0fT1Vv8iZCKWieBGYrNhPWM/kO17oY4iJX7W7WJnosakbQQrXWcfyweT2BonWj3mWOPWZAmIARlpq3HDVq8if5pAkFYX/ta5ZGM7GvjrnISi/7bnLMWnD0HQsw== X-OriginatorOrg: opensource.cirrus.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2026 11:45:03.1610 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 39c06387-08d8-44d6-9475-08df0f30f3e9 X-MS-Exchange-CrossTenant-Id: bec09025-e5bc-40d1-a355-8e955c307de8 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bec09025-e5bc-40d1-a355-8e955c307de8;Ip=[84.19.233.75];Helo=[edirelay1.ad.cirrus.com] X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TreatMessagesAsInternal-CO1PEPF00012E7D.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR19MB4827 X-Authority-Analysis: v=2.4 cv=f9Xdl+yM c=1 sm=1 tr=0 ts=6aa29844 cx=c_pps a=z4sgpIVFmn7gf/JJ24wZvw==:117 a=h1hSm8JtM9GN1ddwPAif2w==:17 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=VdqzKS8jKosA:10 a=s63m1ICgrNkA:10 a=RWc_ulEos4gA:10 a=VkNPw1HP01LnGYTKEx00:22 a=iX4cTi3TZMoOKdANLEfx:22 a=Dj2-6B8FqX4mGL0U3gbX:22 a=w1d2syhTAAAA:8 a=yrhuzdObe6TiVxlqwUMA:9 X-Proofpoint-ORIG-GUID: 5OzFslrU_MBgnIjuFfSOfBuKPG7em6qk X-Proofpoint-GUID: 5OzFslrU_MBgnIjuFfSOfBuKPG7em6qk X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTEwMDEzOCBTYWx0ZWRfX8L3Mcn/JzU7l lXp/xQwaPuyjTatDpSgcZThj54IJVvcLFHe8YMNkM0l306UJA/2z3+9wLwr+oFcvGWffJAtWj1I RIms0i0P7gc39F4UnDrSqvHlsLE2JqRRKKEgFFrQ3u4mszP7eBFJuCsEup13/2yhct0kKSjtKhB b54Ar7Wz8rO0RKeTLfmYrFYt1hlpwpdjwxRob7Twqhn2vDA3HAjI3I57KZIg+kM1iFyET1gA59Y 474SB+JSeQWvbc5/F+hHUhoMhRwYYkxJi7LSFwOUZUVROYYb9es5CXbFdW5do9ThsPJIpow1xxJ q+ifxSk0M7fem0Bbhg8xFbZALK0BUkZRdIufSXNdH2sM8/YWIFYIFk+UEYAwhaVzVTP2tn3aVAe o3MxS7kBZCaez5NRROrOXWjoMcYjQBSBcUkgvkx7nFCzpWRbbTboxakASDxU8UtVmTQlaP/tBK6 l3i1/nqBb0OpN+PWUkw== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTEwMDEzOCBTYWx0ZWRfX7bxxVJmu/boV alzb0VGJKsPNXbqQfDL4bvbDu5Fdb06Tzs4d+B8RMxEid5bHNReCnqkopweJU9gjwOD5rZEJwfe Kc7I7vqmNBeg+BJvttdBVMraAuWZZMY= X-Proofpoint-Spam-Reason: safe Content-Type: text/plain; charset="utf-8" Add a codec_ch_mask member to snd_soc_dai_link_ch_map. The CPU and codec channel masks are not necessarily the same, and are quite likely different. SoundWire and I2S/TDM both support assigning different sample slots to each codec, so for example channel 0 on each codec could map to different channels at the CPU. It is also possible for one TX channel to map to multiple RX channels. So it isn't _always_ safe to assume that the total number of set bits in the CPU ch_mask is the same as the total number of enabled channels on the codec. For example consider this mapping on a capture stream: CPU0 CODEC0 cpu_ch_mask =3D 0x03 CPU1 CODEC0 cpu_ch_mask =3D 0x03 This could be either four TX channels on the codec split across two receiving CPUs, or two TX channels on the codec duplicated to two CPUs. Signed-off-by: Richard Fitzgerald --- include/sound/soc.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/sound/soc.h b/include/sound/soc.h index 94c9b75e27e3..5afc34b147b5 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -700,6 +700,7 @@ struct snd_soc_dai_link_ch_map { unsigned int cpu; unsigned int codec; unsigned int cpu_ch_mask; + unsigned int codec_ch_mask; }; =20 struct snd_soc_dai_link { --=20 2.47.3 From nobody Fri Sep 25 16:51:04 2026 Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) (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 BA8FA478E2C; Thu, 10 Sep 2026 11:45:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=67.231.149.25 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789040726; cv=fail; b=VxPOG5mpAw3IciNo8FXR6CyannlMhbKykBfOYXI7MNYMmjVPKTL0+pbAkZj3FMvv2JtW/WkLjrCfb4nrjWYXd53ebeeuYVQPmuu/ZZ8RVLnmGcpXrsonk2Rmd7jAEW7pXgfnoiZdP0CUdcPDUbLxtE8KQV0FzCcEBx6XkIsweqI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789040726; c=relaxed/simple; bh=0MqeHErgVEoDMDdp7VHIphYok8nZ0scix/BrR2Gghhs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=IA3ZtwHgpnhNtb2eHWHaLgYbLTmzQBX0ghOrDTk7LaCEFjYdyjIl7D5WKyOXY3cV8/8q3chPIJQF9+txWS8YZG+4cM216nrVznSfrgVjGiN+OE2XkqBXDIo6tf0KVF6us9PwU5ukGTVwhqqSVNfJpBBoktMya0ddsExN2/gjl98= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com; spf=pass smtp.mailfrom=opensource.cirrus.com; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b=e8z4zsoD; dkim=pass (1024-bit key) header.d=cirrus4.onmicrosoft.com header.i=@cirrus4.onmicrosoft.com header.b=GiCtjbHh; arc=fail smtp.client-ip=67.231.149.25 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="e8z4zsoD"; dkim=pass (1024-bit key) header.d=cirrus4.onmicrosoft.com header.i=@cirrus4.onmicrosoft.com header.b="GiCtjbHh" Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 689IggaS3050653; Thu, 10 Sep 2026 06:45:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= PODMain02222019; bh=wCjDeeTkEjVW+SraqehDVzpJpU3LyCgq0i1/veU+jcs=; b= e8z4zsoDxO/o9c1/zWCU7XXT2C4oFX2a0Q0ajyAsFnA64Yy+NCuYUSHpHKy2JK1D SUKqnmZPllL5CLIAXGoLt0SmhiOY391sk+lUB3E070/FxpaA95VHB5Z4lxnNhNoJ Gz+yRoCds7is8aqSAirbRYGqCxTOfJzOs+5kOGW3/Jdhk5sTatX/5gdl+irAGC/K OiAcLeZHZFsGV40+IwI4JDwiac5YngOJ0QMpdSizVh+ZqViEb3tV42Mt0sg1+m89 Cc3xy5fr0WSpgc+9wTX2IGq4/qRcurIJGiwynG2dXWvYH1Az+P0ZPqeZEYbvjU7e s99uvJpUa/vLqrm67TAQfg== Received: from bl0pr03cu003.outbound.protection.outlook.com (mail-eastusazon11022079.outbound.protection.outlook.com [52.101.53.79]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 4gkcyp92fu-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 10 Sep 2026 06:45:08 -0500 (CDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=EQjJ4LwQmHSY5TmcLxJ6bXtproRRRF945JyhniZ+iAdRiZAQ2UAWP1Rci/9NKplh/ekgnDJyM9o5mfO2O5nDheAnoVhCd9FGW2tbTGAmfzcxC36ejigZSOxq1HwcnQs8XeTwpMKiJbdPHbbukAF4YPXZ+mQlaoXQfBbfZ/o8ws6fmjOL8pVmqwSY36zosR6EDYPuH+Lsy5wTF/h/6diNq9qcxEAEqZ9PCoFj8X2bk6H0BFHfnf2Ui/AKyQ2J78wRPEI8dWw/UQEi1j587tIxWIb44jw4CZlT9IvlFztn55YpKobaz18wJ1DG2ftw+Rl8To9434YEdPwpjNvytsr79w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wCjDeeTkEjVW+SraqehDVzpJpU3LyCgq0i1/veU+jcs=; b=KDOw3JVlwHFhIxtrZMrts8U+k2z7RquSzaiXx0Q5UXqSy/AJc/LkpDnQYaBJfIWSkrAein48H3vRDLpIxE1D47DrvytMnnyf68fmSQQ8OTZQhL4nQuob/XatgnTDMomgsUSEKOUsNPmxuWj7CK0Yt5HYlQI8GepfS+yvhWG3U+pr/suoUsmzx3sBTmdT6JArdv6NJLvPHvybeNqFBCndif9EsQZ6FdlBGJHh/K4ioLy9+xPGHnUuGIJ+4+1cyKCUbW2uVlmMAJgnltuCVXCyiDIaSXGOAQY30aTLtTEs6VAOIIg88Hg8kzs93Vig3VUCJY3CUFa8Dcn2hozqohhXnQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=softfail (sender ip is 84.19.233.75) smtp.rcpttodomain=cirrus.com smtp.mailfrom=opensource.cirrus.com; dmarc=fail (p=reject sp=reject pct=100) action=oreject header.from=opensource.cirrus.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus4.onmicrosoft.com; s=selector2-cirrus4-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wCjDeeTkEjVW+SraqehDVzpJpU3LyCgq0i1/veU+jcs=; b=GiCtjbHhVUS3HQcpWisCvJa3mSjVY9RLF3tC5OCQ6FswkQbnftLPNXvuRVz491wFd+vTyG0BIjYXQ5NVS+s94URFdnFA9eoCYMkgpo2GxfJ/s8aqsqaFmB99viV1gdo+ZdDOTjtNv+y8sTa5jgao+/6e8qLlEwK2Q/9U/feEskI= Received: from BL1PR13CA0292.namprd13.prod.outlook.com (2603:10b6:208:2bc::27) by CO1PR19MB5078.namprd19.prod.outlook.com (2603:10b6:303:d4::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.406.9; Thu, 10 Sep 2026 11:45:02 +0000 Received: from BL6PEPF00020E62.namprd04.prod.outlook.com (2603:10b6:208:2bc:cafe::a2) by BL1PR13CA0292.outlook.office365.com (2603:10b6:208:2bc::27) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.428.6 via Frontend Transport; Thu, 10 Sep 2026 11:45:02 +0000 X-MS-Exchange-Authentication-Results: spf=softfail (sender IP is 84.19.233.75) smtp.mailfrom=opensource.cirrus.com; dkim=none (message not signed) header.d=none;dmarc=fail action=oreject header.from=opensource.cirrus.com; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning opensource.cirrus.com discourages use of 84.19.233.75 as permitted sender) Received: from edirelay1.ad.cirrus.com (84.19.233.75) by BL6PEPF00020E62.mail.protection.outlook.com (10.167.249.23) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.406.5 via Frontend Transport; Thu, 10 Sep 2026 11:45:02 +0000 Received: from ediswmail9.ad.cirrus.com (ediswmail9.ad.cirrus.com [198.61.86.93]) by edirelay1.ad.cirrus.com (Postfix) with ESMTPS id 4CDBC40655E; Thu, 10 Sep 2026 11:45:01 +0000 (UTC) Received: from ediswws06.ad.cirrus.com (ediswws06.ad.cirrus.com [198.90.208.11]) by ediswmail9.ad.cirrus.com (Postfix) with ESMTPSA id 306EE822565; Thu, 10 Sep 2026 11:45:01 +0000 (UTC) From: Richard Fitzgerald To: broonie@kernel.org Cc: yung-chuan.liao@linux.intel.com, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com Subject: [PATCH 3/5] ASoC: soc-pcm: Apply snd_soc_dai_link_ch_map.codec_ch_mask to codec params Date: Thu, 10 Sep 2026 12:44:58 +0100 Message-ID: <20260910114500.1586637-4-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260910114500.1586637-1-rf@opensource.cirrus.com> References: <20260910114500.1586637-1-rf@opensource.cirrus.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF00020E62:EE_|CO1PR19MB5078:EE_ X-MS-Office365-Filtering-Correlation-Id: 72e58c08-afa2-4991-5017-08df0f30f33a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700016|61400799027|23010399003|376014|10067099003|22082099003|16102099003|18002099003|56012099006|11063799006; X-Microsoft-Antispam-Message-Info: SJyD+ZyuaZBUyDGmgRlTkYEPHlhzYsSly2ZFzEczguoFRpKtil0RAzKc/Kc9x49pYHe3BKkL1wuobDspcso3zeQu59VQRgHv1pTbVwz6odfe4q7nk039npUBCkvbXpSozRLzoISVDFztbh1p2L1zNy1zs9yLRrf2WhYTU+JJoJ40RAeflJFztWwFcHklk7avgJPcF1fA+aB6LqyNSmjHjs5SEfCvUJGPimmabTevqBPyZL4sWOAS9izsGKVKfV1uCReFXkgzFRGitXeUVH/6w6lJrSJa0FUfItG+v7GhtRyUbpq68qlq8CU7KUOyPnoc9E256G9ttQZgyPIZfsqe+YX5CECwakznQlY36CfIizwtZmCLrpJsI6FLBNHFAwDEHVgYazBoNjS/S2dtCXWC8/KzTdRgpL+Nhwd0s22QWHBb4g6vghJgp2tE0N3GyMrPEV+8iuUVclLZJ/M3sSpaZR/SaJ2GetmNl3SyMm6cSdH5+QMTLUU/NLfy3LoLMco3+44+eZ0sCHeSQd/go6AOBpIzrN6Xvzw93E+scDTZNAApNuS1TsCxeqK4lTDsp4YVuE6xnRqvFjVqtL0OWjgsPOQd7H4K1WvWnnUcBfoLT2kBowoUfauN5ArBXcU7Idxyvtws1mgluPADesv9lYioWhOk71us+2hZOFVZNdJVaG9b2DVw8LTni12oULeHBVt44bKnoAflJ7A8PeWQbe6OxQ== X-Forefront-Antispam-Report: CIP:84.19.233.75;CTRY:GB;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:edirelay1.ad.cirrus.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(36860700016)(61400799027)(23010399003)(376014)(10067099003)(22082099003)(16102099003)(18002099003)(56012099006)(11063799006);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: h0MR9y57gHjny3MncH6oj1d1LfBwkTXBOQ7es+LdqYrY/y0DMbZ4vJ9omhG+WWhIT9KahHB6+xX8F0Q4Pwa+E1IN97dUOo/v4nD4+Y27LRn44F9P2uYthopqkWTVzMC6j+3tzKEpp5H3U2eiilfBzcgPwExecsi66A8GSs4KOuGmaI+wBF33uxOMDqvPy/JtOwmiaznsu8kl5pc7vjjqPnBy4ouolzoPHm6EvkHXPjwNenu/TlFGIR/yWz11Bwv+v5Y9gbzcNazwzICl8V0rmfxOPRP0Z1jO1BHpbH47wDqEpKEPF0jQdzYsbU2dpUSCjk4NhG9INBGCsP9vQUnXEvZ4g+r1glS22xbdNX9qUQGY+KIqnKmrBQtR1Zba58sZy0BomL/mbhnjmcE19IEpg78c0X3Pkq5j8657Ct0VHaVJlxytwLyIeIt/espOO7Em X-Exchange-RoutingPolicyChecked: hINMKrSysBbk7FO252QOG1el9++epNbdb/hXInUqzCeZGoMm3pGnFeA42NXhPFp8B2SzX2Op887m6YvISONjPoqDQ5Dnn9FKNvfak4tzACtQsJntZ60rH3NqVlnQ9Co68ZR4YFDyLnwOm1cbY2wQXwGqWhWw/1Q7KLBvjUc5CV1agLVUdaFVESkX/Evr1yi58yxFwSLUusiV8fvBgGvBjno2fNYaPQlcIUhJ8eCyJS/oXj94xhMpyLbFMg2Laoe76P7kCCvGsT7Qgd7yQsk5WF9Mqh6mUFi6+4TlrrbroHIxYiKvHhiFU8a+TpNMpJ9vdgr9bptsngQhLGxMM65Y2g== X-OriginatorOrg: opensource.cirrus.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2026 11:45:02.1260 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 72e58c08-afa2-4991-5017-08df0f30f33a X-MS-Exchange-CrossTenant-Id: bec09025-e5bc-40d1-a355-8e955c307de8 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bec09025-e5bc-40d1-a355-8e955c307de8;Ip=[84.19.233.75];Helo=[edirelay1.ad.cirrus.com] X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TreatMessagesAsInternal-BL6PEPF00020E62.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR19MB5078 X-Authority-Analysis: v=2.4 cv=f9Xdl+yM c=1 sm=1 tr=0 ts=6aa29844 cx=c_pps a=Y1/fp9MKcFODYkh4PiV91Q==:117 a=h1hSm8JtM9GN1ddwPAif2w==:17 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=VdqzKS8jKosA:10 a=s63m1ICgrNkA:10 a=RWc_ulEos4gA:10 a=VkNPw1HP01LnGYTKEx00:22 a=iX4cTi3TZMoOKdANLEfx:22 a=Dj2-6B8FqX4mGL0U3gbX:22 a=w1d2syhTAAAA:8 a=nxyldsqHaxXUjoYXuOwA:9 X-Proofpoint-ORIG-GUID: CiFG5fAvnRaI6Hf2-1sehA-j9SeeddbD X-Proofpoint-GUID: CiFG5fAvnRaI6Hf2-1sehA-j9SeeddbD X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTEwMDEzOCBTYWx0ZWRfX9msFAnSOL9Rx +NJ6NmJOs8H5LFXe3JIoAvUuVx4Z6lNNPyHxgYo8HQ0ziNARvGWshTquBUAQ/rFW0FlC7MbEdET jdEMy0Og3rPHgJuc4t7UteKYfMVR7SAxzsDzMa6KkgmPoWD9F7l2N9SXT0lG0gRGbI5a4W6gog9 bqxwygt7bLuq7O3sUVlc3XIK1wes9qgVZ4JFowttQ1S7KwSTsEcjwkU0Qsyx/C5tI34Jy144p5V gl3/mNObySaM44QApAh8IBq4MaReU1jhg80UqXH+5ZukL1P7Xmo7eTHDg0TE8EkFLwgHZEPjzTo 9vJb+KOQCVhe28BqDRnp9O5Xxoej2Hv4H0J3CldQ3981jTkrqu0Vs7d2zPmE/3KItCEt3rg2+mY SQde69Zjc9NtGXViOwbeUpu2yCpaHMWjySDnpxE9CxlLwbbGBvvzztdxCVolyytsyyxsnUwFSNq brSEMv79pdmv+NpXAKg== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTEwMDEzOCBTYWx0ZWRfX2Wm+Egu8eYsv 6BBlfMzGW1X1FopdISUaEY37Oa177CD3+4hZM3h3zwiP0KGabccafR1+8fK3luQwZVSrJUk2w3/ OXa/+oV6QHY9gJ7V0ICjsKoaXTTHAaQ= X-Proofpoint-Spam-Reason: safe Content-Type: text/plain; charset="utf-8" In __soc_pcm_hw_params() if there is a snd_soc_dai_link_ch_map with non-zero codec_ch_mask, use that channel mask to restrict which channels are enabled on the codec. But only if there isn't a TDM mask. It is possible that a snd_soc_dai_link_ch_map could include the same codec multiple times on different CPUs so the for_each_rtd_ch_maps() loop accumulates the channel masks for all entries of that codec. If a TDM mask was also set, it takes priority and is used instead of any possible snd_soc_dai_link_ch_map entries. (They cannot be ANDed together because the bit positions are indicating different things: TDM is a bit for each TDM slot, codec_ch_mask is a bit for each codec channel.) This fixes a problem of incorrect TX channels enabled on the codec when multiple codecs are aggregated on a single capture link. For example: - Two CPUs with six 4-channel codecs. - The machine driver chooses to assign one channel from each codec to one channel on the CPU - But the codec hw_params() would be passed a channel count of 6, which (a) is more channels than the codec has and (b) allows enabling channels that should not be driving the audio bus. Fixes: ac950278b087 ("ASoC: add N cpus to M codecs dai link support") Signed-off-by: Richard Fitzgerald --- sound/soc/soc-pcm.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index cb64ced21149..3137c091bdb8 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -1206,7 +1206,9 @@ static int __soc_pcm_hw_params(struct snd_pcm_substre= am *substream, goto out; =20 for_each_rtd_codec_dais(rtd, i, codec_dai) { - unsigned int tdm_mask =3D snd_soc_dai_tdm_mask_get(codec_dai, substream-= >stream); + unsigned int ch_mask =3D snd_soc_dai_tdm_mask_get(codec_dai, substream->= stream); + struct snd_soc_dai_link_ch_map *ch_maps; + int j; =20 /* * Skip CODECs which don't support the current stream type, @@ -1228,9 +1230,15 @@ static int __soc_pcm_hw_params(struct snd_pcm_substr= eam *substream, /* copy params for each codec */ tmp_params =3D *params; =20 - /* fixup params based on TDM slot masks */ - if (tdm_mask) - soc_pcm_codec_params_fixup(&tmp_params, tdm_mask); + /* fixup params based on TDM or ch_map masks */ + if (!ch_mask) { + for_each_rtd_ch_maps(rtd, j, ch_maps) + if (ch_maps->codec =3D=3D i) + ch_mask |=3D ch_maps->codec_ch_mask; + } + + if (ch_mask) + soc_pcm_codec_params_fixup(&tmp_params, ch_mask); =20 ret =3D snd_soc_dai_hw_params(codec_dai, substream, &tmp_params); --=20 2.47.3 From nobody Fri Sep 25 16:51:04 2026 Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) (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 BAADF478E47; Thu, 10 Sep 2026 11:45:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=67.231.149.25 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789040725; cv=fail; b=U8e6XjWA5OT6CTdnu5gM2gPs0hMc7dAOMso8qaIZ7qxzmf7VvFlvZs6KSsMfbFD4nqsLeAj0b43X9ohgTOPBEZ8UoopI+yg9lVMemDxsnRR6VtjBEOKkPqCKA5c6LsL9OwdVg/kLE8wTHH9Ss28+DovW51JlEaZ5gsIqm1NSuVI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789040725; c=relaxed/simple; bh=Fl9555w5lfyajuhv41SYiW4r6Sv1jgvBOuLKdpPKiOs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=sD++7SrK1VrU0e40I5AKD3G6OFWlOCvdquaQyezj60YlITOt1a6iqMPpjrTO9cWEBimzt+PQ50qPs84iXN6Z3mn3zTvDf61dihfGh0KtBv6Y2YVIDpgUwslNeuRR7iCb+xadgdbYCZ5vIEa3vGztDul+Uap8tWWUw4WF8b4Cfek= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com; spf=pass smtp.mailfrom=opensource.cirrus.com; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b=W3ruycW4; dkim=pass (1024-bit key) header.d=cirrus4.onmicrosoft.com header.i=@cirrus4.onmicrosoft.com header.b=sK/Bs7/+; arc=fail smtp.client-ip=67.231.149.25 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="W3ruycW4"; dkim=pass (1024-bit key) header.d=cirrus4.onmicrosoft.com header.i=@cirrus4.onmicrosoft.com header.b="sK/Bs7/+" Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 689IggaT3050653; Thu, 10 Sep 2026 06:45:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= PODMain02222019; bh=u6jDVkRkXECk3afFzkGXdlzgZAq/sc3mODfZq+KcORo=; b= W3ruycW4hcqqbp/MH89ljT4d/eeRL1ovoJ+WPuY+VJzkFAgSAYCOp8Z4KAKrKLbe Z0grLh7OTbQ3bD9JN2mth9opNBEeGhe35yqH1J9qYMgEcnPa5cq1puIr50MBpFCE 53ENgVtwGhIak0OPQ0vjNbZkuNq+gvc2QwzBrBjP4Uhazz7AXdjvFWls2Yc3eiRb DitZtu45tiNNcsVfJglKOMii0+jtW9seQe6NZceulfTPHMC8/4RjtCzYlawK7eMn 7+5I9WmQVX78GtTgsQpH3t9v4zYKpbk8juZeTRoT5c/RnD/HPyT3Ea5xDxOWz7j3 lyYyjVEYSh+JJYLbbFCh9A== Received: from ch1pr05cu001.outbound.protection.outlook.com (mail-northcentralusazon11020093.outbound.protection.outlook.com [52.101.193.93]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 4gkcyp92g2-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 10 Sep 2026 06:45:09 -0500 (CDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Vg9dwt6++2jm3TiYqBoBBTL3K0ILYo8B2EEMryxT/luVKHBu0cBT1kSm9WCvWRTEKlIvwer2uSYAkwB9x23TXogn8BZ08xRE9GF0/FB+ZqQnbWdyRMiaMW82eaXDf2oogQ3gCxlenD+lFVNvYKVZ3+JrM7YgIBYGAIIUcOpcgFGA9JOpAq9z1POuuwEJw2sewtm1hzRjdp9EU9ce3Qhgor5Zq2vyIHvm6ldD3Gl9xhUPG5NfUSdB5gauS+7eanq1Kt2x0gSGEoH9dqowGWvp1RKFUvcaLgiJtNTE5epe9Qg7Y5PNkb7Cb4OUTlc6ihCg+sZBF5snhDnWIhginGSrPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=u6jDVkRkXECk3afFzkGXdlzgZAq/sc3mODfZq+KcORo=; b=ch8g71f5CkRIos5UHCUB2mQzidDwrV8aYDpN3hSzpNZUpGVyShknNrJnPBAb7LXjoqk3c5LbMEqx639vU+OdPIOgKAZc82strRnOPsaoyt6eURiZOFbgOf8joOagWEgpoPnW7blyRe378VQG9SDEZ78TrgHmSr4VxuHhdwInVzf1c7ZzTm31VHgxCbqAckDAtLfBMhuwPwr4zQ+devzug7Ym+mSOZN7Gh+njbC5JuTaqqdz06jeFrrhsDnl57Or/8/YEEqHviMmRM+C0wflHH1Fy1aQl3XTCzhGWtnLQX9DkId6i+RRbEjAV3fFtONwunOil+5WK2xpaQl3wU5pUZQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=softfail (sender ip is 84.19.233.75) smtp.rcpttodomain=cirrus.com smtp.mailfrom=opensource.cirrus.com; dmarc=fail (p=reject sp=reject pct=100) action=oreject header.from=opensource.cirrus.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus4.onmicrosoft.com; s=selector2-cirrus4-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=u6jDVkRkXECk3afFzkGXdlzgZAq/sc3mODfZq+KcORo=; b=sK/Bs7/+rOmPH/ZKo4ufnXsrT1cbHLt/lRNvs5Zqcs0K3LnOa93PIu+WuzVOxsZn7mKV11yxm686jReLkt1lbuCpKXk4R5ocnRar81bw47ON+wIMR+Nh/IIrcwTkw5fCAq6YKlBS1o0xfXRbDAxOpg1teQly2YobQmHbaEguR5c= Received: from SJ0PR03CA0150.namprd03.prod.outlook.com (2603:10b6:a03:33c::35) by BLAPR19MB4516.namprd19.prod.outlook.com (2603:10b6:208:29f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.406.9; Thu, 10 Sep 2026 11:45:04 +0000 Received: from CO1PEPF00012E7D.namprd03.prod.outlook.com (2603:10b6:a03:33c:cafe::16) by SJ0PR03CA0150.outlook.office365.com (2603:10b6:a03:33c::35) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.382.14 via Frontend Transport; Thu, 10 Sep 2026 11:45:04 +0000 X-MS-Exchange-Authentication-Results: spf=softfail (sender IP is 84.19.233.75) smtp.mailfrom=opensource.cirrus.com; dkim=none (message not signed) header.d=none;dmarc=fail action=oreject header.from=opensource.cirrus.com; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning opensource.cirrus.com discourages use of 84.19.233.75 as permitted sender) Received: from edirelay1.ad.cirrus.com (84.19.233.75) by CO1PEPF00012E7D.mail.protection.outlook.com (10.167.249.52) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.406.5 via Frontend Transport; Thu, 10 Sep 2026 11:45:03 +0000 Received: from ediswmail9.ad.cirrus.com (ediswmail9.ad.cirrus.com [198.61.86.93]) by edirelay1.ad.cirrus.com (Postfix) with ESMTPS id 51C83406561; Thu, 10 Sep 2026 11:45:01 +0000 (UTC) Received: from ediswws06.ad.cirrus.com (ediswws06.ad.cirrus.com [198.90.208.11]) by ediswmail9.ad.cirrus.com (Postfix) with ESMTPSA id 324C0822566; Thu, 10 Sep 2026 11:45:01 +0000 (UTC) From: Richard Fitzgerald To: broonie@kernel.org Cc: yung-chuan.liao@linux.intel.com, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com Subject: [PATCH 4/5] ASoC: sdw_utils: Set snd_soc_dai_link_ch_map.codec_ch_mask for capture Date: Thu, 10 Sep 2026 12:44:59 +0100 Message-ID: <20260910114500.1586637-5-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260910114500.1586637-1-rf@opensource.cirrus.com> References: <20260910114500.1586637-1-rf@opensource.cirrus.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF00012E7D:EE_|BLAPR19MB4516:EE_ X-MS-Office365-Filtering-Correlation-Id: f554f8e7-706f-4d86-431c-08df0f30f3ed X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|61400799027|23010399003|82310400026|36860700016|376014|10067099003|18002099003|16102099003|22082099003|11063799006|56012099006; X-Microsoft-Antispam-Message-Info: 6Xi1OAFlbEsGQEQOU61MsAK9roSJjbHBmaY3K0Z4XzLL/HVyEIEYpsHdjc5FpNFp24yvx/YR1gdzwB7bZ1G7k/9qa48STEkuWJ5i+OL9htsOByUXyYAPKeOfHqyHSxyNkdohAGz0OlSo8jfH/LGEco11Xi/ZWGtn/bwwO34AqD+FlV5DlBndS4Ej2APUe5vukM5GrrArFo8dLGO6cUBWGZATpCOBQORE7DXU9pp3ZxY1gZZQ0oxUbmqUK3aFpS+UnELo6E6Xoc2qeOVEMtIk3yx0a30tsT/VQngZXJEL27QRZgCCEVYt1wnevg2m/3cl6hdF98/ljyK2Yyp8Qsml/SuBUyZcsVquQhR9NtBJ1yriH9tcAuWp83hQTG6i0BMxTSXEx17FKQAEGkaG017F3jXJjUn5Q4xWybTOk9iyAw7XFSbApNHRAzAtjwsju/jRT01uNkIpZtRliY8RskGaIkNGDX/sQhCeX90aI9r23ACLTUbDBuhIeAdGIu/KeR5Zjbdm6Xhmm6VGCp76eeNdNYpESgFKE4iDG2EJIrR1gxF/ZLGHobSJldI4zrCk+i8lR7F6KtcRfNn8OqDB6WCXUUsg3t780p5W5qvSLkVKj1OZr/zPFGhejZ8Y2l9cqkCmVg7dDV8/ptF50mtd5nawcz81UF4PkFT6sp5gL0GIe5BJMSX1zONO901fIhkyBqLvF/YP0BIAdDkSemIVo89Ssw== X-Forefront-Antispam-Report: CIP:84.19.233.75;CTRY:GB;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:edirelay1.ad.cirrus.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(61400799027)(23010399003)(82310400026)(36860700016)(376014)(10067099003)(18002099003)(16102099003)(22082099003)(11063799006)(56012099006);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: XlbioDxCEq5Ymj5F6YyDz7QhyOJrUan+lqbT2Sml6dNq4hNJLJGjKxgBN2/g5kUONm8DemgtpPiUK2HathCqyNR3XsR2lP7mHElxm2ugdQmc0zN/blezDaXTInD/INyCssJuc94s24hK/gUPa9DAuTYTqYoS2U9b7r80Vwy+m0cQnyy8x559wTfJ41v8k47tD0MNQr3UX1tgwfbCCa3eSbv6H9QjNOCpjPJGwhyeBbLHC6i6I1Mjx7Ri+uZisTXP3/LQQm9qh3yCr8o0wZ5z1A/gqjz+D0cOan0SJO63UyM43WuyfoD0jEvLWT99XKOlzE9/AIa54nbey+aCz8FDEBcd2prLKSR/ZqtvyjSkA3xNDiTcH2zxO0Ph7dun7sAhoqHADcEVUZDbK+s1gUqB/om/+ZzsXd2LLLN7feic/PfcA4BlaQdp4pk4PHiF3PQb X-Exchange-RoutingPolicyChecked: MfEP0r7F0vOvMQmSnqI31OH1Kv+o4RLc8XMVt740hoeU0DkCZGLpZYKZRkRbmQKEOnK/7R0L4/NKRRKfTO4eYpqX8nH+yOI+/XokHpzNrgYx0Q9wOthCAwvgL/fOl42KOAZrZ4wRzaaibM0yQMjn4/R271WR/FZEhzHoYgiKB6QQKGzi9T/xWrd14cR+nxuRwX3UsF/dQRGLahHG3S5hsheP3L5l+qiEfZY1GJr+GjjndzEUBvshgRg/280/OvmRiMJBbKJd2DrvKkengASyO8jhnCqtHefYv0DdGgc3/NklVjxRND62qy5HFb7Gr97RLTyHfmNWSZgGxb/WGsJ3ng== X-OriginatorOrg: opensource.cirrus.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2026 11:45:03.1853 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f554f8e7-706f-4d86-431c-08df0f30f3ed X-MS-Exchange-CrossTenant-Id: bec09025-e5bc-40d1-a355-8e955c307de8 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bec09025-e5bc-40d1-a355-8e955c307de8;Ip=[84.19.233.75];Helo=[edirelay1.ad.cirrus.com] X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TreatMessagesAsInternal-CO1PEPF00012E7D.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR19MB4516 X-Authority-Analysis: v=2.4 cv=f9Xdl+yM c=1 sm=1 tr=0 ts=6aa29845 cx=c_pps a=XmpCLDa7gY5zTWVzJon4ng==:117 a=h1hSm8JtM9GN1ddwPAif2w==:17 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=VdqzKS8jKosA:10 a=s63m1ICgrNkA:10 a=RWc_ulEos4gA:10 a=VkNPw1HP01LnGYTKEx00:22 a=iX4cTi3TZMoOKdANLEfx:22 a=Dj2-6B8FqX4mGL0U3gbX:22 a=w1d2syhTAAAA:8 a=7cSoefOn4YfZyThIjaAA:9 X-Proofpoint-ORIG-GUID: 8Yvg4z1zc-9UkXH3FLe2C7gPWTo8jruW X-Proofpoint-GUID: 8Yvg4z1zc-9UkXH3FLe2C7gPWTo8jruW X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTEwMDEzOCBTYWx0ZWRfXzU8tl2gMjUQs rqp4KOPD1nEHJCnO/YB/8HvAGwSiN8L6bqtVlMyfbE/NoAjc2ORTcWKXktSTvoQk8f9LM7FrMyX faCUVZZUmF0sA5fYFuItXJDyPRulwct739Fz8xtFkjla74JczBzKTo4v0nw6s4QvKkKxl++p0Wz qOBctWmsSSEM9mtihvCQYhGQlgr2D6jvob6W2FUwQYqbhGBrRs/7IfnJ/GlCuqwiRwLKSLY1blu Rl2aHBPpXlYnDnR11UsORSSc6rpNMW0IcgzTRoOdgogcf3u10Ow4RWDAXzOoj3cO4XpiI22Dybq UvD73VfKRaj5OCMosawA+7rgiaDMHAJnnIVSCq70ZujIudVmTP1iuC71DsBQoAaHWPf+p9BWizC ZmUexzU3+nxehtZ2B9/1ApqtZqoqJcjt7Vf/9Tu8LK3JcjkADfwh3u29ruA6Cwf3m84V45tx0IJ 9xxtii5V1z0Q5wNJ12g== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTEwMDEzOCBTYWx0ZWRfX/5qLkFa9LT9T rYiTrh9MzX7NGXW/qR0BQ9FQIZRXNtuKLecrS/ktH8XaUKquuNkcgiI1nk/Ckwhvx3K7ARy0YP6 ks+y0bH/zTK7yhF1CnjMODCVTY+U29o= X-Proofpoint-Spam-Reason: safe Content-Type: text/plain; charset="utf-8" In asoc_sdw_hw_params() set the codec_ch_mask member of struct snd_soc_dai_link_ch_map for capture streams. ASoC will then pass the correct number of channels to each codec hw_params(). This prevents trying to enable more channels on the codec DP than have been allocated bitslots in the SoundWire frame, which would cause bus clash errors. In theory codec_ch_mask could also be set for playback streams, but for those the CPU is the only sender so there is no risk of bus clash. For playback streams codec_ch_mask is set to 0 to preserve the existing behavior and avoid introducing bugs. Signed-off-by: Richard Fitzgerald --- sound/soc/sdw_utils/soc_sdw_utils.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/sound/soc/sdw_utils/soc_sdw_utils.c b/sound/soc/sdw_utils/soc_= sdw_utils.c index cab1578b893d..778ba6531434 100644 --- a/sound/soc/sdw_utils/soc_sdw_utils.c +++ b/sound/soc/sdw_utils/soc_sdw_utils.c @@ -1731,7 +1731,7 @@ int asoc_sdw_hw_params(struct snd_pcm_substream *subs= tream, struct snd_soc_pcm_runtime *rtd =3D snd_soc_substream_to_rtd(substream); struct snd_soc_dai_link_ch_map *ch_maps; int ch =3D params_channels(params); - unsigned int ch_mask; + unsigned int cpu_ch_mask, codec_ch_mask; int num_codecs; int step; int i; @@ -1741,8 +1741,9 @@ int asoc_sdw_hw_params(struct snd_pcm_substream *subs= tream, =20 /* Identical data will be sent to all codecs in playback */ if (substream->stream =3D=3D SNDRV_PCM_STREAM_PLAYBACK) { - ch_mask =3D GENMASK(ch - 1, 0); + cpu_ch_mask =3D GENMASK(ch - 1, 0); step =3D 0; + codec_ch_mask =3D 0; } else { num_codecs =3D rtd->dai_link->num_codecs; =20 @@ -1752,17 +1753,24 @@ int asoc_sdw_hw_params(struct snd_pcm_substream *su= bstream, return -EINVAL; } =20 - ch_mask =3D GENMASK(ch / num_codecs - 1, 0); - step =3D hweight_long(ch_mask); + cpu_ch_mask =3D GENMASK(ch / num_codecs - 1, 0); + step =3D hweight_long(cpu_ch_mask); + codec_ch_mask =3D cpu_ch_mask; } =20 /* * The captured data will be combined from each cpu DAI if the dai * link has more than one codec DAIs. Set codec channel mask and * ASoC will set the corresponding channel numbers for each cpu dai. + * + * sdw_stream_add_slave() assigns different payload offsets to each + * codec in a capture stream, so that the same channels on each + * codec map to different channels on the CPU. */ - for_each_link_ch_maps(rtd->dai_link, i, ch_maps) - ch_maps->cpu_ch_mask =3D ch_mask << (i * step); + for_each_link_ch_maps(rtd->dai_link, i, ch_maps) { + ch_maps->cpu_ch_mask =3D cpu_ch_mask << (i * step); + ch_maps->codec_ch_mask =3D codec_ch_mask; + } =20 return 0; } --=20 2.47.3 From nobody Fri Sep 25 16:51:04 2026 Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) (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 B198347A0A5; Thu, 10 Sep 2026 11:45:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=67.231.149.25 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789040729; cv=fail; b=QRe5GPkW1Q37gj2JO3UMSh0/UHddkdWjxVIZ80eVCP8z1QJyBH64lO+1NhLt+1IkTwdxKOuIAXqiG4/k4GxNqW8VkNiH4kZvW2rrfxImHBQAtnnFNhJInfR1A4DDna+BrYp6nwJQj4UwdM/RFTETEvFNQyDQ+6PbJYxIa40fr/8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789040729; c=relaxed/simple; bh=Q705JKGJZyQ/WAun9iHutNi5bD1VmyOPUHWRosDy/mE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=d3N0TQTJ2It9VmMzFIXZrC/urmMDivqD4leI/0/pIZJOGhBvjsg+FXJ6AsaUXMj2cA2TDjs525DQvSrc2zMJM4M/4mEgSFrXyI2Yp6RU0gVmASsoD/aHMnF3+VOJhCIafNfrr8UHoN7wlwNzsAssWr/3Cml5/vIXjefb8dxrgwg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com; spf=pass smtp.mailfrom=opensource.cirrus.com; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b=kcO0w0j0; dkim=pass (1024-bit key) header.d=cirrus4.onmicrosoft.com header.i=@cirrus4.onmicrosoft.com header.b=A2gVH1e0; arc=fail smtp.client-ip=67.231.149.25 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="kcO0w0j0"; dkim=pass (1024-bit key) header.d=cirrus4.onmicrosoft.com header.i=@cirrus4.onmicrosoft.com header.b="A2gVH1e0" Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68A2dI993831939; Thu, 10 Sep 2026 06:45:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= PODMain02222019; bh=pBjBS0mZ9TIhTiRJFU//ha4bLq0ksU5fpTLiIVEjkds=; b= kcO0w0j0kC5eBTdMkhbVmeah2WWGYm3T4XPDD8KIYsPKvFjnzdbMYcew/lgeOYTn GQI1T33JtVRGlLYJ4zHKjofETYTGzPleisrgC1OiUlIlNr0wwgDIx5HIfTocm6iq PZXe46KecAZ5/pD8kLUzVEHKE+VDi/KiZzuyopKNHZ3uElJIahvmcTpZMqx+oTug 4Kc3TgEKh/yrKrsRR2c1XM1xc2nPW4SHPHOQwo4Qbirjf4I4Z8sA4SFDzex9tXVX bVaoHygcMe6xdAPGhLFGRQmWtPTirMOaDkvOQGoHaa76dCxN6AXc8qUP+Wakqolb 0f9H2isTivACVYZs3uFpSQ== Received: from cy7pr03cu001.outbound.protection.outlook.com (mail-westcentralusazon11020119.outbound.protection.outlook.com [40.93.198.119]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 4gkcyp92g6-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 10 Sep 2026 06:45:13 -0500 (CDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ouyITI0/1/PonsGrq5+kSihh2LzRxyWkWv+J5ZxjmFJEAGWDGd7f7LFPLtgUjkiu9azEPujoPzOWpjGttfgZGdSJ6l7CYF++QYsR+v6mlC2bBJG7NEM1Y5ef7k1nNGTK1ni6PjmmMbwpK04SHUZyJJvWZpjMP4sW7BLnJA6JmHJzn7kvvXR0k3sEZS1SJQEYMJ0Hb03QTn8SYyEc/BBzSxbfZWKihrcyW9T6hSqYV5qS1+KRTlCVY96+iaVsDPeV8tnDsdAgK7yHxtJAnRhxJn4LARkX4sIiztrkl75s4nDtVOuOdhSBVf6ZUIi0KdlFDtS8/nU37xoK3WRq7yMzdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pBjBS0mZ9TIhTiRJFU//ha4bLq0ksU5fpTLiIVEjkds=; b=pjiL/FuVzcFD2MYb3+IaJ/E4dShUl2aZjguYnSS1cPFZzEVOSCi8mNSeiqAl/vusmAT5qClJCGGyk84jUaIDNYOxhdYeY+wZkWwhurzR0aP+jH+lJYiLTBw353aLxlJ+y5V+hjt+2G3NWahfvq/Ur2dcV2l1nyMMdjms/98PvwpiwDKEwkGviA1i1wY+UHrPkCljGOMOiQWQ3d37xLQv16rtKDUSoO5ZQHbgW9ad5RrIzpQuI9GWYpzmcYT7qaK5hFX7APHauJ8TPjttE1bnOUscL4vskmxOPoMzCN2BvxddnNivx/reojoROY+CVDpTLq0LwKek+DpSWsHuRwGzjQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=softfail (sender ip is 84.19.233.75) smtp.rcpttodomain=cirrus.com smtp.mailfrom=opensource.cirrus.com; dmarc=fail (p=reject sp=reject pct=100) action=oreject header.from=opensource.cirrus.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus4.onmicrosoft.com; s=selector2-cirrus4-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pBjBS0mZ9TIhTiRJFU//ha4bLq0ksU5fpTLiIVEjkds=; b=A2gVH1e0HLx4ZhG6A1KSNSqyl25vuZOhWI8syyu9sPEHirBX/HqOzzBcMntlzQhcDnKSk72wY76TKg/xTcPm6BN8rUMmDABulhtQvWUfgAUKJhhld6kqVtc4ZFFn96cRoBoYWQnNdIPtTfcwj8VRk6UToY9OMgasZtyQLX9pllM= Received: from BLAPR03CA0052.namprd03.prod.outlook.com (2603:10b6:208:32d::27) by PH3PPFCDF482381.namprd19.prod.outlook.com (2603:10b6:518:1::c4e) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.406.9; Thu, 10 Sep 2026 11:45:05 +0000 Received: from BL6PEPF00020E64.namprd04.prod.outlook.com (2603:10b6:208:32d:cafe::2a) by BLAPR03CA0052.outlook.office365.com (2603:10b6:208:32d::27) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.406.7 via Frontend Transport; Thu, 10 Sep 2026 11:45:05 +0000 X-MS-Exchange-Authentication-Results: spf=softfail (sender IP is 84.19.233.75) smtp.mailfrom=opensource.cirrus.com; dkim=none (message not signed) header.d=none;dmarc=fail action=oreject header.from=opensource.cirrus.com; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning opensource.cirrus.com discourages use of 84.19.233.75 as permitted sender) Received: from edirelay1.ad.cirrus.com (84.19.233.75) by BL6PEPF00020E64.mail.protection.outlook.com (10.167.249.25) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.406.5 via Frontend Transport; Thu, 10 Sep 2026 11:45:04 +0000 Received: from ediswmail9.ad.cirrus.com (ediswmail9.ad.cirrus.com [198.61.86.93]) by edirelay1.ad.cirrus.com (Postfix) with ESMTPS id 5C447406562; Thu, 10 Sep 2026 11:45:01 +0000 (UTC) Received: from ediswws06.ad.cirrus.com (ediswws06.ad.cirrus.com [198.90.208.11]) by ediswmail9.ad.cirrus.com (Postfix) with ESMTPSA id 344B2822567; Thu, 10 Sep 2026 11:45:01 +0000 (UTC) From: Richard Fitzgerald To: broonie@kernel.org Cc: yung-chuan.liao@linux.intel.com, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com Subject: [PATCH 5/5] ASoC: sdw_utils: cs_amp: Delete bogus and incorrect capture channel fixup Date: Thu, 10 Sep 2026 12:45:00 +0100 Message-ID: <20260910114500.1586637-6-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260910114500.1586637-1-rf@opensource.cirrus.com> References: <20260910114500.1586637-1-rf@opensource.cirrus.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF00020E64:EE_|PH3PPFCDF482381:EE_ X-MS-Office365-Filtering-Correlation-Id: 721a8ef3-72f1-4cb6-ecc3-08df0f30f468 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|61400799027|23010399003|36860700016|3023799007|10067099003|11063799006|5023799004|56012099006|22082099003|16102099003|18002099003; X-Microsoft-Antispam-Message-Info: H+Rq5LPZBkk2BK3o4XYpeOFxAieKDGEw1Ep+10O8/7mf+FE+szHars1QmASBFl3sc5dmtM48DueHJjaaez5d6QvoAgw/ZtrQkUuw/1wBIgVZZ8SW641iFztiAH6lTq/CqyvyXi93KA3lys2prV6ovq96cDFXK4P9r8LUzi/JTcmlDrr2K7XtztSq4gg7PmCXw8SKoZ08MotA37iZDulvk4h/WLJAF94A67xXp/86B+ECPnsfFAt20YIqzc4xH8NpJOeWJYaO8mjSoj0gqL0EmVbTczhDCo/eTpDY6btyQ4kyAtd8uVSObvCEyOUbpkhL7ma1+9NcwABFEKixqly5+p2LWAz3gT+xbKiHOePEbLh34i5M9AwEk7Vp29E6VxP4MD2aI72Qf22922w6BZQL89wiKWkuxoattRrwe6wIMQVzsGWanOrmzy2IqnnQRWlYBY0ELMccoBMY0xLalzakqEV/G9cfjgA3Q4CzYJrvsEJRfBkZdtqsd1i+pyA89DWP4STqmZf0IN3yuD5Tq2h9UamB49l4O4c848Jg4+RRkCQysSXgDTJfeTBEjGhZHR/VLTyurhSBTHU5AFtoLYujNj5m+KIKhji0GPqBuzXDelQhzMC1Z1GDzB+fs2quxJuJF089Lt3cEn7svK9HFhBnSMnstigThDZ/yP7lPpYlckHbzA94HDVcuAVCFMStx0quET6OA87oJFSo+vjK1XOxjQ== X-Forefront-Antispam-Report: CIP:84.19.233.75;CTRY:GB;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:edirelay1.ad.cirrus.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(82310400026)(61400799027)(23010399003)(36860700016)(3023799007)(10067099003)(11063799006)(5023799004)(56012099006)(22082099003)(16102099003)(18002099003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: qe9L5fqs/pXFM4xdlpwgludA2UG8P73yWPdsN5KymvKGMrVzDEUcOyodv9jsH05Vg3faDj7mHALeWJIwfcwBnwvKKyF5TkasrdTzta5RSyKLLGQWhENH2zZXv2ymW6Gszjm+WME2PslpAMpgpe/YaxbWbL9L85Ut5Wzt4MKXYGUkMnA5OwbX3oCIn9eFOvxuP8xS1+wZ9unsA9j5bxOcLLJo9r++JNn9tmDpi0bGjiFs7Pt1uyxf6S7AqulB1eYfUjr19GokL6glZd6SFhxP7A9m9op8O/2Hpjy5zb7HU4Q47+YEHocJEHrmsgrxXKhadlXr9Vg9IBe1Xi4OCuIk9mD6OyvD19E+VGREIAm1u/TChsizeIsoqc55BId3/7SGQ8F3PyVJ8lL2Ifzqrkp3FMHcqK4a1Qa/+UuEp5Qs067c70ol+uAC3hZSMI3/2RI9 X-Exchange-RoutingPolicyChecked: JaqypJO4t9VwHWd16kmFblwkwXySgNa29gGgL/y2hP604tu98a79YgkFEWUMxu6MTW4E9sfJk3XmB5RPXFt3oKCfoI++rIcviHf5T4tAdV5rel7fThGVHS4pyFDOpWnkhaNy5rdlDdoqhJ8Jv3fCw+1U08NsJ/lSZR6M7mibwbd2LNDUiYVPMXRdG4gLwmJtyGnxHsrZ/RwJNqm+7ju6X/uw31OzPpyNdGsMQw7LW1LYVnhUSqKzy0edprxOvFESvvlLugNOIMdWv0x04a3oACqP5f2Taxum+QY7ZWj5u5mCVk4I35lqCa/tImlgV4plV/8KxvbPBGQVT8pegDN7gw== X-OriginatorOrg: opensource.cirrus.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2026 11:45:04.1070 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 721a8ef3-72f1-4cb6-ecc3-08df0f30f468 X-MS-Exchange-CrossTenant-Id: bec09025-e5bc-40d1-a355-8e955c307de8 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bec09025-e5bc-40d1-a355-8e955c307de8;Ip=[84.19.233.75];Helo=[edirelay1.ad.cirrus.com] X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TreatMessagesAsInternal-BL6PEPF00020E64.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH3PPFCDF482381 X-Authority-Analysis: v=2.4 cv=f9Xdl+yM c=1 sm=1 tr=0 ts=6aa29849 cx=c_pps a=su6dv7EX1thkUT4YzH3YWg==:117 a=h1hSm8JtM9GN1ddwPAif2w==:17 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=VdqzKS8jKosA:10 a=s63m1ICgrNkA:10 a=RWc_ulEos4gA:10 a=VkNPw1HP01LnGYTKEx00:22 a=iX4cTi3TZMoOKdANLEfx:22 a=Dj2-6B8FqX4mGL0U3gbX:22 a=w1d2syhTAAAA:8 a=jauQtPRp_uiQbXMOToAA:9 X-Proofpoint-ORIG-GUID: jBst6stjdz4BDUnomvn8QpJIqiAetMQL X-Proofpoint-GUID: jBst6stjdz4BDUnomvn8QpJIqiAetMQL X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTEwMDEzOCBTYWx0ZWRfX0tplChzo3nad 9fxEe8HVrcznLP7VPidrZDIdMR8vIHB7eyXh/4o7eK+3B82pcw+RhPpQeguDug5h78S9l9X6vIt L/MKlc9rWm0/ANc63Uix8JFFd+vbIiodxp7aX0g8CXGGPkAuoVmjUKic57uvFltG7+gItBIkfif +Jt+p5IEkJEu1eq2a1H2VVEDdwlutzZoZzIGXCUcbzyh+ltba7SCrleZNtdbRTtW1y4YDk56HHz GUysahH4fcL/9WituYqAE+TvOqn4ol4jJ1k/aOmSlTCepIYewrhuQ/iKPp2CF/16cmILvnjOxoo AQL1BLSL/4OL5YuX+mHAIIcNxgcA5lLWbuLOxS1hTH/JVZKRyBypKl0oQ68s6mfVUFpm9W0jLeY DCbh4PuEfvteGVjPBfRLALnBDJ7aYv/Ud91+vooCoPr8acZU42CagGyAGnzlYS8o+GJmDDCe2Qs 1r1na4ygHLtpvzqUO9w== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTEwMDEzOCBTYWx0ZWRfXzlFJsSXpyn2b XJnw5BoHVUnlIQgj8sWSzYV/WdRsU3N/36BEzlQgHDGxHra8atlx5N7i6CUK19i1FcZ0x6wsEEY MTR7EJKsh9hXVA2p9kgKnmL9hZVJoQo= X-Proofpoint-Spam-Reason: safe Content-Type: text/plain; charset="utf-8" Delete the asoc_sdw_cs_spk_feedback_rtd_init(). This is not needed now that the ASoC bug it was working around has been fixed. And it was broken anyway because it didn't match the way the core SoundWire code mapped codec channels to frame bitslots. This code was added to avoid a problem where multiple codec DP outputs were mapped to the same SoundWire frame bit slot. This would allow a user to break the SoundWire bus just by enabling mixer outputs using ALSA controls. As no production system has used the capture stream, this workaround was of little consequence and the problem of conflicting DP mappings was not investigated. The ASoC bug that enabled too many channels on each codec has now been fixed. So this workaround can be completely deleted. Signed-off-by: Richard Fitzgerald --- include/sound/soc_sdw_utils.h | 2 -- sound/soc/sdw_utils/soc_sdw_cs_amp.c | 46 ---------------------------- sound/soc/sdw_utils/soc_sdw_utils.c | 4 --- 3 files changed, 52 deletions(-) diff --git a/include/sound/soc_sdw_utils.h b/include/sound/soc_sdw_utils.h index 3c1d177a2f2d..418466438ea1 100644 --- a/include/sound/soc_sdw_utils.h +++ b/include/sound/soc_sdw_utils.h @@ -250,8 +250,6 @@ int asoc_sdw_cs_amp_init(struct snd_soc_card *card, struct snd_soc_dai_link *dai_links, struct asoc_sdw_codec_info *info, bool playback); -int asoc_sdw_cs_spk_feedback_rtd_init(struct snd_soc_pcm_runtime *rtd, - struct snd_soc_dai *dai); int asoc_sdw_cs35l56_volume_limit(struct snd_soc_card *card, const char *n= ame_prefix); =20 /* MAXIM codec support */ diff --git a/sound/soc/sdw_utils/soc_sdw_cs_amp.c b/sound/soc/sdw_utils/soc= _sdw_cs_amp.c index 325ab7230481..6e21ef8f87e2 100644 --- a/sound/soc/sdw_utils/soc_sdw_cs_amp.c +++ b/sound/soc/sdw_utils/soc_sdw_cs_amp.c @@ -14,7 +14,6 @@ #include #include =20 -#define CS_AMP_CHANNELS_PER_AMP 4 #define CS35L56_SPK_VOLUME_0DB 400 /* 0dB Max */ =20 int asoc_sdw_cs35l56_volume_limit(struct snd_soc_card *card, const char *n= ame_prefix) @@ -64,51 +63,6 @@ int asoc_sdw_cs_spk_rtd_init(struct snd_soc_pcm_runtime = *rtd, struct snd_soc_dai } EXPORT_SYMBOL_NS(asoc_sdw_cs_spk_rtd_init, "SND_SOC_SDW_UTILS"); =20 -int asoc_sdw_cs_spk_feedback_rtd_init(struct snd_soc_pcm_runtime *rtd, str= uct snd_soc_dai *dai) -{ - const struct snd_soc_dai_link *dai_link =3D rtd->dai_link; - const struct snd_soc_dai_link_ch_map *ch_map; - const struct snd_soc_dai_link_component *codec_dlc; - struct snd_soc_dai *codec_dai; - u8 ch_slot[8] =3D {}; - unsigned int amps_per_bus, ch_per_amp, mask; - int i, ret; - - WARN_ON(dai_link->num_cpus > ARRAY_SIZE(ch_slot)); - - /* - * CS35L56 has 4 TX channels. When the capture is aggregated the - * same bus slots will be allocated to all the amps on a bus. Only - * one amp on that bus can be transmitting in each slot so divide - * the available 4 slots between all the amps on a bus. - */ - amps_per_bus =3D dai_link->num_codecs / dai_link->num_cpus; - if ((amps_per_bus =3D=3D 0) || (amps_per_bus > CS_AMP_CHANNELS_PER_AMP)) { - dev_err(rtd->card->dev, "Illegal num_codecs:%u / num_cpus:%u\n", - dai_link->num_codecs, dai_link->num_cpus); - return -EINVAL; - } - - ch_per_amp =3D CS_AMP_CHANNELS_PER_AMP / amps_per_bus; - - for_each_rtd_ch_maps(rtd, i, ch_map) { - codec_dlc =3D snd_soc_link_to_codec(rtd->dai_link, i); - codec_dai =3D snd_soc_find_dai(codec_dlc); - mask =3D GENMASK(ch_per_amp - 1, 0) << ch_slot[ch_map->cpu]; - - ret =3D snd_soc_dai_set_tdm_slot(codec_dai, 0, mask, 4, 32); - if (ret < 0) { - dev_err(rtd->card->dev, "Failed to set TDM slot:%d\n", ret); - return ret; - } - - ch_slot[ch_map->cpu] +=3D ch_per_amp; - } - - return 0; -} -EXPORT_SYMBOL_NS(asoc_sdw_cs_spk_feedback_rtd_init, "SND_SOC_SDW_UTILS"); - int asoc_sdw_cs_amp_init(struct snd_soc_card *card, struct snd_soc_dai_link *dai_links, struct asoc_sdw_codec_info *info, diff --git a/sound/soc/sdw_utils/soc_sdw_utils.c b/sound/soc/sdw_utils/soc_= sdw_utils.c index 778ba6531434..0d7182bebcdc 100644 --- a/sound/soc/sdw_utils/soc_sdw_utils.c +++ b/sound/soc/sdw_utils/soc_sdw_utils.c @@ -820,7 +820,6 @@ struct asoc_sdw_codec_info codec_info_list[] =3D { .dai_name =3D "cs35l56-sdw1c", .dai_type =3D SOC_SDW_DAI_TYPE_AMP, .dailink =3D {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_AMP_IN_DAI_ID}, - .rtd_init =3D asoc_sdw_cs_spk_feedback_rtd_init, }, }, .dai_num =3D 2, @@ -849,7 +848,6 @@ struct asoc_sdw_codec_info codec_info_list[] =3D { .dai_name =3D "cs35l56-sdw1c", .dai_type =3D SOC_SDW_DAI_TYPE_AMP, .dailink =3D {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_AMP_IN_DAI_ID}, - .rtd_init =3D asoc_sdw_cs_spk_feedback_rtd_init, }, }, .dai_num =3D 2, @@ -878,7 +876,6 @@ struct asoc_sdw_codec_info codec_info_list[] =3D { .dai_name =3D "cs35l56-sdw1c", .dai_type =3D SOC_SDW_DAI_TYPE_AMP, .dailink =3D {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_AMP_IN_DAI_ID}, - .rtd_init =3D asoc_sdw_cs_spk_feedback_rtd_init, }, }, .dai_num =3D 2, @@ -907,7 +904,6 @@ struct asoc_sdw_codec_info codec_info_list[] =3D { .dai_name =3D "cs35l56-sdw1c", .dai_type =3D SOC_SDW_DAI_TYPE_AMP, .dailink =3D {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_AMP_IN_DAI_ID}, - .rtd_init =3D asoc_sdw_cs_spk_feedback_rtd_init, }, }, .dai_num =3D 2, --=20 2.47.3