From patchwork Tue Nov 26 11:54:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chancel Liu X-Patchwork-Id: 13885834 Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2055.outbound.protection.outlook.com [40.107.247.55]) (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 303901CEAD4; Tue, 26 Nov 2024 11:55:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.247.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732622119; cv=fail; b=o2kJuTPrCtKhxoO88c5bFUyXRyq0WnK8hKIm8xz47aXLhJbWfveEr3rwNbEXjjXY5Fc+N1GXrOf5//Ee1XfIg5e6niAaoojePq6uk4S//WSFRFshjV8TCH8G9+wZJlivlmMAKMI1Dne4nVTH4rWRaRgpYoYqtznzZE3Stj3HACc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732622119; c=relaxed/simple; bh=icWf+E5D7M55M5bvYhDe8mFs3PSyCMXt6G/CZV3lrPU=; h=From:To:Cc:Subject:Date:Message-ID:Content-Type:MIME-Version; b=pq4ShlksC8CTRUuuSx/iFxAfmO81dh+IvBTw0ruz/u9k5JcDHL01YytwtWBNTgC0eZvJ3//q+0B8y8uvR27LfS/8EsIRg2rlQBDct3mwtWu9KRR2a6fzbf0QMraqiocjowAi0BMuw7zqb7KvjBXMHJzz9g3kMrspn6P0Nzs6G1A= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=WLGW5jjv; arc=fail smtp.client-ip=40.107.247.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="WLGW5jjv" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iDIAlEtY8bM5YEcDYKkaZT0W5kKtwSt9EUwbVC4xjolzxWepVMLJWPozAP74Ol5x8S9AcsWS007sOU15jypzsKZ/Y0eJ0lIj7sEhS4O1H+L1prxocOpnmJ7ZJyfffZc6jr83YG4Bix8kvBe2mAJCsl3K4pApFSD5iT8vZGkkRH/IeD3iHOqpbu7BJn2VM2e4J8Q8OypLHOdel5gq3N2/UO99mGmXUUoAI3oGIn8nqv9DwiFrLjw4u0CpFJblUO8UBvXlTMhikPWa2l6BuKrRVTW8TPfat5yW/PUM3pIl/lQ8udCTEFDL53WG7IxJFQH41bSAH2PgqrflLPYrLWPF2A== 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=cA3iiFuck9njuehzcbwLC24MKtMs0Ec5b9ZKlQYY8fA=; b=YMXjokwQH4UYvG8iUX0D5im+DL3psgvPeOWfY9kpBe1kWLkV+17nUs4yD5Kck70RU2T0bU13OFBAmkt8k5vjkLinZabwXTMwTkghOM1m1w9AN98QbbPlb43QLSooTQCbJ7Sms4OEyaBIFjzQVeH7OchrWZwFh/HEvsDbcC/Gfm7PmPkcanPF+0ElqJbI1G0fnXi03yjNkLcztmNeUQWUN8aHHv55D700XiVAIBtwkvdtSKz3izgqFT3YS7Z05tTq2ri46rtgUiCLaJF5jQgEaMMinzckzYz45dJiljTiAhFl6vh5SykQVcmxYGuQODyPd/54oEa7ju31jMWyyIVA/Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cA3iiFuck9njuehzcbwLC24MKtMs0Ec5b9ZKlQYY8fA=; b=WLGW5jjv9V67ZM0IlmjLkGdWq6XH5wfrEQ6ogIyCDiGTKfO9piAfKkVMo4Qj7ip+/ls5oa1/Xu0UAZ2pDdBqhYLHyrZ6WGEu8hj8hOBy96vawZ3Y4k1pXxVOmMaYKaKDMk7Ek8nlcCaOBpLKSyzfr/MpI/hAHac6fEXUBbMpMD2ar1hlGzj1QiL0JkXeUjeFjAnTMv5jrYTiR3Vzfy5mcRRc1FqHnliXyjkBFSTFTmumXASwabB80WVKZK9ajXlHqJ+FKbu8DARE9N6tBg41LZO2r0Tonp0jgyhO1uBTBFLECdM6/1G0yaWD2/IdO2mMmw02D0uhFUDNeB5x+1PlaQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DB9PR04MB9498.eurprd04.prod.outlook.com (2603:10a6:10:360::21) by DU2PR04MB8504.eurprd04.prod.outlook.com (2603:10a6:10:2d3::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8182.21; Tue, 26 Nov 2024 11:55:13 +0000 Received: from DB9PR04MB9498.eurprd04.prod.outlook.com ([fe80::24fa:6f9:8247:c5dc]) by DB9PR04MB9498.eurprd04.prod.outlook.com ([fe80::24fa:6f9:8247:c5dc%5]) with mapi id 15.20.8182.018; Tue, 26 Nov 2024 11:55:13 +0000 From: Chancel Liu To: shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, nicoleotsuka@gmail.com, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-sound@vger.kernel.org Cc: Chancel Liu Subject: [PATCH 0/4] Add function to constrain rates Date: Tue, 26 Nov 2024 20:54:36 +0900 Message-ID: <20241126115440.3929061-1-chancel.liu@nxp.com> X-Mailer: git-send-email 2.46.2 X-ClientProxiedBy: SI2P153CA0017.APCP153.PROD.OUTLOOK.COM (2603:1096:4:140::10) To DB9PR04MB9498.eurprd04.prod.outlook.com (2603:10a6:10:360::21) Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB9PR04MB9498:EE_|DU2PR04MB8504:EE_ X-MS-Office365-Filtering-Correlation-Id: dd6e38ea-77ed-42bb-f834-08dd0e112f3c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|376014|7416014|1800799024|366016|38350700014|921020; X-Microsoft-Antispam-Message-Info: wQ3vzAGvQm8k1XdH4icwUCfBo7JIcKn3WOlfO8vLHn9RsGv6RJSulsOGk9MhfO6gGbdaeaxhDzSJ/hzeIpQKA5yz+uHpcfl6uie1jou09RqPP7sGc76Joza2DqQl9ni3o6XQEhlqA+xtRl0rcboQb7hwxoDtTc/Uvn9bGTc54l7YC3bKxNiLfW8OcU76A6RKu/B9NJcn9R+N1+ap2wJijPLAdRmgPi9oDbVO3AKfr3VWMz2WSajSCKhzz3ZGXHC1VWOtk+RWDsLcw5mbEaUe/e4D0YHa25X+y61BMjVJVZP5ql0MEnkhVWIZZdm5gumaF09uXFmu5cCGVa28dmmmTU+ay5xkVHHudwakVTW76myNgpZt39X9RXtKUaRAV4NAwNg1YB3TP+LNAOGjsmtAwLMBFxmvVFkgTuVZgB9IkZ7b1yNomGM0fB0IWW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.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(376014)(7416014)(1800799024)(366016)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vX0y3jtAeel7V/efau3oWVeOM/Op1Dv1J8Ny8ECC60HlUCLAhHfpRU6g70EbJZf11SOoxBkPC5LhdJRCQumoY4y+H1a4cpqAB8PWGHsZPaBO09WAbSYLMNo8FalMGpZo24tsJmnhLmSErT/vVWyVDyQI6CefPqWUSbLQTvzFGYgM3X28pVQOyjJha6aZq1zhrnjg0BLahBYnh82d0atZU46wQUsekiXshaqDQxdibcMsE67wsoNxLvcfuZC8rQPlLqG4eh8a5LbyBGzEvxEYhwMQhQG4EeZGrw/rqgg9+tGSshYxnkBu9VphWL/ujJXdFnV8SaMKwm6WSp8NsyoSmQwAwohEFfowOVW1vGkmd6BcQ4lFzfLCPkCA9HFvQHFE0V/De1pf6uy56Q6YBgPxZPRs3zV8GAvm327F9LPOHA0GcJvAEghPSha1SJfL16xowNdIR4lovfTthXiIIvgN7jBgVddK/1mkVjoazbzXnVBVUomBFSglk1WA8m5KtMIrISuXL1LSJff+H/++X/Q0Rc19oauKPosk1BsPoK2hOHk1/1QF+ONCF4kqpiuwbEi633I4XSJNAmQIWfoDUgSsCK9/nUI0kP6M/z6Z9FYbTARNzwSt8OLYZ79Kg6QvKDmMCET4IGd/DjHziFFZG+yMkm2AnCeyNkOqnz4UEWU1nec1YR/TJa5oC9nfyWaXZAY2BdBVgVFoiAuhxLF0l7Blr1FzWarVXeZ1RG6LRjIkzk0GJua3NtpuoufMOyGeBjByEFTZwKQWuLh43xxuYSdPjA1p58rvWIfrlPAPeWQ+UGubM6bh7h2EtJ3qrVbS6cadlJUUmwtLevUIYYyhVNjrroQEookWHlG4euirdsbCeDDf34floCiFFj0BN9HHfMII9NLSo8d933yCUQ5ata+NAbx9W/skLg7+PMs91Qjmp/w2DHFxvlhpC0J0inquE5Vo8gldq/qh49t3JQEuilUlU0+yRAfDJbGEZO5CJ8qUsBBGvtxL+LmI5lAmM+MqOUAU32PHbPXdT07EEJytfWQycw+sV+Hn8sUs9DCyBFWBKBWFQIGjoR3GmlefoOMet699T6sOrw4BLaVHE4f7oYINkGizY4NQXPYcpCtAJgDCZhEVIXhuifynjCT0QmXOH6Hlf8P84UA2vk6HGpiXdWapieyGMTEbVyul03WDXbDOWJrkYi2jYAXOQJ5fnVvEPi5gpWyOZQYmseb4M7vy7MdAqpeFf/7o4mAzzKfkG2eOX47OgoBoM3cqk8M4xEsVXYe3MM3h5xXPSGQlHvuZAmErmOmS4eqeBFgdtho8sxAw+4JkSbEmkIcDsRjcuW5hq2b1Fq4LCklPVlr16Vymeq5E0tyMRkWwAWRcoCvSx8EpnIASTg/QKLqjRvW5QkUyVPGOhIy+3PDNzp+o2ReUGUzMpm117J+2lZl1Sev/0RmkfFJJtIzpC4S2fzpzHTmdmG3e62Oyt9v0jxLmBjlI2bLafQhbBI5ZCngyda8gRM5nGmaIXSNbe9FvIzRyNX2CJeALE713+R/WTiaYeTmm7tKExMHfTz+rc42lVOG0dhRyf1BrP4AXKTl6/WoKTA5davCx X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: dd6e38ea-77ed-42bb-f834-08dd0e112f3c X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB9498.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Nov 2024 11:55:12.9856 (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: Sg/PWaAsrhSR+31gcJGXLT1IMNuQ+m/Z5WgD3MkQkH7FdBsxRRcrI3voVcqcKJyGbKUBBfwIIB1+RY2/OSvEuQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8504 Platforms like i.MX93/91 only have one audio PLL. Some sample rates are not supported. If the PLL source is used for 8kHz series rates, then 11kHz series rates can't be supported. Add common function to constrain rates according to different clock sources. In ASoC drivers switch to this new function. Chancel Liu (4): ASoC: fsl_utils: Add function to constrain rates ASoC: fsl_micfil: Switch to common sample rate constraint function ASoC: fsl_xcvr: Add sample rate constraint ASoC: fsl_sai: Add sample rate constraint sound/soc/fsl/fsl_micfil.c | 33 ++++++++++++++-------------- sound/soc/fsl/fsl_sai.c | 7 +++++- sound/soc/fsl/fsl_sai.h | 3 +++ sound/soc/fsl/fsl_utils.c | 45 ++++++++++++++++++++++++++++++++++++++ sound/soc/fsl/fsl_utils.h | 5 +++++ sound/soc/fsl/fsl_xcvr.c | 20 +++++++++++++++-- 6 files changed, 93 insertions(+), 20 deletions(-) --- 2.46.2