From patchwork Sat Oct 21 14:50:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 156460 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp331744vqx; Sat, 21 Oct 2023 07:52:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE416aXxqDc4Y7/NjXLZ0bHwhiTwJKMoX+bh0NOTcALwVo5U6j0b1sNNOwmZeWHvmwlfoZb X-Received: by 2002:a17:902:ecc3:b0:1bc:4415:3c1 with SMTP id a3-20020a170902ecc300b001bc441503c1mr12566610plh.7.1697899928139; Sat, 21 Oct 2023 07:52:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697899928; cv=pass; d=google.com; s=arc-20160816; b=WrH65+Sg78iuGnW4IKvZlvMoYiD1jPLJwP4ED13xUPWRELZcscU2fAzAVIX6y7fsgI N+6LZAX2Xx+BAHINm95/NPgbKgqfC9uG95yHLy3LU0DE1+oM3cn85CjC8XNzMCXpMbHk 7q4FJj5B8QZVSTuWsuE29qUPtBmP1yd7kRO94biRJv2cWFuSOnwcRl7FBhCvS5NAbcAi getQPXX7WpgT4Bbsrg2bJs0D1Msn0yC4ErTJdkyQrRP1HkcyeUyZXyZBD+yglGN45ehN RVIHJAFMo6OoRqcYECrTwLEoAKR9NJ6GfhA7XPHa6FnFIFYmr81Gaax8FFpMgKQFuRvY pS1w== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=AThVajZwDBtQIvZMoGwwZk4auW5IkTuQUHDWO3OdQgs=; fh=sbwYQE2UVSGwqzg0PLjWS8FdQzZ/mEjlFpwqoM1ACOc=; b=VWJ74269UQBGKi19iF8LetcQGqBKNmibxcxXAT0wUgOFhSf6W6+VZMsD37kQrww6Bw Q5jVxiN9CPsshy3jNd0YJVoVi/KrrNE+5MEG884iqDEKbaaxKt4A7XkzB9oA/bAs1ZQv +D1vbZYdC53o8uY1sR7CfpMqZvXfRt8e+7yQN5dJF+0vwIP037QzMowXVAOlKtoPcoKn 4QX5HoUA/92iXwQEHHD9KrjVeAMTu6gv/4H59Jkhd1uK+85VNfqs274qYhqwl2/jC54l s8BclmmEHc6Gtpn+tj1yAwd7GH1HVZVOg97ckVmQmpU0ocJJN7tBEsB5pgpAtSDA+qUd CFjA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=M41KXH2+; 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::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id c9-20020a170902c1c900b001bbaa5e95fdsi3440926plc.102.2023.10.21.07.52.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Oct 2023 07:52:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=M41KXH2+; 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::3:4 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 8327B80D1DC9; Sat, 21 Oct 2023 07:51:57 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231436AbjJUOve (ORCPT + 26 others); Sat, 21 Oct 2023 10:51:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231280AbjJUOvc (ORCPT ); Sat, 21 Oct 2023 10:51:32 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2076.outbound.protection.outlook.com [40.107.244.76]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C834DA for ; Sat, 21 Oct 2023 07:51:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kp/7gLWZp0IGZhf7xnHyh+To7RAqOt/P+jSn54cyC7LKaRWQ4iTnM50Sat5J0yIoEbv9qv8d3RLva+jGO1927MdRfvwnGRTCmZbxJ8KWah4vxIDrt+4qs6NCGcuNFuMPBmSWq+kU21pftfIygom2b86SsSoJ7iUgChRitBN7sHwepT2VwY0hgtFcdga2xtdIClo+2c7qYSjeXAodjmsX69pqGfgCMeStrN00agXgN7nE9bvqH/N9TLBH4vITHbCFZ55HqciUYW6TCmRkCIDtMvYbbHjt4WgWzn4xHBh+oy793h+OKOMieXIIdc515xby7FXDR3UKgpX0/iHzJXojxQ== 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=AThVajZwDBtQIvZMoGwwZk4auW5IkTuQUHDWO3OdQgs=; b=ko1afCyvjCN/kgX/ZPts5wP1X0jxpuhAn4eKNU/TEvVxLi/PXoo+qN9OyjLtKR416jD5seFsi52iDJ9JVMXWxzwlsx2d9GxXGnKnsiciOXkq0GdMAg3xjsWKLc53hY/rYhYkHrVXPQOxcRJ6Sw0ocoNvGXeGWziqCzPPVmcXLQCAVMfOyp0y+hWh5JLifRk6Tm8ZBiPzxXidNK2QtvU0xkvpKyCBaFTbypyTGE6mvZrdy/OXujMEk8PObMqwjJr1DQICi+j7+4csjPV+EPYnqhAzxt46uV5YjfkbHOfM5WQLbS4wC70ysA3aG8xmd4RpbK6yGbWB2LDMCqV2eP+Whg== 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=AThVajZwDBtQIvZMoGwwZk4auW5IkTuQUHDWO3OdQgs=; b=M41KXH2+UAuhaPxPBNsgf+aG00O689kp/O/5GJZ6yA1/nJrZXipAuL7muFP8+yBdv4DusGB7jLcK07dyaEBd3iwd1fSlCmRXRzRLdV2yaXe24ZqlEmfECKO47XFVJeM4THkUVsVaASdZql3ln3HnytlZwqb5KIt2T7nzZcT43w4= Received: from PH0PR07CA0072.namprd07.prod.outlook.com (2603:10b6:510:f::17) by PH7PR12MB6668.namprd12.prod.outlook.com (2603:10b6:510:1aa::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.26; Sat, 21 Oct 2023 14:51:23 +0000 Received: from SN1PEPF0002529E.namprd05.prod.outlook.com (2603:10b6:510:f:cafe::e4) by PH0PR07CA0072.outlook.office365.com (2603:10b6:510:f::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.29 via Frontend Transport; Sat, 21 Oct 2023 14:51:23 +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 SN1PEPF0002529E.mail.protection.outlook.com (10.167.242.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6907.20 via Frontend Transport; Sat, 21 Oct 2023 14:51:23 +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.2507.27; Sat, 21 Oct 2023 09:51:22 -0500 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.2507.27; Sat, 21 Oct 2023 09:51:22 -0500 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Sat, 21 Oct 2023 09:51:16 -0500 From: Syed Saba Kareem To: , CC: , , , , , , , , Syed Saba Kareem , Liam Girdwood , "Jaroslav Kysela" , Takashi Iwai , Kuninori Morimoto , V Sujith Kumar Reddy , Claudiu Beznea , Jarkko Nikula , Nicolas Ferre , =?utf-8?q?Uwe_Kleine-K=C3=B6ni?= =?utf-8?q?g?= , Yang Li , "Dan Carpenter" , open list Subject: [PATCH 01/13] ASoC: amd: acp: Add acp6.3 pci legacy driver support Date: Sat, 21 Oct 2023 20:20:42 +0530 Message-ID: <20231021145110.478744-1-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002529E:EE_|PH7PR12MB6668:EE_ X-MS-Office365-Filtering-Correlation-Id: 65264f71-fd19-4443-2bf2-08dbd24531b4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OOAkuACfBmvDOQzjUcmABJjtN/PWBsp0fXFzHZS3h2v5HGNYTqdIg3iEIDTZAvAleC+MmybviA2THpAva1vzTj6X0lAOvW2o0nDgXdsBMjEriPSLj/McwvXTkshC17NGXXRJZ7SYWmBnVjuWmtIt2MgCaC+BsxxY4vUwoIg6/xtOuxTwdPJwAiZoG1L9Jv6ZN+79uUCeY3pshH5JZFjaRdv4tM9OOL2n57ziWmwT/qBJPscAvr1Ztfdk+GMEpi8kf/0gSdYOE775S53FlaEnZqqpASOJDGwTOHFMSTz2vnhmyCMeL/XL+ASgjoMgHIQrOtdh3J21UHZAkxxxKO0f6gGJVm1qc2oyqnZaquLNPQMab1tOrLw7b70unnCpIa842/lelQFSpvn4Z0+9NT5FuWZXZlUC8k7bpQk5hiC0ZW222LvqrKC0J0W8gTQ68yTxudRX6prrVqwhzPThG5rdeYvHl9n+1hb3UwggFMTyWtXTJxB/U9J99Mq5/8b3ysPStJoeWDtwBRnotYAimrkEwknVTNF298YYGd9jPq3NGiL4FLwoto2t8k273P6gu2ShdiOqWYrwf/CYLj16TPqjZIdvufQQHVw30eatyR4yawJQrX+p8g9Urc0pQ1fRo9EB8qL8vFZeWdZQjdPPTpz3nmHbIPgAF3jQHOQFzIAIWSXCVCukwpVUdJ9c1PdE6cKI24MMfwzkxAKU8Gj1ZrtwqUHJZMlkP97ZK73rLdPRexGq2Gie5AQUqCB8T4L7R0PBM2XHcWMe33QqVMwT1JRTbw== 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:(13230031)(4636009)(39860400002)(376002)(346002)(136003)(396003)(230922051799003)(186009)(451199024)(1800799009)(64100799003)(82310400011)(46966006)(40470700004)(36840700001)(356005)(36756003)(336012)(81166007)(86362001)(40460700003)(7696005)(478600001)(1076003)(30864003)(40480700001)(82740400003)(8676002)(2906002)(41300700001)(6666004)(4326008)(8936002)(5660300002)(426003)(316002)(26005)(110136005)(2616005)(70586007)(36860700001)(83380400001)(7416002)(54906003)(47076005)(70206006)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2023 14:51:23.1056 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 65264f71-fd19-4443-2bf2-08dbd24531b4 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: SN1PEPF0002529E.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6668 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Sat, 21 Oct 2023 07:51:57 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780377115126755080 X-GMAIL-MSGID: 1780377115126755080 Add pci legacy driver support and create platform driver for acp6.3 based platforms. Signed-off-by: Syed Saba Kareem --- sound/soc/amd/acp/acp-legacy-common.c | 4 + sound/soc/amd/acp/acp-pci.c | 4 + sound/soc/amd/acp/acp63.c | 314 ++++++++++++++++++++++++++ sound/soc/amd/acp/amd.h | 4 + 4 files changed, 326 insertions(+) create mode 100644 sound/soc/amd/acp/acp63.c diff --git a/sound/soc/amd/acp/acp-legacy-common.c b/sound/soc/amd/acp/acp-legacy-common.c index 217b4c89b975..e16ef94e6336 100644 --- a/sound/soc/amd/acp/acp-legacy-common.c +++ b/sound/soc/amd/acp/acp-legacy-common.c @@ -260,6 +260,10 @@ static int acp_power_on(struct acp_chip_info *chip) acp_pgfsm_stat_reg = ACP6X_PGFSM_STATUS; acp_pgfsm_ctrl_reg = ACP6X_PGFSM_CONTROL; break; + case ACP63_DEV: + acp_pgfsm_stat_reg = ACP63_PGFSM_STATUS; + acp_pgfsm_ctrl_reg = ACP63_PGFSM_CONTROL; + break; default: return -EINVAL; } diff --git a/sound/soc/amd/acp/acp-pci.c b/sound/soc/amd/acp/acp-pci.c index a32c14a109b7..d7fc4a0e9245 100644 --- a/sound/soc/amd/acp/acp-pci.c +++ b/sound/soc/amd/acp/acp-pci.c @@ -87,6 +87,10 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id chip->name = "acp_asoc_rembrandt"; chip->acp_rev = ACP6X_DEV; break; + case 0x63: + chip->name = "acp_asoc_acp63"; + chip->acp_rev = ACP63_DEV; + break; default: dev_err(dev, "Unsupported device revision:0x%x\n", pci->revision); ret = -EINVAL; diff --git a/sound/soc/amd/acp/acp63.c b/sound/soc/amd/acp/acp63.c new file mode 100644 index 000000000000..f94348ad863d --- /dev/null +++ b/sound/soc/amd/acp/acp63.c @@ -0,0 +1,314 @@ +// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) +// +// This file is provided under a dual BSD/GPLv2 license. When using or +// redistributing this file, you may do so under either license. +// +// Copyright(c) 2023 Advanced Micro Devices, Inc. +// +// Authors: Syed Saba kareem +/* + * Hardware interface for ACP6.3 block + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "amd.h" + +#define DRV_NAME "acp_asoc_acp63" + +#define CLK_PLL_PWR_REQ_N0 0X0006C2C0 +#define CLK_SPLL_FIELD_2_N0 0X0006C114 +#define CLK_PLL_REQ_N0 0X0006C0DC +#define CLK_DFSBYPASS_CONTR 0X0006C2C8 +#define CLK_DFS_CNTL_N0 0X0006C1A4 + +#define PLL_AUTO_STOP_REQ BIT(4) +#define PLL_AUTO_START_REQ BIT(0) +#define PLL_FRANCE_EN BIT(4) +#define EXIT_DPF_BYPASS_0 BIT(16) +#define EXIT_DPF_BYPASS_1 BIT(17) +#define CLK0_DIVIDER 0X30 + +union clk_pll_req_no { + struct { + u32 fb_mult_int : 9; + u32 reserved : 3; + u32 pll_spine_div : 4; + u32 gb_mult_frac : 16; + } bitfields, bits; + u32 clk_pll_req_no_reg; +}; + +static struct acp_resource rsrc = { + .offset = 0, + .no_of_ctrls = 2, + .irqp_used = 1, + .soc_mclk = true, + .irq_reg_offset = 0x1a00, + .i2s_pin_cfg_offset = 0x1440, + .i2s_mode = 0x0a, + .scratch_reg_offset = 0x12800, + .sram_pte_offset = 0x03802800, +}; + +static struct snd_soc_acpi_mach snd_soc_acpi_amd_acp63_acp_machines[] = { + { + .id = "AMDI0052", + .drv_name = "acp63-acp", + }, + {}, +}; + +static struct snd_soc_dai_driver acp63_dai[] = { +{ + .name = "acp-i2s-sp", + .id = I2S_SP_INSTANCE, + .playback = { + .stream_name = "I2S SP Playback", + .rates = SNDRV_PCM_RATE_8000_96000, + .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S8 | + SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S32_LE, + .channels_min = 2, + .channels_max = 8, + .rate_min = 8000, + .rate_max = 96000, + }, + .capture = { + .stream_name = "I2S SP Capture", + .rates = SNDRV_PCM_RATE_8000_48000, + .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S8 | + SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S32_LE, + .channels_min = 2, + .channels_max = 2, + .rate_min = 8000, + .rate_max = 48000, + }, + .ops = &asoc_acp_cpu_dai_ops, +}, +{ + .name = "acp-i2s-bt", + .id = I2S_BT_INSTANCE, + .playback = { + .stream_name = "I2S BT Playback", + .rates = SNDRV_PCM_RATE_8000_96000, + .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S8 | + SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S32_LE, + .channels_min = 2, + .channels_max = 8, + .rate_min = 8000, + .rate_max = 96000, + }, + .capture = { + .stream_name = "I2S BT Capture", + .rates = SNDRV_PCM_RATE_8000_48000, + .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S8 | + SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S32_LE, + .channels_min = 2, + .channels_max = 2, + .rate_min = 8000, + .rate_max = 48000, + }, + .ops = &asoc_acp_cpu_dai_ops, +}, +{ + .name = "acp-i2s-hs", + .id = I2S_HS_INSTANCE, + .playback = { + .stream_name = "I2S HS Playback", + .rates = SNDRV_PCM_RATE_8000_96000, + .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S8 | + SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S32_LE, + .channels_min = 2, + .channels_max = 8, + .rate_min = 8000, + .rate_max = 96000, + }, + .capture = { + .stream_name = "I2S HS Capture", + .rates = SNDRV_PCM_RATE_8000_48000, + .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S8 | + SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S32_LE, + .channels_min = 2, + .channels_max = 8, + .rate_min = 8000, + .rate_max = 48000, + }, + .ops = &asoc_acp_cpu_dai_ops, +}, +{ + .name = "acp-pdm-dmic", + .id = DMIC_INSTANCE, + .capture = { + .rates = SNDRV_PCM_RATE_8000_48000, + .formats = SNDRV_PCM_FMTBIT_S32_LE, + .channels_min = 2, + .channels_max = 2, + .rate_min = 8000, + .rate_max = 48000, + }, + .ops = &acp_dmic_dai_ops, +}, +}; + +static int acp63_i2s_master_clock_generate(struct acp_dev_data *adata) +{ + u32 data; + union clk_pll_req_no clk_pll; + struct pci_dev *smn_dev; + + smn_dev = pci_get_device(PCI_VENDOR_ID_AMD, 0x14E8, NULL); + if (!smn_dev) + return -ENODEV; + + /* Clk5 pll register values to get mclk as 196.6MHz*/ + clk_pll.bits.fb_mult_int = 0x31; + clk_pll.bits.pll_spine_div = 0; + clk_pll.bits.gb_mult_frac = 0x26E9; + + data = smn_read(smn_dev, CLK_PLL_PWR_REQ_N0); + smn_write(smn_dev, CLK_PLL_PWR_REQ_N0, data | PLL_AUTO_STOP_REQ); + + data = smn_read(smn_dev, CLK_SPLL_FIELD_2_N0); + if (data & PLL_FRANCE_EN) + smn_write(smn_dev, CLK_SPLL_FIELD_2_N0, data | PLL_FRANCE_EN); + + smn_write(smn_dev, CLK_PLL_REQ_N0, clk_pll.clk_pll_req_no_reg); + + data = smn_read(smn_dev, CLK_PLL_PWR_REQ_N0); + smn_write(smn_dev, CLK_PLL_PWR_REQ_N0, data | PLL_AUTO_START_REQ); + + data = smn_read(smn_dev, CLK_DFSBYPASS_CONTR); + smn_write(smn_dev, CLK_DFSBYPASS_CONTR, data | EXIT_DPF_BYPASS_0); + smn_write(smn_dev, CLK_DFSBYPASS_CONTR, data | EXIT_DPF_BYPASS_1); + + smn_write(smn_dev, CLK_DFS_CNTL_N0, CLK0_DIVIDER); + return 0; +} + +static int acp63_audio_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct acp_chip_info *chip; + struct acp_dev_data *adata; + struct resource *res; + int ret; + + chip = dev_get_platdata(&pdev->dev); + if (!chip || !chip->base) { + dev_err(&pdev->dev, "ACP chip data is NULL\n"); + return -ENODEV; + } + + if (chip->acp_rev != ACP63_DEV) { + dev_err(&pdev->dev, "Un-supported ACP Revision %d\n", chip->acp_rev); + return -ENODEV; + } + + adata = devm_kzalloc(dev, sizeof(struct acp_dev_data), GFP_KERNEL); + if (!adata) + return -ENOMEM; + + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "acp_mem"); + if (!res) { + dev_err(&pdev->dev, "IORESOURCE_MEM FAILED\n"); + return -ENODEV; + } + + adata->acp_base = devm_ioremap(&pdev->dev, res->start, resource_size(res)); + if (!adata->acp_base) + return -ENOMEM; + + res = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "acp_dai_irq"); + if (!res) { + dev_err(&pdev->dev, "IORESOURCE_IRQ FAILED\n"); + return -ENODEV; + } + + adata->i2s_irq = res->start; + adata->dev = dev; + adata->dai_driver = acp63_dai; + adata->num_dai = ARRAY_SIZE(acp63_dai); + adata->rsrc = &rsrc; + adata->machines = snd_soc_acpi_amd_acp63_acp_machines; + acp_machine_select(adata); + dev_set_drvdata(dev, adata); + ret = acp63_i2s_master_clock_generate(adata); + if (ret) + return ret; + + acp_enable_interrupts(adata); + acp_platform_register(dev); + pm_runtime_set_autosuspend_delay(&pdev->dev, ACP_SUSPEND_DELAY_MS); + pm_runtime_use_autosuspend(&pdev->dev); + pm_runtime_mark_last_busy(&pdev->dev); + pm_runtime_set_active(&pdev->dev); + pm_runtime_enable(&pdev->dev); + return 0; +} + +static void acp63_audio_remove(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct acp_dev_data *adata = dev_get_drvdata(dev); + + acp_disable_interrupts(adata); + acp_platform_unregister(dev); + pm_runtime_disable(&pdev->dev); +} + +static int __maybe_unused acp63_pcm_resume(struct device *dev) +{ + struct acp_dev_data *adata = dev_get_drvdata(dev); + struct acp_stream *stream; + struct snd_pcm_substream *substream; + snd_pcm_uframes_t buf_in_frames; + u64 buf_size; + + acp63_i2s_master_clock_generate(adata); + spin_lock(&adata->acp_lock); + list_for_each_entry(stream, &adata->stream_list, list) { + if (stream) { + substream = stream->substream; + if (substream && substream->runtime) { + buf_in_frames = (substream->runtime->buffer_size); + buf_size = frames_to_bytes(substream->runtime, buf_in_frames); + config_pte_for_stream(adata, stream); + config_acp_dma(adata, stream, buf_size); + if (stream->dai_id) + restore_acp_i2s_params(substream, adata, stream); + else + restore_acp_pdm_params(substream, adata); + } + } + } + spin_unlock(&adata->acp_lock); + return 0; +} + +static const struct dev_pm_ops acp63_dma_pm_ops = { + SET_SYSTEM_SLEEP_PM_OPS(NULL, acp63_pcm_resume) +}; + +static struct platform_driver acp63_driver = { + .probe = acp63_audio_probe, + .remove_new = acp63_audio_remove, + .driver = { + .name = "acp_asoc_acp63", + .pm = &acp63_dma_pm_ops, + }, +}; + +module_platform_driver(acp63_driver); + +MODULE_DESCRIPTION("AMD ACP acp63 Driver"); +MODULE_IMPORT_NS(SND_SOC_ACP_COMMON); +MODULE_LICENSE("Dual BSD/GPL"); +MODULE_ALIAS("platform:" DRV_NAME); diff --git a/sound/soc/amd/acp/amd.h b/sound/soc/amd/acp/amd.h index d6cfae6ec5f7..487eefa5985f 100644 --- a/sound/soc/amd/acp/amd.h +++ b/sound/soc/amd/acp/amd.h @@ -20,6 +20,7 @@ #define ACP3X_DEV 3 #define ACP6X_DEV 6 +#define ACP63_DEV 0x63 #define DMIC_INSTANCE 0x00 #define I2S_SP_INSTANCE 0x01 @@ -95,6 +96,9 @@ #define ACP6X_PGFSM_CONTROL 0x1024 #define ACP6X_PGFSM_STATUS 0x1028 +#define ACP63_PGFSM_CONTROL ACP6X_PGFSM_CONTROL +#define ACP63_PGFSM_STATUS ACP6X_PGFSM_STATUS + #define ACP_SOFT_RST_DONE_MASK 0x00010001 #define ACP_PGFSM_CNTL_POWER_ON_MASK 0x01 From patchwork Sat Oct 21 14:50:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 156461 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp331817vqx; Sat, 21 Oct 2023 07:52:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE0oHygpe/rhea9Bzbx3uSLaFX4O9GEi5EzmOerMzsmYx71lUZ2E28G3taKgwunIyK4WJSu X-Received: by 2002:a17:90a:dc05:b0:27d:c36:e12c with SMTP id i5-20020a17090adc0500b0027d0c36e12cmr4397187pjv.9.1697899940328; Sat, 21 Oct 2023 07:52:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697899940; cv=pass; d=google.com; s=arc-20160816; b=it3KIAsjjh9RY9gbOG1Y5FLouxaKbIcT2B0rs37Sk7ehkEjNuG2yhg25xZgTc5Ond9 CAxPX/xa7zZXEA7Pg4xUDOqg+vGXqISn5QprnNCj7uGXseeBHCLOgOExx5p+vPh3cxkc HAuqYzmEyzsT4fET28auK7Dc6gOarS7lAGMGkuQtgF4VGeZgZ5/glf2q3iHQMqg2qiIa uT53N/m9HDEX1accDy6m1r2xQ1lVIVN+PviZPWqg0xGvXGSDJwcGOWqWthRkOiEvJOD4 qFwpkiTkZED4WOLekd8rcqrQZ1/sRbjK4v4RgQYLiSZTe6Xs7M/kEc8e13jSBm62kLwo bWjw== 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=UUnWxhcW9fsKAipB7r/6RJXMLdyxK+qyIEVB8dgzAZY=; fh=VJv+aOOSnsim5/pjmk/1majRCxkZEb1eD9DUcO3tmpk=; b=xx25QmBqPTYl3f3BPCu9NsE9hFK+FF7FUdUi+LCVjA1eeAkcAXfVbFFZnNGWFIT5oW dlpTelcajNZ4T3LwcUqxfpYaSQ44/Yes7753bs8mPsJhZ4nt2rPiH7Jd0oZb5MVcvXar SCwBCRAZ48F0EqumfgKKJEMraWdPPb1CKc2hcFXBRzoH4hKP0zAJUmczF5nxc1mqFhN3 2w6rHBAl82YgbVepRf6tiDk7+/D9wZuehH6U59fizfjXywdc9FIyZLn/MRMrezTRGWAH p7fBvuuU6mGawVhqXxxqrJ7CQrMabpiaDgPAVFBPzyk2lxr3noUecfMsjWAG9p00q8QI hy7g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=vaHD8GF8; 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 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id h23-20020a17090adb9700b002769b4b64e7si6210249pjv.20.2023.10.21.07.52.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Oct 2023 07:52:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=vaHD8GF8; 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 23.128.96.34 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 055F7802D0CA; Sat, 21 Oct 2023 07:52:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231482AbjJUOvk (ORCPT + 26 others); Sat, 21 Oct 2023 10:51:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231280AbjJUOvi (ORCPT ); Sat, 21 Oct 2023 10:51:38 -0400 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2058.outbound.protection.outlook.com [40.107.96.58]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA985D7 for ; Sat, 21 Oct 2023 07:51:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TYHZtXNd1FMcVgTOT3o+YnSdV0hmIVFlEpPoPDM2dMrhLKkrPt6TeNPQsF0tjt1OpCtjVl8jQMFpK8zmh6fJ0r2aB7ZwkCt44I/kaEyOVxlcNK2Ail1yweRMuM4P1N28qPFaibxpiFi+Znp9rZXhEw9JBhy5jn08tf7A1r/oUa/2Mmkq42IuAkZlhyk/NWv8tQY8VGHyChkFMo5d6WCgrjLmi4bfGHwm+mkArg7LOLAkI0G+zcgT8tcaKim5fmzje3LIyDJ9ivHKlnJiCyWOwqXVTLtJNKEpsO7Ql3mItKhu9OacfPFzabCSAmBVcuefn/R9O0uGcscrbiUqF+rGKQ== 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=UUnWxhcW9fsKAipB7r/6RJXMLdyxK+qyIEVB8dgzAZY=; b=klpKNq0Bqm1wSWUf44Z75nxY3ROf4tcPwy6jJUTQXwZSJRhNudTMbbDs9kZZF9V4uZV5M5FrdFF1uJYaB2FgXw9o+kz2MZp3eIxXEdJ2/RAQJXMCrCaBkYkWAdWqun5x14hpsuOLfvDdzoYb5W0q/ri0Xm4F3iW1IuGynGVDEpydgz6HPIgH8Eis2heEAmVsKtf3TzKZNBAk9uR+D3c80wgBFARM5CLG8Jth+ak+bZP5HjBFRA9EyFjmn3g6ioni19EQh8BmCumkhuqs80PEXOSMHYu1ZJ5w+3hGhqkq09FTxbI7noF3H+U4B7fixtnNoBr3DotYJMY3NONRg7+hDg== 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=UUnWxhcW9fsKAipB7r/6RJXMLdyxK+qyIEVB8dgzAZY=; b=vaHD8GF8j6Mmg/p08J0BJpztpczEgcUw3Of1FR9deRFZXkmzr/ePxySX8qbEwbHxITTFDQMSIKds81m5GX/s6lOfwqkGSj3PGtYCJSxewcqDmInEm4AhGgM6wPdU4Uf+a1qORMUZ3ntPPKLxxXMDwIcvrFg01udFnMGHMNGtgFk= Received: from DM6PR03CA0073.namprd03.prod.outlook.com (2603:10b6:5:333::6) by BL1PR12MB5031.namprd12.prod.outlook.com (2603:10b6:208:31a::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.26; Sat, 21 Oct 2023 14:51:30 +0000 Received: from DS2PEPF00003443.namprd04.prod.outlook.com (2603:10b6:5:333:cafe::a) by DM6PR03CA0073.outlook.office365.com (2603:10b6:5:333::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.26 via Frontend Transport; Sat, 21 Oct 2023 14:51:30 +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 DS2PEPF00003443.mail.protection.outlook.com (10.167.17.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6907.20 via Frontend Transport; Sat, 21 Oct 2023 14:51:30 +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.2507.27; Sat, 21 Oct 2023 09:51:30 -0500 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.2507.27; Sat, 21 Oct 2023 09:51:30 -0500 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Sat, 21 Oct 2023 09:51:25 -0500 From: Syed Saba Kareem To: , CC: , , , , , , , , Syed Saba Kareem , Liam Girdwood , "Jaroslav Kysela" , Takashi Iwai , Kuninori Morimoto , V Sujith Kumar Reddy , open list Subject: [PATCH 02/13] ASoC: amd: acp: refactor acp i2s clock generation code Date: Sat, 21 Oct 2023 20:20:43 +0530 Message-ID: <20231021145110.478744-2-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231021145110.478744-1-Syed.SabaKareem@amd.com> References: <20231021145110.478744-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS2PEPF00003443:EE_|BL1PR12MB5031:EE_ X-MS-Office365-Filtering-Correlation-Id: d773b436-e494-4a72-24f3-08dbd2453646 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: C7JQNv2LoWF60lNlnwGM0EBUI9fTFXKMSHpP9NJizSYpHaFTDg0ONf0a2W4Quw96dNkHIwaqo4/sND9lRkfScIDQCPqoC+MvbMVbovV2iJOzG1BGSzIJRpcXjZo7CqXPMuiVKLKBQQu9O7XQF/xEUtLhJDCTSJ49n6WuTy8z65HKsdPe8Owkn/weqW3F3ZrIoxQM80hSsg+jU0RdmI2y7Ya/fOFtZKFosrN9S1fwIqLuB7nTFMHMWqSlaSJk+FZ2I9oPciQyMN+yT5ZrRBH3Ww22zTDGIaNp2CsE8/TL7wUFpSNU+thWaKdZSVEzNOGQZ6YwsjsY3P3gA6SHRgOhq4bA9mYKOPs9uIiT47mqYVNqaPWC5zTQTvYGSt29hZRf/slmnJHOJnY2UF7svoCrRQynZp/UlnCbLFAzZs8+K5NofzASKBgFPdkXAQgnsuMNUAHXzz6LtmO4m41GJtiG7t9C47ffs3miGyddyMvU3AwVRu3R9M1ehHn54O+IRHghJOZFT7yc490NGqEf7/gAr3Pgl7VlXQX7z1xU1J4gzfPeO+FNZ8sA7tOH4USPsVUROmgpY75ZY8ZYFlz4yl5aG7id+v3TJahcEethT62h70bN7PIKas5TDwPO8S5X9ZC9mFnbgsYTjzUSGWNkqwUrN5zcqV26tXwp8UO6XippUAAfGcKoxzyueQrADhBTb1GAj6uVKI/6MelLNwy/7n2eCtYk3X3YpSa6P+WA75WvvZCJnXZnGYVBwi09ldNTnpTtFrUU9gH0x0/+GnOjQe04Fg== 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:(13230031)(4636009)(396003)(346002)(376002)(136003)(39860400002)(230922051799003)(64100799003)(1800799009)(186009)(451199024)(82310400011)(36840700001)(46966006)(40470700004)(26005)(1076003)(81166007)(2616005)(356005)(82740400003)(336012)(426003)(478600001)(6666004)(47076005)(83380400001)(54906003)(110136005)(70206006)(70586007)(316002)(7696005)(41300700001)(36860700001)(4326008)(8936002)(8676002)(5660300002)(2906002)(40480700001)(36756003)(40460700003)(86362001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2023 14:51:30.7418 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d773b436-e494-4a72-24f3-08dbd2453646 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: DS2PEPF00003443.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5031 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Sat, 21 Oct 2023 07:52:11 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780377127681495753 X-GMAIL-MSGID: 1780377127681495753 Refactor acp i2s LRCLK,BCLK generation code and move to commnon file. Signed-off-by: Syed Saba Kareem --- sound/soc/amd/acp/acp-i2s.c | 32 ++++++++++++++++++++++++++++++ sound/soc/amd/acp/amd.h | 39 ------------------------------------- 2 files changed, 32 insertions(+), 39 deletions(-) diff --git a/sound/soc/amd/acp/acp-i2s.c b/sound/soc/amd/acp/acp-i2s.c index df350014966a..59d3a499771a 100644 --- a/sound/soc/amd/acp/acp-i2s.c +++ b/sound/soc/amd/acp/acp-i2s.c @@ -20,10 +20,42 @@ #include #include #include +#include #include "amd.h" #define DRV_NAME "acp_i2s_playcap" +#define I2S_MASTER_MODE_ENABLE 1 +#define I2S_MODE_ENABLE 0 +#define I2S_FORMAT_MODE GENMASK(1, 1) +#define LRCLK_DIV_FIELD GENMASK(10, 2) +#define BCLK_DIV_FIELD GENMASK(23, 11) + +static inline void acp_set_i2s_clk(struct acp_dev_data *adata, int dai_id) +{ + u32 i2s_clk_reg, val; + + switch (dai_id) { + case I2S_SP_INSTANCE: + i2s_clk_reg = ACP_I2STDM0_MSTRCLKGEN; + break; + case I2S_BT_INSTANCE: + i2s_clk_reg = ACP_I2STDM1_MSTRCLKGEN; + break; + case I2S_HS_INSTANCE: + i2s_clk_reg = ACP_I2STDM2_MSTRCLKGEN; + break; + default: + i2s_clk_reg = ACP_I2STDM0_MSTRCLKGEN; + break; + } + + val = I2S_MASTER_MODE_ENABLE; + val |= I2S_MODE_ENABLE & BIT(1); + val |= FIELD_PREP(LRCLK_DIV_FIELD, adata->lrclk_div); + val |= FIELD_PREP(BCLK_DIV_FIELD, adata->bclk_div); + writel(val, adata->acp_base + i2s_clk_reg); +} static int acp_i2s_set_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt) diff --git a/sound/soc/amd/acp/amd.h b/sound/soc/amd/acp/amd.h index 487eefa5985f..87d1e1f7d6b6 100644 --- a/sound/soc/amd/acp/amd.h +++ b/sound/soc/amd/acp/amd.h @@ -188,17 +188,6 @@ struct acp_dev_data { u32 xfer_rx_resolution[3]; }; -union acp_i2stdm_mstrclkgen { - struct { - u32 i2stdm_master_mode : 1; - u32 i2stdm_format_mode : 1; - u32 i2stdm_lrclk_div_val : 9; - u32 i2stdm_bclk_div_val : 11; - u32:10; - } bitfields, bits; - u32 u32_all; -}; - extern const struct snd_soc_dai_ops asoc_acp_cpu_dai_ops; extern const struct snd_soc_dai_ops acp_dmic_dai_ops; @@ -276,32 +265,4 @@ static inline u64 acp_get_byte_count(struct acp_dev_data *adata, int dai_id, int POINTER_RETURN_BYTES: return byte_count; } - -static inline void acp_set_i2s_clk(struct acp_dev_data *adata, int dai_id) -{ - union acp_i2stdm_mstrclkgen mclkgen; - u32 master_reg; - - switch (dai_id) { - case I2S_SP_INSTANCE: - master_reg = ACP_I2STDM0_MSTRCLKGEN; - break; - case I2S_BT_INSTANCE: - master_reg = ACP_I2STDM1_MSTRCLKGEN; - break; - case I2S_HS_INSTANCE: - master_reg = ACP_I2STDM2_MSTRCLKGEN; - break; - default: - master_reg = ACP_I2STDM0_MSTRCLKGEN; - break; - } - - mclkgen.bits.i2stdm_master_mode = 0x1; - mclkgen.bits.i2stdm_format_mode = 0x00; - - mclkgen.bits.i2stdm_bclk_div_val = adata->bclk_div; - mclkgen.bits.i2stdm_lrclk_div_val = adata->lrclk_div; - writel(mclkgen.u32_all, adata->acp_base + master_reg); -} #endif From patchwork Sat Oct 21 14:50:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 156462 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp331903vqx; Sat, 21 Oct 2023 07:52:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH1B93XiWoQUmw+fq+BAccsNwjOMcAEaPQAhwikH7QLFMHGKEgih/WzQY8ZTCkoiEpQKgjQ X-Received: by 2002:a05:6a00:3a09:b0:690:2ad9:1436 with SMTP id fj9-20020a056a003a0900b006902ad91436mr4149990pfb.7.1697899953027; Sat, 21 Oct 2023 07:52:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697899953; cv=pass; d=google.com; s=arc-20160816; b=clDuxos6GwTBFMh1yoryU774XNgtN1ckaLMG6NUZ1acAZmC8V/sNvE/eqnvnTTnblE G9UUVqtLWT2H1SrBacF/B5pFYqrIbzjC//oUPf6sI2/FhkctxfWtmiLbCS1u6/L0fw5Y QfrxuAHgQgjEp5xkoZM3hKdCwZ/P1TsynQp2Xqsr7TwKCASoaT5IBB6U8jyXz3uAGyB7 zdG28cYtnZQqQ3H2YPdaI6rg3hsfITaChwrU4+sDe1HLfslmG3TCXMLMEmvFb2VDjMIC wwTeWxiIvXBDw3/WWkpLWQn0lz8Ggo2+KVmVjgjWg5IupaguLDmokTCqyqFB0UeByV7o 29sA== 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=X1gdeGaFPOZ8uVrIuwhhlwEbvP+4u8K/xjoJY4vtV9Q=; fh=wqdbPcj9OW60o+p8fdltPWgpu9aJkl3M8COzui1DpxY=; b=fwk0h2WDw2CU/1r0ViZUBUXS5ilaNFSOuTLR/1Y9e5i0OTALDQu70+PADcbCDRM1CK LuIYh/En1zOhm5qzM7iCvTSUMYDj96s3KnIaVVujZSQa8uJjH2GBJknpoTTbvHUPTqdj 4iM5O/vvgqQHO2xo0fIjVfs2YSDU4HC6zcFrTwTAKlrc4xo1iePdVjZcZbbLCzi5H+FY 6IGGQ2aiwqAjczuUyr7De5AkiOc98V9fjs8Nv9FZy4NVjPM+pcXQqzIbJyVhAixeLdwo M8/vJ3x1R+cz+saYHc5kerw/k/b9rWpyj3/YLnBEGd6BUUfdI6hWmgQEMu43doIfDRTr hlvA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=BRRl1Ij1; 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::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id s194-20020a632ccb000000b00563f627f2easi3628053pgs.122.2023.10.21.07.52.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Oct 2023 07:52:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=BRRl1Ij1; 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::3:2 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 5DDD481049A5; Sat, 21 Oct 2023 07:52:28 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231280AbjJUOvu (ORCPT + 26 others); Sat, 21 Oct 2023 10:51:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231604AbjJUOvr (ORCPT ); Sat, 21 Oct 2023 10:51:47 -0400 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2071.outbound.protection.outlook.com [40.107.101.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94210D76 for ; Sat, 21 Oct 2023 07:51:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QF7O9TYDTw2MxKuTZcZ2bmtwbsOdwEiIchkYVX9aO3T3ITH4GzFRuzGQPa5qCTiGlGu6ZmgQG8Me4NLvhZ2c0VM/wvDdZ0uaQYwR2nDbyseicaERJZtAFX5nHU46I7Lx7yWpC27N+SOpu0ZTn2i1CwtMekd8e6CHJm6Abh2KTn34vdGsIhrAArpPceWiMHfTRZflaiFzZzwbpEUvKwLfbV7pmMySG5q7y/2iLOGTwgCCvS5UiP1wlDhklUPxDEtJmKG9yqw0JGV9EX14v7J2+ZGMxWIdHWbJZRjYW91pYH6rp0f40mq0ZegdeFiVo23QhOktXJUDW0xn5fgUWyJNsA== 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=X1gdeGaFPOZ8uVrIuwhhlwEbvP+4u8K/xjoJY4vtV9Q=; b=JppS9Y7lJL8CBdJTol0+Na5jUk28r2eAysWUjJdfsi5qWDoapj3TpMiKaZmn45qVTwVEXQK54xV454L8c27RhrT51fCwT2E7rYYR3u4Gk2BVxex8AA+SXk7vzLSrpjG7xxjIv8Y4sDmZZXnKDDw9LDYUnkKVUBc74Y1v7iMeHaD8g04t3rv9GZR9FTA4r+Q1mYYsBnJd35Q2A7HU9UreON0ay6rgIoyaoi8EvsOXfrAErwU5g1F6MzfHDWtz73PIMcWnzePzDqwvamADZx0pEvbeNf+XlT+jN8aPQkT9rpoIoAGieO+njOrZ1N1bW78xOVg0X/Q12zM2wMIdCvSYMQ== 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=X1gdeGaFPOZ8uVrIuwhhlwEbvP+4u8K/xjoJY4vtV9Q=; b=BRRl1Ij1fDCQuI7caDkr84nZHE3ggp3P16ga/Pb7bxOvIZ8s32uBj/1YKVl4vZKCWXlSmHLvAWKtN1pPO1Qzp2WYbOfIynZFee73JSC07I1msfbL69LvBeCxlVAPjlTcRxVhQhWPOnDrwzmV87k2YFQH4gPBvYPJRbB45uKV6Oc= Received: from PH7PR10CA0003.namprd10.prod.outlook.com (2603:10b6:510:23d::24) by MN0PR12MB5834.namprd12.prod.outlook.com (2603:10b6:208:379::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.34; Sat, 21 Oct 2023 14:51:37 +0000 Received: from SN1PEPF000252A2.namprd05.prod.outlook.com (2603:10b6:510:23d:cafe::25) by PH7PR10CA0003.outlook.office365.com (2603:10b6:510:23d::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.26 via Frontend Transport; Sat, 21 Oct 2023 14:51:37 +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 SN1PEPF000252A2.mail.protection.outlook.com (10.167.242.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6907.20 via Frontend Transport; Sat, 21 Oct 2023 14:51:36 +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.2507.27; Sat, 21 Oct 2023 09:51:36 -0500 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.2507.27; Sat, 21 Oct 2023 09:51:36 -0500 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Sat, 21 Oct 2023 09:51:31 -0500 From: Syed Saba Kareem To: , CC: , , , , , , , , Syed Saba Kareem , Liam Girdwood , "Jaroslav Kysela" , Takashi Iwai , Kuninori Morimoto , open list Subject: [PATCH 03/13] ASoC: amd: acp: add i2s clock generation support for acp6.3 based platforms Date: Sat, 21 Oct 2023 20:20:44 +0530 Message-ID: <20231021145110.478744-3-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231021145110.478744-1-Syed.SabaKareem@amd.com> References: <20231021145110.478744-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000252A2:EE_|MN0PR12MB5834:EE_ X-MS-Office365-Filtering-Correlation-Id: 695df26f-c2ba-49cf-419e-08dbd24539de X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 32b6GS97myme6z82EnnhbyBM1R+tEw/rSAn8A/9uE+7tnmeRMJR0MkCaZKNsQur7V6yztT94q+te/6KMuWZZdBp1xVbXf46ofiPFIZQAZ8Wlh0uLM3q56Hhb9LCa0shu5HGCXiR679iogWtIpz/LU4i4x5L/rhRgYA+Mlfj6pyE+8PdNvQOJiaTxiJ74TeK0nLm8oQe9+P7i3Di8SCcb82sbq/ur4xtkT8H3v1fs5Xdo+ua4GysPXCLUauE5Ly/NrgvcEaWE5jJS+UPgoAMfzsZsVuVM9Q82VUuUmaf/s4qVaS0mO5pDkQbFg3Vvu6dUo45m6Dr9Zy7/zL/OP+aa4dtgY2gV2iXNlVB2fkOtwakoaMw2yEX6YmEQujgX6x2b3Gr5WIImnNX1x0ALXAUYmifkSKCNjHjoAdVv8MMFEezLB3MJcXlLUAgDZ2T0hmbePXPHAnBeeiFZ7k7g1TbBQF3juESXXTkkxAlG83W8h6/HKvlYe2UojwTZK/7ijLB1dJ7DKt2L/4juCin/c6M2sqhVxYhlm95SAGKivQQpmPkQ06dw3NxO0JFRYJQ07mxTVqVdQb0XZjmkfNFlAoRStWCclQ6DSwRoTi84FBOkJuvKp6kvq4wi+yCWs08m8Bcrfxv+kypReRBdC94Y55PuEs+7t+kffsfTtiQ6hE9j4/9KNtgGQx9UbnmVIb7AqkNrhC++rgFIRyN/vEmU7CWMXW2KXY9gdSDwMzumhQH5+Rt6DWGCb4FIeqzbqO2Ngh3Ia7ZW4ghfr++5ZQQob64tzg== 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:(13230031)(4636009)(136003)(376002)(346002)(396003)(39860400002)(230922051799003)(64100799003)(186009)(1800799009)(82310400011)(451199024)(36840700001)(40470700004)(46966006)(7696005)(336012)(40460700003)(426003)(54906003)(4326008)(316002)(6666004)(36860700001)(83380400001)(478600001)(41300700001)(8936002)(8676002)(2906002)(5660300002)(47076005)(70586007)(81166007)(110136005)(356005)(70206006)(82740400003)(26005)(1076003)(2616005)(86362001)(40480700001)(36756003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2023 14:51:36.8031 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 695df26f-c2ba-49cf-419e-08dbd24539de 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: SN1PEPF000252A2.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB5834 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Sat, 21 Oct 2023 07:52:28 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780377141272032490 X-GMAIL-MSGID: 1780377141272032490 Add I2S LRCLK & BCLK generation code for ACP6.3 based platforms. Signed-off-by: Syed Saba Kareem --- sound/soc/amd/acp/acp-i2s.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/sound/soc/amd/acp/acp-i2s.c b/sound/soc/amd/acp/acp-i2s.c index 59d3a499771a..1185e5aac523 100644 --- a/sound/soc/amd/acp/acp-i2s.c +++ b/sound/soc/amd/acp/acp-i2s.c @@ -27,14 +27,19 @@ #define DRV_NAME "acp_i2s_playcap" #define I2S_MASTER_MODE_ENABLE 1 #define I2S_MODE_ENABLE 0 -#define I2S_FORMAT_MODE GENMASK(1, 1) #define LRCLK_DIV_FIELD GENMASK(10, 2) #define BCLK_DIV_FIELD GENMASK(23, 11) +#define ACP63_LRCLK_DIV_FIELD GENMASK(12, 2) +#define ACP63_BCLK_DIV_FIELD GENMASK(23, 13) static inline void acp_set_i2s_clk(struct acp_dev_data *adata, int dai_id) { u32 i2s_clk_reg, val; + struct acp_chip_info *chip; + struct device *dev; + dev = adata->dev; + chip = dev_get_platdata(dev); switch (dai_id) { case I2S_SP_INSTANCE: i2s_clk_reg = ACP_I2STDM0_MSTRCLKGEN; @@ -52,8 +57,16 @@ static inline void acp_set_i2s_clk(struct acp_dev_data *adata, int dai_id) val = I2S_MASTER_MODE_ENABLE; val |= I2S_MODE_ENABLE & BIT(1); - val |= FIELD_PREP(LRCLK_DIV_FIELD, adata->lrclk_div); - val |= FIELD_PREP(BCLK_DIV_FIELD, adata->bclk_div); + + switch (chip->acp_rev) { + case ACP63_DEV: + val |= FIELD_PREP(ACP63_LRCLK_DIV_FIELD, adata->lrclk_div); + val |= FIELD_PREP(ACP63_BCLK_DIV_FIELD, adata->bclk_div); + break; + default: + val |= FIELD_PREP(LRCLK_DIV_FIELD, adata->lrclk_div); + val |= FIELD_PREP(BCLK_DIV_FIELD, adata->bclk_div); + } writel(val, adata->acp_base + i2s_clk_reg); } From patchwork Sat Oct 21 14:50:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 156463 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp331950vqx; Sat, 21 Oct 2023 07:52:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEOTLhBMJ0Q3Es+eZt457y3QqcB1YwFWHMglCH2o17QwHqxVm1c4XHA6EWNmY5Sll7ot3bg X-Received: by 2002:a05:6a20:7489:b0:15e:bf2b:e6d3 with SMTP id p9-20020a056a20748900b0015ebf2be6d3mr4303502pzd.46.1697899959531; Sat, 21 Oct 2023 07:52:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697899959; cv=pass; d=google.com; s=arc-20160816; b=l+0QGPpEOuO2wvzo5FuRQf/Zh5gyKoPILNL/nLEr35EOOc4Z8rRUtt5MyBXm5MRIZe f/VzqtQXAlZFK2dC/hKRLpDiu5b4Aeh5J6tpauckSewYWimBHMMX23HTon2DRw7al+qh X2EVXRAEVvLziLnO8IdtVSh/w2g+gfsjXhi1SzdA4bJ6h0Uh0U1id7AMndUcaQUjH7it 3Sklhz1FQA1HAV8rqw7n0Kq79lor25ygUDiI+qikb30sxP/4TJBFFL8miEVXZeGh132j 5lEXs1qOpgORFXatrp3ZNmeoz+xiRvyJeoJNnwTy3e82ed98obwe6py+qSHqA30NJ7+f lfpA== 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=bAG39eZ1BVdDuYUo95xzfJdqnqe77LBQtVNF2w05y5o=; fh=LHgWZBUrjbtsLqkN7lnQw8hIsBUwxMC4OVXKd64qvp4=; b=I5/tcwM/aIycieJjD4c4isT1pxoYd+ZInPYEoduXTFul4mkdTE2+YcEceZ8DfcUf/8 K+B2kAQb6uRSH5uRRn7XpP/IqguVWuv7APjk8LM/oTAKCmLA1h0pOLbov96wrARskBKc 6r6p1+P6D9BxVh9LTx+Wf3xqA4Qwmjt/h8Ws05rbb5HZNIS84jXNlfU9uNCnVlYO8g5Z Svf6mEinPKJHlSaJe/1tnE9I6Nq82S/1JLsB083TVhuXICPfNFqs5fYReNgwCl7r4lRB rbjD1BEVRt73w5rASVOzOLd+huWYrlBrizFkKWksvzkqeyE+vwZyLYRpIh5t0ZT06yg4 jlWg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=YdfhmYLv; 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::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id gp8-20020a17090adf0800b0027d032092d7si6075218pjb.184.2023.10.21.07.52.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Oct 2023 07:52:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=YdfhmYLv; 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::3:4 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id D3B3680D1DCC; Sat, 21 Oct 2023 07:52:31 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231602AbjJUOv5 (ORCPT + 26 others); Sat, 21 Oct 2023 10:51:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231616AbjJUOvy (ORCPT ); Sat, 21 Oct 2023 10:51:54 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2083.outbound.protection.outlook.com [40.107.92.83]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1050DA for ; Sat, 21 Oct 2023 07:51:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BdRGiIn6g3c8t8jvCp1pRzHWN7U0nAESiI0/uizwUz0XyKQbcu5zN5H0me/xzk2Dvx7iTpZdIXnx8fVgbfaifh/x6lo1NDhwJM1bBtzt+q1n8YMa0MrD9CUckUFgr0Zc+CSGvUGD7O9mLmuecw4e1GwCbGSmXjRRVd6NhTgMSal/J1Ud7VCtAucvk6sgxxstg6m/daoTxx2yNPczTJCK1b/wRJKMnstXD6nzx9K5AZgQCQIKKKqGtgL4LkAZrXttzCv8InBKsNKXlGTVDArrMGddMct+Etghodlv3OE/qDTmvOYbDb4zF68hb8bHcr10cU8ueFq3Pt3w35nwvO3FAQ== 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=bAG39eZ1BVdDuYUo95xzfJdqnqe77LBQtVNF2w05y5o=; b=UOrqbhqYh+l7kvHz4R6RFfRMzLeh1pkRK3J+x2XaKnVrJQdKMP5lkRb5Q8jnA26dsa91iB9NSvtMyc2jQdZhgDtCr3Td0Hs6+Vd94mhHJU5mp/UnAjDhXWW57PZgsTWkI1iQ4Q+MvM2hBM48tvHJyVtGmiqOs9bE7Jf99gYOLZPSaXjJg9QhXCNe89rkSaoYWtI3+s2TYt67vix9GxmYywLQwUkECOoJ7pseh9sEWEnPVuw1oD7UcrSrcIjzczThRvrmMB4fxfDNEvcm7UqPEhMdkcESJVyH8MJ3NXDnSX5/ZuvV+krjqZIw/R41wJsYNzepItbVkpD+ijEWLKKpdw== 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=bAG39eZ1BVdDuYUo95xzfJdqnqe77LBQtVNF2w05y5o=; b=YdfhmYLv2B6AcHZhi4bXMLuU/1N+DA4CdcJFXwrRtIFV0jTYv/SIWSyRQZu9bZmqEki6oQp5CpBJIxfpnLagf/2A+ivIDF+ffN8OV54vdTHIcyxxE7V5gLkApr+/qYCIpgIvf9u3c2OVRKAb9OvUzsGZSjFndPK9jB+poaPv+O8= Received: from SA0PR11CA0168.namprd11.prod.outlook.com (2603:10b6:806:1bb::23) by SN7PR12MB7024.namprd12.prod.outlook.com (2603:10b6:806:26e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.34; Sat, 21 Oct 2023 14:51:45 +0000 Received: from SN1PEPF000252A3.namprd05.prod.outlook.com (2603:10b6:806:1bb:cafe::a4) by SA0PR11CA0168.outlook.office365.com (2603:10b6:806:1bb::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.31 via Frontend Transport; Sat, 21 Oct 2023 14:51:45 +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 SN1PEPF000252A3.mail.protection.outlook.com (10.167.242.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6933.15 via Frontend Transport; Sat, 21 Oct 2023 14:51:44 +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.2507.27; Sat, 21 Oct 2023 09:51:44 -0500 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.2507.27; Sat, 21 Oct 2023 09:51:44 -0500 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Sat, 21 Oct 2023 09:51:39 -0500 From: Syed Saba Kareem To: , CC: , , , , , , , , Syed Saba Kareem , Liam Girdwood , "Jaroslav Kysela" , Takashi Iwai , Alper Nebi Yasak , Kuninori Morimoto , Marian Postevca , open list Subject: [PATCH 04/13] ASoC: amd: acp: add machine driver support for acp6.3 platform Date: Sat, 21 Oct 2023 20:20:45 +0530 Message-ID: <20231021145110.478744-4-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231021145110.478744-1-Syed.SabaKareem@amd.com> References: <20231021145110.478744-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000252A3:EE_|SN7PR12MB7024:EE_ X-MS-Office365-Filtering-Correlation-Id: c9552501-e94c-43b1-0091-08dbd2453ea4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Qie3VoTBsrbFjpKOsjl55hi8DqczYHTYp2q7dpX1vej0WakSHQQa4w0rtICww4gUEoSInzY+DscDOKZv+GenEbJVHNN6ZLhJuQcyXF8athG6E08/pLt5Nv8yBzTuXosez/9WbY2iSVNlK6fK98pn8e/AZebL2NBSB8CS7mtsvyXNW+cKIc2s66kbkFZo2HKbN9UFIDSRDVh1YXf6a/14J0n5pkFCWS8SsmyCn9ZsHGnIzQGYy0V5VYEXXTB2Ptq/R/lyXc3xt1IzqNju3JaD5Rqq3yWLe/ijOiq8NkwFRjBs3fMhwopt83MGu7Oz6lF3ioQdndVI5lO2KAZAUTmPd1u5o1ZGhzWmCyHyCGW3PwQmGXciJlL/Z1ckehf105KO4ksGNacqlTBxVEzD80g7JGX8D8E8kLrM5HTcA/HuSbcbELEScggHXGi4vCkOh1zpAGx/P/Q55r6MyWeWG1qEup6i/lwM09vs52bIInu+9pDPfOs6fmflcwLQBduMExlO7pDdR7x1S0TJTpYQnvlBkBXb3TgTQnL0TSbO350eTS6s9PLsDI50G3WbO/DAnVlGaVBGVGf8vBs3rdLPkqa0g2SdEYinhzMV89z2MOKrjTWZH6874BRJecpHnDhUK+cObKSdziQuhpd1m5glkSkkASSDhS2oBOWf/vWXMGJCosW9ygiEGCYNXV7SdT6w/BxrVN1yxm6aNKpqjLxysu/rR2OAfxQ0/wgeatjKx9u3NINJhFb3vvrApVx8xki2txKYba6u2dSRNaK6osC1ZZ6M7A== 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:(13230031)(4636009)(396003)(346002)(39860400002)(376002)(136003)(230922051799003)(1800799009)(186009)(451199024)(82310400011)(64100799003)(40470700004)(46966006)(36840700001)(81166007)(356005)(82740400003)(1076003)(2616005)(6666004)(26005)(70586007)(54906003)(316002)(70206006)(336012)(426003)(7696005)(478600001)(36860700001)(4326008)(8936002)(5660300002)(86362001)(41300700001)(40460700003)(47076005)(110136005)(40480700001)(8676002)(2906002)(36756003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2023 14:51:44.7943 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c9552501-e94c-43b1-0091-08dbd2453ea4 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: SN1PEPF000252A3.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7024 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Sat, 21 Oct 2023 07:52:31 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780377148252189339 X-GMAIL-MSGID: 1780377148252189339 add legacy machine driver support for acp6.3 based platform. Signed-off-by: Syed Saba Kareem --- sound/soc/amd/acp/acp-mach-common.c | 15 +++++++++++++++ sound/soc/amd/acp/acp-mach.h | 1 + 2 files changed, 16 insertions(+) diff --git a/sound/soc/amd/acp/acp-mach-common.c b/sound/soc/amd/acp/acp-mach-common.c index 9def77bfc608..88e91af47532 100644 --- a/sound/soc/amd/acp/acp-mach-common.c +++ b/sound/soc/amd/acp/acp-mach-common.c @@ -1260,6 +1260,12 @@ static struct snd_soc_dai_link_component platform_rmb_component[] = { } }; +static struct snd_soc_dai_link_component platform_acp63_component[] = { + { + .name = "acp_asoc_acp63.0", + } +}; + static struct snd_soc_dai_link_component sof_component[] = { { .name = "0000:04:00.5", @@ -1570,6 +1576,9 @@ int acp_legacy_dai_links_create(struct snd_soc_card *card) if (drv_data->platform == REMBRANDT) { links[i].platforms = platform_rmb_component; links[i].num_platforms = ARRAY_SIZE(platform_rmb_component); + } else if (drv_data->platform == ACP63) { + links[i].platforms = platform_acp63_component; + links[i].num_platforms = ARRAY_SIZE(platform_acp63_component); } else { links[i].platforms = platform_component; links[i].num_platforms = ARRAY_SIZE(platform_component); @@ -1634,6 +1643,9 @@ int acp_legacy_dai_links_create(struct snd_soc_card *card) if (drv_data->platform == REMBRANDT) { links[i].platforms = platform_rmb_component; links[i].num_platforms = ARRAY_SIZE(platform_rmb_component); + } else if (drv_data->platform == ACP63) { + links[i].platforms = platform_acp63_component; + links[i].num_platforms = ARRAY_SIZE(platform_acp63_component); } else { links[i].platforms = platform_component; links[i].num_platforms = ARRAY_SIZE(platform_component); @@ -1677,6 +1689,9 @@ int acp_legacy_dai_links_create(struct snd_soc_card *card) if (drv_data->platform == REMBRANDT) { links[i].platforms = platform_rmb_component; links[i].num_platforms = ARRAY_SIZE(platform_rmb_component); + } else if (drv_data->platform == ACP63) { + links[i].platforms = platform_acp63_component; + links[i].num_platforms = ARRAY_SIZE(platform_acp63_component); } else { links[i].platforms = platform_component; links[i].num_platforms = ARRAY_SIZE(platform_component); diff --git a/sound/soc/amd/acp/acp-mach.h b/sound/soc/amd/acp/acp-mach.h index b0a3f6bd172f..69db61f12eca 100644 --- a/sound/soc/amd/acp/acp-mach.h +++ b/sound/soc/amd/acp/acp-mach.h @@ -53,6 +53,7 @@ enum codec_endpoints { enum platform_end_point { RENOIR = 0, REMBRANDT, + ACP63, }; struct acp_mach_ops { From patchwork Sat Oct 21 14:50:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 156468 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp332475vqx; Sat, 21 Oct 2023 07:53:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFweWENuW+ebLvKugwNcrbDyx58JOVXV/LS5YcXO8ucTjUBiBH3AR1Be0T/W26tVrYKQ7sq X-Received: by 2002:a05:6a21:790a:b0:16b:f586:3c4 with SMTP id bg10-20020a056a21790a00b0016bf58603c4mr5150290pzc.58.1697900027942; Sat, 21 Oct 2023 07:53:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697900027; cv=pass; d=google.com; s=arc-20160816; b=ymZeaobDsD2o4MzubVPF0Di1EYGE1p78b+5hLvQ/wTuEVXAL8xtVYGGM3hivO0IagF 53J6HagvC/sBrZk8LzjkP2rbb2JYHBjNRNj1LWjFwXFML7ZVNIMNC8QLDBaYKS4tJWrV BvuQxBrTlgWBzMIOXjV55I1aLxG2FHBmkM8CAoj+/U3PNolCISkASxcdJUV6tu6RoSP/ iSzgJW9JFyKBUs6bN2P3m1b4Md8p8OLD0pCwBk/jTN8Bb1Mtv05dNWIXb+Uk52fax5mM CQtItc9cq0pXN+51nqWP73uKvVzUBgmhh4W3kkFa56Lj8FLsbJWx8CWCEiYmU+dCxUEF /gxA== 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=HWz4BnHADkuwzJ/1vmb4UAJYRCa27cr9uLeGPHAvEQg=; fh=+tuSxjKzYI2UUNCNCw947PY37bARC557hN7q19QkmNo=; b=UsuCLIo/KuNB56SKHg0ROad+9BdlBPT69i1nG0uwjjZV2928ofC7/9T1LRgMd2VPy1 MP8EtQRBJVD9IaPMuc/enVxLFupPo7KvOEC0taFbIJLmKm3ub7rHexvZ7FGJA7IGN4OA +A4lca7I1eRrcomsdk2+0dM1Zg83fNbuHAFl+7P5a5KzR1zcWkkUbH4GCJ9ZBGCt+2WV 70KiYV+/HspPoEqAjEW/V28tsKe8O3CfkXyvYyqQb6V+hHKofPJZihWMV79kIa9ucRdh fY0Wqh/GtbC/uLlf3qdBvDxPMWxRcoX5xTNRKhnYN9fgU21CbDUabgVmVab0uasHj4r2 vf5g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=AKm2fxcZ; 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 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id y72-20020a638a4b000000b00585adc52bd5si3713341pgd.730.2023.10.21.07.53.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Oct 2023 07:53:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=AKm2fxcZ; 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 23.128.96.36 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 3491C816822D; Sat, 21 Oct 2023 07:53:42 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231625AbjJUOwK (ORCPT + 26 others); Sat, 21 Oct 2023 10:52:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231600AbjJUOwG (ORCPT ); Sat, 21 Oct 2023 10:52:06 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2072.outbound.protection.outlook.com [40.107.237.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5A82D79 for ; Sat, 21 Oct 2023 07:51:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nI5iufCdiBtS887WpOA6HgQ6S95VcXX8p4Qk85qzVEhFAcACMJgKHJAfDg8FT+V7kiKNwO+/Tk5Q8aarDTBccig98pDRwuQDkfnf3UoxZtZkpsRlNRKdP5b0tghHOm2625wp9S4BmbAyyLDlSyrEzQ0VL2qYrm45A6PCRQh6EQc6c4uOk/Nq7iRiVYsOg5C8sFd9GUa2vZd3X1a7mt9YN3Ay0DChtz+LBq29g+qTFgUsscNSO5gXcNdEZx37e1ec2JHBUNe2Wl9a7tQVfnTVcCMLhzcq7Qpyv3Q0Qt3bVDcCNdOlt94dGHJa6id//KLRrVNaAkerEBy3onKObTVWWQ== 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=HWz4BnHADkuwzJ/1vmb4UAJYRCa27cr9uLeGPHAvEQg=; b=aJfoG/0w7jQv+F6VMEjKCRGqsckXZXic8DUhxVafAuXMM5Dlu1dKjp0Un17B0OmcPVD91ZxgRWZyK4quDwelsWepVrHibhUafHq1D/WQLeladkrn+aNokEy211isKdEXh1kk7wN6Xgy8Jz1ETvf3XHTc8q6S07zEPiIFlOO6HS+PH7yTG6m6eEQsUuN927hX5EitUoEa1OSwIzDzadXLy0tmWuwPv+NBvUFKgvnqdRZcMmyeGjKXCepy0Ie0nbauzCheYfUMvTt4LbHBuY/14cGaCGrjV3kMua9GuT9+yjFYNS3C4e5m2l5YghzMDuNnqxJ1XxPh/IZQ2UBCiXt1Bg== 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=HWz4BnHADkuwzJ/1vmb4UAJYRCa27cr9uLeGPHAvEQg=; b=AKm2fxcZvUWwFo9Lso15R9lGPWWnjZfClqWV7FI/Tppjrnp6dcE8p+G2sUxEIGDydRLa9Otl/X6Mz6nTbj3rhvRu9SIB3TjbcVxhX/vc7UgjBNwKSb10pMIta9nUY4kugVSeBsGEVMlUsT1IJuBMSYmIErC81WqTCgP+N67rkeQ= Received: from CH2PR08CA0013.namprd08.prod.outlook.com (2603:10b6:610:5a::23) by MN0PR12MB5833.namprd12.prod.outlook.com (2603:10b6:208:378::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.34; Sat, 21 Oct 2023 14:51:52 +0000 Received: from DS2PEPF00003442.namprd04.prod.outlook.com (2603:10b6:610:5a:cafe::b6) by CH2PR08CA0013.outlook.office365.com (2603:10b6:610:5a::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.26 via Frontend Transport; Sat, 21 Oct 2023 14:51:52 +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 DS2PEPF00003442.mail.protection.outlook.com (10.167.17.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6907.21 via Frontend Transport; Sat, 21 Oct 2023 14:51:52 +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.2507.27; Sat, 21 Oct 2023 09:51:51 -0500 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Sat, 21 Oct 2023 09:51:47 -0500 From: Syed Saba Kareem To: , CC: , , , , , , , , Syed Saba Kareem , Liam Girdwood , "Jaroslav Kysela" , Takashi Iwai , Arnd Bergmann , Marian Postevca , open list Subject: [PATCH 05/13] ASoC: amd: acp: add Kconfig options for acp6.3 based platform driver Date: Sat, 21 Oct 2023 20:20:46 +0530 Message-ID: <20231021145110.478744-5-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231021145110.478744-1-Syed.SabaKareem@amd.com> References: <20231021145110.478744-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS2PEPF00003442:EE_|MN0PR12MB5833:EE_ X-MS-Office365-Filtering-Correlation-Id: ded95279-c8d6-45d1-2f7d-08dbd245430f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Qv8avkckgz/stjuYH40HlbXv5WJoPJYn/fA3MdEVaBWrT58V/Hiqjai9poLQYyZYMfzLmfVQF+FuGI1VkVTLqamK31SBVhTreymS1uMWhOYa93bZaE3XvrW+j0fDPK3VnYokzB8WBPLQNBdit70cqt/sgNXr3bV+M7n+PejYBupR6ec3cLIDasg4Nf5hiKKB+vPDHmShlVFfhfg+TDZGtlGFpFbYiIm4E7oGeY4JfKF9siSAu/p7vLCRAn0ozgvHcXo9lMYJERHIsiKr/qYavf8t6H3HT0Y2iigtwPsLkC/tcX5Ni6BkmW+1kj7QZZjE7XbYw8NxrfxWzQ2yu8TMxyn7maxANBRJcG3PUBRp9USD3GFtgxXwG8Rq3smxRCMfWacR8HIOSTxQrgTCLrwsOOLJ0zfez/wydVMwAFp1VlS3m/jalY3bWOE0DpL4arPH/ZWeheQj/PfsO6YpFyE85Hy7Abg7Ysr1Iu+LEvcLrAxuV05uY+xKkAh+AxGKAifnSiJIS9+rxQ/wl5FV+iGwVW+XnXPlaxwAvWHXjgi+iVPF2O+N1skCJAejQ3r2YG61+G5u7ykn/GNNxOvdgsWuX3x9q68MVHvdko3dy+1yDAMvgSQfGz6mqBczXcnV/tcA4uv8DwQqMuhLGTi6ujALYe/8n8EAmbPQiYtLjv/yaXd8B45SkCws7gH0iQAtyo/ndZHo7GD3Novl6Uv13S4cBSqM9Dkbadrr/T+JyNVuCbV8VoLXzvI6V8EPz6Vnok49Rq8cXw4XW8DoSmUOWrfypA== 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:(13230031)(4636009)(346002)(136003)(39860400002)(396003)(376002)(230922051799003)(451199024)(1800799009)(186009)(64100799003)(82310400011)(36840700001)(46966006)(40470700004)(47076005)(36756003)(86362001)(54906003)(2616005)(70586007)(40460700003)(82740400003)(26005)(356005)(81166007)(40480700001)(110136005)(70206006)(1076003)(316002)(7696005)(36860700001)(336012)(426003)(5660300002)(478600001)(8676002)(2906002)(8936002)(41300700001)(4326008)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2023 14:51:52.1920 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ded95279-c8d6-45d1-2f7d-08dbd245430f 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: DS2PEPF00003442.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB5833 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Sat, 21 Oct 2023 07:53:42 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780377219941799298 X-GMAIL-MSGID: 1780377219941799298 ACP6.3 based platform legacy drivers can be built by selecting necessary kernel config option. This patch enables build support of the same. Signed-off-by: Syed Saba Kareem --- sound/soc/amd/acp/Kconfig | 11 +++++++++++ sound/soc/amd/acp/Makefile | 2 ++ 2 files changed, 13 insertions(+) diff --git a/sound/soc/amd/acp/Kconfig b/sound/soc/amd/acp/Kconfig index 631cdf96d637..c0b2a2df8f80 100644 --- a/sound/soc/amd/acp/Kconfig +++ b/sound/soc/amd/acp/Kconfig @@ -57,6 +57,17 @@ config SND_AMD_ASOC_REMBRANDT Say Y if you want to enable AUDIO on Rembrandt If unsure select "N". +config SND_AMD_ASOC_ACP63 + tristate "AMD ACP ASOC ACP6.3 Support" + select SND_SOC_AMD_ACP_PCM + select SND_SOC_AMD_ACP_I2S + select SND_SOC_AMD_ACP_PDM + depends on X86 && PCI + help + This option enables Acp6.3 I2S support on AMD platform. + Say Y if you want to enable AUDIO on ACP6.3 + If unsure select "N". + config SND_SOC_AMD_MACH_COMMON tristate depends on X86 && PCI && I2C diff --git a/sound/soc/amd/acp/Makefile b/sound/soc/amd/acp/Makefile index dc70691bc293..dd85700f1c5f 100644 --- a/sound/soc/amd/acp/Makefile +++ b/sound/soc/amd/acp/Makefile @@ -14,6 +14,7 @@ snd-acp-pci-objs := acp-pci.o #platform specific driver snd-acp-renoir-objs := acp-renoir.o snd-acp-rembrandt-objs := acp-rembrandt.o +snd-acp63-objs := acp63.o #machine specific driver snd-acp-mach-objs := acp-mach-common.o @@ -28,6 +29,7 @@ obj-$(CONFIG_SND_SOC_AMD_ACP_PCI) += snd-acp-pci.o obj-$(CONFIG_SND_AMD_ASOC_RENOIR) += snd-acp-renoir.o obj-$(CONFIG_SND_AMD_ASOC_REMBRANDT) += snd-acp-rembrandt.o +obj-$(CONFIG_SND_AMD_ASOC_ACP63) += snd-acp63.o obj-$(CONFIG_SND_SOC_AMD_MACH_COMMON) += snd-acp-mach.o obj-$(CONFIG_SND_SOC_AMD_LEGACY_MACH) += snd-acp-legacy-mach.o From patchwork Sat Oct 21 14:50:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 156464 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp332089vqx; Sat, 21 Oct 2023 07:52:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGdpy+RW8GYwJ3ehdXRv992CIxgo7JyNL3kLcEsReRv2GZeJXySp4s8iq4a6iqAvEpnaVbw X-Received: by 2002:a17:902:d4cf:b0:1c3:92de:1b23 with SMTP id o15-20020a170902d4cf00b001c392de1b23mr4817870plg.59.1697899976897; Sat, 21 Oct 2023 07:52:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697899976; cv=pass; d=google.com; s=arc-20160816; b=SUykywe8Eu5hNDZEXbUtpanX5/AWA+tQg3/0/4qNWgT3qbuxIAnzEJR1uxnaO2soiz A7UXZt6X7t/oZ7RwyL1c5ihpdEc0aQORpG/7HFuc5HuhTIHw5xE4EI8XbSSMtEzJr1/R VH2yhI6HdY0KSFZPdjvWkJElcMv9QWEeTUeUqtop0IS/i7MN3Dg2GqqKz+YX46NZ+3Cn Ac+ooJLTkcUQAs9fVTgxIbdAEWf/TPWFZDSAliFDZt/xFSx5rpDEM6NW1vg9MdZYQK/p OOMKuiKhraMkyIFK+gk2/+TkjZjvlKNXZE8Ccqd8GYqkpFoyrgHYnkd+1FNcIjkyicA2 CYog== 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=7h/y0H64UH3ieCAT4vktmaqn7AZKS+4IvoIzH5wPbb4=; fh=sE18ZEF1UtjhXV7jHMkYfoLVWIH0OZJnHZX/afp7jFc=; b=JMrUMMVtaVN0THGlRJ88YPDAwRVyKVWoUTIVKaTdare+0hiS+c9OrWnkN5GC1VXpOi AoD8wIDEi0JbA03ENm3XhntgVK4zzHUdK4hGuxKNXhfKn0oymLD9SXjAYJuPozKBmzwT pEv8SH4cgByDN+BnIifswm2AiDS3wqB++M2ix98LUh8PbjS4jG4uUW3ncU6e46SCm3+R Irk5pKSb0BuJ7vVUL29qpHRksja+SJ6ue5RG8mBED9mAk6hG0pqBa/D3ItM9JulFSJOZ xQfegMrtP3lKQ9FCLRXw9nEb8xo97oS5Mk0v+3bsht2vJs7Ikj8lhx1Wgi0F6T0Z2MaD W3Ng== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=t8VOTDZZ; 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 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id f5-20020a170902684500b001c5c632aea4si3590136pln.217.2023.10.21.07.52.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Oct 2023 07:52:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=t8VOTDZZ; 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 23.128.96.33 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 2CAE98039EF6; Sat, 21 Oct 2023 07:52:52 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231624AbjJUOw0 (ORCPT + 26 others); Sat, 21 Oct 2023 10:52:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231324AbjJUOwY (ORCPT ); Sat, 21 Oct 2023 10:52:24 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2076.outbound.protection.outlook.com [40.107.243.76]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC591D7C for ; Sat, 21 Oct 2023 07:52:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YC8nGSgsNeAnZMhVn6MVuZ+tSil2xet8Mc8yyZHnQyDQ5hhpAAF6BnEysuwIgc2C/SLiS1uVaTM+iQCWQroTKJbMtGMs9hETPFnhkaQkntgBwmvatB8dszWVB4IOoD82sVAcIPVoHYj+Bl6HCFDqucya+8D98wbTUmoewaMoFDWH/06N9zHt1avLMw3uXfM2GyD/Tps0ECB9eIA1WsmL1p2hI5xIBm+noMvsfFS07TK8/PFSj6Q67lgDV0Jq9nXIpW/h9P7dsAASY/AiVDc2Pa7Jte6U9nbGu1QaMzECiXPnL36ud1Qc9NJ1Yx+7MYXy8N9UjFu34V3jLsHHrTDF8Q== 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=7h/y0H64UH3ieCAT4vktmaqn7AZKS+4IvoIzH5wPbb4=; b=K5XOb1mpqBekxGTcTta+bbGVnbXXG6jdL44A3SE/o27P0KmyRG6kVW3kqLffKpy2m6/Rblpflfu2bV1OTWJwvqiXFJyvlHhSTCdZhBo0JxSjLoyYWSVrCOQ+rHHWk21d6xTyzgk48uae4qRSE41oPBrf30nmIlXl6+95IOGdzr76d8FUgww0PWbLG2wJCuwhoFSGKZcLYrFa09Evr+t56mXGSem3rr/Jvc8J4v15OZXBHKN6rRUZqM0iLQASaNW5Ne6ec/3ov67rXZP9Yy0gMTjJ+2WGudJH7qr41y5QFNKY4jOBwQ6mbCbbI8eXdFU+2cFLwxt0PMoiSAnHukZroA== 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=7h/y0H64UH3ieCAT4vktmaqn7AZKS+4IvoIzH5wPbb4=; b=t8VOTDZZnUBNzhq7Q6tN4e+WqrimpLZNV3bJL6QS/WaEDxyYUlp+Gi4Z+viN1uZaZi3Vcuy4dAJS1DT/uqRk+kQPbNRmHh49BnFuxmD5GXK+I0soFrSqBxIy0Ouro/gRDZiMFsR8s8qauCiticETtrUyfmIFubRA7n6pUCQyyNk= Received: from DM6PR13CA0064.namprd13.prod.outlook.com (2603:10b6:5:134::41) by PH7PR12MB8427.namprd12.prod.outlook.com (2603:10b6:510:242::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.26; Sat, 21 Oct 2023 14:52:05 +0000 Received: from DS2PEPF00003448.namprd04.prod.outlook.com (2603:10b6:5:134:cafe::16) by DM6PR13CA0064.outlook.office365.com (2603:10b6:5:134::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.7 via Frontend Transport; Sat, 21 Oct 2023 14:52:05 +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 DS2PEPF00003448.mail.protection.outlook.com (10.167.17.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6907.20 via Frontend Transport; Sat, 21 Oct 2023 14:52:05 +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.2507.27; Sat, 21 Oct 2023 09:52:04 -0500 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Sat, 21 Oct 2023 09:51:59 -0500 From: Syed Saba Kareem To: , CC: , , , , , , , , Syed Saba Kareem , Liam Girdwood , "Jaroslav Kysela" , Takashi Iwai , V Sujith Kumar Reddy , Kuninori Morimoto , Claudiu Beznea , Jarkko Nikula , open list Subject: [PATCH 06/13] ASoC: amd: acp: add code for scanning acp pdm controller Date: Sat, 21 Oct 2023 20:20:47 +0530 Message-ID: <20231021145110.478744-6-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231021145110.478744-1-Syed.SabaKareem@amd.com> References: <20231021145110.478744-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS2PEPF00003448:EE_|PH7PR12MB8427:EE_ X-MS-Office365-Filtering-Correlation-Id: 95a7c156-7fd0-4526-2407-08dbd2454b05 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5e49GLamlP4bbvIaYfbISnprH3Y7ZaSTsYAoAd1cDK5DLX85Ncdi2x3/0ObHZeus+Ko+kHOb14VIN4p+/diMHSunNtlK37X2zbJiY/L9JW9HOpN768ckeCShIjUqQ1fGv8i4GS8acfbdNgREogwXVnAIgRxmC+2lq/4Ew8eYPVWfYfODJ/i2iVbDk77vBIHdeKzuiCG3VTKoVmvPzrtceXK4B0Z19ckxmHZy3dt0oA73WUf/ISc+XLAzF0j55WyBB4S1Xxhq1AG5GGXSFfJOIyWpzmjlk9U2twVWROgZx2YmtJ53vZ4d3/u8AZwmoWeYITd8f7h/qxw9xzcbMdgJemBSDX4ricBDjZmxYJuMU2NpNsbDHP8Phkg5IqbEbVTmIohGwEb5OSNjcYm9uqcD4lgs4CNwB2N12Qbt3Ij9c6FmISqIoxxt7m7Ex/VZauVRLrBM0Wbggj6paGdknjyP8o1ps/2299GvRugO22q8bQFJ0wq2mYzbuU3T8I0XA2FaE7vIXHDK5N/6MJUWu6M79vRuAq1Xbes5Jmn4rvc2hxGVC4YGWPfYxBa7a3Sqz3I/s3jixX6CCrMVCGSm53eF1D0yfeRzN/5GUxIZHYvCZ/6VXtJBGpqtvyVNMZ1XhqN+KXUoWdzRvTuDZbxFFTC33uBdmIXNtN+eDf0lWN5QHAU3Z3HXIYAPhl5lN97GBDntYAettt/Y+AqQALU2JcUZfSLUslsoWGFFDD7pdOlnnyQWR9C2tYEMV0famcTwdssUqCI1MLsqO55XD/Eru4RIrg== 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:(13230031)(4636009)(39860400002)(396003)(136003)(346002)(376002)(230922051799003)(64100799003)(82310400011)(186009)(1800799009)(451199024)(46966006)(36840700001)(40470700004)(83380400001)(36860700001)(47076005)(336012)(1076003)(426003)(26005)(2616005)(7696005)(6666004)(356005)(86362001)(36756003)(82740400003)(81166007)(40460700003)(41300700001)(4326008)(8936002)(8676002)(478600001)(5660300002)(40480700001)(2906002)(70206006)(54906003)(110136005)(70586007)(316002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2023 14:52:05.5480 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 95a7c156-7fd0-4526-2407-08dbd2454b05 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: DS2PEPF00003448.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB8427 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Sat, 21 Oct 2023 07:52:52 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780377166213029445 X-GMAIL-MSGID: 1780377166213029445 Add common code for scanning acp pdm controller and create platform device for the same. Signed-off-by: Syed Saba Kareem --- sound/soc/amd/acp/acp-legacy-common.c | 52 +++++++++++++++++++++++++++ sound/soc/amd/acp/acp-pci.c | 11 +++++- sound/soc/amd/acp/amd.h | 22 ++++++++++++ sound/soc/amd/acp/chip_offset_byte.h | 1 + sound/soc/amd/mach-config.h | 1 + 5 files changed, 86 insertions(+), 1 deletion(-) diff --git a/sound/soc/amd/acp/acp-legacy-common.c b/sound/soc/amd/acp/acp-legacy-common.c index e16ef94e6336..af85a153a770 100644 --- a/sound/soc/amd/acp/acp-legacy-common.c +++ b/sound/soc/amd/acp/acp-legacy-common.c @@ -16,6 +16,10 @@ #include #include +#define ACP_RENOIR_PDM_ADDR 0x02 +#define ACP_REMBRANDT_PDM_ADDR 0x03 +#define ACP63_PDM_ADDR 0x02 + void acp_enable_interrupts(struct acp_dev_data *adata) { struct acp_resource *rsrc = adata->rsrc; @@ -348,4 +352,52 @@ int smn_read(struct pci_dev *dev, u32 smn_addr) } EXPORT_SYMBOL_NS_GPL(smn_read, SND_SOC_ACP_COMMON); +int check_acp_pdm(struct pci_dev *pci, struct acp_chip_info *chip) +{ + struct acpi_device *pdm_dev; + const union acpi_object *obj; + u32 pdm_addr, val; + + val = readl(chip->base + ACP_PIN_CONFIG); + switch (val) { + case ACP_CONFIG_4: + case ACP_CONFIG_5: + case ACP_CONFIG_6: + case ACP_CONFIG_7: + case ACP_CONFIG_8: + case ACP_CONFIG_10: + case ACP_CONFIG_11: + case ACP_CONFIG_12: + case ACP_CONFIG_13: + case ACP_CONFIG_14: + break; + default: + return -EINVAL; + } + + switch (chip->acp_rev) { + case ACP3X_DEV: + pdm_addr = ACP_RENOIR_PDM_ADDR; + break; + case ACP6X_DEV: + pdm_addr = ACP_REMBRANDT_PDM_ADDR; + break; + case ACP63_DEV: + pdm_addr = ACP63_PDM_ADDR; + break; + default: + return -EINVAL; + } + + pdm_dev = acpi_find_child_device(ACPI_COMPANION(&pci->dev), pdm_addr, 0); + if (pdm_dev) { + if (!acpi_dev_get_property(pdm_dev, "acp-audio-device-type", + ACPI_TYPE_INTEGER, &obj) && + obj->integer.value == pdm_addr) + return 0; + } + return -ENODEV; +} +EXPORT_SYMBOL_NS_GPL(check_acp_pdm, SND_SOC_ACP_COMMON); + MODULE_LICENSE("Dual BSD/GPL"); diff --git a/sound/soc/amd/acp/acp-pci.c b/sound/soc/amd/acp/acp-pci.c index d7fc4a0e9245..bbf079d47dc4 100644 --- a/sound/soc/amd/acp/acp-pci.c +++ b/sound/soc/amd/acp/acp-pci.c @@ -55,7 +55,7 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id int ret; flag = snd_amd_acp_find_config(pci); - if (flag != FLAG_AMD_LEGACY) + if (flag != FLAG_AMD_LEGACY && flag != FLAG_AMD_LEGACY_ONLY_DMIC) return -ENODEV; chip = devm_kzalloc(&pci->dev, sizeof(*chip), GFP_KERNEL); @@ -129,6 +129,13 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id } } + if (flag == FLAG_AMD_LEGACY_ONLY_DMIC) { + ret = check_acp_pdm(pci, chip); + if (ret < 0) + goto skip_pdev_creation; + } + + chip->flag = flag; memset(&pdevinfo, 0, sizeof(pdevinfo)); pdevinfo.name = chip->name; @@ -145,6 +152,8 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id ret = PTR_ERR(pdev); goto unregister_dmic_dev; } + +skip_pdev_creation: chip->chip_pdev = pdev; dev_set_drvdata(&pci->dev, chip); pm_runtime_set_autosuspend_delay(&pci->dev, 2000); diff --git a/sound/soc/amd/acp/amd.h b/sound/soc/amd/acp/amd.h index 87d1e1f7d6b6..2ffe1effc6b5 100644 --- a/sound/soc/amd/acp/amd.h +++ b/sound/soc/amd/acp/amd.h @@ -133,6 +133,7 @@ struct acp_chip_info { unsigned int acp_rev; /* ACP Revision id */ void __iomem *base; /* ACP memory PCI base */ struct platform_device *chip_pdev; + unsigned int flag; /* Distinguish b/w Legacy or Only PDM */ }; struct acp_stream { @@ -188,6 +189,25 @@ struct acp_dev_data { u32 xfer_rx_resolution[3]; }; +enum acp_config { + ACP_CONFIG_0 = 0, + ACP_CONFIG_1, + ACP_CONFIG_2, + ACP_CONFIG_3, + ACP_CONFIG_4, + ACP_CONFIG_5, + ACP_CONFIG_6, + ACP_CONFIG_7, + ACP_CONFIG_8, + ACP_CONFIG_9, + ACP_CONFIG_10, + ACP_CONFIG_11, + ACP_CONFIG_12, + ACP_CONFIG_13, + ACP_CONFIG_14, + ACP_CONFIG_15, +}; + extern const struct snd_soc_dai_ops asoc_acp_cpu_dai_ops; extern const struct snd_soc_dai_ops acp_dmic_dai_ops; @@ -214,6 +234,8 @@ void restore_acp_pdm_params(struct snd_pcm_substream *substream, int restore_acp_i2s_params(struct snd_pcm_substream *substream, struct acp_dev_data *adata, struct acp_stream *stream); +int check_acp_pdm(struct pci_dev *pci, struct acp_chip_info *chip); + static inline u64 acp_get_byte_count(struct acp_dev_data *adata, int dai_id, int direction) { u64 byte_count = 0, low = 0, high = 0; diff --git a/sound/soc/amd/acp/chip_offset_byte.h b/sound/soc/amd/acp/chip_offset_byte.h index ce3948e0679c..cfd6c4d07594 100644 --- a/sound/soc/amd/acp/chip_offset_byte.h +++ b/sound/soc/amd/acp/chip_offset_byte.h @@ -19,6 +19,7 @@ #define ACP_PGFSM_STATUS 0x1420 #define ACP_SOFT_RESET 0x1000 #define ACP_CONTROL 0x1004 +#define ACP_PIN_CONFIG 0x1440 #define ACP_EXTERNAL_INTR_REG_ADDR(adata, offset, ctrl) \ (adata->acp_base + adata->rsrc->irq_reg_offset + offset + (ctrl * 0x04)) diff --git a/sound/soc/amd/mach-config.h b/sound/soc/amd/mach-config.h index d392e6d6e6e1..e6b520459164 100644 --- a/sound/soc/amd/mach-config.h +++ b/sound/soc/amd/mach-config.h @@ -15,6 +15,7 @@ #define FLAG_AMD_SOF BIT(1) #define FLAG_AMD_SOF_ONLY_DMIC BIT(2) #define FLAG_AMD_LEGACY BIT(3) +#define FLAG_AMD_LEGACY_ONLY_DMIC BIT(4) #define ACP_PCI_DEV_ID 0x15E2 From patchwork Sat Oct 21 14:50:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 156467 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp332448vqx; Sat, 21 Oct 2023 07:53:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGqWMm2wbs1raJOblVtYroJu9aYZpKVCgcK9hOnbbYmPrUuktYJUohtNVgpX9AdjEUdcJWn X-Received: by 2002:a05:6a20:9389:b0:17a:4891:e33 with SMTP id x9-20020a056a20938900b0017a48910e33mr4710893pzh.4.1697900024511; Sat, 21 Oct 2023 07:53:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697900024; cv=pass; d=google.com; s=arc-20160816; b=NHZ+vnAzq+mg9NzieL5iXG7KjaHjfhVCA09NxpNdr0VXxnD9h4ZvSbqO7yq92So1hA 9r4tHlPUs31TpTtdLJ61XeFRKUYgiel1qxQrMJkP1IxqyLK+ovzq1AzyJlhC6aMIUF/G HleheWPIIloUvk/Xl5CC4bHQIq9NAgus3bE2WLHoeW3nNY7MIAdS02R6lbLjQeW9YIM1 YPO9SJvlIg/TAIbEys3Pw0zOtHULr8xpdwPaXLPihPTpVlC2D0ymXQj8JJYc/Gdu97fO vthoFjbUYFXUzfzXcc04SbpqzKdzfgP/3HHc2bIinoc7wD9+BJ73hlB4MlaAueGUaT0V fQmg== 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=ZH8rugi7wUfF1GJF+mFMINCAm702SP9QIoZUlrbiypE=; fh=cg/LfRto+Y+6ogyUVxwLrqTZXl3r6IefTAogNjUSnZs=; b=c0zKQTKKqdgL2xteF8TnKuB+vgFhWr4/GS74MJEWZZYaC+9IVkcEy1+vQPZt0zCJ30 wi589/CIS5Av6igYtG2Uo+EFzNqZJaAr6Zb6I69xhBlqyoGjwVdQnx/kibu37rvMg3V0 Sph1SMWa6E4dhGWWiuSbhIQIze67B0rfOEbicwChRHZMaBV3JjnwpWkKk9ZGgKaaHeuO Bk+O7iT9k4uT3VMHeJ6Z+SMbNTUYBk9Y1eO+fYEf30XiwasrIL0/mzc1nxjwGszyR9P4 Wbcg8BVVUsMCNgUN1W7/nvD+11DePis+qH1lTPmbwCJWLIbjShJTKqYJJZzQLwN6X8Ff OG2Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=QcL8a76I; 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::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id h71-20020a63834a000000b005b837c257a8si3639211pge.370.2023.10.21.07.53.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Oct 2023 07:53:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=QcL8a76I; 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::3:2 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 17E148104986; Sat, 21 Oct 2023 07:53:40 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231280AbjJUOwh (ORCPT + 26 others); Sat, 21 Oct 2023 10:52:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231631AbjJUOwe (ORCPT ); Sat, 21 Oct 2023 10:52:34 -0400 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2083.outbound.protection.outlook.com [40.107.100.83]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AA4A10CC for ; Sat, 21 Oct 2023 07:52:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fSFuqHFBSOZNkrGsUe/l+I1m1HnhDEIfC7Gbft+534VNpWE8RlroyiOgj9NxkR8ZixlIKy9Uc9zY7+ggwa/qy/T6qZMxBhmagFfbhZAafQ6/rvVsb2yRGpap2PAIyqJ/B2tEY6ikvlYaaUzbdxckRptoChmm2PT2RYkVIxpZZZSoZ//t+vQjhoN73lFRKm+B4clhYAJc1eh2WnY1ES4tTc3t8cqMqp8ZRJ+ELjK/NVSz08HIlpiwOfuHKjqA22ag9wS6ylK6UDVbKBrIdm2+WGC4idjDUtzPkIw6VsV9Njn2HF16lM/tsAHkU4JEpK2AkkarUhg1+kfs68W9lMzTEg== 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=ZH8rugi7wUfF1GJF+mFMINCAm702SP9QIoZUlrbiypE=; b=Ftnpwcc6gNJasahnSRjvTiP1s5FZBIGpSh95p0pIXDjlTb8o4IpAJIP4kskwHzyMLn7Saa6I/ajqsJEDqH+lEy5EjIvSSFaqiJHTLBKBUSJGG0wI3S6zqDWvkZtaB3XliN2Tk3yNmEwl6wnyChTu3279ouSJQ6mG5ZkaYNDEym7H4lDYB5bfZBS+9n7hJd5gsirNQXWm8TlwGN3cc8MkWq0aANJdGDLCWSQNJHLwqzX1tdnL+DLhAhDYcAWhYxgF22zp/iDKNo8JiFwHDhgTM/DgdwcEBUtZvTP3PkEScOVDJLY99UNpythZpvUwsu4Iz9Qsv2Jgg/7Zs3EboykACg== 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=ZH8rugi7wUfF1GJF+mFMINCAm702SP9QIoZUlrbiypE=; b=QcL8a76IS5aXT2emHDmNW+IHpnhcf36F6legh2xv4ZPPPJJym60g8TuUdi3dFsmaxWIwnt2fHCPYyswMtwi2srMyuVOo33A1GCxdoXYMjm4BsCmz8xWZft/OC7I50Q2vQ7gc6ji/V0SLwS/vE132vSoJDzKWbeJdb8HY7ZOUGiE= Received: from CH0PR03CA0402.namprd03.prod.outlook.com (2603:10b6:610:11b::23) by IA0PR12MB7625.namprd12.prod.outlook.com (2603:10b6:208:439::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.23; Sat, 21 Oct 2023 14:52:20 +0000 Received: from DS2PEPF00003446.namprd04.prod.outlook.com (2603:10b6:610:11b:cafe::cc) by CH0PR03CA0402.outlook.office365.com (2603:10b6:610:11b::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.29 via Frontend Transport; Sat, 21 Oct 2023 14:52:19 +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 DS2PEPF00003446.mail.protection.outlook.com (10.167.17.73) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6907.20 via Frontend Transport; Sat, 21 Oct 2023 14:52:19 +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.2507.27; Sat, 21 Oct 2023 09:52:19 -0500 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Sat, 21 Oct 2023 09:52:13 -0500 From: Syed Saba Kareem To: , CC: , , , , , , , , Syed Saba Kareem , Liam Girdwood , "Jaroslav Kysela" , Takashi Iwai , Nicolas Ferre , Kuninori Morimoto , =?utf-8?q?Uwe_Kleine-?= =?utf-8?q?K=C3=B6nig?= , Yang Li , "Dan Carpenter" , Marian Postevca , "V Sujith Kumar Reddy" , open list Subject: [PATCH 07/13] ASoC: amd: acp: add platform and flag data to acp data structure Date: Sat, 21 Oct 2023 20:20:48 +0530 Message-ID: <20231021145110.478744-7-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231021145110.478744-1-Syed.SabaKareem@amd.com> References: <20231021145110.478744-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS2PEPF00003446:EE_|IA0PR12MB7625:EE_ X-MS-Office365-Filtering-Correlation-Id: 75f554b9-e331-467a-9b43-08dbd2455380 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jlYDVOKeiPNPFz9e8yGD42/oahjwuFpc6E+ERbYAJ3k/WEmIyN5Slt+zkE5vnJrYnhSrMbeMRhquC0KPNuDVbfJqrEXnM7QtG6Txpc8LL5pKeIje29r5n+d4NF00WLrNSue2iUgFwyOtNiz4T7bYbERdaV95JFBB1Wnaz6f4TFl88vYNyrFG+XyTHpMPHJl6uweg0bbbkqNgKEeTDupid1dYOqK6QC5Yvw2CR7moILGAOqdRonC9tyROj9xrSa5p1fU56v8n0heVwSnj9yF1xGnVmZ4GqoPLddvXWT+wQpZSabqSoHQ5TY/fvNWEmwRa+ZIFERtFnuElQeN1iCFKNfPcBx2KygGPPf8XZMdZPOM90wirEaWvqSzmeyX4gLYLvzxWarAuoD6YA4mPWquXsyMYUPJNY5ETq5VBtWPCPGLbb/Chq/b0qaugtfDVq5m+wIuH+UvvHhvQ1hVH9PsGIQ1ZgqjtL/oeS1p+ccAXCEQSOWZAOniVhoFcMs63alx6IkRu7JwkLFJ4sxB8H75WSw5S3fsbWkziY25gHVeqoQejw6cTnOZNlXEeSx38kz7+mEpEgwnbPbLijexDeKiquuUdjsxfv3VCW8Gfohu0LR1jaS4ue9DBvqCoagHNPwivzROZvzz/l8yzJ6Ii9wb8fcmL/q7DnTUvO+UzRng//bg97qnFacCL/eCMLL48FqibZv6Q6HVsKzpaEazkHB4xjqFT0gdIeL/pPHvRf//KRWjGHUIUTrUu9CVFMhkAjcY8PztscLeMKPdR9ANaeiEN3w== 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:(13230031)(4636009)(396003)(346002)(376002)(136003)(39860400002)(230922051799003)(1800799009)(451199024)(82310400011)(186009)(64100799003)(40470700004)(46966006)(36840700001)(2616005)(8676002)(4326008)(8936002)(40480700001)(478600001)(40460700003)(7416002)(86362001)(426003)(356005)(26005)(7696005)(2906002)(36756003)(6666004)(41300700001)(47076005)(336012)(1076003)(81166007)(83380400001)(82740400003)(36860700001)(5660300002)(70206006)(54906003)(70586007)(316002)(110136005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2023 14:52:19.7789 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 75f554b9-e331-467a-9b43-08dbd2455380 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: DS2PEPF00003446.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB7625 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Sat, 21 Oct 2023 07:53:40 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780377215949599796 X-GMAIL-MSGID: 1780377215949599796 add name of the platform and flag data in private data structure. name of the platform will be used to differentiate platforms where as flag will be used to know what kind of endpoint configuration is selected where its legacy(I2S + PDM) or only ACP PDM. Signed-off-by: Syed Saba Kareem --- sound/soc/amd/acp/acp-rembrandt.c | 5 ++++- sound/soc/amd/acp/acp-renoir.c | 3 +++ sound/soc/amd/acp/acp63.c | 4 ++++ sound/soc/amd/acp/amd.h | 2 ++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/sound/soc/amd/acp/acp-rembrandt.c b/sound/soc/amd/acp/acp-rembrandt.c index 1bf7b2e68a11..ef5fe6438efd 100644 --- a/sound/soc/amd/acp/acp-rembrandt.c +++ b/sound/soc/amd/acp/acp-rembrandt.c @@ -23,6 +23,8 @@ #include #include "amd.h" +#include "../mach-config.h" +#include "acp-mach.h" #define DRV_NAME "acp_asoc_rembrandt" @@ -226,7 +228,8 @@ static int rembrandt_audio_probe(struct platform_device *pdev) adata->dai_driver = acp_rmb_dai; adata->num_dai = ARRAY_SIZE(acp_rmb_dai); adata->rsrc = &rsrc; - + adata->platform = REMBRANDT; + adata->flag = chip->flag; adata->machines = snd_soc_acpi_amd_rmb_acp_machines; acp_machine_select(adata); diff --git a/sound/soc/amd/acp/acp-renoir.c b/sound/soc/amd/acp/acp-renoir.c index b15cbdf7fa9b..a591482a0726 100644 --- a/sound/soc/amd/acp/acp-renoir.c +++ b/sound/soc/amd/acp/acp-renoir.c @@ -22,6 +22,7 @@ #include #include "amd.h" +#include "acp-mach.h" #define DRV_NAME "acp_asoc_renoir" @@ -185,6 +186,8 @@ static int renoir_audio_probe(struct platform_device *pdev) adata->dai_driver = acp_renoir_dai; adata->num_dai = ARRAY_SIZE(acp_renoir_dai); adata->rsrc = &rsrc; + adata->platform = RENOIR; + adata->flag = chip->flag; adata->machines = snd_soc_acpi_amd_acp_machines; acp_machine_select(adata); diff --git a/sound/soc/amd/acp/acp63.c b/sound/soc/amd/acp/acp63.c index f94348ad863d..0cec6ecaadfa 100644 --- a/sound/soc/amd/acp/acp63.c +++ b/sound/soc/amd/acp/acp63.c @@ -21,6 +21,8 @@ #include #include #include "amd.h" +#include "acp-mach.h" +#include "../mach-config.h" #define DRV_NAME "acp_asoc_acp63" @@ -237,6 +239,8 @@ static int acp63_audio_probe(struct platform_device *pdev) adata->dai_driver = acp63_dai; adata->num_dai = ARRAY_SIZE(acp63_dai); adata->rsrc = &rsrc; + adata->platform = ACP63; + adata->flag = chip->flag; adata->machines = snd_soc_acpi_amd_acp63_acp_machines; acp_machine_select(adata); dev_set_drvdata(dev, adata); diff --git a/sound/soc/amd/acp/amd.h b/sound/soc/amd/acp/amd.h index 2ffe1effc6b5..62d0793027f2 100644 --- a/sound/soc/amd/acp/amd.h +++ b/sound/soc/amd/acp/amd.h @@ -187,6 +187,8 @@ struct acp_dev_data { u32 tdm_rx_fmt[3]; u32 xfer_tx_resolution[3]; u32 xfer_rx_resolution[3]; + unsigned int flag; + unsigned int platform; }; enum acp_config { From patchwork Sat Oct 21 14:50:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 156465 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp332265vqx; Sat, 21 Oct 2023 07:53:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGVVFXYhXi1vBW/dTElEhg14iMm9gGEs+MybympM4OcU9TFrVIIAVLJfZQfwhHPjqY8OC+D X-Received: by 2002:a17:902:c942:b0:1c9:dcea:33e5 with SMTP id i2-20020a170902c94200b001c9dcea33e5mr4593360pla.67.1697900001321; Sat, 21 Oct 2023 07:53:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697900001; cv=pass; d=google.com; s=arc-20160816; b=N3PuKiRp6Xu2Ei4wAWc72yWfrkBKE60SOe+rfoCOprme71RDF+ufM8m5BZv6JBooPF mE/aPn6maYYJf92Zfe2qB2gOyCttodwE8954deLsk3M3yJmP17ROKsPlexVr03TFLMDj 7NbWCrP7yuDUSk3f8SpYScMv6tLIDVR7cqEuQ/alyNtpV/e7NhQS1S9UdRcK3MOAY5zK 1mBNubwBhrxBUI1At4nW2R32q8kXSTwFjGq4R6Ggo40va7BNEzPNtdmvLHobi8K//ysD p72inknvOEcf0pBzFnc4yyR0gdzvgkfU2H+X8+Pvdg2sylfDTCIJAkKj8viVGDPX6EIS RHTw== 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=lCfG35GUU9rE7pOjCv/q44Xh+EfGOT7Kukj6QeTuhCQ=; fh=3MT2KDmDClESX3TMo5foQcj4IHO5gV8X6cvEIJNdob0=; b=e8qZYHPViSKz39+sX4TMVvmjQOJMb/1tkCCOLD8M/3rxxLkDg+g2G2S0R07accpGTG fXHuD9/yzj7B5I5EdDdXyT9+KdmgDS8jrANhEfW0jJ8a9lAbYEgWHdbKnl4/hpFxEe0H 8JmW7CaFGSu9Is79UZQf5SCrIYlSEh4ETB+d/PnnQe6E1BkxNYqjsltpWaQTjgtT5twi r4PniNKiJT7gwAL6BW/0D0p4xMHovh3NDCJ0uOB16qOMa1nZjjrnB4LSfM3lEE4QBupG vX16E9x3T3QkhLuDHH9//JBMMLnXEZI+0dvdcPOYxYhmcKM5XtC3GInufRDWUH07R/S6 eRqw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=mF+CYNEI; 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 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id c7-20020a170902b68700b001c737001bb3si3391313pls.345.2023.10.21.07.53.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Oct 2023 07:53:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=mF+CYNEI; 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 23.128.96.31 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 0F17F8029344; Sat, 21 Oct 2023 07:53:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231626AbjJUOwt (ORCPT + 26 others); Sat, 21 Oct 2023 10:52:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231685AbjJUOwr (ORCPT ); Sat, 21 Oct 2023 10:52:47 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 783A310C8 for ; Sat, 21 Oct 2023 07:52:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kcSYF1ZrH+DA7PT6LDQEnXIaffmKWK5k9jUgSHyHxQRrBKR8axraHICwJY/FqbB8F8XlGTLDkyKgdv6qUgcSBrVbuDE9IHkm+6pRQhJz61XoEWJb7HagwxcDOuIoMI26kzIUTsccIP8p9Y6jCjIXy3WCZBT5HutAzPlSUC6vpedqE5DRL3jXevuKR6V3pt5DJWU8vnCGxY07z6IEfOODEsgo78KyM6ZZ+DzDatpyqmr8U7SwtXevXWyfhzPMKWrUfHZYlcLYNgSieXS033dmG2EjDydp6Jop1bIPLA3sqi7Sw9pzhVJEo8Sli9N5k7zxXCOonBd79r4IRtV2bFZtTw== 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=lCfG35GUU9rE7pOjCv/q44Xh+EfGOT7Kukj6QeTuhCQ=; b=MSQZVG+3jOlvfhUT4UsbYdSg5jCAYzwuJyMTlF3P9jUZfKynh4+xeKZORQDLvfkYK0lf3eJ9dcruAKS8zVPeKFxqgJ+FntHPO9G8U1WpY4SnczVs+iD4QqIqp9s1sL/rUItwMUrE28FXTT9KZq1qlZobvpJxnWRJkwrk9D56I13Aw/XcowA962k8RHIRyTv0RgseYOcMVDJHBANbDNPSt0374fsfBCvNcrgex+MjwFv9kOlOT6VnTzYwbmqF5/P/NQSwtxXRKtXpPTF/W9Egavgo/sgrQ8LETEDZ2mcWbJs4OrVIuu84qXv8/dmmRasvISGVLR3nMFKtMXDeUCSb1Q== 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=lCfG35GUU9rE7pOjCv/q44Xh+EfGOT7Kukj6QeTuhCQ=; b=mF+CYNEI2s7TD3yBNaES6lOEpb8WzkY1ApqaJRY1t+dKsjsKYbqofp9fNKgA+8MI4TsFggGdJqEAdJa3EYIHS1vUyB0l/KhqNAFoIyn42lmNVbM3Zr5DF13jeK3IaLfi6Jq5Rhld7LXiK+4sBxk/DL/rMQ2AdCPKPnS9EdMO+Sg= Received: from CH2PR08CA0003.namprd08.prod.outlook.com (2603:10b6:610:5a::13) by BL1PR12MB5239.namprd12.prod.outlook.com (2603:10b6:208:315::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.26; Sat, 21 Oct 2023 14:52:31 +0000 Received: from DS2PEPF00003442.namprd04.prod.outlook.com (2603:10b6:610:5a:cafe::b8) by CH2PR08CA0003.outlook.office365.com (2603:10b6:610:5a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.29 via Frontend Transport; Sat, 21 Oct 2023 14:52:31 +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 DS2PEPF00003442.mail.protection.outlook.com (10.167.17.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6907.21 via Frontend Transport; Sat, 21 Oct 2023 14:52:31 +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.2507.27; Sat, 21 Oct 2023 09:52:30 -0500 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.2507.27; Sat, 21 Oct 2023 09:52:30 -0500 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Sat, 21 Oct 2023 09:52:25 -0500 From: Syed Saba Kareem To: , CC: , , , , , , , , Syed Saba Kareem , Liam Girdwood , "Jaroslav Kysela" , Takashi Iwai , Nicolas Ferre , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Kuninori Morimoto , Yang Li , Dan Carpenter , open list Subject: [PATCH 08/13] ASoC: amd: acp: add condition check for i2s clock generation Date: Sat, 21 Oct 2023 20:20:49 +0530 Message-ID: <20231021145110.478744-8-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231021145110.478744-1-Syed.SabaKareem@amd.com> References: <20231021145110.478744-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS2PEPF00003442:EE_|BL1PR12MB5239:EE_ X-MS-Office365-Filtering-Correlation-Id: 6a61db00-820a-401c-7498-08dbd2455a50 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BaCvimpujZ496Hclyw7s/yfRYHEIYKw4m+N88pa5qicIkhYF5f/yRuQ97wBJVt/oaUsGnZehu8sMDug/l4vft19txBEPvOBttah5Qia9YU9dnlje4a3nZfgcPJn9PDxPvCsXu+fHnjWI8DxSH9Ra08bqToHRLDKNuus4GwCU1k7winnPZNAjhS4YU5SaXGj7+BSzADXMjhROJ3Dm7MmIPsd51j3/WoZKTgrSQ6AWIO36YxIdQdFcRV6EJSeYRnX2+F2rNRqNqjtbgPqiF0dPn+dynBZZtRI4eiN8aWcus0N5/TXc0d8INn6R935TYS2HOvQDcFXqV4Uo4859su2LA1lxg4ys7tUkjvEQVtKphtfeLDC57iWahjbgY2kqKOE69G9U4jfhtQPrVWkMOe60oBF8ykbhtLD4ZMEEaLvXVuzvegC3tIDDezRPUg3OHjzxCcJLrJWagnETcsWPB728thG1Nz9Swzs7ZLOPIdtDPLT0IlM3k8wmDx+/Sl3YSibFpE1BTDekl52nOUgkrd1xkir/4SZ5BovoCe6vXYgdCB6ErNHJxymwiUOJMkV9q5bvp8vAQ2j1SHWIrsM1Ni0RzF31w4xz+Moplp/91BPMHqS2d/NSMs0ccwiM39hPBjZ6rD1OirTGq7fq9XxtMGHlYrsOJfFo/G4PACDYqT0gspcLGW4yCoughigdPKgaDEgeYdjDZb8JwZXGclu50LFk1SczMWMJb1YCraDKWMqttUAQ0vLHX65x6EGf4IIX9NhTw9mXRzLLtH7gbctCDUJ0Yg== 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:(13230031)(4636009)(346002)(396003)(376002)(39860400002)(136003)(230922051799003)(451199024)(186009)(82310400011)(64100799003)(1800799009)(40470700004)(46966006)(36840700001)(40480700001)(36756003)(40460700003)(316002)(110136005)(70206006)(54906003)(70586007)(86362001)(356005)(81166007)(82740400003)(36860700001)(83380400001)(2616005)(26005)(426003)(1076003)(336012)(7696005)(6666004)(2906002)(478600001)(41300700001)(5660300002)(8936002)(47076005)(4326008)(8676002)(7416002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2023 14:52:31.2074 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6a61db00-820a-401c-7498-08dbd2455a50 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: DS2PEPF00003442.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5239 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Sat, 21 Oct 2023 07:53:17 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780377192051014552 X-GMAIL-MSGID: 1780377192051014552 for only PDM endpoint i2s master clock is not required. Add a condition check for the same based on chip flag value. Signed-off-by: Syed Saba Kareem --- sound/soc/amd/acp/acp-rembrandt.c | 12 ++++++++++-- sound/soc/amd/acp/acp63.c | 12 ++++++++---- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/sound/soc/amd/acp/acp-rembrandt.c b/sound/soc/amd/acp/acp-rembrandt.c index ef5fe6438efd..158f819f8da4 100644 --- a/sound/soc/amd/acp/acp-rembrandt.c +++ b/sound/soc/amd/acp/acp-rembrandt.c @@ -191,6 +191,7 @@ static int rembrandt_audio_probe(struct platform_device *pdev) struct acp_chip_info *chip; struct acp_dev_data *adata; struct resource *res; + u32 ret; chip = dev_get_platdata(&pdev->dev); if (!chip || !chip->base) { @@ -234,7 +235,12 @@ static int rembrandt_audio_probe(struct platform_device *pdev) acp_machine_select(adata); dev_set_drvdata(dev, adata); - acp6x_master_clock_generate(dev); + + if (chip->flag != FLAG_AMD_LEGACY_ONLY_DMIC) { + ret = acp6x_master_clock_generate(dev); + if (ret) + return ret; + } acp_enable_interrupts(adata); acp_platform_register(dev); pm_runtime_set_autosuspend_delay(&pdev->dev, ACP_SUSPEND_DELAY_MS); @@ -263,7 +269,9 @@ static int __maybe_unused rmb_pcm_resume(struct device *dev) snd_pcm_uframes_t buf_in_frames; u64 buf_size; - acp6x_master_clock_generate(dev); + if (adata->flag != FLAG_AMD_LEGACY_ONLY_DMIC) + acp6x_master_clock_generate(dev); + spin_lock(&adata->acp_lock); list_for_each_entry(stream, &adata->stream_list, list) { substream = stream->substream; diff --git a/sound/soc/amd/acp/acp63.c b/sound/soc/amd/acp/acp63.c index 0cec6ecaadfa..b871a216a6af 100644 --- a/sound/soc/amd/acp/acp63.c +++ b/sound/soc/amd/acp/acp63.c @@ -244,10 +244,12 @@ static int acp63_audio_probe(struct platform_device *pdev) adata->machines = snd_soc_acpi_amd_acp63_acp_machines; acp_machine_select(adata); dev_set_drvdata(dev, adata); - ret = acp63_i2s_master_clock_generate(adata); - if (ret) - return ret; + if (chip->flag != FLAG_AMD_LEGACY_ONLY_DMIC) { + ret = acp63_i2s_master_clock_generate(adata); + if (ret) + return ret; + } acp_enable_interrupts(adata); acp_platform_register(dev); pm_runtime_set_autosuspend_delay(&pdev->dev, ACP_SUSPEND_DELAY_MS); @@ -276,7 +278,9 @@ static int __maybe_unused acp63_pcm_resume(struct device *dev) snd_pcm_uframes_t buf_in_frames; u64 buf_size; - acp63_i2s_master_clock_generate(adata); + if (adata->flag != FLAG_AMD_LEGACY_ONLY_DMIC) + acp63_i2s_master_clock_generate(adata); + spin_lock(&adata->acp_lock); list_for_each_entry(stream, &adata->stream_list, list) { if (stream) { From patchwork Sat Oct 21 14:50:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 156466 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp332362vqx; Sat, 21 Oct 2023 07:53:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGW4HTp2fTxCWpUww5wa9sdjosPADci3eM5Ylr+jp7msb9GCfm/jSZ/FkPm5gsuxt38uJbK X-Received: by 2002:a05:6870:f60e:b0:1ea:989c:3c9f with SMTP id ek14-20020a056870f60e00b001ea989c3c9fmr4914158oab.31.1697900012911; Sat, 21 Oct 2023 07:53:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697900012; cv=pass; d=google.com; s=arc-20160816; b=piawLyZhHY3qk1LcJY9RXx/J+xSa5lcwvEVTZL2JUJq2IRsrs55FBsn0sy11YPe8nQ xf1UlIZHMQeYicOLiVGSwGe5h6/cbCFjriBJKw7nMgUugfauj7S51B0qZdDCrdLypzHA 9UbS/dP4TpWxvYkVJV1oUsP8C3oUPOa/5AIhhbzN34Ndxh7C/lVvP74M/egUObpvg+Pl hY8B3wtLd3Q+WRsNPyfuQx0PXU195iFfTNA7WDXDiQ/lsX+RHLZS2RQo4fVStAokM0uY fTo1+hIrouJBOGRcBIyjpOnTWt2WtW6ecIjqEqihZH6nTfjYP0EPyOsQubysoKQ2ntNd 90ug== 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=N2AYoYlU6AD/2FrJzoVU3wZWBvcWdpwuZ7A9GInqjww=; fh=EYMqnVHjUKHOt8i9n7AgP+KpH22GAdpDObPUBsYqix0=; b=zAxk5pcJEYiI169hwvj3S9HKM0lLGw6UOpCm0afsi+QRe4sJxKBAYzflyuCibZ8drU +vxXE6ezn6vZgJN/poUWjndAEbXy4XWiHncegZtVvbuGzL7klXlaCdnWysiuQBKPjEBO 5i2igtAotEWex43MOrY4StXtW6tms8Ao0Go2N99opKu5hrMlSnDImN5GdDduGE7I+Zcp oyEDd+Cl75/9vkJWcN95KKzgtcFy3nNL7E69cE5FF99CtU3FJr9GqdejDj4BnRwjjDB2 jLqzW8mgDBrzOcINlzxx7yjunSKkG1GdyltnDEXXgUZR6a7L6MrOfIfKIrnx7MdaRdXH LizA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=z2fW08kn; 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::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id o14-20020a656a4e000000b005ad176a9d2bsi3951167pgu.240.2023.10.21.07.53.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Oct 2023 07:53:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=z2fW08kn; 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::3:4 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 9D35E80D240F; Sat, 21 Oct 2023 07:53:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231649AbjJUOwv (ORCPT + 26 others); Sat, 21 Oct 2023 10:52:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231584AbjJUOwt (ORCPT ); Sat, 21 Oct 2023 10:52:49 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2071.outbound.protection.outlook.com [40.107.92.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F26810DA for ; Sat, 21 Oct 2023 07:52:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FjiemmcMUPyeIj19YcezlNSWJA9c2P6Fh9m8WNFiWos15c0ogKnCOghLmV+f1tKeWOol1yoqFiGDPm1+1FnMHmalYrkRRb9dFYWuFwpmE/oDcATSDxwHnid176MvUO/pJ0UenTG/3aMdMmPWSnU+emb0K1xx4nOug+04kg2EWFTcs0CONoHJQqyMYjHrd3nrBX5krWarCfAoF6um1BJMP667XAlVWcLkj3yb5fLqF1pEmioP3+cVX2f5HAlobXHtRGKFzq4IjbtSncMvABXd4efedN1S1bgYump9gwtw1SaeLKGKm2h2QncPIUko17qdDQT0U5xuFGwKJPeQ1P7JpQ== 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=N2AYoYlU6AD/2FrJzoVU3wZWBvcWdpwuZ7A9GInqjww=; b=FzaJHuVCJ7mUKhtQCW7QwDCH4AKFR1vpgTZnBda6+O0J8ifuwp+smKkU4g7DWldJsNVRaxe4slJUFx+Hh9Azj8JcxtUYR1hJ6zUruiVYFEYoAKXjafzHBMwbGA7rl0Sbu34N72fbLvKBEyMi5QneQluLzceit9sx8fCr93d7Xo1b9I9ONc5saEcN3TK8lfPITT2T68TnizoQRV5rdvfvVSdLA9NXWRMmS7axI1xEPtnIn9eHeQ9CGREMMx1F18dFWLh8a1aBcjqtWAv2WQcFG43vVDAtQcGqgO6NvuuRivPu/8cnp/mVkhVGDctoy5Vk1ew+HuJT/Dj/HH2bWqYUNA== 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=N2AYoYlU6AD/2FrJzoVU3wZWBvcWdpwuZ7A9GInqjww=; b=z2fW08knYhgId5dEoGy9gYRFO9BxpepwyztHfLvrJ6k9IKdS+VXOLE+2GSqP1+/wMq45GUupTb9PvUuxhgHF9MN29GUwm/gvmjEyrFfpDkdFwnAfi/KVArGqdEhXkn3mhbEyixvT6url/ShTcWtYveVe8vfdJKBVZj1CZWK+ioY= Received: from CH0PR03CA0422.namprd03.prod.outlook.com (2603:10b6:610:10e::19) by BN9PR12MB5049.namprd12.prod.outlook.com (2603:10b6:408:132::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.29; Sat, 21 Oct 2023 14:52:40 +0000 Received: from DS2PEPF00003447.namprd04.prod.outlook.com (2603:10b6:610:10e:cafe::e0) by CH0PR03CA0422.outlook.office365.com (2603:10b6:610:10e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.29 via Frontend Transport; Sat, 21 Oct 2023 14:52:39 +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 DS2PEPF00003447.mail.protection.outlook.com (10.167.17.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6907.20 via Frontend Transport; Sat, 21 Oct 2023 14:52:39 +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.2507.27; Sat, 21 Oct 2023 09:52:39 -0500 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.2507.27; Sat, 21 Oct 2023 09:52:38 -0500 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Sat, 21 Oct 2023 09:52:33 -0500 From: Syed Saba Kareem To: , CC: , , , , , , , , Syed Saba Kareem , Liam Girdwood , "Jaroslav Kysela" , Takashi Iwai , Marian Postevca , Alper Nebi Yasak , "Claudiu Beznea" , Gaosheng Cui , Jarkko Nikula , "open list" Subject: [PATCH 09/13] ASoC: amd: acp: add machine driver support for pdm use case Date: Sat, 21 Oct 2023 20:20:50 +0530 Message-ID: <20231021145110.478744-9-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231021145110.478744-1-Syed.SabaKareem@amd.com> References: <20231021145110.478744-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS2PEPF00003447:EE_|BN9PR12MB5049:EE_ X-MS-Office365-Filtering-Correlation-Id: 812cfc1a-5f49-470a-4615-08dbd2455f51 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4Bc/3QdrB8g1X9Eo6NadbpYmFb/pMdS5qwvYanKDh510uxp83NBQNCggFfSm83P9DXvwt9wIWVHXEKqcU5udOcFMa4c/vPJuWJzjSzKg9z1q26YwTRkw4Dj/Chdd+Ny7JlMhMyxwHYvWXMduVQ/b6QulwR8naAhIoKo/Cg64R87jiQ2tvNo4uT0/V+v0G48QK+Z6wBdt1MAAhw0u93cepOSMoUAVZeE4/tl0oRIcRwy8ZJ4WkElzOr4kbQrgDUUwrw1/+WsTyjhAfUrlZOOgSWCIGq5bRa1TFejuVjWvhekd8C5BL8DH8xjufC1Jg9Vag/QO07aahHoOUhQg1ruIJI6k0feBOqViDQxzOR5abvtG52IX7SHP1+FbevEwp+j42gKlebG8Gx+172UcOaEXp5vqkvFQTs5uXu/ApaLSlt2kUKJh7G9aOx5tF900UqVgeRAiecx31dGtRbq+GMzmK0IAI6O9DM6BXK8m1UBOPpPUkBTD5LV4Cfws591kNk7xlA6u/XZ831uiBTw7BlVJd0qrk00tDYP6sNLfPJbillzMM4TElAtq2S6vslGF7eWDQr/QnsWXVCVo/b1KmwyRUM+YWl7qlFVEEvGV+RrpMkevwyD6DUbfmEQJ9/lwCfbnkwImE+5CGrz8aRimOwkV5otEXkdDfX24+afztlIkiJbwsZaywTd46WyLwzTWfkAXzdv782wMOL32fycBGnVlXHx08qvVDlVMb3iYvRk6kmmn5cUjHP9k6UHe3YIcEKEMsGRo/iIghIJRyCttd7JZPg== 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:(13230031)(4636009)(136003)(396003)(346002)(39860400002)(376002)(230922051799003)(82310400011)(1800799009)(64100799003)(451199024)(186009)(36840700001)(46966006)(40470700004)(40460700003)(40480700001)(70586007)(70206006)(54906003)(110136005)(41300700001)(86362001)(5660300002)(316002)(7696005)(6666004)(478600001)(36756003)(4326008)(8676002)(8936002)(2906002)(7416002)(36860700001)(356005)(81166007)(2616005)(426003)(336012)(26005)(1076003)(47076005)(82740400003)(83380400001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2023 14:52:39.5232 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 812cfc1a-5f49-470a-4615-08dbd2455f51 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: DS2PEPF00003447.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5049 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Sat, 21 Oct 2023 07:53:24 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780377203629804605 X-GMAIL-MSGID: 1780377203629804605 add pdm use case machine driver support Signed-off-by: Syed Saba Kareem --- sound/soc/amd/acp/acp-legacy-mach.c | 12 ++++++++++++ sound/soc/amd/acp/acp-platform.c | 29 ++++++++++++++++++----------- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/sound/soc/amd/acp/acp-legacy-mach.c b/sound/soc/amd/acp/acp-legacy-mach.c index 1ab3edffe0ce..47c3b5f167f5 100644 --- a/sound/soc/amd/acp/acp-legacy-mach.c +++ b/sound/soc/amd/acp/acp-legacy-mach.c @@ -84,6 +84,11 @@ static struct acp_card_drvdata rt5682s_rt1019_rmb_data = { .tdm_mode = false, }; +static struct acp_card_drvdata acp_dmic_data = { + .dmic_cpu_id = DMIC, + .dmic_codec_id = DMIC, +}; + static bool acp_asoc_init_ops(struct acp_card_drvdata *priv) { bool has_ops = false; @@ -165,6 +170,8 @@ static int acp_asoc_probe(struct platform_device *pdev) card->name, ret); goto out; } + if (!strcmp(pdev->name, "acp-pdm-mach")) + acp_card_drvdata->platform = *((int *)dev->platform_data); dmi_id = dmi_first_match(acp_quirk_table); if (dmi_id && dmi_id->driver_data) @@ -214,6 +221,10 @@ static const struct platform_device_id board_ids[] = { .name = "rmb-rt5682s-rt1019", .driver_data = (kernel_ulong_t)&rt5682s_rt1019_rmb_data, }, + { + .name = "acp-pdm-mach", + .driver_data = (kernel_ulong_t)&acp_dmic_data, + }, { } }; static struct platform_driver acp_asoc_audio = { @@ -235,4 +246,5 @@ MODULE_ALIAS("platform:acp3xalc5682s1019"); MODULE_ALIAS("platform:acp3x-es83xx"); MODULE_ALIAS("platform:rmb-nau8825-max"); MODULE_ALIAS("platform:rmb-rt5682s-rt1019"); +MODULE_ALIAS("platform:acp-pdm-mach"); MODULE_LICENSE("GPL v2"); diff --git a/sound/soc/amd/acp/acp-platform.c b/sound/soc/amd/acp/acp-platform.c index f516daf6fef4..aaac8aa744cb 100644 --- a/sound/soc/amd/acp/acp-platform.c +++ b/sound/soc/amd/acp/acp-platform.c @@ -21,6 +21,8 @@ #include #include "amd.h" +#include "../mach-config.h" +#include "acp-mach.h" #define DRV_NAME "acp_i2s_dma" @@ -69,20 +71,25 @@ static const struct snd_pcm_hardware acp_pcm_hardware_capture = { int acp_machine_select(struct acp_dev_data *adata) { struct snd_soc_acpi_mach *mach; - int size; - - size = sizeof(*adata->machines); - mach = snd_soc_acpi_find_machine(adata->machines); - if (!mach) { - dev_err(adata->dev, "warning: No matching ASoC machine driver found\n"); - return -EINVAL; + int size, platform; + + if (adata->flag == FLAG_AMD_LEGACY_ONLY_DMIC) { + platform = adata->platform; + adata->mach_dev = platform_device_register_data(adata->dev, "acp-pdm-mach", + PLATFORM_DEVID_NONE, &platform, + sizeof(platform)); + } else { + size = sizeof(*adata->machines); + mach = snd_soc_acpi_find_machine(adata->machines); + if (!mach) { + dev_err(adata->dev, "warning: No matching ASoC machine driver found\n"); + return -EINVAL; + } + adata->mach_dev = platform_device_register_data(adata->dev, mach->drv_name, + PLATFORM_DEVID_NONE, mach, size); } - - adata->mach_dev = platform_device_register_data(adata->dev, mach->drv_name, - PLATFORM_DEVID_NONE, mach, size); if (IS_ERR(adata->mach_dev)) dev_warn(adata->dev, "Unable to register Machine device\n"); - return 0; } EXPORT_SYMBOL_NS_GPL(acp_machine_select, SND_SOC_ACP_COMMON); From patchwork Sat Oct 21 14:50:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 156469 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp332580vqx; Sat, 21 Oct 2023 07:54:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE6gWW/CvXX8K3HpvJBNwn/xO1lXjx0/GldM0bvrzaOBkMfuUtZRbC63MX/CuFC+8t58k4C X-Received: by 2002:a05:6a00:1a86:b0:68e:2f6e:b4c0 with SMTP id e6-20020a056a001a8600b0068e2f6eb4c0mr4096180pfv.28.1697900039739; Sat, 21 Oct 2023 07:53:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697900039; cv=pass; d=google.com; s=arc-20160816; b=jIL/sHwrihx+lztEtv7E0gwcbYAtSL0axOaevfiV2mOGbujJ9xUs0v7UVnAzRF+I5t kGXrvqLwFC69xBnYxJHhJnrlupJoEZjYft3placINx8UpDhQmlII/G6svoe0G+Y4SmJp fVQ7OzVn4g4M//CgKD3xZiqPzP4/OQIT1i9KG97fAxhwKh1+6N6gIvLYOpicdn279mwQ GlNlErnH5+kChA4OlFBxp5obC/th/+zxGnCK31IzYLNhGmbK4uxaHaFGbF1YrIBA5ktu 8ZYoYCJbq/r32yqUmdFy6Yt44f6IC3BXB56lcAA5G1tEyzxJtOZWXvcpID/GDNiBD03g ctDg== 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=dAp94MXbWlUHOFFPRdpY09OJ6JFayAk1JST2qWf3c/U=; fh=sE18ZEF1UtjhXV7jHMkYfoLVWIH0OZJnHZX/afp7jFc=; b=RmD8K85yKLE9mfdsQuBU+AMhEFnQZoOHyJQJGcCv/FYAH+ZvOUm+zCue7WeAi0II1J HhKyZbnTvl/r3+3F+gfOhRejqP0Y0A9bJab1xFjpHmbqPzgmUOPpnFQkDnDKS4N7nEmm c7cRiU5DUiItIUvj2ZmePk7mKQ0Bh/D5EwfLyDJSjC38ZYfcJnALN8uyB6J/N7+feQ4M pmk5A/fFUWlWN12fv1lFXfRrRIf577eh1YMmXtN8dj5r/q2sLqamlHmvIhIF40bHfUTf Hgx0utnzD39yL+hZgHk65OHGHDApMTs+tm/e0lCbpyqHAQ0UJaSczSRUkso/6CWAtOLK 7ylA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="pdskug/h"; 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 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id t15-20020a63954f000000b00564929df8besi3572873pgn.568.2023.10.21.07.53.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Oct 2023 07:53:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="pdskug/h"; 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 23.128.96.34 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 195B380D1EF1; Sat, 21 Oct 2023 07:53:57 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231481AbjJUOxI (ORCPT + 26 others); Sat, 21 Oct 2023 10:53:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231667AbjJUOxC (ORCPT ); Sat, 21 Oct 2023 10:53:02 -0400 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 3EA7710EF for ; Sat, 21 Oct 2023 07:52:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GMotHABrSIQV+4eTLjmWfvLnOdpk1CuybAmQexcGcrqghVTlh3CUOIb/5awXTeFXuU5Fsgs5a7V4pVseQfs5d23M7RKWjLjMaxUhs8812cZhR0b//Xq69HEynZmeSN0/tUAg5fJDe0VQ1IEUOryWhA1hxJn975calIA/wgIWKPToSbMGe3Dx5mbVUvtsyLhSsviiQJ7/5E5e6lZdzMgll2M5ZoOk+BTpt/GURFoVGYbHcY4qsyQGImmPlKuaG+/5eeJ0quoRssQF/B7k9hNcfJrTE44wdkL4PGlZt6l2bd7/K821W3waEgZJfiMuGAkmtiz0LxwBuXmMFPwBSYjmpA== 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=dAp94MXbWlUHOFFPRdpY09OJ6JFayAk1JST2qWf3c/U=; b=BthZKqbtRyhkQHIL8VJ24AQtdmoNGI3FCUBtg6hQuNWLimBb3NS9QlJyaZWykxzFsNX34LCEoNcrfCJchnmlA9aPKS8tli0H6W7S1CSiWKhoUdoOL+599GHlz+H5uywj+XaULWUonWVnLqbO73I5nwj9gDAX9ZGVXoY3gDoJvP9ZA9zTKA+LWVEYH5J+g01pnpnrwIYve0MBNko/AJvXGepJ0j8dKbB3PYegtjMAnH0VBsflayjovtT063MC4qdjAsuq2z6FlF2YLduK1GvvQ39qfaZLQHVPqMOtnmiM1UhBHszpB9kK985SFDIwVoH6ahICYHn9Sd/ApGoYaXMKrw== 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=dAp94MXbWlUHOFFPRdpY09OJ6JFayAk1JST2qWf3c/U=; b=pdskug/hSprUnCdft+OnpI1EJnq54gwz4Eu/4PBe/mPR+cFENEJ7qWC7iNWqUmYFxT4F285IbS8rknStLmG9Da0dCfrrku9ZBJuvtvqrR3DebsJLnR6CwlvHUytgeJ5CYGQhXZ2iTfYJw2dwfHckjgUVK3ctRtxXfKJL2jLgZaY= Received: from SN6PR16CA0045.namprd16.prod.outlook.com (2603:10b6:805:ca::22) by SN7PR12MB7129.namprd12.prod.outlook.com (2603:10b6:806:2a1::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.24; Sat, 21 Oct 2023 14:52:50 +0000 Received: from SN1PEPF000252A4.namprd05.prod.outlook.com (2603:10b6:805:ca:cafe::81) by SN6PR16CA0045.outlook.office365.com (2603:10b6:805:ca::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.26 via Frontend Transport; Sat, 21 Oct 2023 14:52:50 +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 SN1PEPF000252A4.mail.protection.outlook.com (10.167.242.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6907.20 via Frontend Transport; Sat, 21 Oct 2023 14:52:50 +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.2507.27; Sat, 21 Oct 2023 09:52:49 -0500 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.2507.27; Sat, 21 Oct 2023 09:52:49 -0500 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Sat, 21 Oct 2023 09:52:44 -0500 From: Syed Saba Kareem To: , CC: , , , , , , , , Syed Saba Kareem , Liam Girdwood , "Jaroslav Kysela" , Takashi Iwai , V Sujith Kumar Reddy , Kuninori Morimoto , Claudiu Beznea , Jarkko Nikula , open list Subject: [PATCH 10/13] ASoC: amd: acp: change acp-deinit function arguments Date: Sat, 21 Oct 2023 20:20:51 +0530 Message-ID: <20231021145110.478744-10-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231021145110.478744-1-Syed.SabaKareem@amd.com> References: <20231021145110.478744-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000252A4:EE_|SN7PR12MB7129:EE_ X-MS-Office365-Filtering-Correlation-Id: 5189fa8e-f78d-43bc-5186-08dbd24565a2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: C9cA/QHcBpaFyAOTSD/hlJpgjTlRWdpHMRmZrD9AA1Zz5kYY4Rm9IWSC/2Dfj3/FZ8GxNpJ4mJELSt0+PzvpxNCH16nFQ4TAch5tAb2xIfU11a9pP4fhsZw0PVZdu+YUXUc5bMYLADZlZA4jdhWG7rRlfWthkx0I+FG11qpUR2jJyx9c/V1+s/oyDKoC3y2a6qQdiQ4egp3fXaw5WYmLQczVJOerC6W5PSukJUNZTI1EIP5Ai4NFzfqQOGlb5TWa1U4a59xijZ6191HmIGqd0X7NORObrkbEhOeDz0oH//Krgu9t3s4KKScPr4Cd8dGZUQC6bO5+8bZSfykMGgSsr+HfqCPbDftOL818V7HkHHaJeAtbUOv/gVt0p1dvVdO8uWjXjMYzya1Yn4gEKbHs/bGu0YMPD2cwxKX5lVNjIdV+o9b8XFI/Ko1Xy0Uj5V+qyOjdz6vvyOCTbRjDIhdizhnm9sKe7A2QexLd+GCpwusCAmpqlCaz73E1KJyFMx6a4PNHieHoSBGc7z1fXEqECLXXySDUuWwgZEasmFYL/ruqz5Ud8X77ja5lKbAtZthOuVe84KJp22c6Pktc5ohtT8cQh/tgqUP0N5OGtoOs1VLPGmE6UoIORtObLNCKKIoTiUiShC5KG2LTEQtrvQhYijEVqmJ/FRbVT2dNkZizhRKdahGRGIQYTXCJNd4rwvwKbxUpI313wdBTx/Q97e0fW8CISsmGSaNHZnLqMogY5mp894LAAWavJp1NPEkstMlyoVJbYeuJdA+FuLXd/CKjag== 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:(13230031)(4636009)(136003)(346002)(376002)(396003)(39860400002)(230922051799003)(82310400011)(1800799009)(64100799003)(451199024)(186009)(40470700004)(46966006)(36840700001)(1076003)(26005)(40460700003)(36756003)(86362001)(40480700001)(356005)(81166007)(82740400003)(36860700001)(336012)(83380400001)(2906002)(478600001)(7696005)(6666004)(2616005)(426003)(47076005)(8936002)(8676002)(54906003)(4326008)(316002)(70586007)(5660300002)(41300700001)(70206006)(110136005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2023 14:52:50.2145 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5189fa8e-f78d-43bc-5186-08dbd24565a2 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: SN1PEPF000252A4.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7129 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Sat, 21 Oct 2023 07:53:57 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780377232453330357 X-GMAIL-MSGID: 1780377232453330357 acp-deinit function will not be same for all platforms. To make platform specific changes in acp-deinit function, instead of passing base address pass chip structure which contains acp_rev feild. chip->acp_rev will be used to add platform specific code in acp-deinit(). Signed-off-by: Syed Saba Kareem --- sound/soc/amd/acp/acp-legacy-common.c | 6 +++--- sound/soc/amd/acp/acp-pci.c | 4 ++-- sound/soc/amd/acp/amd.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/soc/amd/acp/acp-legacy-common.c b/sound/soc/amd/acp/acp-legacy-common.c index af85a153a770..cba0aabefb34 100644 --- a/sound/soc/amd/acp/acp-legacy-common.c +++ b/sound/soc/amd/acp/acp-legacy-common.c @@ -320,16 +320,16 @@ int acp_init(struct acp_chip_info *chip) } EXPORT_SYMBOL_NS_GPL(acp_init, SND_SOC_ACP_COMMON); -int acp_deinit(void __iomem *base) +int acp_deinit(struct acp_chip_info *chip) { int ret; /* Reset */ - ret = acp_reset(base); + ret = acp_reset(chip->base); if (ret) return ret; - writel(0, base + ACP_CONTROL); + writel(0, chip->base + ACP_CONTROL); return 0; } EXPORT_SYMBOL_NS_GPL(acp_deinit, SND_SOC_ACP_COMMON); diff --git a/sound/soc/amd/acp/acp-pci.c b/sound/soc/amd/acp/acp-pci.c index bbf079d47dc4..696c9ee6786f 100644 --- a/sound/soc/amd/acp/acp-pci.c +++ b/sound/soc/amd/acp/acp-pci.c @@ -178,7 +178,7 @@ static int __maybe_unused snd_acp_suspend(struct device *dev) int ret; chip = dev_get_drvdata(dev); - ret = acp_deinit(chip->base); + ret = acp_deinit(chip); if (ret) dev_err(dev, "ACP de-init failed\n"); return ret; @@ -219,7 +219,7 @@ static void acp_pci_remove(struct pci_dev *pci) platform_device_unregister(dmic_dev); if (pdev) platform_device_unregister(pdev); - ret = acp_deinit(chip->base); + ret = acp_deinit(chip); if (ret) dev_err(&pci->dev, "ACP de-init failed\n"); } diff --git a/sound/soc/amd/acp/amd.h b/sound/soc/amd/acp/amd.h index 62d0793027f2..e3bb470d1f32 100644 --- a/sound/soc/amd/acp/amd.h +++ b/sound/soc/amd/acp/amd.h @@ -222,7 +222,7 @@ int smn_read(struct pci_dev *dev, u32 smn_addr); int smn_write(struct pci_dev *dev, u32 smn_addr, u32 data); int acp_init(struct acp_chip_info *chip); -int acp_deinit(void __iomem *base); +int acp_deinit(struct acp_chip_info *chip); void acp_enable_interrupts(struct acp_dev_data *adata); void acp_disable_interrupts(struct acp_dev_data *adata); /* Machine configuration */ From patchwork Sat Oct 21 14:50:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 156470 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp332631vqx; Sat, 21 Oct 2023 07:54:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFJ4W7MMd4JZpbnF8SQWVi7z/aChwkoe1PxlppceV3vHwnaIZXbacXq9YAbHLRUOWDjUU5Q X-Received: by 2002:a05:6a20:4a1c:b0:13c:988c:e885 with SMTP id fr28-20020a056a204a1c00b0013c988ce885mr3669010pzb.56.1697900045209; Sat, 21 Oct 2023 07:54:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697900045; cv=pass; d=google.com; s=arc-20160816; b=tFCtjMC1+0kwCoxeUSFHRCzg1y+vPJPh+NMXIjKx5nWM6y5sXRZBXS+ywX1797eG4Y 8wPg1yQp/6jQOJIevjQfhORr6DCCFYuc7CYTBP3q4KapncBZWqsUTc407csGUea7zMu/ 5MET0eySW30tgJ6/kkaEpVyqJYJP1cbvgQubQi7SeSJ/T+r5VaZVjYblo+JQv/kT2Y8G AwhdhHhof13qNGugpo+I5boKfpEpukEgXfQny873dP+dRqdk5/TZcR31eh2Hsho8s14a /owRfxY3MjhmCiWJ3Kb0gp/qF38mG4c3q1yARqwLROTyd0x6EssMBwhFHh6gjHEw/qqr oC2w== 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=fDkltNeWy4y5RmjuXcK9dTZA6jIBlejdqfTAUKQ7iD4=; fh=VJv+aOOSnsim5/pjmk/1majRCxkZEb1eD9DUcO3tmpk=; b=ezFRpef1vuQWbLaqjOrR2FnodKwcpnIwnYXvVrH6vOz/Y7PQvN13o2eBKa/gLaP5c2 3s6ivenxYbF/xEMUrJ34lG5Uk3pANJKcw2xRaxEJxGWKozyBVvmpz7HWFUOcxIKFPH9Q 6H7T98uOx9SjcH5pkWayXm+TEIIJxu1fikNOEGU12QPeyrSu+MaayCebB2hfmV5rIrls hCCx0iz+QBXs9n8m/Ee6u6FhHGkioEMlDWRyWLuQKN++4b0QdvZ45lksqXltoaBM3tKy tkEm6YoXunJyHcSr3qeif7nmEnyVCPneWYWJQyUa+ZeiLf4wdSqFfF+P0O1SNsG5QC7s WTcA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=MEqk2Mnn; 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::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id j9-20020a17090a318900b002636d222400si5988175pjb.14.2023.10.21.07.54.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Oct 2023 07:54:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=MEqk2Mnn; 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::3:1 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id AD04B8025075; Sat, 21 Oct 2023 07:54:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231696AbjJUOxR (ORCPT + 26 others); Sat, 21 Oct 2023 10:53:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231679AbjJUOxL (ORCPT ); Sat, 21 Oct 2023 10:53:11 -0400 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2070.outbound.protection.outlook.com [40.107.101.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9700F10D9 for ; Sat, 21 Oct 2023 07:53:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aX9I7B+nH+/n2BYkvMHQIcbPU+QFLZh1FsyfPKOBP7JtLyZ+zDmmA+DQbvpUwBnIy3xoVfnoUxaLhyIZWNxwk8rYMfDUI8tceKvZChCOxwe7PMlIABYGRhq33OJGygVHiYtNsb80qxRUvpMcNYOXmnfRanEo7l1Vy93rTp2mx66A0JdvSQVEdCKbdedOaCGM6/hjdkV3HSOhW2eRHl42k6sTsUaooBVd8scjZAiGrxAFFgvWsDl/N71rKX8VE+WGpLBTcwSG1SGDD5qeij2XbeTWIGJmHlPwV50BYiuf7rS+okrADfV3Y+HgDQIYCxWzy86JNvy/iM7Sb1hfJePRPA== 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=fDkltNeWy4y5RmjuXcK9dTZA6jIBlejdqfTAUKQ7iD4=; b=lEBBsjJ1Q8ZBUzefMcKDuIP2RJb+H4CQ9a/5EaPwiH98FPL/rwuSFMhtj6m8R8emCgtlRp87PUn5U1xKtVvN4nj+VKokFCweMJiSVwoM7niFgwV22wD/NX9uDfihqWAkeXGBJcPG4s+BZCGz41LHGCODiEVJJSrqbWINpS5AgcTwQgX0tphv7HeeE2EthCY05ZbzfqxYaK4mT4N54drGwOPpQnhhE6AK8fv4/J62Z6DaFIAZ/w1XKYKTnQkDxe24C2W4gtzB95vCEvSNz1K8tWsvp2aXyM1o8XsaqA++KyC2RY4ubpvVMTSsKLzo6s4+EJawQ6mxAmIN1sMvkiMz9g== 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=fDkltNeWy4y5RmjuXcK9dTZA6jIBlejdqfTAUKQ7iD4=; b=MEqk2MnnWMvcSz4YliIvhKYMs3+HspuHDmBsilRHtp0YQItLTp4/DfWOsM7G/ilWZsMlcpl+fCmDNwQLwTCUUaL/8GiVEhE6B2sdVGi4W9sABKYf2JP5wjtYQ4uULXjCf4mmw5VuP+HuFlMzHtZASZbBsvrJTtbmtbHqB5BKPuI= Received: from SA0PR11CA0174.namprd11.prod.outlook.com (2603:10b6:806:1bb::29) by PH8PR12MB8605.namprd12.prod.outlook.com (2603:10b6:510:1cc::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.34; Sat, 21 Oct 2023 14:52:56 +0000 Received: from SN1PEPF000252A3.namprd05.prod.outlook.com (2603:10b6:806:1bb:cafe::c5) by SA0PR11CA0174.outlook.office365.com (2603:10b6:806:1bb::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.29 via Frontend Transport; Sat, 21 Oct 2023 14:52:56 +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 SN1PEPF000252A3.mail.protection.outlook.com (10.167.242.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6933.15 via Frontend Transport; Sat, 21 Oct 2023 14:52:56 +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.2507.27; Sat, 21 Oct 2023 09:52:56 -0500 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.2507.27; Sat, 21 Oct 2023 09:52:55 -0500 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Sat, 21 Oct 2023 09:52:51 -0500 From: Syed Saba Kareem To: , CC: , , , , , , , , Syed Saba Kareem , Liam Girdwood , "Jaroslav Kysela" , Takashi Iwai , Kuninori Morimoto , V Sujith Kumar Reddy , open list Subject: [PATCH 11/13] ASoC: amd: acp: change acp power on mask macro value Date: Sat, 21 Oct 2023 20:20:52 +0530 Message-ID: <20231021145110.478744-11-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231021145110.478744-1-Syed.SabaKareem@amd.com> References: <20231021145110.478744-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000252A3:EE_|PH8PR12MB8605:EE_ X-MS-Office365-Filtering-Correlation-Id: 978ee171-64a5-4e72-0551-08dbd245696d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NdGkE4sgSrMOqJt17BLI9CqSP9DOqm6sogikbTlpTj7/y9HVwOFpxZFvIru/JloQeZFKKT6OKMr0XF0ifktleCtGhHB3acBxkWJUAFeluYY8T/nUbPFmLNraqGlUcbEUQaHX/DUb13TSWCUPcn6AQ1KPauoGP4YY3KaKty11rJYn9/7AoKTRha29UOJruJ2pHjBWES0NRUeL3t6yWc8ocmyrUhoJOyGcHgRRbcnmRr57t0SwJFaWoajYGH4I+DoL1sBK5KpMrv7NQ+ehR+V8/7usgXDkMgjWhVLZBgfbkvwrLwUyYfmT1DvBGz4pMeHUOfaT9+h/ioyimzQtERXfR/2GIWEp65iEnEc7CZO9zEBQ/2DMQi2PTvTURCr3ftrDjnMdq9EYW5lO8qLynw4XE9tvgzxFXtX8iMS6RNiv4pwA3sJPTTAl+B8P/ap63vx2Ju4t6i98rb5qu2vxwFTvDtcawWIPS2JpbU6BsgHhgVmqzQja/feLdoj5ekidIXGfB7EbApCZQAPG/BLfMk+YGMZxLkUN32hN/6wLv50hL76P3Q9JLaKnuxje7kBlLs5xMj8eejNS81UJaPsS9d/B2eAEsV7C+7TIQ8kNnOQEys+Vp3UPocY5a3Xn5kxrmspnxnRrDbu8DwDHIpF37aUbn0DiLmVP3mb47qBf+kzCzHx+PQD2sNTf9/0SKTi1pAUTrpwr+jhMDEEfzbaaQwstSwx54OWYVbour/QlCNFh5KTJHk7ulh3VO8UyYqar0BpEgOZ6qlDlL9MoTr4q+ZxNjg== 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:(13230031)(4636009)(39860400002)(346002)(136003)(396003)(376002)(230922051799003)(186009)(1800799009)(64100799003)(82310400011)(451199024)(40470700004)(36840700001)(46966006)(356005)(26005)(336012)(4744005)(83380400001)(426003)(316002)(47076005)(2616005)(70206006)(8936002)(36860700001)(8676002)(478600001)(1076003)(41300700001)(110136005)(2906002)(4326008)(81166007)(70586007)(54906003)(7696005)(5660300002)(82740400003)(36756003)(86362001)(40460700003)(40480700001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2023 14:52:56.5761 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 978ee171-64a5-4e72-0551-08dbd245696d 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: SN1PEPF000252A3.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB8605 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Sat, 21 Oct 2023 07:54:02 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780377237867618145 X-GMAIL-MSGID: 1780377237867618145 change acp power on mask macro value so that same macro can be used for all amd platforms. Signed-off-by: Syed Saba Kareem --- sound/soc/amd/acp/amd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/amd/acp/amd.h b/sound/soc/amd/acp/amd.h index e3bb470d1f32..937ce13c7d40 100644 --- a/sound/soc/amd/acp/amd.h +++ b/sound/soc/amd/acp/amd.h @@ -101,7 +101,7 @@ #define ACP_SOFT_RST_DONE_MASK 0x00010001 -#define ACP_PGFSM_CNTL_POWER_ON_MASK 0x01 +#define ACP_PGFSM_CNTL_POWER_ON_MASK 0xffffffff #define ACP_PGFSM_CNTL_POWER_OFF_MASK 0x00 #define ACP_PGFSM_STATUS_MASK 0x03 #define ACP_POWERED_ON 0x00 From patchwork Sat Oct 21 14:50:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 156472 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp333030vqx; Sat, 21 Oct 2023 07:55:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGqkj9+DZX7CB+db/6cRwFHhfYIEdE5AAxCsU8x7odS0NnQD1Ht+htzf2KUgeFj12qRfMrC X-Received: by 2002:a05:6a00:2d8a:b0:6b3:6bc6:68d1 with SMTP id fb10-20020a056a002d8a00b006b36bc668d1mr4124628pfb.11.1697900105288; Sat, 21 Oct 2023 07:55:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697900105; cv=pass; d=google.com; s=arc-20160816; b=oJLNYrDK9s4MvOpWLyChnkdX5oHBJ/hEMJcsvGJrl4hYEPcLwLucluXCyVcNjHPNKw EeqUM3VqSKhQd80RKsA4PyR2YkaS4UX5I2bqLp8vnx0KKNI69sD0FEEfYINDLYUOtPnM UkV4qW0dqf4TvTlyfwAVD/+6LOi3cpygBjcrccSpMQAaptR3QS+RPd0QYISGvZCH+Eov VsJVDoZcWIEKi3SINJnL78fRfga0PpyhuMVgz/SCj2ahJkZXL0mWWuOvsdH01mqmkpLZ aHxQcyxSzRZPz9b366nYqOZ8hsPRmmRk9FUO9+ziCITJfm7Jpi+5sFkfJMKxTP9xQFk8 enZQ== 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=VUl+/jOmshxtwB90xbdpSKuf+wov1WY/I+TPhIdwLyg=; fh=BbM/3VD+TglcZpux4WlAlYmbsgYj1Klrm66c7kXxAQg=; b=A5h3ymJA0TwaZaIT3ukbk3S9WWUjAbZFX20iYQ4CcooLCOiQDx5xHa0Ylgn2/1POUM CYZbArhuMSSC3kPSp0kcAzPOrdPnMeV2pNK8o6D+DDt/6GRZsoYCVbGhOk9FWAGJ/o4p k+t8rTA2OIfQesLn0VLtHP+OsqKKc2qxKA/oj+UQiixRijSAriOoEUhyaJ5pAHXn74bH RndoSst+nN1wsqG93FRgudx76XvEA6+M6SVY2vsahWw1pmC2ahsm5Roa4HkXMEvQgPfc MzvsBQWSiov84ygzNB9zqe5CM2KBewLkInOz5yZWrGO0usW1dTYz3IjWbDjY62FfcT8q 3ppQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=5BF0lC9U; 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 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id i131-20020a639d89000000b00588fa0def2bsi3539127pgd.768.2023.10.21.07.55.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Oct 2023 07:55:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=5BF0lC9U; 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 23.128.96.34 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 7DBBE8024FE9; Sat, 21 Oct 2023 07:55:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231676AbjJUOxt (ORCPT + 26 others); Sat, 21 Oct 2023 10:53:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231403AbjJUOxq (ORCPT ); Sat, 21 Oct 2023 10:53:46 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2062.outbound.protection.outlook.com [40.107.223.62]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44C631704 for ; Sat, 21 Oct 2023 07:53:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YxPVIYtGXeZsatPVwwghKhcvrMMRDEd0O1NAGOrqa5I6Puwm3K80G+RUOzfK4775P3GlO0ipxMjS6mQSzQZUlZ5fBue9An8tYBc4DjMFhW8YGujac/QTj8sIf5QUos1Xb8UjQOSyXqDooqc/z7TKr057cwh0Kn/xve1Ckt83s7psi2kFEqZ8+9SbJ1rBe0DBQUwoDisfpwsSM8XqM6RTtoFNEqvch1fDeqrg+duQQsYac6hbe328zanKYHvPO0loYScrGf7DxacncMexMknql9PUZZ0YlI8p5FEVN7vWhOGSS1doROHM9Jj8zE7PUYS9I1pE9tWrE1Zu9lMgKBCvrA== 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=VUl+/jOmshxtwB90xbdpSKuf+wov1WY/I+TPhIdwLyg=; b=k4rig5IUk50FtojXjd+EludzYeXQGM3kKFl262+eeTDKwoWvY32Gvc5tcAUGz1+jFuVpvbfm2/vwkBcfMLriyZZ9F6RXdUQG1/PsofbTRsQeeETW6hDsDOUDDLKMbXcukdW4z1yx6jYUrVEx5LLb1Tnw4E9JMAA7O1lRWXYF5GCimVt0A3ClH05YCMPofKFKfThStBw3FbmqoacGOptHqYknfVGUjgU1P8TRA1maVd3aD1oeM2qcNv7RnUK9XPcndICZFEGCpXrtQuLSZMceRnAXWIIQ6fMiBvkvZIWJreOgB0GAMXcWNIEFC89QWZvw/U1Raf/W/3cH70EGaH4gRA== 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=VUl+/jOmshxtwB90xbdpSKuf+wov1WY/I+TPhIdwLyg=; b=5BF0lC9Uggrj+m8FztaGB7ZIppv9pPvbhpKFUTcia0DVrxUqPUZ6/WiACHi8D0s9cf8qEMjfWxELj1lngWCPtl1Fn34S8Mzv6TMAIiomWShGunxDSGfL3sVzhDUiSEmeqXzqqjeK1MMuyyJx8Bix5eKjzJHjvvmOPqAHOEeIXd8= Received: from PH0PR07CA0048.namprd07.prod.outlook.com (2603:10b6:510:e::23) by MN2PR12MB4271.namprd12.prod.outlook.com (2603:10b6:208:1d7::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.26; Sat, 21 Oct 2023 14:53:18 +0000 Received: from SN1PEPF000252A0.namprd05.prod.outlook.com (2603:10b6:510:e:cafe::fb) by PH0PR07CA0048.outlook.office365.com (2603:10b6:510:e::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.26 via Frontend Transport; Sat, 21 Oct 2023 14:53:17 +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 SN1PEPF000252A0.mail.protection.outlook.com (10.167.242.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6907.20 via Frontend Transport; Sat, 21 Oct 2023 14:53:17 +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.2507.27; Sat, 21 Oct 2023 09:53:17 -0500 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.2507.27; Sat, 21 Oct 2023 09:53:16 -0500 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Sat, 21 Oct 2023 09:53:10 -0500 From: Syed Saba Kareem To: , CC: , , , , , , , , Syed Saba Kareem , Liam Girdwood , "Jaroslav Kysela" , Takashi Iwai , Kuninori Morimoto , V Sujith Kumar Reddy , Marian Postevca , "Jarkko Nikula" , Claudiu Beznea , =?utf-8?q?Uwe_Kleine-K=C3=B6?= =?utf-8?q?nig?= , Yang Li , "Dan Carpenter" , open list Subject: [PATCH 12/13] ASoC: amd: acp: Add pci legacy driver support for acp7.0 platform Date: Sat, 21 Oct 2023 20:20:53 +0530 Message-ID: <20231021145110.478744-12-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231021145110.478744-1-Syed.SabaKareem@amd.com> References: <20231021145110.478744-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000252A0:EE_|MN2PR12MB4271:EE_ X-MS-Office365-Filtering-Correlation-Id: ee501119-f36a-48fc-3a37-08dbd24575fc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aaafx4uqYdIfL5ES2Z0KZPEo07dbNL+r8VUfpVARsNo4m535NCzaHp8Fj1cWcdcMHoNraQZFPAVirLUeVY3/6B6AmlGbPREgBmV1f+Ysx2po0Q1N5l1r+FpHwTC7FXkTB9X1/eQXHOCjlGA6zDEalDS/RSqIS0giAQcWFFXA7CKldOgEMZRhKUz0/zDGVnVu2/+RSH7OyQH8v9kO6GDL7gmo7z/o5DO1AVxcC30L3zhWSSM9rKW5reSX9ckgDXxvMI2EpsXESEkf2Q1jC/FSQPFpUD5PsIFFcYb3MB83YLvh5u51CmBqYTHfgumrf5BxYjDctmTAZuYLozteZduynlhZJe4LYrRU/EyykU3Xp2BUHFv1doyF09nM+LJ9LO64WkkzeModmeqep3pppfsIuzU1YeTTnaVCY54SoWoCNLl6YjJXDc2kLNxn2AtuDKPNdcQd0YCyEqVAvMV67xKqnGZkZprFbw1lH13/gHe/60MxiT63oN2kJFgEkxysq2f6UJPCiPF3SKsKYlgO5IGS2+qBek+Hbsrs2pAtvpHMNM8Ihxkk8AW7GaTxa+19Eifc0foDMFW4927gelTIUYr9sHqBAB/Jx7Hu6ZPUx+juP1blguA+ax+ms+g0AHLn+uHAFurTDlcypYOhFgVzbQ+UazFB1wDQSUqRHP3sPpq/jX/qxCsjzvAwSRQNecyGMVozRVZ/Q/TadsKRtAAEWuBvaiUCHg86BEBmAjtvPBJKveoRVu03gfzzcuNEGUs6hpeLOLIj1jG8Pbi6TDvpu3PZwQ== 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:(13230031)(4636009)(376002)(396003)(136003)(39860400002)(346002)(230922051799003)(82310400011)(64100799003)(451199024)(1800799009)(186009)(40470700004)(46966006)(36840700001)(40460700003)(47076005)(41300700001)(4326008)(36756003)(7416002)(26005)(5660300002)(36860700001)(83380400001)(1076003)(82740400003)(81166007)(426003)(336012)(356005)(86362001)(7696005)(2616005)(40480700001)(478600001)(70206006)(8676002)(2906002)(70586007)(110136005)(54906003)(6666004)(316002)(8936002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2023 14:53:17.6472 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ee501119-f36a-48fc-3a37-08dbd24575fc 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: SN1PEPF000252A0.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4271 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Sat, 21 Oct 2023 07:55:00 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780377300956233793 X-GMAIL-MSGID: 1780377300956233793 Add pci legacy driver support and create platform driver for acp7.0 platform. Signed-off-by: Syed Saba Kareem --- sound/soc/amd/acp/acp-legacy-common.c | 11 +- sound/soc/amd/acp/acp-mach.h | 1 + sound/soc/amd/acp/acp-pci.c | 4 + sound/soc/amd/acp/acp70.c | 254 ++++++++++++++++++++++++++ sound/soc/amd/acp/amd.h | 4 + 5 files changed, 273 insertions(+), 1 deletion(-) create mode 100644 sound/soc/amd/acp/acp70.c diff --git a/sound/soc/amd/acp/acp-legacy-common.c b/sound/soc/amd/acp/acp-legacy-common.c index cba0aabefb34..b5aff3f230be 100644 --- a/sound/soc/amd/acp/acp-legacy-common.c +++ b/sound/soc/amd/acp/acp-legacy-common.c @@ -19,6 +19,7 @@ #define ACP_RENOIR_PDM_ADDR 0x02 #define ACP_REMBRANDT_PDM_ADDR 0x03 #define ACP63_PDM_ADDR 0x02 +#define ACP70_PDM_ADDR 0x02 void acp_enable_interrupts(struct acp_dev_data *adata) { @@ -268,6 +269,10 @@ static int acp_power_on(struct acp_chip_info *chip) acp_pgfsm_stat_reg = ACP63_PGFSM_STATUS; acp_pgfsm_ctrl_reg = ACP63_PGFSM_CONTROL; break; + case ACP70_DEV: + acp_pgfsm_stat_reg = ACP70_PGFSM_STATUS; + acp_pgfsm_ctrl_reg = ACP70_PGFSM_CONTROL; + break; default: return -EINVAL; } @@ -329,7 +334,8 @@ int acp_deinit(struct acp_chip_info *chip) if (ret) return ret; - writel(0, chip->base + ACP_CONTROL); + if (chip->acp_rev != ACP70_DEV) + writel(0, chip->base + ACP_CONTROL); return 0; } EXPORT_SYMBOL_NS_GPL(acp_deinit, SND_SOC_ACP_COMMON); @@ -385,6 +391,9 @@ int check_acp_pdm(struct pci_dev *pci, struct acp_chip_info *chip) case ACP63_DEV: pdm_addr = ACP63_PDM_ADDR; break; + case ACP70_DEV: + pdm_addr = ACP70_PDM_ADDR; + break; default: return -EINVAL; } diff --git a/sound/soc/amd/acp/acp-mach.h b/sound/soc/amd/acp/acp-mach.h index 69db61f12eca..cd681101bea7 100644 --- a/sound/soc/amd/acp/acp-mach.h +++ b/sound/soc/amd/acp/acp-mach.h @@ -54,6 +54,7 @@ enum platform_end_point { RENOIR = 0, REMBRANDT, ACP63, + ACP70, }; struct acp_mach_ops { diff --git a/sound/soc/amd/acp/acp-pci.c b/sound/soc/amd/acp/acp-pci.c index 696c9ee6786f..8c8b1dcac628 100644 --- a/sound/soc/amd/acp/acp-pci.c +++ b/sound/soc/amd/acp/acp-pci.c @@ -91,6 +91,10 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id chip->name = "acp_asoc_acp63"; chip->acp_rev = ACP63_DEV; break; + case 0x70: + chip->name = "acp_asoc_acp70"; + chip->acp_rev = ACP70_DEV; + break; default: dev_err(dev, "Unsupported device revision:0x%x\n", pci->revision); ret = -EINVAL; diff --git a/sound/soc/amd/acp/acp70.c b/sound/soc/amd/acp/acp70.c new file mode 100644 index 000000000000..dd384c966ae9 --- /dev/null +++ b/sound/soc/amd/acp/acp70.c @@ -0,0 +1,254 @@ +// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) +// +// This file is provided under a dual BSD/GPLv2 license. When using or +// redistributing this file, you may do so under either license. +// +// Copyright(c) 2023 Advanced Micro Devices, Inc. +// +// Authors: Syed Saba kareem +/* + * Hardware interface for ACP7.0 block + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "amd.h" +#include "acp-mach.h" + +#define DRV_NAME "acp_asoc_acp70" + +static struct acp_resource rsrc = { + .offset = 0, + .no_of_ctrls = 2, + .irqp_used = 1, + .soc_mclk = true, + .irq_reg_offset = 0x1a00, + .i2s_pin_cfg_offset = 0x1440, + .i2s_mode = 0x0a, + .scratch_reg_offset = 0x12800, + .sram_pte_offset = 0x03802800, +}; + +static struct snd_soc_acpi_mach snd_soc_acpi_amd_acp70_acp_machines[] = { + { + .id = "AMDI0029", + .drv_name = "acp70-acp", + }, + {}, +}; + +static struct snd_soc_dai_driver acp70_dai[] = { +{ + .name = "acp-i2s-sp", + .id = I2S_SP_INSTANCE, + .playback = { + .stream_name = "I2S SP Playback", + .rates = SNDRV_PCM_RATE_8000_96000, + .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S8 | + SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S32_LE, + .channels_min = 2, + .channels_max = 8, + .rate_min = 8000, + .rate_max = 96000, + }, + .capture = { + .stream_name = "I2S SP Capture", + .rates = SNDRV_PCM_RATE_8000_48000, + .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S8 | + SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S32_LE, + .channels_min = 2, + .channels_max = 2, + .rate_min = 8000, + .rate_max = 48000, + }, + .ops = &asoc_acp_cpu_dai_ops, +}, +{ + .name = "acp-i2s-bt", + .id = I2S_BT_INSTANCE, + .playback = { + .stream_name = "I2S BT Playback", + .rates = SNDRV_PCM_RATE_8000_96000, + .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S8 | + SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S32_LE, + .channels_min = 2, + .channels_max = 8, + .rate_min = 8000, + .rate_max = 96000, + }, + .capture = { + .stream_name = "I2S BT Capture", + .rates = SNDRV_PCM_RATE_8000_48000, + .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S8 | + SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S32_LE, + .channels_min = 2, + .channels_max = 2, + .rate_min = 8000, + .rate_max = 48000, + }, + .ops = &asoc_acp_cpu_dai_ops, +}, +{ + .name = "acp-i2s-hs", + .id = I2S_HS_INSTANCE, + .playback = { + .stream_name = "I2S HS Playback", + .rates = SNDRV_PCM_RATE_8000_96000, + .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S8 | + SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S32_LE, + .channels_min = 2, + .channels_max = 8, + .rate_min = 8000, + .rate_max = 96000, + }, + .capture = { + .stream_name = "I2S HS Capture", + .rates = SNDRV_PCM_RATE_8000_48000, + .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S8 | + SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S32_LE, + .channels_min = 2, + .channels_max = 8, + .rate_min = 8000, + .rate_max = 48000, + }, + .ops = &asoc_acp_cpu_dai_ops, +}, +{ + .name = "acp-pdm-dmic", + .id = DMIC_INSTANCE, + .capture = { + .rates = SNDRV_PCM_RATE_8000_48000, + .formats = SNDRV_PCM_FMTBIT_S32_LE, + .channels_min = 2, + .channels_max = 2, + .rate_min = 8000, + .rate_max = 48000, + }, + .ops = &acp_dmic_dai_ops, +}, +}; + +static int acp_acp70_audio_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct acp_chip_info *chip; + struct acp_dev_data *adata; + struct resource *res; + + chip = dev_get_platdata(&pdev->dev); + if (!chip || !chip->base) { + dev_err(&pdev->dev, "ACP chip data is NULL\n"); + return -ENODEV; + } + + if (chip->acp_rev != ACP70_DEV) { + dev_err(&pdev->dev, "Un-supported ACP Revision %d\n", chip->acp_rev); + return -ENODEV; + } + + adata = devm_kzalloc(dev, sizeof(struct acp_dev_data), GFP_KERNEL); + if (!adata) + return -ENOMEM; + + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "acp_mem"); + if (!res) { + dev_err(&pdev->dev, "IORESOURCE_MEM FAILED\n"); + return -ENODEV; + } + + adata->acp_base = devm_ioremap(&pdev->dev, res->start, resource_size(res)); + if (!adata->acp_base) + return -ENOMEM; + + res = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "acp_dai_irq"); + if (!res) { + dev_err(&pdev->dev, "IORESOURCE_IRQ FAILED\n"); + return -ENODEV; + } + + adata->i2s_irq = res->start; + adata->dev = dev; + adata->dai_driver = acp70_dai; + adata->num_dai = ARRAY_SIZE(acp70_dai); + adata->rsrc = &rsrc; + adata->machines = snd_soc_acpi_amd_acp70_acp_machines; + adata->platform = ACP70; + adata->flag = chip->flag; + acp_machine_select(adata); + + dev_set_drvdata(dev, adata); + acp_enable_interrupts(adata); + acp_platform_register(dev); + pm_runtime_set_autosuspend_delay(&pdev->dev, ACP_SUSPEND_DELAY_MS); + pm_runtime_use_autosuspend(&pdev->dev); + pm_runtime_mark_last_busy(&pdev->dev); + pm_runtime_set_active(&pdev->dev); + pm_runtime_enable(&pdev->dev); + return 0; +} + +static void acp_acp70_audio_remove(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct acp_dev_data *adata = dev_get_drvdata(dev); + + acp_disable_interrupts(adata); + acp_platform_unregister(dev); + pm_runtime_disable(&pdev->dev); +} + +static int __maybe_unused acp70_pcm_resume(struct device *dev) +{ + struct acp_dev_data *adata = dev_get_drvdata(dev); + struct acp_stream *stream; + struct snd_pcm_substream *substream; + snd_pcm_uframes_t buf_in_frames; + u64 buf_size; + + spin_lock(&adata->acp_lock); + list_for_each_entry(stream, &adata->stream_list, list) { + if (stream) { + substream = stream->substream; + if (substream && substream->runtime) { + buf_in_frames = (substream->runtime->buffer_size); + buf_size = frames_to_bytes(substream->runtime, buf_in_frames); + config_pte_for_stream(adata, stream); + config_acp_dma(adata, stream, buf_size); + if (stream->dai_id) + restore_acp_i2s_params(substream, adata, stream); + else + restore_acp_pdm_params(substream, adata); + } + } + } + spin_unlock(&adata->acp_lock); + return 0; +} + +static const struct dev_pm_ops acp70_dma_pm_ops = { + SET_SYSTEM_SLEEP_PM_OPS(NULL, acp70_pcm_resume) +}; + +static struct platform_driver acp70_driver = { + .probe = acp_acp70_audio_probe, + .remove_new = acp_acp70_audio_remove, + .driver = { + .name = "acp_asoc_acp70", + .pm = &acp70_dma_pm_ops, + }, +}; + +module_platform_driver(acp70_driver); + +MODULE_DESCRIPTION("AMD ACP ACP70 Driver"); +MODULE_IMPORT_NS(SND_SOC_ACP_COMMON); +MODULE_LICENSE("Dual BSD/GPL"); +MODULE_ALIAS("platform:" DRV_NAME); diff --git a/sound/soc/amd/acp/amd.h b/sound/soc/amd/acp/amd.h index 937ce13c7d40..5017e868f39b 100644 --- a/sound/soc/amd/acp/amd.h +++ b/sound/soc/amd/acp/amd.h @@ -21,6 +21,7 @@ #define ACP3X_DEV 3 #define ACP6X_DEV 6 #define ACP63_DEV 0x63 +#define ACP70_DEV 0x70 #define DMIC_INSTANCE 0x00 #define I2S_SP_INSTANCE 0x01 @@ -99,6 +100,9 @@ #define ACP63_PGFSM_CONTROL ACP6X_PGFSM_CONTROL #define ACP63_PGFSM_STATUS ACP6X_PGFSM_STATUS +#define ACP70_PGFSM_CONTROL ACP6X_PGFSM_CONTROL +#define ACP70_PGFSM_STATUS ACP6X_PGFSM_STATUS + #define ACP_SOFT_RST_DONE_MASK 0x00010001 #define ACP_PGFSM_CNTL_POWER_ON_MASK 0xffffffff From patchwork Sat Oct 21 14:50:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 156471 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp332941vqx; Sat, 21 Oct 2023 07:54:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFZXPibDyI1JXYvDpDsG/sEX8O+BHA5+8L/Y6fOiUI3WsSwfzFJpxXBRPbUdHoQaVqB4g+/ X-Received: by 2002:a05:6a00:24c6:b0:690:1c1b:aefd with SMTP id d6-20020a056a0024c600b006901c1baefdmr5233995pfv.5.1697900091449; Sat, 21 Oct 2023 07:54:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697900091; cv=pass; d=google.com; s=arc-20160816; b=AjM7kFlt5FNGshK9WnsoLs+rzcmc39cJxeSD9+e1HDLhXb9YEVziDkKu0/xnzJ4nYT yz4dOwt1GhIsY54kMuJpWNTHkdxASO2nWapVkglBmGAu1C9wIjLGevjfPyFHw27WOPft ieW5zwcAww1ma9E+zzOQW/eWzTk0rYYziL80mXSk+R/NjxDtz6Bb8VGQjM8TxxoD6YLz EqkrhBCzYw99E/yS9KekLUb2lrOImdawpANCKOCyaR5oX7A2eWN64QVRdTXh04Yu05PT JQh0dyg876msYUFlBN6pXqPPyfSdxMMcuTGF1RrsW9DdtzZSv0YM73zFdMhn5Sccno7L kFjQ== 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=exNq9uwFBp+7ErFmKdC05GmdLKLXetHVniuI0Li0pXA=; fh=LHgWZBUrjbtsLqkN7lnQw8hIsBUwxMC4OVXKd64qvp4=; b=wOzXTQ+i29S7Cpc3U/2kdAsXb2jHncoV7uzN6CNk5Kx85Iu/lNSbvQnJze2Ma7HOoH cuNeMn6m3xQjg5IRSp/O/2aDa3b87bq5ryAcXtJ2Lfzu/7U0TGfx4Inhi+x4kzEMrMKl cs5allVLGprDrNvCz/PU9wMl06MzTyfK4JuV5ER7S2n8hdrMcA/dE/I2xJqQDAxog8YN CcKMG7HW5UHDM/17z174u+/fzm1nS2RgfLvsnMmIVEx6v4phKsF92Hi/ihZg6KJHF/4s pLh/w5JBxcerWP+Km0TN5EkkLCWtPowhM4/BeYf1YKlFobI7aXUfW//oRfvJNd+9cdnX d3kg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=fOKpg3nO; 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 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id h10-20020a056a00218a00b006be199ee091si3846454pfi.295.2023.10.21.07.54.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Oct 2023 07:54:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=fOKpg3nO; 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 23.128.96.31 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id E34858024DEE; Sat, 21 Oct 2023 07:54:46 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231403AbjJUOxw (ORCPT + 26 others); Sat, 21 Oct 2023 10:53:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231671AbjJUOxt (ORCPT ); Sat, 21 Oct 2023 10:53:49 -0400 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2068.outbound.protection.outlook.com [40.107.100.68]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8EEE10C3 for ; Sat, 21 Oct 2023 07:53:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Wc2/uxu5nwgoKbQRpaRp+z7I3GsCRinjRpfHf8AjD5W/QGYUlRRPX5bgrtEYEfp8QSlab/PLp1UC6VykraxZ9d3TLVvM3WXcRYUWbMksggKYuXmpPg3LRumU0125eG40ARacS7dY+czi++8BwRHN6bdE8N3kmD69dj9VbQt3IxtZt5vJRCjOEEmF5wwBB+IH/AdZalN68oY0+LpdPU7UdkJinyKQekd45k6+9rgkp4Qbn+u1e18JUfYW6MOusujcWiZCF3VxD0ARVSHIrCDLNvHFdZ2CwMzJpNNH00I58ybty4mvB1tdQYc8qzkbgBfDn5VOS38jDsAgR3/EqGNYIA== 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=exNq9uwFBp+7ErFmKdC05GmdLKLXetHVniuI0Li0pXA=; b=TF9i5Hr3uT4x3uFcA3zy1Ybv2TkhdHDHJSzx3tgxUUL0BTZk4bAoKO4CaqH/ZSax+X15XOCTMbRj8/+u1If7oMue3ltk5CgXCKKjxWOTxNbMgpLeZ/GRqKA/Q11X3m9QywehtvDlP9UgjqyEf6M5UEiQHNn0b2S2UkWmu3Cauf8OD7beI78IVjLawzjtDNw2kjXv9SvHkDkJI2iwNB2j1oQ0YpWgTfV+6oYKeMmC1ZyuE7mmUc2tUyvVS57RDKlWg0LY2GsPfS1BSREcUSiZpZxch5CcMz6yJxd5Jd/PDTynKSWMAPIgETVrdOMcl3nXwZB62+RLEG9OGXpiOoTzNg== 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=exNq9uwFBp+7ErFmKdC05GmdLKLXetHVniuI0Li0pXA=; b=fOKpg3nOHSGUDz0Qv85AIKteXIInKtLpgnGLY96Y3rqoP5gSwetO1YqP+a3/bdynNwNBEU8FUA5q9M9nJABd+DjrAQ0wS0of63KM4K6UGol+qFbKqZO0qwUPQU9urJ/dHzycoU2MGaj3pVMSlUrxa9IQVuziLYBtwduR44iXiE8= Received: from DS7PR07CA0008.namprd07.prod.outlook.com (2603:10b6:5:3af::21) by IA0PR12MB8716.namprd12.prod.outlook.com (2603:10b6:208:485::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.26; Sat, 21 Oct 2023 14:53:24 +0000 Received: from DS2PEPF00003441.namprd04.prod.outlook.com (2603:10b6:5:3af:cafe::cf) by DS7PR07CA0008.outlook.office365.com (2603:10b6:5:3af::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.26 via Frontend Transport; Sat, 21 Oct 2023 14:53:24 +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 DS2PEPF00003441.mail.protection.outlook.com (10.167.17.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6907.20 via Frontend Transport; Sat, 21 Oct 2023 14:53:24 +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.2507.27; Sat, 21 Oct 2023 09:53:23 -0500 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.2507.27; Sat, 21 Oct 2023 09:53:23 -0500 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Sat, 21 Oct 2023 09:53:18 -0500 From: Syed Saba Kareem To: , CC: , , , , , , , , Syed Saba Kareem , Liam Girdwood , "Jaroslav Kysela" , Takashi Iwai , Alper Nebi Yasak , Kuninori Morimoto , Marian Postevca , open list Subject: [PATCH 13/13] ASoC: amd: acp: add machine driver support for acp7.0 Date: Sat, 21 Oct 2023 20:20:54 +0530 Message-ID: <20231021145110.478744-13-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231021145110.478744-1-Syed.SabaKareem@amd.com> References: <20231021145110.478744-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS2PEPF00003441:EE_|IA0PR12MB8716:EE_ X-MS-Office365-Filtering-Correlation-Id: 3292a2c1-ad7a-4acd-fa31-08dbd24579e7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HSRyx6/1uP+R/ht+u8RF+XTHpCR51EYbgkGlsYGIF8A6WgkE2eEk3ZRyRcKUltgOPTXh+aKDUgr/61joX0xWfnQBOaLf7yJKtlKAJ1dg6TtOW9a28LipSHKKyRNUlGGPIsKku7GTWUGGPrtvmL9ls9OQO3XqCK7AKrXPG6zS6kinrL6FbmN7QSAk10Lhrr6dqW8cW759jcZt3HxPR2tFcBl2XxwuX/R2LJXlpY/D8dGvuKZ1peeDuntVt1hiiOd8LKgvxTaHqWi5uKxco3t/7ryPfrAaknDczDewUZhsnoCMOR5YnTCtgaAIHHg5xzeqjf8KtzsHjhnKidv7HQOvSPqDvKBLTLrTSvpNStQrUE5dJATky+qS2HB4xxXTPjKPQHD6Rpg6zROtqAojIG+idW0UjG2RtG7/p3T3CIjl3b8PO0Xnc0y89bPYcHb0218SiUEQihV0+X2EoBSEoyaLf3LnsoGkDZfBOicK6lljtNmRsJHFCik8shrAaGFX7JDFZRLI1ehz5PQbwjOuNYxIpHEBbHIMhaYEf2NIouBLbKWRHyYokicDeopYZ8dO7+hKahEDCMnvQ4D1fgiDyoLOciitbWNcW7hX2k9Iu9LKI5QH9hJSGbPz7Z4rbgyX8UZhu5zkmqE41O6VnXioviTiXbfEk8Y1w6lOhjFvvoDj5iYOi8znkifv+C2Ba8ckEvqoBWWSDd2KG0SDwnEn9MpHBwyH8gagaFZP04E+ZjoyooVpBrbUCFcj9vrVofirhQ4dkA28935mjONxsaF3OSDOwQ== 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:(13230031)(4636009)(136003)(346002)(376002)(396003)(39850400004)(230922051799003)(82310400011)(186009)(64100799003)(1800799009)(451199024)(36840700001)(40470700004)(46966006)(40460700003)(426003)(36860700001)(356005)(5660300002)(47076005)(2906002)(2616005)(26005)(1076003)(6666004)(81166007)(7696005)(478600001)(336012)(40480700001)(110136005)(86362001)(36756003)(70206006)(8676002)(54906003)(8936002)(82740400003)(41300700001)(316002)(70586007)(4326008)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2023 14:53:24.1629 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3292a2c1-ad7a-4acd-fa31-08dbd24579e7 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: DS2PEPF00003441.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8716 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Sat, 21 Oct 2023 07:54:46 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780377286661200652 X-GMAIL-MSGID: 1780377286661200652 add machine driver support for ACP7.0 on legacy stack. Signed-off-by: Syed Saba Kareem --- sound/soc/amd/acp/acp-mach-common.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sound/soc/amd/acp/acp-mach-common.c b/sound/soc/amd/acp/acp-mach-common.c index 88e91af47532..34b14f2611ba 100644 --- a/sound/soc/amd/acp/acp-mach-common.c +++ b/sound/soc/amd/acp/acp-mach-common.c @@ -1266,6 +1266,12 @@ static struct snd_soc_dai_link_component platform_acp63_component[] = { } }; +static struct snd_soc_dai_link_component platform_acp70_component[] = { + { + .name = "acp_asoc_acp70.0", + } +}; + static struct snd_soc_dai_link_component sof_component[] = { { .name = "0000:04:00.5", @@ -1692,6 +1698,9 @@ int acp_legacy_dai_links_create(struct snd_soc_card *card) } else if (drv_data->platform == ACP63) { links[i].platforms = platform_acp63_component; links[i].num_platforms = ARRAY_SIZE(platform_acp63_component); + } else if (drv_data->platform == ACP70) { + links[i].platforms = platform_acp70_component; + links[i].num_platforms = ARRAY_SIZE(platform_acp70_component); } else { links[i].platforms = platform_component; links[i].num_platforms = ARRAY_SIZE(platform_component);