From patchwork Tue Dec 20 07:27:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Venkata Prasad Potturu X-Patchwork-Id: 34950 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp2821546wrn; Mon, 19 Dec 2022 23:27:36 -0800 (PST) X-Google-Smtp-Source: AA0mqf5lzrncD2wgvZVQzDZE0OL9qzCSptYiyfhE0S8aILP/8lkopM1Rrx7g/N+6NMmO/aKrm+AA X-Received: by 2002:a17:906:6892:b0:7c1:637:585d with SMTP id n18-20020a170906689200b007c10637585dmr36392167ejr.0.1671521256575; Mon, 19 Dec 2022 23:27:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1671521256; cv=pass; d=google.com; s=arc-20160816; b=nVZpsyD9aJ5h7YqqOiZspaSEy3gJZGlwVaB5RI4ZL3U0HxAVgW/qO/K7kI57bV07Hl aANuCzo9wcuzdOCF3ZYvxVLPfVEcpkBCYOEum1AsyIMqFzdgHG5CFqpXmMolU9LKiWLR GwQnysbrFUgJcLUAVkULVY7hPkrW+c8999IznalXqmywBVMZV8hYa+pcmFUVT/+0RyZz 7AC4gXLYLQtRqRM7VeJGKdGe5MLY4nOXcN8QouXzIekh5kMotgRokdelru8pAaBHt+4u AH377GrYJVvf9CNKVi5Lr8+RnnwWmwvQv0wDUvZSMAEBJMl1Syet6kuPSnTSHnzpDbHi zphw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9FdkS6DEfFHEze2HIBSshFnNVres1tCHRpjco96ctNQ=; b=LDQUGCTBbWl9oSXMjG7oQ60FGbH5XL42X+65c5EZ8y5jWHUWpwCZEXgEeMa+GvSy8s SFpNK88rccAmJU+Qm1p2uELYF28NpSnhzCc4HD8bLVZGT8OUvEdmaY3W6Dbjtj/SdYa+ 48oG+Zs7XbcShS9Ws66EK3QOT+Z0nGwaRjnwHRt+GUw7YQhvbo7Ks2YLmdxT1ZAvLtGy C1YV5ffRF2MZAmjcT7BSM1FR1GnhdB5HxUinIO0z0kXAez+n2CojplbFtDOKsYm6rYBd yaudl91EHsLCJ+sRfq7wN86SvEEUZg35wRWL8sMbnlT7WODpqG/c+awJ6L/LZoHXywAd jm2w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=1eUzgbCl; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qw25-20020a1709066a1900b007dbea9fb8dasi6880179ejc.641.2022.12.19.23.27.13; Mon, 19 Dec 2022 23:27:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=1eUzgbCl; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233244AbiLTHXA (ORCPT + 99 others); Tue, 20 Dec 2022 02:23:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233116AbiLTHW6 (ORCPT ); Tue, 20 Dec 2022 02:22:58 -0500 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2041.outbound.protection.outlook.com [40.107.220.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 091FA9FF7 for ; Mon, 19 Dec 2022 23:22:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Tq4TL8lkBNPbqekHfdB4r/ZkRKxGYIbD7sBsl7JB0YihMDtdYfXSEYD6hosBmmsl19X4xDKBN7Obqy2HzP2Tx4Pwn7vrLpG/tNLgHv2/ihVCEUzxyegie7/rq40sZo+4ibxLGcmsEe3wjqcH1CLdlYtJs7U3fJrXiiq51d1thqw+53eD+ts/Qet2QdGx8E2E0PPd3xDiCXtrSX+YPukzw5XA6ZHaMDwJUJ0e/P3mLExasOClMfNeO/0l1Hmry+VOuAKdqG7jcvAmczMVYEQo/ZPETa2BfNmrnENPH3tqXaNZrmNnqqDGyjmg7w83l6ZMEXF1s64GQU+67HdSgbu16Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=9FdkS6DEfFHEze2HIBSshFnNVres1tCHRpjco96ctNQ=; b=J6qc7NGkFWt3dLU7j1DMJ6ZZR6deu2yzkFzl8kui+QdMoU1a9uIe995pYgIfrgZ28/mQ3+hVp8kVQWuNWKtYwJiGfG57LcLnfUz9iTkrohJeu34YZi8I3ts/AO8ZldReS1zl8JUXfy+q+F4MeBAprNh2xiVxW+5V1Bbm9bi76NsaR/MpjCPXltgsI7aqO/4a4etZ+ZSSLAvdWBr7MBCgKJ3e8kA3uKdMeSTYcieyC++sTX3mXJrkechIZ48WTW9dI5SL3eHb6tlzepgS7znWIBoDkRMgCcyGLjO5Nx+o1pY0beiM71u2VlILSiSiwUXItsCOwIk121dFvCxc/UmPGA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9FdkS6DEfFHEze2HIBSshFnNVres1tCHRpjco96ctNQ=; b=1eUzgbClPemi/EwhKlDwgvtIwqgPMAkYlsvVqbUr6thfFNXgzh74WnjSwq7s0ByQnC5vGlIcihKRCg0NRc8vPaVTdwKYFaiUWd7b25iVgdZfl7AAgLwDPKXBTEe/itJk9ajBOSy2cdwaEPhnaNkpaKqgDfTYI5gd8JX2BP7gR7s= Received: from BN0PR04CA0016.namprd04.prod.outlook.com (2603:10b6:408:ee::21) by DM4PR12MB5914.namprd12.prod.outlook.com (2603:10b6:8:67::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.16; Tue, 20 Dec 2022 07:22:54 +0000 Received: from BN8NAM11FT026.eop-nam11.prod.protection.outlook.com (2603:10b6:408:ee:cafe::40) by BN0PR04CA0016.outlook.office365.com (2603:10b6:408:ee::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.21 via Frontend Transport; Tue, 20 Dec 2022 07:22:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT026.mail.protection.outlook.com (10.13.177.51) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5944.6 via Frontend Transport; Tue, 20 Dec 2022 07:22:54 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 20 Dec 2022 01:22:53 -0600 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 20 Dec 2022 01:22:50 -0600 Received: from amd-System-Product-Name.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Tue, 20 Dec 2022 01:22:40 -0600 From: Venkata Prasad Potturu To: , CC: , , , , , Venkata Prasad Potturu , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , V sujith kumar Reddy , Ajit Kumar Pandey , Akihiko Odaki , Jia-Ju Bai , open list Subject: [PATCH 1/5] ASoC: amd: acp: Refactor i2s bclk calculation Date: Tue, 20 Dec 2022 12:57:01 +0530 Message-ID: <20221220072705.1456908-2-venkataprasad.potturu@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221220072705.1456908-1-venkataprasad.potturu@amd.com> References: <20221220072705.1456908-1-venkataprasad.potturu@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT026:EE_|DM4PR12MB5914:EE_ X-MS-Office365-Filtering-Correlation-Id: 59515763-6905-40f9-25e0-08dae25b02ff X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hhuIq7NkteP6/j4q6RIzBaSZVYJUvTC+xguxQzfIvk31Eh5oouTyOKZCKK4NFMfPHLr/zAH1bf4MuA+w1eVVu3+9QERQUN/+eNwt9Ki8ySW4wZmYsHYt2JmZqDE60Wa6PSmbQ4bzGy86e+uhRTqA3E9Hsdc8ZD6ST9gZxAACDUuCI+IQLypY0sU6qGOwP92le9b6ZZ8wv6nNbtGqS7MP999sZXHQR7UIEBa75uo7dHtqjuvv9tW97kGCWyxuvSeQ46uaGTfL9QDeW+BvLCrE1McsSm2W3calgxyB3AlOc7GzTD9l0EBdMoYclVwIQ9DgLpsUqQqRifI7hr1Fe4jTJYepnX3kEzR9XWZo7wzMCshb88ab5t4/+fU+s3CFX4Ois2DAWKjwFDPM+kP4W31UDQtolBte4b4GGeJ3pOTKBjsFAN9EsaW2w5tEz+wmF4oa1sTR9blHE1IYheLg5JlMLsvSe1ijAiRVcKw8DDuFHXTnLMFHsXaC0Yg5HdxPHSlctDseVV6NzBFXCry1e3Xgy5k/jhjQv5pnWkJZTzouAVJsubHT1TyoZQ8OvfhRQ+nYBrxbTPFpYcOKFJweWvp01V2f6LmSuTA+y8B42pYzSk3mGOtagz/rrs2O7sGhUpKeX6yzPf9G09yfeNF3hz+R5QrqvUWvhUMDKzFGtWpj+aYHYAMkLcZ5RyWU3Yp9FUPNNr1uSOf4Maf1F8yjtooUpOeHEj+XVrkgPjJCEOHe9kE= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(376002)(136003)(346002)(39860400002)(396003)(451199015)(36840700001)(46966006)(40470700004)(82310400005)(41300700001)(36860700001)(356005)(8936002)(4326008)(70206006)(5660300002)(70586007)(8676002)(83380400001)(81166007)(47076005)(40460700003)(426003)(1076003)(2616005)(336012)(478600001)(186003)(26005)(86362001)(82740400003)(2906002)(7696005)(110136005)(40480700001)(54906003)(6666004)(36756003)(316002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2022 07:22:54.6054 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 59515763-6905-40f9-25e0-08dae25b02ff X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT026.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5914 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752717073444050114?= X-GMAIL-MSGID: =?utf-8?q?1752717073444050114?= Refactor i2s bclk value based on hw_params. Signed-off-by: Venkata Prasad Potturu --- sound/soc/amd/acp/acp-mach-common.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sound/soc/amd/acp/acp-mach-common.c b/sound/soc/amd/acp/acp-mach-common.c index a78cf29387a7..016110fd6ad8 100644 --- a/sound/soc/amd/acp/acp-mach-common.c +++ b/sound/soc/amd/acp/acp-mach-common.c @@ -352,8 +352,11 @@ static int acp_card_rt1019_hw_params(struct snd_pcm_substream *substream, struct acp_card_drvdata *drvdata = card->drvdata; struct snd_soc_dai *codec_dai; int srate, i, ret = 0; + unsigned int ch, format; srate = params_rate(params); + ch = params_channels(params); + format = 8 * params_format(params); if (drvdata->amp_codec_id != RT1019) return -EINVAL; @@ -363,7 +366,7 @@ static int acp_card_rt1019_hw_params(struct snd_pcm_substream *substream, continue; ret = snd_soc_dai_set_pll(codec_dai, 0, RT1019_PLL_S_BCLK, - 64 * srate, 256 * srate); + ch * format * srate, 256 * srate); if (ret < 0) return ret; From patchwork Tue Dec 20 07:27:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Venkata Prasad Potturu X-Patchwork-Id: 34949 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp2821505wrn; Mon, 19 Dec 2022 23:27:28 -0800 (PST) X-Google-Smtp-Source: AMrXdXuloiQ7htgS9GxopQyEefsim47cYdQlAk4HbzBIhQbsnFi6qJuwqshRPyxVmsncTbMADFQI X-Received: by 2002:a05:6a21:2d05:b0:b2:3174:d2b2 with SMTP id tw5-20020a056a212d0500b000b23174d2b2mr2666260pzb.28.1671521247735; Mon, 19 Dec 2022 23:27:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1671521247; cv=pass; d=google.com; s=arc-20160816; b=kwJX1lf9Jb/iQ7LaLzbsCgAkf/WtvS8WgcR+884D+ygsNvypCrOoUbXThVeB+YXXWu s0qA86BsGnE8ywxl+vlCJzSHxzMPldXYMKxNJ7KZNoRNaYzu+Hw5VEEmtK9IZKjNP+Cd lkL9gEZK3Ck9Hjv+7tImjtQeKJxU8ugpT5E91H/4a/nqOj+qKKb6PcOXrDGatS+2t27n Yr3dQGYU3f5MiOHK9ek091AGO6HwBoYa1mXPH+ryxZQGoRfW5oeHw2tczeeDWiRdGaHw lnEIf9onKJ0rtk+Ydt/eGEysE1teWM7mP9Xm4brFW3pBXy1ISnXXINuoXNP+zY2h1aXd WOxA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1Wa7IpqNolNQl3j7OOVK9dnF3RlNogITv8+toSIkQVg=; b=HxSumnRZuyu5kM86MS054ywox2Z9II91W5b3QDoxd/0Mfunt0A7Y/3UXTRRPGcMMTI onxm2oxeJB1IALySWppLBEw9NHGVVO35sBAgbH1STbtqdr9E3j8oIpfI8g+zQEdhTz0J HYO6HHzaNtmKy70t4sKJTt+TqL4zGQWgRjbr6a2Q6gW0bPbKRo6KCxgFk+nmV5wReXv6 C4aMtFVLiIDrIZxH56v1JcsSo2QUl93UBOVvzcnzkZtbyrq518hhnUcasDmbc3HPSet6 4KaMFpe2mLwdvjz64dqALDmRvQjlj6AKYRUlKcCPdYS73RAsYiHJuskYdNHLS5Gr/4tV /Xjg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=Y4T8Oom+; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w4-20020a656944000000b004772bd7e38esi13031988pgq.868.2022.12.19.23.27.13; Mon, 19 Dec 2022 23:27:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=Y4T8Oom+; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233269AbiLTHXK (ORCPT + 99 others); Tue, 20 Dec 2022 02:23:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233257AbiLTHXG (ORCPT ); Tue, 20 Dec 2022 02:23:06 -0500 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2081.outbound.protection.outlook.com [40.107.237.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A59991057E for ; Mon, 19 Dec 2022 23:23:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J7ucRJ+zsIBM3Mw8Yi2433DwYRKkB7MVoAMHQSijVt6C8y/85aHNbzydNx+5GdnbHKTXCPfWjqbluWk0A3mHo8+aNcagSsUiieJMDaw/mRlrSOA3qJj7tApx93gZGiRM4kgbVrIvYdgyl/0mtI+OHgbXnu5qB+3dZipaWi2OyXaO8ba156RclZI3re66P6kwQTTrwN0ffr2xR2DTbJRu9RJsBBlT3SnZtuV7zB+ZVok95NwcwmPGqfgFYmfsZ2ahAA3Va4/Ef6qXgOHO6ecfRrMRjbwLKgojgWdbRkuQCeULteO8LLuesIrvBFtc11LUUjkUAld8NAiNnV3OGrX2JQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=1Wa7IpqNolNQl3j7OOVK9dnF3RlNogITv8+toSIkQVg=; b=T8QeTWJyw04FVZCFwLHTJvW7oO0IW5XH9gea97yqPsjEtn/odrYnAtttQ0py3f/xcmyCfJBcY8lbAW8FyrECn4naXcEU9hWyENp+wYfdCcnT96v7MCVhafYb6PbHZwmV6hfRP3brNUfbONG3kR20ibByCbSNZJzM0KQ7TlFVbpoM7fLRtwtYX2DD2ZJY/Rju2uLr3Ypsh85IJjSvYD2nOkdliCygJppLAiu8lg1WwpJbBcYdfxdsB8NjeUu+siVHx634S+Y9+olYxrlYs1n4HpJ+y2hebhyOMEm8si5zw3Hx0rduwwS91ULsbAON11sFTeOVcyHhEM9vd/oGlwsIpA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1Wa7IpqNolNQl3j7OOVK9dnF3RlNogITv8+toSIkQVg=; b=Y4T8Oom+1bk7pgTLFuOJ0RzgOwL/dRN3qpRh1zxRfavG7YWgwnf18pVU5iKgrVt8VHVxUO4I0PxU6KeGAHEIzC6peyEAW7/4RNyspLHwki+PymfFw+vT9g2oEltlVnhr52/JlgioS8pIoIQwU6bFBf0tvh+gIUEMTw5Ca509d/4= Received: from DM6PR03CA0094.namprd03.prod.outlook.com (2603:10b6:5:333::27) by CY8PR12MB7489.namprd12.prod.outlook.com (2603:10b6:930:90::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.16; Tue, 20 Dec 2022 07:23:03 +0000 Received: from DM6NAM11FT062.eop-nam11.prod.protection.outlook.com (2603:10b6:5:333:cafe::2c) by DM6PR03CA0094.outlook.office365.com (2603:10b6:5:333::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.21 via Frontend Transport; Tue, 20 Dec 2022 07:23:03 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by DM6NAM11FT062.mail.protection.outlook.com (10.13.173.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5924.16 via Frontend Transport; Tue, 20 Dec 2022 07:23:02 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 20 Dec 2022 01:23:01 -0600 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 20 Dec 2022 01:23:01 -0600 Received: from amd-System-Product-Name.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Tue, 20 Dec 2022 01:22:51 -0600 From: Venkata Prasad Potturu To: , CC: , , , , , Venkata Prasad Potturu , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , V sujith kumar Reddy , Ajit Kumar Pandey , Akihiko Odaki , Jia-Ju Bai , open list Subject: [PATCH 2/5] ASoC: amd: acp: Add new cpu dai's in machine driver Date: Tue, 20 Dec 2022 12:57:02 +0530 Message-ID: <20221220072705.1456908-3-venkataprasad.potturu@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221220072705.1456908-1-venkataprasad.potturu@amd.com> References: <20221220072705.1456908-1-venkataprasad.potturu@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT062:EE_|CY8PR12MB7489:EE_ X-MS-Office365-Filtering-Correlation-Id: 046be12b-fb7c-4d52-2cff-08dae25b07e3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QkKybKJo0KE8z92B2gX9c46SoUrCnL6zmFhNFhqQ389kq9Wvw4euf7eBeOvFWqHpIJQZ4RGPcJPG/A30L+6cTDdjVhs0WFnmKhRgEOhH7QmU+6+7p+zd4ySlC1m3IGdwL2LsJzjPcb7umhwPCOBfsulbvXEQ2TWwaugJqWzq5ErBmsAGO39aPjKEraZymasStrRo7bayqPWuSwKjEGYEoXzntpF5/3W3eM/L1+iPP4H5IZ/boK/RgMs4Zvqnm798180bFG2LoHz+daESZja9Ix0sljmZpCxX59yPiBH0iPqwnfAkh5UKs2h29I5yDcJO7GX+DuR4vLDEN52FFIIVdpwHPqL0/WZTKVIZSd2ijmanvew9HOERQHn5VuBgtL8SR7k6GRRNjYWJ2hndt10SQZ9FSZNQdVDamt3Le8qKjTw5BxzXbQ6FJh0hnMNJvaMqxAUZ3oVpgFNJKa3fOjUcrn272u6P6TQUNz879KN31X99WaKRjXo3xbgFRuvGZBTQtnKXS1vby+OgWvS64foRxGCkQWGhMylc2LZqU4NDJyetkNPQNkF0eNu+QLwktma4uyqXd2POYn30M3U1jk8syRd4X/dy7Mtsv4uRZEENwDpNdUbYHJYFqlPyaWBNAdMrf8Cvr+eaOm05fP/400JGM+vzaNzvKA0iIBFWLv+rABC4Fv+LbugUQo6z5Vf8lbwRJ4VYuA3igLc3f29POj2rQC1OJsQETQyDG+KVWh3zj4Q= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(376002)(396003)(346002)(136003)(39860400002)(451199015)(36840700001)(40470700004)(46966006)(82310400005)(36860700001)(83380400001)(36756003)(1076003)(336012)(2616005)(426003)(86362001)(40480700001)(82740400003)(40460700003)(81166007)(356005)(316002)(8936002)(47076005)(110136005)(2906002)(70206006)(4326008)(8676002)(54906003)(5660300002)(70586007)(186003)(41300700001)(6666004)(7696005)(26005)(478600001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2022 07:23:02.7639 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 046be12b-fb7c-4d52-2cff-08dae25b07e3 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT062.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7489 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752717063603120138?= X-GMAIL-MSGID: =?utf-8?q?1752717063603120138?= While using same cpu dai for 2 different dai links below error is reported. error: can't find BE for DAI ACPHS_VIRTUAL1.OUT To avoid this error add new cpu dai. Signed-off-by: Venkata Prasad Potturu --- sound/soc/amd/acp/acp-mach-common.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sound/soc/amd/acp/acp-mach-common.c b/sound/soc/amd/acp/acp-mach-common.c index 016110fd6ad8..5132fedef00f 100644 --- a/sound/soc/amd/acp/acp-mach-common.c +++ b/sound/soc/amd/acp/acp-mach-common.c @@ -568,8 +568,12 @@ SND_SOC_DAILINK_DEF(i2s_hs, DAILINK_COMP_ARRAY(COMP_CPU("acp-i2s-hs"))); SND_SOC_DAILINK_DEF(sof_sp, DAILINK_COMP_ARRAY(COMP_CPU("acp-sof-sp"))); +SND_SOC_DAILINK_DEF(sof_sp_virtual, + DAILINK_COMP_ARRAY(COMP_CPU("acp-sof-sp-virtual"))); SND_SOC_DAILINK_DEF(sof_hs, DAILINK_COMP_ARRAY(COMP_CPU("acp-sof-hs"))); +SND_SOC_DAILINK_DEF(sof_hs_virtual, + DAILINK_COMP_ARRAY(COMP_CPU("acp-sof-hs-virtual"))); SND_SOC_DAILINK_DEF(sof_dmic, DAILINK_COMP_ARRAY(COMP_CPU("acp-sof-dmic"))); SND_SOC_DAILINK_DEF(pdm_dmic, @@ -704,8 +708,8 @@ int acp_sofdsp_dai_links_create(struct snd_soc_card *card) if (drv_data->amp_cpu_id == I2S_SP) { links[i].name = "acp-amp-codec"; links[i].id = AMP_BE_ID; - links[i].cpus = sof_sp; - links[i].num_cpus = ARRAY_SIZE(sof_sp); + links[i].cpus = sof_sp_virtual; + links[i].num_cpus = ARRAY_SIZE(sof_sp_virtual); links[i].platforms = sof_component; links[i].num_platforms = ARRAY_SIZE(sof_component); links[i].dpcm_playback = 1; @@ -736,8 +740,8 @@ int acp_sofdsp_dai_links_create(struct snd_soc_card *card) if (drv_data->amp_cpu_id == I2S_HS) { links[i].name = "acp-amp-codec"; links[i].id = AMP_BE_ID; - links[i].cpus = sof_hs; - links[i].num_cpus = ARRAY_SIZE(sof_hs); + links[i].cpus = sof_hs_virtual; + links[i].num_cpus = ARRAY_SIZE(sof_hs_virtual); links[i].platforms = sof_component; links[i].num_platforms = ARRAY_SIZE(sof_component); links[i].dpcm_playback = 1; From patchwork Tue Dec 20 07:27:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Venkata Prasad Potturu X-Patchwork-Id: 34951 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp2821584wrn; Mon, 19 Dec 2022 23:27:41 -0800 (PST) X-Google-Smtp-Source: AMrXdXvRTUfevGQCFHUxsHtwjF76tru+91TwdZqoX461ze0BraFvPCFg2V5GKWyvvhMfNWyRgFIQ X-Received: by 2002:a17:907:98f0:b0:7c0:98d0:f433 with SMTP id ke16-20020a17090798f000b007c098d0f433mr5777202ejc.75.1671521261642; Mon, 19 Dec 2022 23:27:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1671521261; cv=pass; d=google.com; s=arc-20160816; b=cAE3NRoyOIiN65DWjOwUQxDNvSBZj3TvM7ivnqDqe/A1yS9L2pE19CJstJ/HI/bfnE iCQMU3se56ecY4VY8UgQvgQUXHvaCQgWUEd3RbFKFG/BMXuRXw5RVFW7oaDMK+ywge0J 4UTfj0GhnGDUKOwt1Ev3ick/OvjUlV500ibNEkx/dtyVUGA/CqGL8Xo1JIWqByq8FZ1S nIT4avPqftyI5rztnRHXKD4goKwl4vMk0iKKousNvRCZQCEVsx+cfy+SI31kAlES8FYt GVBmlTr7NtohRqFhUXMKYYxlso9cOikJOj8D30eRnXRrBgAyJyBadQlmjUm+OTNDdpQF Gx/g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8xbCPOLaQLH0IsHAexek5YCEs/b2MJhpyvwcEOaY5Fc=; b=cIPOHnweqljFSjW//Vf2hPdkCvxVPiy8s+uW0ANiPW/8DX6U8VuU8ZpVhwTzI2fCCV r4tzxn8KrhGWq8Bhs9U5925amMfU51iAZfDDyqeX9aOecX+JTF3QSDSdwhf64yHdkpHH HNMqli0hI7cjAZz16aIWEqB4avrQa5Xay5FDZi0BxtjU+1kFKMFvqYE6lNxZRq7MDDsX 6MoTG4JbyPgh4wbupddGWpYE8ff1sm24vIjX/N+IOb9mj1mKy7Ka3luIqFRtpJCsl790 sTwEPzedpZ7eskxZugsmb2SD3q2mF++7hYUYyN7DSqzzCyFeAR0W2z967MGhemslVXnN PuMA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=IOD5lqZe; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g11-20020a1709065d0b00b007c4f6870a9fsi12686517ejt.554.2022.12.19.23.27.18; Mon, 19 Dec 2022 23:27:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=IOD5lqZe; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233288AbiLTHYs (ORCPT + 99 others); Tue, 20 Dec 2022 02:24:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233314AbiLTHYl (ORCPT ); Tue, 20 Dec 2022 02:24:41 -0500 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2041.outbound.protection.outlook.com [40.107.244.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 615DF1274F for ; Mon, 19 Dec 2022 23:24:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bnhxRs0c0sM/zRWHWvFaAh5YDLREJRbbLaEoZf58tQ38EbKA+c1DRIr6MBZwilY5W2V6GZ5rOWmy9XZP4bYO/Lolb2W+w4vRLxi4lv14XQtb3lGXm3L4DJZWWbZhGXviEu0MO81h/6DAT63OlrTDJX7Pfm6e3ll3w33JPXX5JkzrqDFavv+Wds/wYJ6sGJ1JphQ8MVL/v3uQHI+/kg4qPCVcUkvx0kL1ZlIxsi65qIPZzKgXD+kIIH/fhyCbTuYvPSeCBBVrW1znhGvjE/7iGgE3/AUXgTDcJA2R8T83dyfh8ysDexWsAViERQsIuhKk33i8ymAYwmbdXx9F02x4Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=8xbCPOLaQLH0IsHAexek5YCEs/b2MJhpyvwcEOaY5Fc=; b=HH40FAHrzT8C8cRo6cxk9OiOJhe48bzRNoZSy0hgv+gxirmWAMmPMNQK7uKC0hCc3NrWa1foGqFBErE0sH+pPH7iruaDr2YyvsE3/c1fLlWKq7KAWLNbOcj5eCm411PPiCnlyC/324Y4mJvM6uYQ145hjrt4rsarylYUA7ZTsElSDZm5sM+Vib1zHaAFejXzF3NamMHggSAitnFT9JIJdGObG0FGCxhn/8xcgdBADE8Yga6AFtTKRhKJ0RsJRL7i1XW36wfSYxAbNDUmI2A1xN+A/RhkZvJUi9X2ZGDh6KMD4QyOvS3m/xnZUgefysX0onrA8TLXn+tuPCbVYiarTw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8xbCPOLaQLH0IsHAexek5YCEs/b2MJhpyvwcEOaY5Fc=; b=IOD5lqZedNVN+9hxqtrQlAXCr6jyeqfL2L8EonI6YbBNXC2gLXKV/O1oZRr/hhuZHSF8a4XfSuIYYSQYcj0SKtkk6DhkQ30C/6dUQNQLv6Q3s0Fq2Y7dKJuCkiVLRxnGX5mrw760OSwljEHCwp8mExlTeWiZmZIMvbwfbowbUn4= Received: from DS7P222CA0014.NAMP222.PROD.OUTLOOK.COM (2603:10b6:8:2e::34) by DS0PR12MB8043.namprd12.prod.outlook.com (2603:10b6:8:14d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.16; Tue, 20 Dec 2022 07:24:38 +0000 Received: from DM6NAM11FT052.eop-nam11.prod.protection.outlook.com (2603:10b6:8:2e:cafe::f2) by DS7P222CA0014.outlook.office365.com (2603:10b6:8:2e::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.21 via Frontend Transport; Tue, 20 Dec 2022 07:24:38 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT052.mail.protection.outlook.com (10.13.172.111) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5924.16 via Frontend Transport; Tue, 20 Dec 2022 07:24:37 +0000 Received: from SATLEXMB07.amd.com (10.181.41.45) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 20 Dec 2022 01:23:38 -0600 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB07.amd.com (10.181.41.45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 19 Dec 2022 23:23:12 -0800 Received: from amd-System-Product-Name.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Tue, 20 Dec 2022 01:23:02 -0600 From: Venkata Prasad Potturu To: , CC: , , , , , Venkata Prasad Potturu , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , V sujith kumar Reddy , Ajit Kumar Pandey , Akihiko Odaki , Jia-Ju Bai , ye xingchen , open list Subject: [PATCH 3/5] ASoC: amd: acp: Refactor dai format implementation Date: Tue, 20 Dec 2022 12:57:03 +0530 Message-ID: <20221220072705.1456908-4-venkataprasad.potturu@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221220072705.1456908-1-venkataprasad.potturu@amd.com> References: <20221220072705.1456908-1-venkataprasad.potturu@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT052:EE_|DS0PR12MB8043:EE_ X-MS-Office365-Filtering-Correlation-Id: 4b789f64-c15c-4622-8371-08dae25b4077 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6yJX3p0GSZbmbAez2ZFDA24ozQOumS0lujJz58K7/ret05AlA+c0+2/qtSbsiRD1aNaEtgpFl+Rm4lcPGAHlAEq9XluYoZhfz8g7spBS3nupAjCKPfgxTxLHQ8Lh6MtrE4wAPCtAUZB2WACZdcH0Hn9E+nrHF1KZg/psRCspPbat8XmwgJpZq6SZT/+cYd4CgZFauzeNscArAt+0G3CgRb51Aq8lzEgxkUnzJvR8gythM6+duyjT0xiTXLHbKeTR6lbwdYlzHIuRigkOLhSjtsT2tlPqDp30iWRwzXzS09U0+g0ucOut/0DR3I4S6GFNKPtGopUZGWYf2c3b2qJsg2T6XMpqlHcXq0Kwuk4E4ftnpbUfMQEAzvG/YQekoXLI8jXOmWGBBNOh6A9e+NrcryNVwsPLpZ6j6HB0ExmmPICaugpLkDYg9HmZVSgDtlf9fW3wz+UT+GV81n3WGejsAXvDmVBprp/KBnojn4Vj/Ymwq11zEZ7SNmQHFeyh1j3AA8H+5DYOKTFKe+csHVP/GnMJxBirC0CXnCsl8LiqQYIgOkO63GWisAK1BscGzE8gQ/RSO2v12PAwprSwjxSA5A6K/7pHfef+9HmXdFxJkPzbnDsSZI+KAOSn3Ye4GuSU+SWoM3zUSkKG0fzwMo6JfbsDiqOcqzOFWAXQxpKUYKkgraU+UQhE3xUOHwC14hKXkr1fW3u+ptGs+RAxT3T7xWFKVHkKTTGwt4kxvMTIwmY= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(396003)(376002)(346002)(136003)(451199015)(36840700001)(46966006)(40470700004)(40480700001)(41300700001)(86362001)(70206006)(5660300002)(356005)(4326008)(54906003)(8676002)(81166007)(70586007)(316002)(8936002)(2906002)(110136005)(7696005)(82310400005)(26005)(186003)(82740400003)(83380400001)(40460700003)(36756003)(426003)(2616005)(1076003)(47076005)(336012)(36860700001)(478600001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2022 07:24:37.7040 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4b789f64-c15c-4622-8371-08dae25b4077 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT052.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8043 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752717078564143960?= X-GMAIL-MSGID: =?utf-8?q?1752717078564143960?= Refactor dai format implementation in dai_link specific snd_soc_ops. Signed-off-by: Venkata Prasad Potturu --- sound/soc/amd/acp/acp-mach-common.c | 134 +++++++++++++++++++--------- 1 file changed, 90 insertions(+), 44 deletions(-) diff --git a/sound/soc/amd/acp/acp-mach-common.c b/sound/soc/amd/acp/acp-mach-common.c index 5132fedef00f..748cbefa8252 100644 --- a/sound/soc/amd/acp/acp-mach-common.c +++ b/sound/soc/amd/acp/acp-mach-common.c @@ -86,13 +86,6 @@ static int acp_card_rt5682_init(struct snd_soc_pcm_runtime *rtd) if (drvdata->hs_codec_id != RT5682) return -EINVAL; - ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF - | SND_SOC_DAIFMT_CBP_CFP); - if (ret < 0) { - dev_err(rtd->card->dev, "Failed to set dai fmt: %d\n", ret); - return ret; - } - ret = snd_soc_dai_set_pll(codec_dai, RT5682_PLL2, RT5682_PLL2_S_MCLK, PCO_PLAT_CLK, RT5682_PLL_FREQ); if (ret < 0) { @@ -148,19 +141,7 @@ static int acp_card_hs_startup(struct snd_pcm_substream *substream) struct snd_soc_card *card = rtd->card; struct acp_card_drvdata *drvdata = card->drvdata; struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); - int ret; - unsigned int fmt; - - if (drvdata->soc_mclk) - fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBC_CFC; - else - fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBP_CFP; - - ret = snd_soc_dai_set_fmt(codec_dai, fmt); - if (ret < 0) { - dev_err(rtd->card->dev, "Failed to set dai fmt: %d\n", ret); - return ret; - } + int ret = 0; runtime->hw.channels_max = DUAL_CHANNEL; snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, @@ -191,9 +172,41 @@ static void acp_card_shutdown(struct snd_pcm_substream *substream) clk_disable_unprepare(drvdata->wclk); } +static int acp_card_rt5682x_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params) +{ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_card *card = rtd->card; + struct acp_card_drvdata *drvdata = card->drvdata; + struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); + struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); + int ret; + unsigned int fmt; + + if (drvdata->soc_mclk) + fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBC_CFC; + else + fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBP_CFP; + + ret = snd_soc_dai_set_fmt(cpu_dai, fmt); + if (ret && ret != -ENOTSUPP) { + dev_err(rtd->dev, "Failed to set dai fmt: %d\n", ret); + return ret; + } + + ret = snd_soc_dai_set_fmt(codec_dai, fmt); + if (ret < 0) { + dev_err(rtd->card->dev, "Failed to set dai fmt: %d\n", ret); + return ret; + } + + return 0; +} + static const struct snd_soc_ops acp_card_rt5682_ops = { .startup = acp_card_hs_startup, .shutdown = acp_card_shutdown, + .hw_params = acp_card_rt5682x_hw_params, }; /* Define RT5682S CODEC component*/ @@ -212,7 +225,6 @@ static int acp_card_rt5682s_init(struct snd_soc_pcm_runtime *rtd) struct acp_card_drvdata *drvdata = card->drvdata; struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); struct snd_soc_component *component = codec_dai->component; - unsigned int fmt; int ret; dev_info(rtd->dev, "codec dai name = %s\n", codec_dai->name); @@ -220,17 +232,6 @@ static int acp_card_rt5682s_init(struct snd_soc_pcm_runtime *rtd) if (drvdata->hs_codec_id != RT5682S) return -EINVAL; - if (drvdata->soc_mclk) - fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBC_CFC; - else - fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBP_CFP; - - ret = snd_soc_dai_set_fmt(codec_dai, fmt); - if (ret < 0) { - dev_err(rtd->card->dev, "Failed to set dai fmt: %d\n", ret); - return ret; - } - ret = snd_soc_dai_set_pll(codec_dai, RT5682S_PLL2, RT5682S_PLL_S_MCLK, PCO_PLAT_CLK, RT5682_PLL_FREQ); if (ret < 0) { @@ -283,6 +284,7 @@ static int acp_card_rt5682s_init(struct snd_soc_pcm_runtime *rtd) static const struct snd_soc_ops acp_card_rt5682s_ops = { .startup = acp_card_hs_startup, + .hw_params = acp_card_rt5682x_hw_params, }; static const unsigned int dmic_channels[] = { @@ -351,8 +353,9 @@ static int acp_card_rt1019_hw_params(struct snd_pcm_substream *substream, struct snd_soc_card *card = rtd->card; struct acp_card_drvdata *drvdata = card->drvdata; struct snd_soc_dai *codec_dai; + struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); int srate, i, ret = 0; - unsigned int ch, format; + unsigned int ch, format, fmt; srate = params_rate(params); ch = params_channels(params); @@ -361,6 +364,17 @@ static int acp_card_rt1019_hw_params(struct snd_pcm_substream *substream, if (drvdata->amp_codec_id != RT1019) return -EINVAL; + if (drvdata->soc_mclk) + fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBC_CFC; + else + fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBP_CFP; + + ret = snd_soc_dai_set_fmt(cpu_dai, fmt); + if (ret && ret != -ENOTSUPP) { + dev_err(rtd->dev, "Failed to set dai fmt: %d\n", ret); + return ret; + } + for_each_rtd_codec_dais(rtd, i, codec_dai) { if (strcmp(codec_dai->name, "rt1019-aif")) continue; @@ -429,9 +443,31 @@ static int acp_card_maxim_init(struct snd_soc_pcm_runtime *rtd) ARRAY_SIZE(max98360a_map)); } +static int acp_card_maxim_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params) +{ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); + unsigned int fmt; + int ret; + + if (drvdata->soc_mclk) + fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBC_CFC; + else + fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBP_CFP; + + ret = snd_soc_dai_set_fmt(cpu_dai, fmt); + if (ret && ret != -ENOTSUPP) { + dev_err(rtd->dev, "Failed to set dai fmt: %d\n", ret); + return ret; + } + return 0; +} + static const struct snd_soc_ops acp_card_maxim_ops = { .startup = acp_card_amp_startup, .shutdown = acp_card_shutdown, + .hw_params = acp_card_maxim_hw_params, }; /* Declare nau8825 codec components */ @@ -449,7 +485,6 @@ static int acp_card_nau8825_init(struct snd_soc_pcm_runtime *rtd) struct acp_card_drvdata *drvdata = card->drvdata; struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); struct snd_soc_component *component = codec_dai->component; - unsigned int fmt; int ret; dev_info(rtd->dev, "codec dai name = %s\n", codec_dai->name); @@ -457,16 +492,6 @@ static int acp_card_nau8825_init(struct snd_soc_pcm_runtime *rtd) if (drvdata->hs_codec_id != NAU8825) return -EINVAL; - if (drvdata->soc_mclk) - fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBC_CFC; - else - fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBP_CFP; - - ret = snd_soc_dai_set_fmt(codec_dai, fmt); - if (ret < 0) { - dev_err(rtd->card->dev, "Failed to set dai fmt: %d\n", ret); - return ret; - } ret = snd_soc_card_jack_new(card, "Headset Jack", SND_JACK_HEADSET | SND_JACK_LINEOUT | SND_JACK_BTN_0 | SND_JACK_BTN_1 | @@ -495,8 +520,12 @@ static int acp_nau8825_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); + struct snd_soc_card *card = rtd->card; + struct acp_card_drvdata *drvdata = card->drvdata; struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); + struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); int ret; + unsigned int fmt; ret = snd_soc_dai_set_sysclk(codec_dai, NAU8825_CLK_FLL_FS, (48000 * 256), SND_SOC_CLOCK_IN); @@ -510,6 +539,23 @@ static int acp_nau8825_hw_params(struct snd_pcm_substream *substream, return ret; } + if (drvdata->soc_mclk) + fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBC_CFC; + else + fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBP_CFP; + + ret = snd_soc_dai_set_fmt(cpu_dai, fmt); + if (ret && ret != -ENOTSUPP) { + dev_err(rtd->dev, "Failed to set dai fmt: %d\n", ret); + return ret; + } + + ret = snd_soc_dai_set_fmt(codec_dai, fmt); + if (ret < 0) { + dev_err(rtd->card->dev, "Failed to set dai fmt: %d\n", ret); + return ret; + } + return ret; } From patchwork Tue Dec 20 07:27:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Venkata Prasad Potturu X-Patchwork-Id: 34952 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp2821606wrn; Mon, 19 Dec 2022 23:27:45 -0800 (PST) X-Google-Smtp-Source: AA0mqf5STpAkQa9aYhvAGWQqhiPEktLSunRbnECyNSo2qoHbq8006urEyfi2BC+FTLHpqhHlidNw X-Received: by 2002:a05:6402:1f8e:b0:45c:835c:eab6 with SMTP id c14-20020a0564021f8e00b0045c835ceab6mr41515507edc.36.1671521265365; Mon, 19 Dec 2022 23:27:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1671521265; cv=pass; d=google.com; s=arc-20160816; b=KWg2NYw2FY52XAKaG0ylPZCFSpn3KEzFHDcZZg0l/F8tLzRivTZeWGfMVX/AdJQAmx +cbNsZYMzRjGeM+7lcqLWm0FH9/zHroBmMWlXE+RRgobB/DpJHyvnjEVjSAfJ3Bg+s6P LttCDXYdQzShopSfA9y4zqO9imBcOMmZ//o9+wNxTZqICmFWA0e82XuFavDUxvtnEcc3 GkomkS2XqZ+KaN/oWDmtlIi58uWbFp5/1tUJ/4C2FwI9JdL+sS8JOPHH8ESAC8rIor5p dh0SC6XLz7PsirbX6yXL3NXwn2ywDTc6wzyryBJF4MAZFurpMbM5eCsSAZ6hqgg3bUrd 0h/g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mdNgbIcv5DunzMSQAN4qFyyoS+KexLcIFjidToiIkyA=; b=FjpInFUJm5TjwQtFFMXzhIB4YO7TX52+EMBDFvSADNyFlgOs4KMRbesgComohMqN0s PUzq94vFYVtSyACb5yPhguqlSl01/tcO8a8EhaGZzZoxHxXbZJk5ym8By+LBbusD07AI U+slfDuj1T5eVcChJVOXUlgvvYxzm/yR21pLhgvSGEQF6+ozHQtXRWthltja2gq0HYak osq6pEqeGXWhAT2H4QI/kGx2PyiBuyWXD564r+EduuR46WE5GFwbhVsOq7JfFwVNM3uZ sKcWm9cyTtSUIm73MpQ9NvFb/AWMnT+8krUPlY50VFpmSW2F8EBzAfTBU5k1UERXitAH G7cw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=wRixHSF8; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n6-20020aa7c786000000b004675cf238cbsi9649177eds.322.2022.12.19.23.27.22; Mon, 19 Dec 2022 23:27:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=wRixHSF8; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229980AbiLTHYw (ORCPT + 99 others); Tue, 20 Dec 2022 02:24:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229866AbiLTHYo (ORCPT ); Tue, 20 Dec 2022 02:24:44 -0500 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2056.outbound.protection.outlook.com [40.107.92.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0928F10FE6 for ; Mon, 19 Dec 2022 23:24:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L8Ca0SMZapVJSiJ2vOR3aVwF2Up+ASy2aFXxcFSk4O0uXWutYS6QPSOw8LK+PuM9HtEHTX7BeRw6ak3wOu0QEDbEcECtP3sE+wz3PFmJeByetDVGF/EhAwdWzVV5gPdKaXExwSIAYZd7II+O1yaGb+d2kaw/5yqkFI2dcvynKAVmisiIskmo/lGyWJcD8IpKbDa9OrYiUMwcdCpqK6+Ln4qDgnSQqTwkPrMHGcasKdG0WxPUhnNgKR/5FdSdqJp93kAAU2xq7dItHq3ND7GvVNb+EsNavjhbRoCG7oubBcjV61uhmYdbIKaYnzCJqsRrjppZU89FGOiNxNUhHfWO+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=mdNgbIcv5DunzMSQAN4qFyyoS+KexLcIFjidToiIkyA=; b=dw4uDouzBoQi2Np/KcXxJKMZtHj/kbY3q7diY20X6eqbZsE9JEwN5uCYe886L3Ohbe2BFhr1xreQ2MHUBeT6aLiCI1g6TOGrG8WphTGp0+3Y5gscsQvGnDKpJvx8J0yRebbCe4P0dADkNwEkehJXUfc8HafUZx2GkPz3/RK7gyoDNHbC+uajju9Bv9gy+OtakQTxunLPyIMKt7gs/DYSeyjFY/f/cSqikbKCMtK9Tp0sfNhLJrRXb0eA0mkQyKKPbBzoieHtzC0IC6vZmY4UCfj1k3lJrGaWz/+ipH7Mo0jR0wLvU3ncGtsVFF9fILo3GSrSDr389w1mhdYXwa7Z3Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mdNgbIcv5DunzMSQAN4qFyyoS+KexLcIFjidToiIkyA=; b=wRixHSF8DypcpoaYiyhrhIuEhxMRUJZ6smto94ewDgRYr/PHF+0q02o0NuoHSW5UYFDWwfBsF1Gzjht86cD+Y8/bhK+sNFrNwXfpSQJJ+fGViNC25giHpxtP3aebN43xFyeTeOt2wrL01dzR7tqhpMIGHSCFKbSpJBdpL7mYt7g= Received: from BN9PR03CA0614.namprd03.prod.outlook.com (2603:10b6:408:106::19) by BN9PR12MB5323.namprd12.prod.outlook.com (2603:10b6:408:104::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.16; Tue, 20 Dec 2022 07:24:40 +0000 Received: from BN8NAM11FT040.eop-nam11.prod.protection.outlook.com (2603:10b6:408:106:cafe::61) by BN9PR03CA0614.outlook.office365.com (2603:10b6:408:106::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.21 via Frontend Transport; Tue, 20 Dec 2022 07:24:40 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT040.mail.protection.outlook.com (10.13.177.166) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5924.16 via Frontend Transport; Tue, 20 Dec 2022 07:24:40 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 20 Dec 2022 01:23:38 -0600 Received: from amd-System-Product-Name.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Tue, 20 Dec 2022 01:23:16 -0600 From: Venkata Prasad Potturu To: , CC: , , , , , Venkata Prasad Potturu , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Ajit Kumar Pandey , V sujith kumar Reddy , Akihiko Odaki , ye xingchen , open list Subject: [PATCH 4/5] ASoC: amd: acp: Add tdm support in machine driver Date: Tue, 20 Dec 2022 12:57:04 +0530 Message-ID: <20221220072705.1456908-5-venkataprasad.potturu@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221220072705.1456908-1-venkataprasad.potturu@amd.com> References: <20221220072705.1456908-1-venkataprasad.potturu@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT040:EE_|BN9PR12MB5323:EE_ X-MS-Office365-Filtering-Correlation-Id: 95c98bc6-b28b-49e8-b7ec-08dae25b41e5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ta1+V/oVY+NUYVJKFyfqMiUEWOvZgRfMmpNOH1CbCWCYQZAPKC2HAgyPfjRQi/zanL7Rmlnh7/WU2/oFIcz5CgKcozIZTT4xKXJ7QztxM5V5x9+7Zd0bNPA9QVX52W2eMHZdnBeJBsmOXIQlFvQyT5FOjPEeo6iwEGchXDT2Ayzn3WjXay2NcbaMx7CBv+xZ7J8TUZWQ8yy2xlrTAupzXau4cgynnA7+mHblfGK9lG0GbGAzvaIVGwkeyvyRNaUtHzJswQSGAbqDupATT1Z/UR7bSdyq/o6is2q+wMdzNSjxJ99UnV0j/PEvWI2OR9cdeBuGVVrav5iR+FZt2CJU2eOT8pVIec/ZwoKsFIYdRyGoy3A0COXwo17Gl0HA3ojyZM/JmUP7lgjpvORUVvdxay0/kZrn11gI6PTSvB+fRSmqllrCENAiS63mq4szyCuH8AFWmcMBMz/gyd34XmM8lOpxmKzzVirpWBo7TOzzElhf3NmgTGF4eRwArBL+SAITmBgbIHRPcC2Tl3yTS5/OfeWDR2XWXBtWd0+pySRhkG2T7SyyAzQb7eyzpWd+NKdr8MfG8QdmmM5yRv1AmsyXZ4go5KdRUdcXR0GdabaxyjlD71xWsESXBqzXavXMU+R8CA3nBUp6Ew7hWFEMl6ylkpeT4c3z/c4l1UeRgXlZqeve+wtpTPBjCs/7pZPtmQ/H5yReoSshDrY7Rvi7KSnQGSEIe3Cgca6BbtFUlzDwmDM= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(396003)(376002)(346002)(136003)(39860400002)(451199015)(46966006)(36840700001)(40470700004)(70206006)(86362001)(70586007)(8676002)(40460700003)(4326008)(316002)(5660300002)(36756003)(8936002)(2616005)(41300700001)(186003)(1076003)(82310400005)(6666004)(7696005)(36860700001)(83380400001)(47076005)(426003)(336012)(356005)(26005)(54906003)(40480700001)(82740400003)(81166007)(478600001)(110136005)(2906002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2022 07:24:40.1352 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 95c98bc6-b28b-49e8-b7ec-08dae25b41e5 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT040.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5323 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752717082456639694?= X-GMAIL-MSGID: =?utf-8?q?1752717082456639694?= Add tdm support for amd platforms. Signed-off-by: Venkata Prasad Potturu --- sound/soc/amd/acp/acp-legacy-mach.c | 5 ++ sound/soc/amd/acp/acp-mach-common.c | 130 +++++++++++++++++++++++++--- sound/soc/amd/acp/acp-mach.h | 3 + sound/soc/amd/acp/acp-sof-mach.c | 6 ++ 4 files changed, 133 insertions(+), 11 deletions(-) diff --git a/sound/soc/amd/acp/acp-legacy-mach.c b/sound/soc/amd/acp/acp-legacy-mach.c index 1f4878ff7d37..d508792dba4f 100644 --- a/sound/soc/amd/acp/acp-legacy-mach.c +++ b/sound/soc/amd/acp/acp-legacy-mach.c @@ -27,6 +27,7 @@ static struct acp_card_drvdata rt5682_rt1019_data = { .hs_codec_id = RT5682, .amp_codec_id = RT1019, .dmic_codec_id = DMIC, + .tdm_mode = false, }; static struct acp_card_drvdata rt5682s_max_data = { @@ -36,6 +37,7 @@ static struct acp_card_drvdata rt5682s_max_data = { .hs_codec_id = RT5682S, .amp_codec_id = MAX98360A, .dmic_codec_id = DMIC, + .tdm_mode = false, }; static struct acp_card_drvdata rt5682s_rt1019_data = { @@ -45,6 +47,7 @@ static struct acp_card_drvdata rt5682s_rt1019_data = { .hs_codec_id = RT5682S, .amp_codec_id = RT1019, .dmic_codec_id = DMIC, + .tdm_mode = false, }; static struct acp_card_drvdata max_nau8825_data = { @@ -56,6 +59,7 @@ static struct acp_card_drvdata max_nau8825_data = { .dmic_codec_id = DMIC, .soc_mclk = true, .platform = REMBRANDT, + .tdm_mode = false, }; static struct acp_card_drvdata rt5682s_rt1019_rmb_data = { @@ -67,6 +71,7 @@ static struct acp_card_drvdata rt5682s_rt1019_rmb_data = { .dmic_codec_id = DMIC, .soc_mclk = true, .platform = REMBRANDT, + .tdm_mode = false, }; static const struct snd_kcontrol_new acp_controls[] = { diff --git a/sound/soc/amd/acp/acp-mach-common.c b/sound/soc/amd/acp/acp-mach-common.c index 748cbefa8252..73a27f02b52b 100644 --- a/sound/soc/amd/acp/acp-mach-common.c +++ b/sound/soc/amd/acp/acp-mach-common.c @@ -183,10 +183,15 @@ static int acp_card_rt5682x_hw_params(struct snd_pcm_substream *substream, int ret; unsigned int fmt; + if (drvdata->tdm_mode) + fmt = SND_SOC_DAIFMT_DSP_A; + else + fmt = SND_SOC_DAIFMT_I2S; + if (drvdata->soc_mclk) - fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBC_CFC; + fmt |= SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBC_CFC; else - fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBP_CFP; + fmt |= SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBP_CFP; ret = snd_soc_dai_set_fmt(cpu_dai, fmt); if (ret && ret != -ENOTSUPP) { @@ -200,6 +205,23 @@ static int acp_card_rt5682x_hw_params(struct snd_pcm_substream *substream, return ret; } + if (drvdata->tdm_mode) { + /** + * As codec supports slot 0 and slot 1 for playback and capture. + */ + ret = snd_soc_dai_set_tdm_slot(cpu_dai, 0x3, 0x3, 8, 16); + if (ret && ret != -ENOTSUPP) { + dev_err(rtd->dev, "set TDM slot err: %d\n", ret); + return ret; + } + + ret = snd_soc_dai_set_tdm_slot(codec_dai, 0x3, 0x3, 8, 16); + if (ret < 0) { + dev_warn(rtd->dev, "set TDM slot err:%d\n", ret); + return ret; + } + } + return 0; } @@ -364,10 +386,15 @@ static int acp_card_rt1019_hw_params(struct snd_pcm_substream *substream, if (drvdata->amp_codec_id != RT1019) return -EINVAL; + if (drvdata->tdm_mode) + fmt = SND_SOC_DAIFMT_DSP_A; + else + fmt = SND_SOC_DAIFMT_I2S; + if (drvdata->soc_mclk) - fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBC_CFC; + fmt |= SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBC_CFC; else - fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBP_CFP; + fmt |= SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBP_CFP; ret = snd_soc_dai_set_fmt(cpu_dai, fmt); if (ret && ret != -ENOTSUPP) { @@ -375,12 +402,27 @@ static int acp_card_rt1019_hw_params(struct snd_pcm_substream *substream, return ret; } + if (drvdata->tdm_mode) { + /** + * As codec supports slot 2 and slot 3 for playback. + */ + ret = snd_soc_dai_set_tdm_slot(cpu_dai, 0xC, 0, 8, 16); + if (ret && ret != -ENOTSUPP) { + dev_err(rtd->dev, "set TDM slot err: %d\n", ret); + return ret; + } + } for_each_rtd_codec_dais(rtd, i, codec_dai) { if (strcmp(codec_dai->name, "rt1019-aif")) continue; - ret = snd_soc_dai_set_pll(codec_dai, 0, RT1019_PLL_S_BCLK, - ch * format * srate, 256 * srate); + if (drvdata->tdm_mode) + ret = snd_soc_dai_set_pll(codec_dai, 0, RT1019_PLL_S_BCLK, + TDM_CHANNELS * format * srate, 256 * srate); + else + ret = snd_soc_dai_set_pll(codec_dai, 0, RT1019_PLL_S_BCLK, + ch * format * srate, 256 * srate); + if (ret < 0) return ret; @@ -388,8 +430,34 @@ static int acp_card_rt1019_hw_params(struct snd_pcm_substream *substream, 256 * srate, SND_SOC_CLOCK_IN); if (ret < 0) return ret; - } + if (drvdata->tdm_mode) { + ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_DSP_A + | SND_SOC_DAIFMT_NB_NF); + if (ret < 0) { + dev_err(rtd->card->dev, "Failed to set dai fmt: %d\n", ret); + return ret; + } + + /** + * As codec supports slot 2 for left channel playback. + */ + if (!strcmp(codec_dai->component->name, "i2c-10EC1019:00")) { + ret = snd_soc_dai_set_tdm_slot(codec_dai, 0x4, 0x4, 8, 16); + if (ret < 0) + break; + } + + /** + * As codec supports slot 3 for right channel playback. + */ + if (!strcmp(codec_dai->component->name, "i2c-10EC1019:01")) { + ret = snd_soc_dai_set_tdm_slot(codec_dai, 0x8, 0x8, 8, 16); + if (ret < 0) + break; + } + } + } return 0; } @@ -448,19 +516,38 @@ static int acp_card_maxim_hw_params(struct snd_pcm_substream *substream, { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); + struct snd_soc_card *card = rtd->card; + struct acp_card_drvdata *drvdata = card->drvdata; unsigned int fmt; int ret; + + if (drvdata->tdm_mode) + fmt = SND_SOC_DAIFMT_DSP_A; + else + fmt = SND_SOC_DAIFMT_I2S; + if (drvdata->soc_mclk) - fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBC_CFC; + fmt |= SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBC_CFC; else - fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBP_CFP; + fmt |= SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBP_CFP; ret = snd_soc_dai_set_fmt(cpu_dai, fmt); if (ret && ret != -ENOTSUPP) { dev_err(rtd->dev, "Failed to set dai fmt: %d\n", ret); return ret; } + + if (drvdata->tdm_mode) { + /** + * As codec supports slot 2 and slot 3 for playback. + */ + ret = snd_soc_dai_set_tdm_slot(cpu_dai, 0xC, 0, 8, 16); + if (ret && ret != -ENOTSUPP) { + dev_err(rtd->dev, "set TDM slot err: %d\n", ret); + return ret; + } + } return 0; } @@ -539,10 +626,15 @@ static int acp_nau8825_hw_params(struct snd_pcm_substream *substream, return ret; } + if (drvdata->tdm_mode) + fmt = SND_SOC_DAIFMT_DSP_A; + else + fmt = SND_SOC_DAIFMT_I2S; + if (drvdata->soc_mclk) - fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBC_CFC; + fmt |= SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBC_CFC; else - fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBP_CFP; + fmt |= SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBP_CFP; ret = snd_soc_dai_set_fmt(cpu_dai, fmt); if (ret && ret != -ENOTSUPP) { @@ -556,6 +648,22 @@ static int acp_nau8825_hw_params(struct snd_pcm_substream *substream, return ret; } + if (drvdata->tdm_mode) { + /** + * As codec supports slot 4 and slot 5 for playback and slot 6 for capture. + */ + ret = snd_soc_dai_set_tdm_slot(cpu_dai, 0x30, 0xC0, 8, 16); + if (ret && ret != -ENOTSUPP) { + dev_err(rtd->dev, "set TDM slot err: %d\n", ret); + return ret; + } + + ret = snd_soc_dai_set_tdm_slot(codec_dai, 0x40, 0x30, 8, 16); + if (ret < 0) { + dev_warn(rtd->dev, "set TDM slot err:%d\n", ret); + return ret; + } + } return ret; } diff --git a/sound/soc/amd/acp/acp-mach.h b/sound/soc/amd/acp/acp-mach.h index 20583ef902df..9f87439b3cfd 100644 --- a/sound/soc/amd/acp/acp-mach.h +++ b/sound/soc/amd/acp/acp-mach.h @@ -18,6 +18,8 @@ #include #include +#define TDM_CHANNELS 8 + enum be_id { HEADSET_BE_ID = 0, AMP_BE_ID, @@ -58,6 +60,7 @@ struct acp_card_drvdata { struct clk *wclk; struct clk *bclk; bool soc_mclk; + bool tdm_mode; }; int acp_sofdsp_dai_links_create(struct snd_soc_card *card); diff --git a/sound/soc/amd/acp/acp-sof-mach.c b/sound/soc/amd/acp/acp-sof-mach.c index f19f064a7527..f3ba22a25962 100644 --- a/sound/soc/amd/acp/acp-sof-mach.c +++ b/sound/soc/amd/acp/acp-sof-mach.c @@ -27,6 +27,7 @@ static struct acp_card_drvdata sof_rt5682_rt1019_data = { .hs_codec_id = RT5682, .amp_codec_id = RT1019, .dmic_codec_id = DMIC, + .tdm_mode = false, }; static struct acp_card_drvdata sof_rt5682_max_data = { @@ -36,6 +37,7 @@ static struct acp_card_drvdata sof_rt5682_max_data = { .hs_codec_id = RT5682, .amp_codec_id = MAX98360A, .dmic_codec_id = DMIC, + .tdm_mode = false, }; static struct acp_card_drvdata sof_rt5682s_rt1019_data = { @@ -45,6 +47,7 @@ static struct acp_card_drvdata sof_rt5682s_rt1019_data = { .hs_codec_id = RT5682S, .amp_codec_id = RT1019, .dmic_codec_id = DMIC, + .tdm_mode = false, }; static struct acp_card_drvdata sof_rt5682s_max_data = { @@ -54,6 +57,7 @@ static struct acp_card_drvdata sof_rt5682s_max_data = { .hs_codec_id = RT5682S, .amp_codec_id = MAX98360A, .dmic_codec_id = DMIC, + .tdm_mode = false, }; static struct acp_card_drvdata sof_nau8825_data = { @@ -64,6 +68,7 @@ static struct acp_card_drvdata sof_nau8825_data = { .amp_codec_id = MAX98360A, .dmic_codec_id = DMIC, .soc_mclk = true, + .tdm_mode = false, }; static struct acp_card_drvdata sof_rt5682s_hs_rt1019_data = { @@ -74,6 +79,7 @@ static struct acp_card_drvdata sof_rt5682s_hs_rt1019_data = { .amp_codec_id = RT1019, .dmic_codec_id = DMIC, .soc_mclk = true, + .tdm_mode = false, }; static const struct snd_kcontrol_new acp_controls[] = { From patchwork Tue Dec 20 07:27:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Venkata Prasad Potturu X-Patchwork-Id: 34962 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp2822091wrn; Mon, 19 Dec 2022 23:29:14 -0800 (PST) X-Google-Smtp-Source: AA0mqf40buuRfSBB5BY7Gd+7AsZmaZgLL0Ycx5BogIOB4o5TMtr10GxSMwXtg3XlLilGGSkOGax6 X-Received: by 2002:a05:6402:450a:b0:45c:835b:ac67 with SMTP id ez10-20020a056402450a00b0045c835bac67mr39188224edb.34.1671521354267; Mon, 19 Dec 2022 23:29:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1671521354; cv=pass; d=google.com; s=arc-20160816; b=hOitz1EeOa5OqX4nyCE8V2XFQrXgyg/qGa5QMq8HaY/B4FvcSsSxrtU4OcDlrfIQy5 8kbFlIfZRwLvfLlmWEDhiLp3e4MY4WYHfMu6teRv9Rpo5K59wT6VxZgy348tOXVhAYaS hplmeuDux/u1WhvtRyQS/Gem1FZaM8Jhv8bJRTHSAO6HQgrEfpHdbU7DbKSqwHPCcWqn ziuluhaXJ3aRRjRAtnwuIQNUoSETCRZSCT/C5qo1TZ9vL5PQUivN0SNYFZzW7AUR8VEA 0isBQDbZjrYPuWWdG4Zb3HhR31aSfwPockshSTEdK5UvVt2clMjvLhu6VGO0vCf0/mX6 ViTQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ykCI5N8keBqShLGS5+VKgUK3O6kAbfgv32T0VSJUBok=; b=r4dF6iRaDnJ0DGK4q9C0dZLHjbSaZv6k8OdjY54MQwuZaifzXLBo+8ckeMkuF/6R5c A7IvpV+hzzp+/9kwRFRbQqNRJfusUAH+IkxiAvdVw7f2t3SskdtOEFgxlsgOEF/4LPuw 2Rf763TXD4d4ivid+CLUl66Uu0zLRvLUDJsB7Dbf8QB1rRku8yUoUcOWKJqx1NofJxGE qTzkN8XWmiENl3+aWBJTfKAzY36i3c2LLk9b08hXCIaKVqHI3NhQn4bBC6hH5aVUy3+I 6or9HtelRa2M2oL+wDcpvkdlYkm5iZbVoRSbVo/xLbmV15xHBndXWif3XPPuIXh+ADxR 1ceA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=F6XLg7dJ; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ga19-20020a1709070c1300b007c4ebc96265si13041254ejc.55.2022.12.19.23.28.51; Mon, 19 Dec 2022 23:29:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=F6XLg7dJ; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233319AbiLTHYL (ORCPT + 99 others); Tue, 20 Dec 2022 02:24:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233300AbiLTHYI (ORCPT ); Tue, 20 Dec 2022 02:24:08 -0500 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2071.outbound.protection.outlook.com [40.107.223.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0B0A11C28 for ; Mon, 19 Dec 2022 23:23:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JTaJYYZ27ltCVsPCUlY09b3Kjo9cgwc59uObIdwLfSZyCY38SpbhN+OIYW15e2kwJTCe/wJbxvT9pS+Ifafl94Z2Sxgc6WNGUYycZi3O6T+xpULyrF00epf6lhWJaxtIA+3HyazhQh8+beIrEqNWzTXckSFYh5DKaz3Pgnz4G9c7AufjwBsdbPySml29nYsyHaQzs5J1SIrAQD+bzApKuCj60S2ZpE3v9dYt0qyW1CKUiQ2PEWgXea7+csL1jn+FoDSCQ/P3EwbUj4tjBjeRIucjRpDgrHDAZuMP0aOhP9U95tXQFcr8EWwXEM+EdiET0goco1NczDj5XLKr6O52sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=ykCI5N8keBqShLGS5+VKgUK3O6kAbfgv32T0VSJUBok=; b=StPfj0eZvZxCBfTSKW+KvtBdPTcahryxVLeNGUL5/YAlJBjUv+imERf61gSfMvsZF5Tr+QfhePlhFLaq+9OJWck4q4pclwmAafK3njV6VhPb+YTryWOLX2M1Ti+v8n1rFGs1SzkbV8yntZhEHSz1zUvtqvI0pQx5UgMVQx++4HkVhX8yiqImJTjr8r53o0sEHCsPjFo0y2eiT+WcHLJ0yy7Q2ipBkfc/t4THX80/3BcBeZnUU5kB9bOkc7APlubTUk6uZAyYie3pMugmFLfO1HLaKRgkxZ1Hyj1Hhs5c2cIZ2I93QxDYf9pTCDElWdowTu3xzLM4T8CQzE8SuRAL+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ykCI5N8keBqShLGS5+VKgUK3O6kAbfgv32T0VSJUBok=; b=F6XLg7dJu8oj3iovNmVFEQ9SQg3OEf0tOIZfg6hoYD5o7Egkzll9fFOboW+z5O8DlcZJqyNQ6KS5z/fddTU83xKUyU/uXWcMqlK/Ahb4BqtYZmnpSHwGJiH5gnkHEGX4sDA2d4IXvRVTD5crwdfgEF5nZeTUNOkbeaif2ieHtYc= Received: from DS7PR03CA0147.namprd03.prod.outlook.com (2603:10b6:5:3b4::32) by IA0PR12MB8349.namprd12.prod.outlook.com (2603:10b6:208:407::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.16; Tue, 20 Dec 2022 07:23:55 +0000 Received: from DM6NAM11FT110.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b4:cafe::32) by DS7PR03CA0147.outlook.office365.com (2603:10b6:5:3b4::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.21 via Frontend Transport; Tue, 20 Dec 2022 07:23:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by DM6NAM11FT110.mail.protection.outlook.com (10.13.173.205) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5924.16 via Frontend Transport; Tue, 20 Dec 2022 07:23:54 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 20 Dec 2022 01:23:51 -0600 Received: from amd-System-Product-Name.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Tue, 20 Dec 2022 01:23:42 -0600 From: Venkata Prasad Potturu To: , CC: , , , , , Venkata Prasad Potturu , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Ajit Kumar Pandey , V sujith kumar Reddy , Akihiko Odaki , Jia-Ju Bai , ye xingchen , open list Subject: [PATCH 5/5] ASoC: amd: acp: Enable tdm support for skyrim platforms Date: Tue, 20 Dec 2022 12:57:05 +0530 Message-ID: <20221220072705.1456908-6-venkataprasad.potturu@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221220072705.1456908-1-venkataprasad.potturu@amd.com> References: <20221220072705.1456908-1-venkataprasad.potturu@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT110:EE_|IA0PR12MB8349:EE_ X-MS-Office365-Filtering-Correlation-Id: 381d2692-0ef9-4c88-d38c-08dae25b26a5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fDa7D/DPwEg+b26SyEwH7YaifUGfbkZrhkN0Fk2kF2B6PcKK4stI/ckMwS00Pi8F4qLgdXY3JaVlG6+f/qrbnh+yuIwld2I2Omr6+WWxHppoNHzJHzfwuTTlgxghHsEyBCBoK4ghKz20ciNhmh/i0kE36kANqZEJ6b3aPzrKbIWy26yrs6uwv4Tsq6yp7ms/RQHMEK2P01n59PpzMppkUKfXyvxchqvospaR6My1iIBoaIC5ii1eVnndMMgPc2tAf4Tr+PU84GiLHNHezho7FvuLRArGpE4Sxnvb0n4mM5tdWcggITz2dUnuubk3odpjxHolNzAdknxwP7PYUqXMUYwFdalul6uZwoHRErSIOdSSfsndH18TD3beVI5WmXZJfbEauwwPujMQ2uMgmAs8sVrqdpTcNN/D0P+gxhh511KzbP2PRh6OJndBMhT0WpmHJcOpenFQmO+rQCJHOLBckaR7URezJrM/MU2Ffwqs0gByVnaI6bP6F/qgmqbV8tEUHeOaGP7ps4t3gqkS1sDDM42kzgtvHQAxABCKfJnllKYQYtLCiuLQMidTY4CgrX68EHPJJKpHXbK0LDbteJ0nuBpwsUOncNnzJCl2v+Wl7S+EL2Rr/6ZopxFIXmjeIA5m2KN+Ah3wa/Omd9UHIfX1HlAhNHbJ5kkjNMm9vTcEV6ZJOBXmfZzn8OtMBF0pgyvjDJEjQGrdhUc3jdcZEnQNqtPXqGOlzkgD8WnyBjYshyE= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(346002)(39860400002)(136003)(396003)(376002)(451199015)(46966006)(40470700004)(36840700001)(5660300002)(4326008)(8676002)(110136005)(54906003)(70586007)(70206006)(2906002)(6666004)(478600001)(26005)(186003)(7696005)(41300700001)(47076005)(426003)(40480700001)(86362001)(82310400005)(36860700001)(2616005)(336012)(1076003)(36756003)(82740400003)(81166007)(356005)(8936002)(316002)(40460700003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2022 07:23:54.3868 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 381d2692-0ef9-4c88-d38c-08dae25b26a5 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT110.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8349 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752717176076864444?= X-GMAIL-MSGID: =?utf-8?q?1752717176076864444?= Enable tdm support for skyrim platform using dmi quirks. Signed-off-by: Venkata Prasad Potturu --- sound/soc/amd/acp/acp-legacy-mach.c | 8 ++++++++ sound/soc/amd/acp/acp-mach-common.c | 14 ++++++++++++++ sound/soc/amd/acp/acp-mach.h | 1 + sound/soc/amd/acp/acp-sof-mach.c | 8 ++++++++ 4 files changed, 31 insertions(+) diff --git a/sound/soc/amd/acp/acp-legacy-mach.c b/sound/soc/amd/acp/acp-legacy-mach.c index d508792dba4f..04958a884cfd 100644 --- a/sound/soc/amd/acp/acp-legacy-mach.c +++ b/sound/soc/amd/acp/acp-legacy-mach.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include "acp-mach.h" @@ -95,6 +96,8 @@ static int acp_asoc_probe(struct platform_device *pdev) { struct snd_soc_card *card = NULL; struct device *dev = &pdev->dev; + const struct dmi_system_id *dmi_id; + struct acp_card_drvdata *acp_drvdata; int ret; if (!pdev->id_entry) @@ -113,6 +116,11 @@ static int acp_asoc_probe(struct platform_device *pdev) card->num_controls = ARRAY_SIZE(acp_controls); card->drvdata = (struct acp_card_drvdata *)pdev->id_entry->driver_data; + acp_drvdata = card->drvdata; + dmi_id = dmi_first_match(acp_quirk_table); + if (dmi_id && dmi_id->driver_data) + acp_drvdata->tdm_mode = dmi_id->driver_data; + acp_legacy_dai_links_create(card); ret = devm_snd_soc_register_card(&pdev->dev, card); diff --git a/sound/soc/amd/acp/acp-mach-common.c b/sound/soc/amd/acp/acp-mach-common.c index 73a27f02b52b..bde3ea3377ef 100644 --- a/sound/soc/amd/acp/acp-mach-common.c +++ b/sound/soc/amd/acp/acp-mach-common.c @@ -32,6 +32,20 @@ #define DUAL_CHANNEL 2 #define FOUR_CHANNEL 4 +#define TDM_MODE_ENABLE 1 + +const struct dmi_system_id acp_quirk_table[] = { + { + /* Google skyrim proto-0 */ + .matches = { + DMI_EXACT_MATCH(DMI_PRODUCT_FAMILY, "Google_Skyrim"), + }, + .driver_data = (void *)TDM_MODE_ENABLE, + }, + {} +}; +EXPORT_SYMBOL_GPL(acp_quirk_table); + static struct snd_soc_jack pco_jack; static const unsigned int channels[] = { diff --git a/sound/soc/amd/acp/acp-mach.h b/sound/soc/amd/acp/acp-mach.h index 9f87439b3cfd..165f407697c0 100644 --- a/sound/soc/amd/acp/acp-mach.h +++ b/sound/soc/amd/acp/acp-mach.h @@ -65,5 +65,6 @@ struct acp_card_drvdata { int acp_sofdsp_dai_links_create(struct snd_soc_card *card); int acp_legacy_dai_links_create(struct snd_soc_card *card); +extern const struct dmi_system_id acp_quirk_table[]; #endif diff --git a/sound/soc/amd/acp/acp-sof-mach.c b/sound/soc/amd/acp/acp-sof-mach.c index f3ba22a25962..e5b3a0d5363a 100644 --- a/sound/soc/amd/acp/acp-sof-mach.c +++ b/sound/soc/amd/acp/acp-sof-mach.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include "acp-mach.h" @@ -102,6 +103,8 @@ static int acp_sof_probe(struct platform_device *pdev) { struct snd_soc_card *card = NULL; struct device *dev = &pdev->dev; + const struct dmi_system_id *dmi_id; + struct acp_card_drvdata *acp_drvdata; int ret; if (!pdev->id_entry) @@ -120,6 +123,11 @@ static int acp_sof_probe(struct platform_device *pdev) card->num_controls = ARRAY_SIZE(acp_controls); card->drvdata = (struct acp_card_drvdata *)pdev->id_entry->driver_data; + acp_drvdata = card->drvdata; + dmi_id = dmi_first_match(acp_quirk_table); + if (dmi_id && dmi_id->driver_data) + acp_drvdata->tdm_mode = dmi_id->driver_data; + acp_sofdsp_dai_links_create(card); ret = devm_snd_soc_register_card(&pdev->dev, card);