{"id":2230126,"url":"http://patchwork.ozlabs.org/api/1.2/patches/2230126/?format=json","web_url":"http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260429100028.2739711-4-shengjiu.wang@nxp.com/","project":{"id":2,"url":"http://patchwork.ozlabs.org/api/1.2/projects/2/?format=json","name":"Linux PPC development","link_name":"linuxppc-dev","list_id":"linuxppc-dev.lists.ozlabs.org","list_email":"linuxppc-dev@lists.ozlabs.org","web_url":"https://github.com/linuxppc/wiki/wiki","scm_url":"https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git","webscm_url":"https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/","list_archive_url":"https://lore.kernel.org/linuxppc-dev/","list_archive_url_format":"https://lore.kernel.org/linuxppc-dev/{}/","commit_url_format":"https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}"},"msgid":"<20260429100028.2739711-4-shengjiu.wang@nxp.com>","list_archive_url":"https://lore.kernel.org/linuxppc-dev/20260429100028.2739711-4-shengjiu.wang@nxp.com/","date":"2026-04-29T10:00:25","name":"[v2,3/5] ASoC: fsl-asoc-card: add channel and rate constraints for CS42888","commit_ref":null,"pull_url":null,"state":"handled-elsewhere","archived":false,"hash":"62a42b8eec8c5a00f1668d0c1065e371df62cb7a","submitter":{"id":75958,"url":"http://patchwork.ozlabs.org/api/1.2/people/75958/?format=json","name":"Shengjiu Wang","email":"shengjiu.wang@nxp.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260429100028.2739711-4-shengjiu.wang@nxp.com/mbox/","series":[{"id":502028,"url":"http://patchwork.ozlabs.org/api/1.2/series/502028/?format=json","web_url":"http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=502028","date":"2026-04-29T10:00:22","name":"ASoC: fsl-asoc-card: Add some improvements","version":2,"mbox":"http://patchwork.ozlabs.org/series/502028/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2230126/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2230126/checks/","tags":{},"related":[],"headers":{"Return-Path":"\n <linuxppc-dev+bounces-20266-incoming=patchwork.ozlabs.org@lists.ozlabs.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256\n header.s=selector1 header.b=cR8x0H9K;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org\n (client-ip=112.213.38.117; helo=lists.ozlabs.org;\n envelope-from=linuxppc-dev+bounces-20266-incoming=patchwork.ozlabs.org@lists.ozlabs.org;\n receiver=patchwork.ozlabs.org)","lists.ozlabs.org;\n arc=pass smtp.remote-ip=\"2a01:111:f403:c200::3\" arc.chain=microsoft.com","lists.ozlabs.org;\n dmarc=pass (p=none dis=none) header.from=nxp.com","lists.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256\n header.s=selector1 header.b=cR8x0H9K;\n\tdkim-atps=neutral","lists.ozlabs.org;\n spf=permerror (SPF Permanent Error: Void lookup limit of 2 exceeded)\n smtp.mailfrom=nxp.com (client-ip=2a01:111:f403:c200::3;\n helo=du2pr03cu002.outbound.protection.outlook.com;\n envelope-from=shengjiu.wang@nxp.com; receiver=lists.ozlabs.org)","dkim=none (message not signed)\n header.d=none;dmarc=none action=none header.from=nxp.com;"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1 raw public key)\n server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g5CSg687vz1yHZ\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 29 Apr 2026 19:59:15 +1000 (AEST)","from boromir.ozlabs.org (localhost [127.0.0.1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4g5CSH5rkWz2yrt;\n\tWed, 29 Apr 2026 19:58:55 +1000 (AEST)","from DU2PR03CU002.outbound.protection.outlook.com\n (mail-northeuropeazlp170110003.outbound.protection.outlook.com\n [IPv6:2a01:111:f403:c200::3])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange secp256r1 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 4g5CSG3nMLz2yv9\n\tfor <linuxppc-dev@lists.ozlabs.org>; Wed, 29 Apr 2026 19:58:54 +1000 (AEST)","from AM0PR04MB7044.eurprd04.prod.outlook.com (2603:10a6:208:191::20)\n by PAXPR04MB8269.eurprd04.prod.outlook.com (2603:10a6:102:1c4::15) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9870.19; Wed, 29 Apr\n 2026 09:58:40 +0000","from AM0PR04MB7044.eurprd04.prod.outlook.com\n ([fe80::bab2:d15c:fcf8:ef2b]) by AM0PR04MB7044.eurprd04.prod.outlook.com\n ([fe80::bab2:d15c:fcf8:ef2b%4]) with mapi id 15.20.9846.025; Wed, 29 Apr 2026\n 09:58:40 +0000"],"ARC-Seal":["i=2; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1777456735;\n\tcv=pass;\n b=OLfeJ3n6STQi3oH0mn5Ou15ym00tYd0sdgKOXsUAqUu8+8LSRP5kT9jALKCHGAgpFnjhBVzXUqLquoxfFd3UvO3hnuC6fKU3WgrHjK7NSFI9eTXl6GWwq1DU/KfiPNbRlVoFQOYtXvv5RrRy6ipzQeG/Hujs4HC0DD4pZuxHayuvDoJAlsRiRwPW6hFy63sIlCRIyLbIQSJCQRPaClgQSlxXK16iDz3b3zwZcUeehcnsWAOXbY7olvUHTLgvmesXM85G+yIlZtBhRPz6d1lipI9tOBHDwZ8rmUbIZZTUIJrobFjU8Vy/VZN6cXkW1dQR0xxSi/OoB+GzInjkDwrVgw==","i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;\n b=D2ym+bXm8D7Z4GCL+axFPuASEFFBpoeFRtimYd1ZH6m5rNMaHL2Q5pZtcQndHrag2oAcg75L1mRK8p5qGnBllSxIKE1AeFaCpajNsxr+TNpAuvPEaaGEFxzc0XIlNKbbBS5UopRDBkq+gGQSNmtbgq+ir2ALZqnunuGSRJSh95ukWzIAQ8ygpRJ4AtFkZEEoqvE/hKvo0uqjKq0ocsZ4P1gQ075fg/TZpzJbFYxF/81+Nb+3j0t+/a8EuJBxJlflgOOXC/mgdoAnPUofO2eg9r3WH17XNv8tC2X2YHXTVYyvlVayvIeZ2TT0aCUVfDs3tkS13EA6bTn3ky7tsLGfHg=="],"ARC-Message-Signature":["i=2; a=rsa-sha256; d=lists.ozlabs.org; s=201707;\n\tt=1777456735; c=relaxed/relaxed;\n\tbh=HTt1TJCql10MN7yHqE6AMTCLTFedCZip5Vu8emkSp4o=;\n\th=From:To:Subject:Date:Message-Id:In-Reply-To:References:\n\t Content-Type:MIME-Version;\n b=IXv1YbisQheFgvwcvJQPqYtmJYcB23+LK/8VirK1sLpoHMQoWJmcivxXCPgNoUUvrv7RKSoZE/u8TkYN+9cCxet7HqfcWGsBMJvL6uPKDTDBejGu4adf3ImywTzr0mm+jV65if3FudEEWxDmgYiZ8XJ2fCnE2FgyEDjlV93M3R0DvzT/dEwln/LOBSL+4L7D+oR4fGYXsf0Cu1E6qcrdHNSiA+ODLdwGfIpvoB17CkGIRPx/6mEXUALfUaSGCNgDem6S/5KeUv/EelKboLSm79zK2qEsV3w/TTHrFXXNDXMtrWAhJnuGzo5KhPFbb+CN2MnJJtKCa3fXEo50frg1Hg==","i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector10001;\n 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;\n bh=HTt1TJCql10MN7yHqE6AMTCLTFedCZip5Vu8emkSp4o=;\n b=I86ojLYitU5eHVypQoCHDLjHL8ZGyBz2NyFLTwLXmvsbODN7mlOCUhM0BSU2t7/DWpzbGd5Jek2B8kW/QoyoOxVpJNehnRcPexSTQ1EGy3cWtrojs0ma5xzuyYYiqmz7F8xvSMFzt5pHS7mu8eB8tvBCfWeIsZs5Gv4WtdbM9yx5RN4UVllpzgwzYS21EFLYgEFj50GLZP8XFsiK/7y9k7GMPcRmcLvGw2hauy83OPvwVoU2gdF+llb3W7VJgVjcOdRweMUwT7yDmczo89p3jcLU6XSkDLRgoaVpFAy02uGAmV2oABOf5w28ksO5PUf7yhnVRUmxmpW/Z/ZgaERH+A=="],"ARC-Authentication-Results":["i=2; lists.ozlabs.org;\n dmarc=pass (p=none dis=none) header.from=nxp.com; dkim=pass (2048-bit key;\n unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256\n header.s=selector1 header.b=cR8x0H9K; dkim-atps=neutral;\n spf=permerror (client-ip=2a01:111:f403:c200::3;\n helo=du2pr03cu002.outbound.protection.outlook.com;\n envelope-from=shengjiu.wang@nxp.com;\n receiver=lists.ozlabs.org) smtp.mailfrom=nxp.com","i=1; mx.microsoft.com 1; spf=pass\n smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass\n header.d=nxp.com; arc=none"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=HTt1TJCql10MN7yHqE6AMTCLTFedCZip5Vu8emkSp4o=;\n b=cR8x0H9KMIpGBVzU/6OrpzFpaQ5wBXXgBrdS4DMpMy0bKMTStPXk8+wQEEFABnKXlYPiQ+YncKCwIeIa5hQ0UCRllQsQCD3+DA/p0WFS9OArU4oqd/M3fGy9LqhfLjg77ACFTKbzXN8w5E46nu3f4l8uEt0QbcdzbLBaof2eIjC6+oZRlqeGN0QOqcTCFWcCoxAJ532vPUGS1E/G7MFookv71W2XBT09pC8azOXy255Fw2TgguJLfOCjJGMjAtT6+KLLF3p7D3Me+z/SEqJ5ADVqogYB/RgfOBE0mybuKB42EpjBMa6Vw1BfBtKp8l1yVNbvpT4NL6AB0HGZEr8Bzw==","From":"Shengjiu Wang <shengjiu.wang@nxp.com>","To":"shengjiu.wang@gmail.com,\n\tXiubo.Lee@gmail.com,\n\tfestevam@gmail.com,\n\tnicoleotsuka@gmail.com,\n\tlgirdwood@gmail.com,\n\tbroonie@kernel.org,\n\tperex@perex.cz,\n\ttiwai@suse.com,\n\tlinux-sound@vger.kernel.org,\n\tlinuxppc-dev@lists.ozlabs.org,\n\tlinux-kernel@vger.kernel.org","Subject":"[PATCH v2 3/5] ASoC: fsl-asoc-card: add channel and rate constraints\n for CS42888","Date":"Wed, 29 Apr 2026 18:00:25 +0800","Message-Id":"<20260429100028.2739711-4-shengjiu.wang@nxp.com>","X-Mailer":"git-send-email 2.37.1","In-Reply-To":"<20260429100028.2739711-1-shengjiu.wang@nxp.com>","References":"<20260429100028.2739711-1-shengjiu.wang@nxp.com>","Content-Transfer-Encoding":"8bit","Content-Type":"text/plain","X-ClientProxiedBy":"SG2P153CA0005.APCP153.PROD.OUTLOOK.COM (2603:1096::15) To\n AM0PR04MB7044.eurprd04.prod.outlook.com (2603:10a6:208:191::20)","X-Mailing-List":"linuxppc-dev@lists.ozlabs.org","List-Id":"<linuxppc-dev.lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev+help@lists.ozlabs.org>","List-Owner":"<mailto:linuxppc-dev+owner@lists.ozlabs.org>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Archive":"<https://lore.kernel.org/linuxppc-dev/>,\n  <https://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Subscribe":"<mailto:linuxppc-dev+subscribe@lists.ozlabs.org>,\n  <mailto:linuxppc-dev+subscribe-digest@lists.ozlabs.org>,\n  <mailto:linuxppc-dev+subscribe-nomail@lists.ozlabs.org>","List-Unsubscribe":"<mailto:linuxppc-dev+unsubscribe@lists.ozlabs.org>","Precedence":"list","MIME-Version":"1.0","X-MS-PublicTrafficType":"Email","X-MS-TrafficTypeDiagnostic":"AM0PR04MB7044:EE_|PAXPR04MB8269:EE_","X-MS-Office365-Filtering-Correlation-Id":"0790acd2-1232-42bb-cf61-08dea5d5e40c","X-MS-Exchange-SenderADCheck":"1","X-MS-Exchange-AntiSpam-Relay":"0","X-Microsoft-Antispam":"\n\tBCL:0;ARA:13230040|366016|19092799006|376014|52116014|7416014|1800799024|56012099003|22082099003|18002099003|921020|38350700014;","X-Microsoft-Antispam-Message-Info":"\n\t1MkTekPGjbvrySwMInwprasi0uzaz9I6a/jbZil1Or4m2/9FskW3OGw5SpDC25LAjMmR8hMxJQXDPh5xYo7fiX1DexEaw68BAUxSF774UHgPv7RqSZ7+3nFlJc5dU+ph/7CTPwavP5LWKvV+76CeWRchapHlVGeQHI+nLvi2OLTL178QjpiPK1vK9a50c864c3VSwgzDFzCqAmxlkNdqjIi1s2iLcsRsqai5T+426qUL2jUvzNafxiBxha0gRrvEATIoVCEZYkRJCclXr47Z7hkiBiWXOXaTcqpYeSeMzCQBZhY1gjK5gDdUk6XODaxzjcVNZ93GsVcj73UAMFrIXK0/yJw6dITzsG4S17FnQw160StIkv69P2URgL3Pn97qkNm06UzLFnJ5aKqWXeDfVgsud0DbZL2sghJQON6BP9JYcWs2I6EwY1HaBy+lVQsxRmrOJif+lCfHKfKQKXRl56Y6/e/c6H2BA0VHmjIH5nnUGTXKLv01w498mQc7PqZBVOT9QEBdC8iYTuNBquvpKHQtzHB8y+hWJJ/zU5wTsKgQlpaz/9UByK3NRTXk3mhDAuzdWnpFHlMmjgE5XZO3P/WZq191TR4tJW+5+RZ49cOtiNL7+0tG/IVH12OC5hiLcDextW3Htc9qqS2jBEDrSbcoNmf1mjEXbY037yyk0HaXfySgy76plGLP+Ny9N4USPX9RmHoQhzF1t3agb6ki/J0+oc0eVDNWXRdOD0yWBzy4s5LgCa7uLQoUgQY7e5ijxreav72wEpsAhBBQQKSIIVMiIXDLRcDQOwvEvOSD5gc+Wi/F85zyqOLE7qzChVCM","X-Forefront-Antispam-Report":"\n\tCIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB7044.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(19092799006)(376014)(52116014)(7416014)(1800799024)(56012099003)(22082099003)(18002099003)(921020)(38350700014);DIR:OUT;SFP:1101;","X-MS-Exchange-AntiSpam-MessageData-ChunkCount":"1","X-MS-Exchange-AntiSpam-MessageData-0":"\n X5B/NAvf/CrCLLefSUKJBSCUxi8cJVtH0K94zYnAuVzoORgQ1fSg99f3YLo1+fwi6eiIDQGRDr+DNCJKkrlJXi7FQ2aphk33s2wUK1wbyjqIpnI51bKGYJk2dNXZkajg/nLIO0DjftwJMqNem7odEcCHloKR5QPAMOgokf5FbalSN7+CMEHbylPBkB8VbTNE138iJAVmRCJEaV+ACa1u1QpfsMADMNdx8/N+KpiXJiuadDBg4ZGsvY9IaQQcjes3g0KJr0bH4VrKvUP1RrSFGTkKTZDnIqfQTSesqhyi3PQ+Xo4/6yFUil/WH1trh332myGxGxd6z4M7nJJhZa+NaAVyeKuIsi6Cd/q9CKiewiAGwoXSl7EgTURQC5KI32GEHlKbMLS/a1z2JwLJVF4ntvZm/fshx10A1g2OrxbSsl6da9DuxpyIvIT8QLVlM+TFvJirlRpC8000if8gN+vLpMS1QEzVtRoJihmxeR7IL7S/5gF4JZykfRRGRftRClOk+x7VBvyRe9zIRZbcc8FYqniE4eBi0gsX3tCskv4AbA0msBbnL4L2+X1S4dLFLgVkOWDnqvzfHfLjf7DyX8da90AMpW+uAvOqha88egpnBl8Im99YNoTe8OVpST1ThbspN30i+ErWmf0g3ehayXCGy/5TqtjPFXfAZqdnT+RdEJ9gkLOAx+/I8bovXRwertsWXOnbhzVlvZxNjpinruZD4H+CS4i72h5xlKvE/7+jwlSqU75dQrK2yniVdqGwh1zlMw1O8HJhyQ+6Wbk5+5SXZujy3l+O62NLXfmBEDX94yDNuFcQ+nkvYg+fiiJhFz5egdV8E6p3wAc3QMKDUpSEuw6+Krual/b5ITYqg2PxnHjkBmw8SM4YjaIT5Cvuiha/0wxDrubgmci+A4WVA2XT5mR8rP8JAX9gPHPivKII71BLSl07oA1ruLoVeA22qVolGQqXRrjcJI0X2HlfHeVdxEU6ke9vRs0TSkNfHh0TYdM++BJTlcpVynJvDHg2yHB/fnRg08Hq0mpzPU7UIX3BP4qfe71ZFR7KsppZyvwHPzpaol8IHkzs4ghhvVuaPksOeEWMLmmmbRFw5qUFQGDTBuuoozCagy0dDpkFeuemtw9dOKj3D/81P+7clumY5v+W584JSrVbFYiSuAusnQsRyC8JhU6z6P1Emtw0ga8mF+f7XuuD2R+wEqJ3J8BUhnY4cHQ6XWQers8ux7j9DSoSm7JCWM+2+e6J01v68zGrcBi9WGZqEj4RO+7SZ6LvVr2NiEJu2GIbVUOdkGkB1syR8dF0qkRvnZrq78L+r6RdmSGHqfcI2y5M7ExhvJyGXifoqvXoHep/BWlXajuW1ykpftiAxVsmWIB1JAnOhlTouf2uphk5mDTW72OVJkrZ9FRt3irQ9wgOj20pSdNYHyoGyuEKARrq/ALDaCT1qWPqM65ZFp+3fc6dPMBueKfmAXqR5NpoSYPvHRRQTgZTqdzxxMUoVTjDH/e5z0qLD7u2W93o6DL9fs5HuAuutjqFr2n38RfA1uaN5N1oxgeIMLXdFRkYLXqPVmeXwdzUqPf3rfvZLl4iXO5wLlKMSOuCMRWHriVzfINkiM8UNnRXNTRgZg9S4MBSwPMQk3171GzVgxBMoo1QxhVDjvoAId8sD4TWxiN6fgVENJVWfp384iTl8XlYSEvh0rcReeufgMZO4ctE5uupifuZyQ0KKQhDBbxCUZinlm9IAGtAQfTUSMs7Rw==","X-OriginatorOrg":"nxp.com","X-MS-Exchange-CrossTenant-Network-Message-Id":"\n 0790acd2-1232-42bb-cf61-08dea5d5e40c","X-MS-Exchange-CrossTenant-AuthSource":"AM0PR04MB7044.eurprd04.prod.outlook.com","X-MS-Exchange-CrossTenant-AuthAs":"Internal","X-MS-Exchange-CrossTenant-OriginalArrivalTime":"29 Apr 2026 09:58:40.6828\n (UTC)","X-MS-Exchange-CrossTenant-FromEntityHeader":"Hosted","X-MS-Exchange-CrossTenant-Id":"686ea1d3-bc2b-4c6f-a92c-d99c5c301635","X-MS-Exchange-CrossTenant-MailboxType":"HOSTED","X-MS-Exchange-CrossTenant-UserPrincipalName":"\n tQxogmjYWFvniVQe/ubYf3eYrFOg2Cg+9iVkRqFAl7rTq8Wf+6c4F3HbZfKmEyLZomGw3fgQ8Et8jKmaOwRlcA==","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"PAXPR04MB8269","X-Spam-Status":"No, score=0.8 required=3.0 tests=ARC_SIGNED,ARC_VALID,\n\tDKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,\n\tSPF_HELO_PASS,T_SPF_PERMERROR autolearn=disabled version=4.0.1 OzLabs 8","X-Spam-Checker-Version":"SpamAssassin 4.0.1 (2024-03-25) on lists.ozlabs.org"},"content":"The CS42888 codec has 4 I2S lanes with 2 channels per lane. Using odd\nchannel counts (3, 5, 7) causes data misalignment in the I2S frame,\nresulting in incorrect channel mapping. Only mono and even channel\ncounts (1, 2, 4, 6, 8) work correctly.\n\nAdditionally, the fixed system clock on i.MX platforms limits supported\nsample rates. With 12.288 MHz MCLK, only 48kHz family rates (48k, 96k,\n192k) achieve valid MCLK:LRCK ratios. With 11.2896 MHz MCLK, only 44k\nfamily rates are supported.\n\nAdd a startup callback to apply PCM constraints for both channels and\nrates, preventing userspace from requesting unsupported configurations.\n\nSigned-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>\n---\n sound/soc/fsl/fsl-asoc-card.c | 71 +++++++++++++++++++++++++++++++++++\n 1 file changed, 71 insertions(+)","diff":"diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c\nindex e08e135886f7..90414ac10032 100644\n--- a/sound/soc/fsl/fsl-asoc-card.c\n+++ b/sound/soc/fsl/fsl-asoc-card.c\n@@ -40,6 +40,33 @@\n /* Default DAI format without Master and Slave flag */\n #define DAI_FMT_BASE (SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF)\n \n+static const u32 cs42888_rates_48k[] = {\n+\t48000, 96000, 192000,\n+};\n+\n+static const u32 cs42888_rates_44k[] = {\n+\t44100, 88200, 176400,\n+};\n+\n+static const u32 cs42888_channels[] = {\n+\t1, 2, 4, 6, 8,\n+};\n+\n+static const struct snd_pcm_hw_constraint_list cs42888_rate_48k_constraints = {\n+\t.list = cs42888_rates_48k,\n+\t.count = ARRAY_SIZE(cs42888_rates_48k),\n+};\n+\n+static const struct snd_pcm_hw_constraint_list cs42888_rate_44k_constraints = {\n+\t.list = cs42888_rates_44k,\n+\t.count = ARRAY_SIZE(cs42888_rates_44k),\n+};\n+\n+static const struct snd_pcm_hw_constraint_list cs42888_channel_constraints = {\n+\t.list = cs42888_channels,\n+\t.count = ARRAY_SIZE(cs42888_channels),\n+};\n+\n /**\n  * struct codec_priv - CODEC private data\n  * @mclk: Main clock of the CODEC\n@@ -87,6 +114,8 @@ struct cpu_priv {\n  * @codec_priv: CODEC private data\n  * @cpu_priv: CPU private data\n  * @card: ASoC card structure\n+ * @constraint_rates: array of supported rates\n+ * @constraint_channels: array of supported channels\n  * @streams: Mask of current active streams\n  * @sample_rate: Current sample rate\n  * @sample_format: Current sample format\n@@ -104,6 +133,8 @@ struct fsl_asoc_card_priv {\n \tstruct codec_priv codec_priv[2];\n \tstruct cpu_priv cpu_priv;\n \tstruct snd_soc_card card;\n+\tconst struct snd_pcm_hw_constraint_list *constraint_rates;\n+\tconst struct snd_pcm_hw_constraint_list *constraint_channels;\n \tu8 streams;\n \tu32 sample_rate;\n \tsnd_pcm_format_t sample_format;\n@@ -291,7 +322,39 @@ static int fsl_asoc_card_hw_free(struct snd_pcm_substream *substream)\n \treturn 0;\n }\n \n+static int fsl_asoc_card_startup(struct snd_pcm_substream *substream)\n+{\n+\tstruct snd_soc_pcm_runtime *rtd = substream->private_data;\n+\tstruct fsl_asoc_card_priv *priv = snd_soc_card_get_drvdata(rtd->card);\n+\tstruct snd_pcm_runtime *runtime = substream->runtime;\n+\tint ret;\n+\n+\tif (priv->constraint_channels) {\n+\t\tret = snd_pcm_hw_constraint_list(runtime, 0,\n+\t\t\t\t\t\t SNDRV_PCM_HW_PARAM_CHANNELS,\n+\t\t\t\t\t\t priv->constraint_channels);\n+\t\tif (ret)\n+\t\t\treturn ret;\n+\t}\n+\n+\t/*\n+\t * Apply rate constraints only to frontend DAI links (no_pcm = 0).\n+\t * Skip DPCM backend (no_pcm = 1) as rate is fixed by be_hw_params_fixup()\n+\t * and ASRC frontend handles rate conversion.\n+\t */\n+\tif (priv->constraint_rates && !rtd->dai_link->no_pcm) {\n+\t\tret = snd_pcm_hw_constraint_list(runtime, 0,\n+\t\t\t\t\t\t SNDRV_PCM_HW_PARAM_RATE,\n+\t\t\t\t\t\t priv->constraint_rates);\n+\t\tif (ret)\n+\t\t\treturn ret;\n+\t}\n+\n+\treturn 0;\n+}\n+\n static const struct snd_soc_ops fsl_asoc_card_ops = {\n+\t.startup = fsl_asoc_card_startup,\n \t.hw_params = fsl_asoc_card_hw_params,\n \t.hw_free = fsl_asoc_card_hw_free,\n };\n@@ -753,6 +816,14 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)\n \t\tpriv->cpu_priv.sysclk_dir[RX] = SND_SOC_CLOCK_OUT;\n \t\tpriv->cpu_priv.slot_width = 32;\n \t\tpriv->dai_fmt |= SND_SOC_DAIFMT_CBC_CFC;\n+\t\tpriv->constraint_channels = &cs42888_channel_constraints;\n+\t\tif (priv->codec_priv[0].mclk_freq % 12288000 == 0)\n+\t\t\tpriv->constraint_rates  = &cs42888_rate_48k_constraints;\n+\t\telse if (priv->codec_priv[0].mclk_freq % 11289600 == 0)\n+\t\t\tpriv->constraint_rates = &cs42888_rate_44k_constraints;\n+\t\telse\n+\t\t\tdev_warn(&pdev->dev, \"Unknown MCLK frequency %lu, no rate constraints\\n\",\n+\t\t\t\t priv->codec_priv[0].mclk_freq);\n \t} else if (of_device_is_compatible(np, \"fsl,imx-audio-cs427x\")) {\n \t\tcodec_dai_name[0] = \"cs4271-hifi\";\n \t\tpriv->codec_priv[0].mclk_id = CS427x_SYSCLK_MCLK;\n","prefixes":["v2","3/5"]}