From patchwork Sat Aug 27 16:56:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 12957055 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E0C2CC0502C for ; Sat, 27 Aug 2022 17:00:44 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 1BF20AE9; Sat, 27 Aug 2022 18:59:53 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1BF20AE9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1661619643; bh=EhFDhtprVUrv7j0Vq8fd8pR2d4uhQM6xBFZhAt3snqI=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=hAiYOlNiQSeZ5k69SkJy1TC3cLwBcBxV23Hg26M06xtYYbMRbtZcBonv2haMDEmtU ygx2KRMTgbY4wPlmZZiFvgNU3AYXxk2n0dgVwtzO5a9Ij6bPwLveS+o1Kwxh5p5sHc SywX4eS70gPidW/IuvtsVW/mA5ao5LdwywJKGMlY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 5C80BF80290; Sat, 27 Aug 2022 18:59:34 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E9D58F802E8; Sat, 27 Aug 2022 18:59:32 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2068.outbound.protection.outlook.com [40.107.94.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A6EACF80132 for ; Sat, 27 Aug 2022 18:59:26 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A6EACF80132 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="id3cDiRj" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WinxPFO7UJaegMV90FVgHApV1VeXaZOuKBGE9EPLXRloE7o4nxTSJBGWB5yGaVtJ7vnffLvqMgjbaSDi8VIrt2QraoXym0y7tIApAOI2aFqvUZTZYpLvePzpxo7sHVey7ePVoTdDxiT/ghYwnXO75+f4LDsi3h7g6IeNUgQR9YBfQeQBaSxO6FEt51qtXRMUulQLhT0qsXD3Kb7X5TXvIKdfLsWp8o8+CimLnuGvPqWYLlptRMNl7DlKjB7F4VYlnuWND6D/eDcY5XsyJ2iO8XDe6s+l5/xfulMLYXZHrZyCbLAXSAVYWedze5xN6wu6GSZtoMcozWIYutA/nYKmJw== 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=TBK9EJPEZvP7BuZrlYjuBWm2vub/rRDLDZ/dnP95BDY=; b=L0bpG7ULH++uAUFD3UMF8W17QN8M7/dWYNCiNwKLtwCzLxNVVhNk8CLcAH590JbORWSEngVH08DyeW+rS3pSIcsv62J9S6/+2i2oBfCkTDCSXz4HruhMkqmQ5FvDxbS/NajDTMKiBK4cjGvYzlFjG5DhA/p7WQvVLbgznBFnwlMkAHUJ4epRCMrce5+y83VF4W8B4wa1QH56ul0Du9MAVNCj8qGPGqewrENeUfoDmcJCYpwp2iZBvetYFx45XIxBhf0cShMEGnDwOo0g2ArLvuFYGieV1xVWt1vKC8cTq9g37hOCz9pBVMfpoIH4XLmRHy6BBcXhbmX4/Hb1eCNeKQ== 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=TBK9EJPEZvP7BuZrlYjuBWm2vub/rRDLDZ/dnP95BDY=; b=id3cDiRjytdfiBOXUcBY82MQmasbCyL5+Hvj0P2nhD8DJZnpQQgOzdhblfnJp9TpT+sDdglaIELNae62YGSEOqMNyO1RNz8Z9eA0/FAJ5YUdHoXLIoR5WDe8NIQ7xhUJpg+6o7E09MAixx/JOe2xnrunUvMdNDGcvHXxCB8TPjc= Received: from DS7PR03CA0027.namprd03.prod.outlook.com (2603:10b6:5:3b8::32) by CY4PR12MB1815.namprd12.prod.outlook.com (2603:10b6:903:122::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.14; Sat, 27 Aug 2022 16:59:19 +0000 Received: from DM6NAM11FT036.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b8:cafe::a2) by DS7PR03CA0027.outlook.office365.com (2603:10b6:5:3b8::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15 via Frontend Transport; Sat, 27 Aug 2022 16:59: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=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by DM6NAM11FT036.mail.protection.outlook.com (10.13.172.64) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5566.15 via Frontend Transport; Sat, 27 Aug 2022 16:59:19 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sat, 27 Aug 2022 11:59:18 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sat, 27 Aug 2022 11:59:18 -0500 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.28 via Frontend Transport; Sat, 27 Aug 2022 11:59:14 -0500 From: Syed Saba Kareem To: , Subject: [PATCH v2 01/13] ASoC: amd: add Pink Sardine platform ACP IP register header Date: Sat, 27 Aug 2022 22:26:45 +0530 Message-ID: <20220827165657.2343818-2-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220827165657.2343818-1-Syed.SabaKareem@amd.com> References: <20220827165657.2343818-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 870cae0d-1a4f-4239-4810-08da884d7b7a X-MS-TrafficTypeDiagnostic: CY4PR12MB1815:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: W0HJ/MhbgQojpofrjevdlALFFGQkKnCu2DQrNGDq2vP8ibA2hxY7bv/g9wQUjYfB6goh8aW5FH5lURC03oohcnCzGtQnA3163ilILs9KGn/7RVDLoBw0W6lUc6t13GcDvKpTN4Y/JJ1e1oH910CkW0kD6rM3HtyJnHLITVx5rjqKubb91wVeWZEuyyODzfFUv97ImgjJi1c9fnc2XtVFpi74Fi5NHP/Iw0Bns8L4zkAOJx4hArAlsGgh5TYV8z+CZEWu8W6TQvkUNx2/4qp2E2YLUJka/31q+ZZGzd+RnQT+wBy2ELqYJ3YjeD8iTV/aGpJ40Be27QPc6m03EqSC8oUIxOFmLDd+5zuqRoVR9FL5rgH1nDToa5fgjd1fGZuAth3OWcatQQMokJxd1H0mMsOR/tpnScGoDWnw0sgxvw8Wef/myNr6UFI/mcSGsbgl1Ek5sY6HeQfgC8kZz3Z3Fcbof/sHVPW6qSPEvBm2iffAM1tA5u3SRo998uEbUDNAEUpDN7a66US3E5FZzJy2dHlf3d7q8Mn991ixa32zhlCbS95gIxBvpWk6/Z3Vgy42lKA0Izqc5dUCVP79J+e5WyRDduXlqm6bUaoST4UFXBTkq2GEq2ythBMOzB+ewFi9nmZ5H5050TgnOtNh5joS8LgrlYUERkujvHJ19dVP1a3sk2nClpoqsWFoTgOefJtmm9YDsXp0U/Go8C/eXeqCfAGD/kGcKK2xbNomsf1VZUF3VHoCfjSCcTcDUGnoGbEWb0iMDLzA6XXm5Hle7P4wG6BLxe9I1Jw6W3erKl7pYX4= 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:(13230016)(4636009)(136003)(396003)(346002)(376002)(39860400002)(46966006)(36840700001)(40470700004)(41300700001)(40460700003)(83380400001)(6666004)(186003)(8936002)(36860700001)(7696005)(2906002)(5660300002)(2616005)(30864003)(86362001)(1076003)(40480700001)(478600001)(70586007)(336012)(47076005)(8676002)(70206006)(81166007)(316002)(26005)(426003)(356005)(36756003)(4326008)(54906003)(110136005)(82740400003)(82310400005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2022 16:59:19.0879 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 870cae0d-1a4f-4239-4810-08da884d7b7a 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: DM6NAM11FT036.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1815 Cc: Sunil-kumar.Dommati@amd.com, open list , Basavaraj.Hiregoudar@amd.com, Takashi Iwai , mario.limonciello@amd.com, Vijendar.Mukunda@amd.com, alexander.deucher@amd.com, Syed Saba Kareem X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Add ACP IP Register header for Pink Sardine platform. Signed-off-by: Syed Saba Kareem Reviewed-by: Vijendar Mukunda --- include/sound/acp62_chip_offset_byte.h | 444 +++++++++++++++++++++++++ 1 file changed, 444 insertions(+) create mode 100644 include/sound/acp62_chip_offset_byte.h diff --git a/include/sound/acp62_chip_offset_byte.h b/include/sound/acp62_chip_offset_byte.h new file mode 100644 index 000000000000..f03992f81168 --- /dev/null +++ b/include/sound/acp62_chip_offset_byte.h @@ -0,0 +1,444 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * AMD ACP 6.2 Register Documentation + * + * Copyright 2022 Advanced Micro Devices, Inc. + */ + +#ifndef _acp_ip_OFFSET_HEADER +#define _acp_ip_OFFSET_HEADER + +/* Registers from ACP_DMA block */ +#define ACP_DMA_CNTL_0 0x0000000 +#define ACP_DMA_CNTL_1 0x0000004 +#define ACP_DMA_CNTL_2 0x0000008 +#define ACP_DMA_CNTL_3 0x000000C +#define ACP_DMA_CNTL_4 0x0000010 +#define ACP_DMA_CNTL_5 0x0000014 +#define ACP_DMA_CNTL_6 0x0000018 +#define ACP_DMA_CNTL_7 0x000001C +#define ACP_DMA_DSCR_STRT_IDX_0 0x0000020 +#define ACP_DMA_DSCR_STRT_IDX_1 0x0000024 +#define ACP_DMA_DSCR_STRT_IDX_2 0x0000028 +#define ACP_DMA_DSCR_STRT_IDX_3 0x000002C +#define ACP_DMA_DSCR_STRT_IDX_4 0x0000030 +#define ACP_DMA_DSCR_STRT_IDX_5 0x0000034 +#define ACP_DMA_DSCR_STRT_IDX_6 0x0000038 +#define ACP_DMA_DSCR_STRT_IDX_7 0x000003C +#define ACP_DMA_DSCR_CNT_0 0x0000040 +#define ACP_DMA_DSCR_CNT_1 0x0000044 +#define ACP_DMA_DSCR_CNT_2 0x0000048 +#define ACP_DMA_DSCR_CNT_3 0x000004C +#define ACP_DMA_DSCR_CNT_4 0x0000050 +#define ACP_DMA_DSCR_CNT_5 0x0000054 +#define ACP_DMA_DSCR_CNT_6 0x0000058 +#define ACP_DMA_DSCR_CNT_7 0x000005C +#define ACP_DMA_PRIO_0 0x0000060 +#define ACP_DMA_PRIO_1 0x0000064 +#define ACP_DMA_PRIO_2 0x0000068 +#define ACP_DMA_PRIO_3 0x000006C +#define ACP_DMA_PRIO_4 0x0000070 +#define ACP_DMA_PRIO_5 0x0000074 +#define ACP_DMA_PRIO_6 0x0000078 +#define ACP_DMA_PRIO_7 0x000007C +#define ACP_DMA_CUR_DSCR_0 0x0000080 +#define ACP_DMA_CUR_DSCR_1 0x0000084 +#define ACP_DMA_CUR_DSCR_2 0x0000088 +#define ACP_DMA_CUR_DSCR_3 0x000008C +#define ACP_DMA_CUR_DSCR_4 0x0000090 +#define ACP_DMA_CUR_DSCR_5 0x0000094 +#define ACP_DMA_CUR_DSCR_6 0x0000098 +#define ACP_DMA_CUR_DSCR_7 0x000009C +#define ACP_DMA_CUR_TRANS_CNT_0 0x00000A0 +#define ACP_DMA_CUR_TRANS_CNT_1 0x00000A4 +#define ACP_DMA_CUR_TRANS_CNT_2 0x00000A8 +#define ACP_DMA_CUR_TRANS_CNT_3 0x00000AC +#define ACP_DMA_CUR_TRANS_CNT_4 0x00000B0 +#define ACP_DMA_CUR_TRANS_CNT_5 0x00000B4 +#define ACP_DMA_CUR_TRANS_CNT_6 0x00000B8 +#define ACP_DMA_CUR_TRANS_CNT_7 0x00000BC +#define ACP_DMA_ERR_STS_0 0x00000C0 +#define ACP_DMA_ERR_STS_1 0x00000C4 +#define ACP_DMA_ERR_STS_2 0x00000C8 +#define ACP_DMA_ERR_STS_3 0x00000CC +#define ACP_DMA_ERR_STS_4 0x00000D0 +#define ACP_DMA_ERR_STS_5 0x00000D4 +#define ACP_DMA_ERR_STS_6 0x00000D8 +#define ACP_DMA_ERR_STS_7 0x00000DC +#define ACP_DMA_DESC_BASE_ADDR 0x00000E0 +#define ACP_DMA_DESC_MAX_NUM_DSCR 0x00000E4 +#define ACP_DMA_CH_STS 0x00000E8 +#define ACP_DMA_CH_GROUP 0x00000EC +#define ACP_DMA_CH_RST_STS 0x00000F0 + +/* Registers from ACP_AXI2AXIATU block */ +#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_1 0x0000C00 +#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_1 0x0000C04 +#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_2 0x0000C08 +#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_2 0x0000C0C +#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_3 0x0000C10 +#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_3 0x0000C14 +#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_4 0x0000C18 +#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_4 0x0000C1C +#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_5 0x0000C20 +#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_5 0x0000C24 +#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_6 0x0000C28 +#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_6 0x0000C2C +#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_7 0x0000C30 +#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_7 0x0000C34 +#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_8 0x0000C38 +#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_8 0x0000C3C +#define ACPAXI2AXI_ATU_CTRL 0x0000C40 +#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_9 0x0000C44 +#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_9 0x0000C48 +#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_10 0x0000C4C +#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_10 0x0000C50 +#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_11 0x0000C54 +#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_11 0x0000C58 +#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_12 0x0000C5C +#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_12 0x0000C60 +#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_13 0x0000C64 +#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_13 0x0000C68 +#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_14 0x0000C6C +#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_14 0x0000C70 +#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_15 0x0000C74 +#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_15 0x0000C78 +#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_16 0x0000C7C +#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_16 0x0000C80 + +/* Registers from ACP_CLKRST block */ +#define ACP_SOFT_RESET 0x0001000 +#define ACP_CONTROL 0x0001004 +#define ACP_STATUS 0x0001008 +#define ACP_DYNAMIC_CG_MASTER_CONTROL 0x0001010 +#define ACP_ZSC_DSP_CTRL 0x0001014 +#define ACP_ZSC_STS 0x0001018 +#define ACP_PGFSM_CONTROL 0x0001024 +#define ACP_PGFSM_STATUS 0x0001028 +#define ACP_CLKMUX_SEL 0x000102C + +/* Registers from ACP_AON block */ +#define ACP_PME_EN 0x0001400 +#define ACP_DEVICE_STATE 0x0001404 +#define AZ_DEVICE_STATE 0x0001408 +#define ACP_PIN_CONFIG 0x0001440 +#define ACP_PAD_PULLUP_CTRL 0x0001444 +#define ACP_PAD_PULLDOWN_CTRL 0x0001448 +#define ACP_PAD_DRIVE_STRENGTH_CTRL 0x000144C +#define ACP_PAD_SCHMEN_CTRL 0x0001450 +#define ACP_SW_PAD_KEEPER_EN 0x0001454 +#define ACP_SW_WAKE_EN 0x0001458 +#define ACP_I2S_WAKE_EN 0x000145C +#define ACP_SW1_WAKE_EN 0x0001460 + +/* Registers from ACP_P1_MISC block */ +#define ACP_EXTERNAL_INTR_ENB 0x0001A00 +#define ACP_EXTERNAL_INTR_CNTL 0x0001A04 +#define ACP_EXTERNAL_INTR_CNTL1 0x0001A08 +#define ACP_EXTERNAL_INTR_STAT 0x0001A0C +#define ACP_EXTERNAL_INTR_STAT1 0x0001A10 +#define ACP_ERROR_STATUS 0x0001A4C +#define ACP_P1_SW_I2S_ERROR_REASON 0x0001A50 +#define ACP_P1_SW_POS_TRACK_I2S_TX_CTRL 0x0001A6C +#define ACP_P1_SW_I2S_TX_DMA_POS 0x0001A70 +#define ACP_P1_SW_POS_TRACK_I2S_RX_CTRL 0x0001A74 +#define ACP_P1_SW_I2S_RX_DMA_POS 0x0001A78 +#define ACP_P1_DMIC_I2S_GPIO_INTR_CTRL 0x0001A7C +#define ACP_P1_DMIC_I2S_GPIO_INTR_STATUS 0x0001A80 +#define ACP_SCRATCH_REG_BASE_ADDR 0x0001A84 +#define ACP_P1_SW_POS_TRACK_BT_TX_CTRL 0x0001A88 +#define ACP_P1_SW_BT_TX_DMA_POS 0x0001A8C +#define ACP_P1_SW_POS_TRACK_HS_TX_CTRL 0x0001A90 +#define ACP_P1_SW_HS_TX_DMA_POS 0x0001A94 +#define ACP_P1_SW_POS_TRACK_BT_RX_CTRL 0x0001A98 +#define ACP_P1_SW_BT_RX_DMA_POS 0x0001A9C +#define ACP_P1_SW_POS_TRACK_HS_RX_CTRL 0x0001AA0 +#define ACP_P1_SW_HS_RX_DMA_POS 0x0001AA4 + +/* Registers from ACP_AUDIO_BUFFERS block */ +#define ACP_I2S_RX_RINGBUFADDR 0x0002000 +#define ACP_I2S_RX_RINGBUFSIZE 0x0002004 +#define ACP_I2S_RX_LINKPOSITIONCNTR 0x0002008 +#define ACP_I2S_RX_FIFOADDR 0x000200C +#define ACP_I2S_RX_FIFOSIZE 0x0002010 +#define ACP_I2S_RX_DMA_SIZE 0x0002014 +#define ACP_I2S_RX_LINEARPOSITIONCNTR_HIGH 0x0002018 +#define ACP_I2S_RX_LINEARPOSITIONCNTR_LOW 0x000201C +#define ACP_I2S_RX_INTR_WATERMARK_SIZE 0x0002020 +#define ACP_I2S_TX_RINGBUFADDR 0x0002024 +#define ACP_I2S_TX_RINGBUFSIZE 0x0002028 +#define ACP_I2S_TX_LINKPOSITIONCNTR 0x000202C +#define ACP_I2S_TX_FIFOADDR 0x0002030 +#define ACP_I2S_TX_FIFOSIZE 0x0002034 +#define ACP_I2S_TX_DMA_SIZE 0x0002038 +#define ACP_I2S_TX_LINEARPOSITIONCNTR_HIGH 0x000203C +#define ACP_I2S_TX_LINEARPOSITIONCNTR_LOW 0x0002040 +#define ACP_I2S_TX_INTR_WATERMARK_SIZE 0x0002044 +#define ACP_BT_RX_RINGBUFADDR 0x0002048 +#define ACP_BT_RX_RINGBUFSIZE 0x000204C +#define ACP_BT_RX_LINKPOSITIONCNTR 0x0002050 +#define ACP_BT_RX_FIFOADDR 0x0002054 +#define ACP_BT_RX_FIFOSIZE 0x0002058 +#define ACP_BT_RX_DMA_SIZE 0x000205C +#define ACP_BT_RX_LINEARPOSITIONCNTR_HIGH 0x0002060 +#define ACP_BT_RX_LINEARPOSITIONCNTR_LOW 0x0002064 +#define ACP_BT_RX_INTR_WATERMARK_SIZE 0x0002068 +#define ACP_BT_TX_RINGBUFADDR 0x000206C +#define ACP_BT_TX_RINGBUFSIZE 0x0002070 +#define ACP_BT_TX_LINKPOSITIONCNTR 0x0002074 +#define ACP_BT_TX_FIFOADDR 0x0002078 +#define ACP_BT_TX_FIFOSIZE 0x000207C +#define ACP_BT_TX_DMA_SIZE 0x0002080 +#define ACP_BT_TX_LINEARPOSITIONCNTR_HIGH 0x0002084 +#define ACP_BT_TX_LINEARPOSITIONCNTR_LOW 0x0002088 +#define ACP_BT_TX_INTR_WATERMARK_SIZE 0x000208C +#define ACP_HS_RX_RINGBUFADDR 0x0002090 +#define ACP_HS_RX_RINGBUFSIZE 0x0002094 +#define ACP_HS_RX_LINKPOSITIONCNTR 0x0002098 +#define ACP_HS_RX_FIFOADDR 0x000209C +#define ACP_HS_RX_FIFOSIZE 0x00020A0 +#define ACP_HS_RX_DMA_SIZE 0x00020A4 +#define ACP_HS_RX_LINEARPOSITIONCNTR_HIGH 0x00020A8 +#define ACP_HS_RX_LINEARPOSITIONCNTR_LOW 0x00020AC +#define ACP_HS_RX_INTR_WATERMARK_SIZE 0x00020B0 +#define ACP_HS_TX_RINGBUFADDR 0x00020B4 +#define ACP_HS_TX_RINGBUFSIZE 0x00020B8 +#define ACP_HS_TX_LINKPOSITIONCNTR 0x00020BC +#define ACP_HS_TX_FIFOADDR 0x00020C0 +#define ACP_HS_TX_FIFOSIZE 0x00020C4 +#define ACP_HS_TX_DMA_SIZE 0x00020C8 +#define ACP_HS_TX_LINEARPOSITIONCNTR_HIGH 0x00020CC +#define ACP_HS_TX_LINEARPOSITIONCNTR_LOW 0x00020D0 +#define ACP_HS_TX_INTR_WATERMARK_SIZE 0x00020D4 + +/* Registers from ACP_I2S_TDM block */ +#define ACP_I2STDM_IER 0x0002400 +#define ACP_I2STDM_IRER 0x0002404 +#define ACP_I2STDM_RXFRMT 0x0002408 +#define ACP_I2STDM_ITER 0x000240C +#define ACP_I2STDM_TXFRMT 0x0002410 +#define ACP_I2STDM0_MSTRCLKGEN 0x0002414 +#define ACP_I2STDM1_MSTRCLKGEN 0x0002418 +#define ACP_I2STDM2_MSTRCLKGEN 0x000241C +#define ACP_I2STDM_REFCLKGEN 0x0002420 + +/* Registers from ACP_BT_TDM block */ +#define ACP_BTTDM_IER 0x0002800 +#define ACP_BTTDM_IRER 0x0002804 +#define ACP_BTTDM_RXFRMT 0x0002808 +#define ACP_BTTDM_ITER 0x000280C +#define ACP_BTTDM_TXFRMT 0x0002810 +#define ACP_HSTDM_IER 0x0002814 +#define ACP_HSTDM_IRER 0x0002818 +#define ACP_HSTDM_RXFRMT 0x000281C +#define ACP_HSTDM_ITER 0x0002820 +#define ACP_HSTDM_TXFRMT 0x0002824 + +/* Registers from ACP_WOV block */ +#define ACP_WOV_PDM_ENABLE 0x0002C04 +#define ACP_WOV_PDM_DMA_ENABLE 0x0002C08 +#define ACP_WOV_RX_RINGBUFADDR 0x0002C0C +#define ACP_WOV_RX_RINGBUFSIZE 0x0002C10 +#define ACP_WOV_RX_LINKPOSITIONCNTR 0x0002C14 +#define ACP_WOV_RX_LINEARPOSITIONCNTR_HIGH 0x0002C18 +#define ACP_WOV_RX_LINEARPOSITIONCNTR_LOW 0x0002C1C +#define ACP_WOV_RX_INTR_WATERMARK_SIZE 0x0002C20 +#define ACP_WOV_PDM_FIFO_FLUSH 0x0002C24 +#define ACP_WOV_PDM_NO_OF_CHANNELS 0x0002C28 +#define ACP_WOV_PDM_DECIMATION_FACTOR 0x0002C2C +#define ACP_WOV_PDM_VAD_CTRL 0x0002C30 +#define ACP_WOV_WAKE 0x0002C54 +#define ACP_WOV_BUFFER_STATUS 0x0002C58 +#define ACP_WOV_MISC_CTRL 0x0002C5C +#define ACP_WOV_CLK_CTRL 0x0002C60 +#define ACP_PDM_VAD_DYNAMIC_CLK_GATING_EN 0x0002C64 +#define ACP_WOV_ERROR_STATUS_REGISTER 0x0002C68 +#define ACP_PDM_CLKDIV 0x0002C6C + +/* Registers from ACP_P1_AUDIO_BUFFERS block */ +#define ACP_P1_I2S_RX_RINGBUFADDR 0x0003A00 +#define ACP_P1_I2S_RX_RINGBUFSIZE 0x0003A04 +#define ACP_P1_I2S_RX_LINKPOSITIONCNTR 0x0003A08 +#define ACP_P1_I2S_RX_FIFOADDR 0x0003A0C +#define ACP_P1_I2S_RX_FIFOSIZE 0x0003A10 +#define ACP_P1_I2S_RX_DMA_SIZE 0x0003A14 +#define ACP_P1_I2S_RX_LINEARPOSITIONCNTR_HIGH 0x0003A18 +#define ACP_P1_I2S_RX_LINEARPOSITIONCNTR_LOW 0x0003A1C +#define ACP_P1_I2S_RX_INTR_WATERMARK_SIZE 0x0003A20 +#define ACP_P1_I2S_TX_RINGBUFADDR 0x0003A24 +#define ACP_P1_I2S_TX_RINGBUFSIZE 0x0003A28 +#define ACP_P1_I2S_TX_LINKPOSITIONCNTR 0x0003A2C +#define ACP_P1_I2S_TX_FIFOADDR 0x0003A30 +#define ACP_P1_I2S_TX_FIFOSIZE 0x0003A34 +#define ACP_P1_I2S_TX_DMA_SIZE 0x0003A38 +#define ACP_P1_I2S_TX_LINEARPOSITIONCNTR_HIGH 0x0003A3C +#define ACP_P1_I2S_TX_LINEARPOSITIONCNTR_LOW 0x0003A40 +#define ACP_P1_I2S_TX_INTR_WATERMARK_SIZE 0x0003A44 +#define ACP_P1_BT_RX_RINGBUFADDR 0x0003A48 +#define ACP_P1_BT_RX_RINGBUFSIZE 0x0003A4C +#define ACP_P1_BT_RX_LINKPOSITIONCNTR 0x0003A50 +#define ACP_P1_BT_RX_FIFOADDR 0x0003A54 +#define ACP_P1_BT_RX_FIFOSIZE 0x0003A58 +#define ACP_P1_BT_RX_DMA_SIZE 0x0003A5C +#define ACP_P1_BT_RX_LINEARPOSITIONCNTR_HIGH 0x0003A60 +#define ACP_P1_BT_RX_LINEARPOSITIONCNTR_LOW 0x0003A64 +#define ACP_P1_BT_RX_INTR_WATERMARK_SIZE 0x0003A68 +#define ACP_P1_BT_TX_RINGBUFADDR 0x0003A6C +#define ACP_P1_BT_TX_RINGBUFSIZE 0x0003A70 +#define ACP_P1_BT_TX_LINKPOSITIONCNTR 0x0003A74 +#define ACP_P1_BT_TX_FIFOADDR 0x0003A78 +#define ACP_P1_BT_TX_FIFOSIZE 0x0003A7C +#define ACP_P1_BT_TX_DMA_SIZE 0x0003A80 +#define ACP_P1_BT_TX_LINEARPOSITIONCNTR_HIGH 0x0003A84 +#define ACP_P1_BT_TX_LINEARPOSITIONCNTR_LOW 0x0003A88 +#define ACP_P1_BT_TX_INTR_WATERMARK_SIZE 0x0003A8C +#define ACP_P1_HS_RX_RINGBUFADDR 0x0003A90 +#define ACP_P1_HS_RX_RINGBUFSIZE 0x0003A94 +#define ACP_P1_HS_RX_LINKPOSITIONCNTR 0x0003A98 +#define ACP_P1_HS_RX_FIFOADDR 0x0003A9C +#define ACP_P1_HS_RX_FIFOSIZE 0x0003AA0 +#define ACP_P1_HS_RX_DMA_SIZE 0x0003AA4 +#define ACP_P1_HS_RX_LINEARPOSITIONCNTR_HIGH 0x0003AA8 +#define ACP_P1_HS_RX_LINEARPOSITIONCNTR_LOW 0x0003AAC +#define ACP_P1_HS_RX_INTR_WATERMARK_SIZE 0x0003AB0 +#define ACP_P1_HS_TX_RINGBUFADDR 0x0003AB4 +#define ACP_P1_HS_TX_RINGBUFSIZE 0x0003AB8 +#define ACP_P1_HS_TX_LINKPOSITIONCNTR 0x0003ABC +#define ACP_P1_HS_TX_FIFOADDR 0x0003AC0 +#define ACP_P1_HS_TX_FIFOSIZE 0x0003AC4 +#define ACP_P1_HS_TX_DMA_SIZE 0x0003AC8 +#define ACP_P1_HS_TX_LINEARPOSITIONCNTR_HIGH 0x0003ACC +#define ACP_P1_HS_TX_LINEARPOSITIONCNTR_LOW 0x0003AD0 +#define ACP_P1_HS_TX_INTR_WATERMARK_SIZE 0x0003AD4 + +/* Registers from ACP_SCRATCH block */ +#define ACP_SCRATCH_REG_0 0x0010000 +#define ACP_SCRATCH_REG_1 0x0010004 +#define ACP_SCRATCH_REG_2 0x0010008 +#define ACP_SCRATCH_REG_3 0x001000C +#define ACP_SCRATCH_REG_4 0x0010010 +#define ACP_SCRATCH_REG_5 0x0010014 +#define ACP_SCRATCH_REG_6 0x0010018 +#define ACP_SCRATCH_REG_7 0x001001C +#define ACP_SCRATCH_REG_8 0x0010020 +#define ACP_SCRATCH_REG_9 0x0010024 +#define ACP_SCRATCH_REG_10 0x0010028 +#define ACP_SCRATCH_REG_11 0x001002C +#define ACP_SCRATCH_REG_12 0x0010030 +#define ACP_SCRATCH_REG_13 0x0010034 +#define ACP_SCRATCH_REG_14 0x0010038 +#define ACP_SCRATCH_REG_15 0x001003C +#define ACP_SCRATCH_REG_16 0x0010040 +#define ACP_SCRATCH_REG_17 0x0010044 +#define ACP_SCRATCH_REG_18 0x0010048 +#define ACP_SCRATCH_REG_19 0x001004C +#define ACP_SCRATCH_REG_20 0x0010050 +#define ACP_SCRATCH_REG_21 0x0010054 +#define ACP_SCRATCH_REG_22 0x0010058 +#define ACP_SCRATCH_REG_23 0x001005C +#define ACP_SCRATCH_REG_24 0x0010060 +#define ACP_SCRATCH_REG_25 0x0010064 +#define ACP_SCRATCH_REG_26 0x0010068 +#define ACP_SCRATCH_REG_27 0x001006C +#define ACP_SCRATCH_REG_28 0x0010070 +#define ACP_SCRATCH_REG_29 0x0010074 +#define ACP_SCRATCH_REG_30 0x0010078 +#define ACP_SCRATCH_REG_31 0x001007C +#define ACP_SCRATCH_REG_32 0x0010080 +#define ACP_SCRATCH_REG_33 0x0010084 +#define ACP_SCRATCH_REG_34 0x0010088 +#define ACP_SCRATCH_REG_35 0x001008C +#define ACP_SCRATCH_REG_36 0x0010090 +#define ACP_SCRATCH_REG_37 0x0010094 +#define ACP_SCRATCH_REG_38 0x0010098 +#define ACP_SCRATCH_REG_39 0x001009C +#define ACP_SCRATCH_REG_40 0x00100A0 +#define ACP_SCRATCH_REG_41 0x00100A4 +#define ACP_SCRATCH_REG_42 0x00100A8 +#define ACP_SCRATCH_REG_43 0x00100AC +#define ACP_SCRATCH_REG_44 0x00100B0 +#define ACP_SCRATCH_REG_45 0x00100B4 +#define ACP_SCRATCH_REG_46 0x00100B8 +#define ACP_SCRATCH_REG_47 0x00100BC +#define ACP_SCRATCH_REG_48 0x00100C0 +#define ACP_SCRATCH_REG_49 0x00100C4 +#define ACP_SCRATCH_REG_50 0x00100C8 +#define ACP_SCRATCH_REG_51 0x00100CC +#define ACP_SCRATCH_REG_52 0x00100D0 +#define ACP_SCRATCH_REG_53 0x00100D4 +#define ACP_SCRATCH_REG_54 0x00100D8 +#define ACP_SCRATCH_REG_55 0x00100DC +#define ACP_SCRATCH_REG_56 0x00100E0 +#define ACP_SCRATCH_REG_57 0x00100E4 +#define ACP_SCRATCH_REG_58 0x00100E8 +#define ACP_SCRATCH_REG_59 0x00100EC +#define ACP_SCRATCH_REG_60 0x00100F0 +#define ACP_SCRATCH_REG_61 0x00100F4 +#define ACP_SCRATCH_REG_62 0x00100F8 +#define ACP_SCRATCH_REG_63 0x00100FC +#define ACP_SCRATCH_REG_64 0x0010100 +#define ACP_SCRATCH_REG_65 0x0010104 +#define ACP_SCRATCH_REG_66 0x0010108 +#define ACP_SCRATCH_REG_67 0x001010C +#define ACP_SCRATCH_REG_68 0x0010110 +#define ACP_SCRATCH_REG_69 0x0010114 +#define ACP_SCRATCH_REG_70 0x0010118 +#define ACP_SCRATCH_REG_71 0x001011C +#define ACP_SCRATCH_REG_72 0x0010120 +#define ACP_SCRATCH_REG_73 0x0010124 +#define ACP_SCRATCH_REG_74 0x0010128 +#define ACP_SCRATCH_REG_75 0x001012C +#define ACP_SCRATCH_REG_76 0x0010130 +#define ACP_SCRATCH_REG_77 0x0010134 +#define ACP_SCRATCH_REG_78 0x0010138 +#define ACP_SCRATCH_REG_79 0x001013C +#define ACP_SCRATCH_REG_80 0x0010140 +#define ACP_SCRATCH_REG_81 0x0010144 +#define ACP_SCRATCH_REG_82 0x0010148 +#define ACP_SCRATCH_REG_83 0x001014C +#define ACP_SCRATCH_REG_84 0x0010150 +#define ACP_SCRATCH_REG_85 0x0010154 +#define ACP_SCRATCH_REG_86 0x0010158 +#define ACP_SCRATCH_REG_87 0x001015C +#define ACP_SCRATCH_REG_88 0x0010160 +#define ACP_SCRATCH_REG_89 0x0010164 +#define ACP_SCRATCH_REG_90 0x0010168 +#define ACP_SCRATCH_REG_91 0x001016C +#define ACP_SCRATCH_REG_92 0x0010170 +#define ACP_SCRATCH_REG_93 0x0010174 +#define ACP_SCRATCH_REG_94 0x0010178 +#define ACP_SCRATCH_REG_95 0x001017C +#define ACP_SCRATCH_REG_96 0x0010180 +#define ACP_SCRATCH_REG_97 0x0010184 +#define ACP_SCRATCH_REG_98 0x0010188 +#define ACP_SCRATCH_REG_99 0x001018C +#define ACP_SCRATCH_REG_100 0x0010190 +#define ACP_SCRATCH_REG_101 0x0010194 +#define ACP_SCRATCH_REG_102 0x0010198 +#define ACP_SCRATCH_REG_103 0x001019C +#define ACP_SCRATCH_REG_104 0x00101A0 +#define ACP_SCRATCH_REG_105 0x00101A4 +#define ACP_SCRATCH_REG_106 0x00101A8 +#define ACP_SCRATCH_REG_107 0x00101AC +#define ACP_SCRATCH_REG_108 0x00101B0 +#define ACP_SCRATCH_REG_109 0x00101B4 +#define ACP_SCRATCH_REG_110 0x00101B8 +#define ACP_SCRATCH_REG_111 0x00101BC +#define ACP_SCRATCH_REG_112 0x00101C0 +#define ACP_SCRATCH_REG_113 0x00101C4 +#define ACP_SCRATCH_REG_114 0x00101C8 +#define ACP_SCRATCH_REG_115 0x00101CC +#define ACP_SCRATCH_REG_116 0x00101D0 +#define ACP_SCRATCH_REG_117 0x00101D4 +#define ACP_SCRATCH_REG_118 0x00101D8 +#define ACP_SCRATCH_REG_119 0x00101DC +#define ACP_SCRATCH_REG_120 0x00101E0 +#define ACP_SCRATCH_REG_121 0x00101E4 +#define ACP_SCRATCH_REG_122 0x00101E8 +#define ACP_SCRATCH_REG_123 0x00101EC +#define ACP_SCRATCH_REG_124 0x00101F0 +#define ACP_SCRATCH_REG_125 0x00101F4 +#define ACP_SCRATCH_REG_126 0x00101F8 +#define ACP_SCRATCH_REG_127 0x00101FC +#define ACP_SCRATCH_REG_128 0x0010200 +#endif From patchwork Sat Aug 27 16:56:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 12957056 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D63FBC0502C for ; Sat, 27 Aug 2022 17:01:07 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 24C10161E; Sat, 27 Aug 2022 19:00:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 24C10161E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1661619666; bh=2RXDr0ZunB5nCKBEUDYtu79SXo+rBLl3X1ypa7NfPaI=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=oESkt7CatK1Elerm9a6HAbTzcP/hKXgxrxnKLdotD6pEpygj2BO7MnSBgRBmO+rdi Ued4/MgOqxh6bt3qeA7t+ks4cAhJ/yNBcZ+gJgqyJ8vpCu8X9LAHDugzSS4F29wvs9 HIPd6TE82aHdi3sOq1Ks4qvRybIMKcAuH+gqoEkI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 74162F8052D; Sat, 27 Aug 2022 18:59:45 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D3073F8052F; Sat, 27 Aug 2022 18:59:43 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2076.outbound.protection.outlook.com [40.107.244.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 77C3BF80526 for ; Sat, 27 Aug 2022 18:59:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 77C3BF80526 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="YWjUOCt5" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=khFco4a3TdLTy8m/6bcNfsOlqu3M9iIPp8Z0oB0VFqGJmg7zRwKPHGZoAMCx2adfHEIRbCc7QdCmULyDsUxX0eD9lH3KsSECElwUoJluOR/vPGOfpIsdk3/r487EH1KINFoeiFlH9vcm6am2uRBifg52FalGmyb9rsrR8nLY21MlNoFm7X1uRsTELQ+/6VB3jhwIJJMh+8sntS8PR5wjmvqVJ1Dl3iobaNYtuq5qMm32XQr0PGSrbs+hVMJsV5V58kCT1Ya4IK3fIqL75a1WlDdD+r0PwmcdlS6H+5c0c5hbdqw4IcGNQvoZoVu2b2M4fBrcfeTWYsCQ0UI1ZIRMMw== 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=vIQsHVe3Bj4pPChcGCypFb8fZQB6b26eNL/2K5BLdjE=; b=HfrBhClEgpYdcI84neyHuJvmOc9GnhLh70inb2LojC6MZXSvIF6m5XAvKuYFi+JY7zQWReUXbd6IR8BylKbQKUjx/8ejwLxP5GBIKRRnUTBLf6SXuMAs+7+yo5CNJewpBk9OnvaK48KjkMhUwc5PDhMLoKmnNey48dXt1Y+DK9ozOL/DkM5mzjIWOmf6mQvjnG7gYq/YtRe5CBvuvPHskOPNyQnEDrqkZImx7/ohpmqVJkxncCK7/GnvRpJGQYoLHDM0mKLEX+sIeJjC+p7AZDy+i9aSbv11S4crW9creI/ROHDQ2Y2GDtzEm1tJYVNpMWUVtK4ZV/DsfxQlPwok2g== 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=vIQsHVe3Bj4pPChcGCypFb8fZQB6b26eNL/2K5BLdjE=; b=YWjUOCt51cjbgx5+5I802+TsBN0U8///6V1glkqsDKakX+9PaoaDhXD3wYXbFnNB56PbMHhueK+pzF9EjDFy3D35GeWk/4oen9zd5I0N+8ZPf6TOFtsqBe8WCZtRA2F0yOJmwa2xPlXkmieVsO0JEoa4gFGTtMSjq8vDZOYCTk0= Received: from DM5PR08CA0055.namprd08.prod.outlook.com (2603:10b6:4:60::44) by CH0PR12MB5140.namprd12.prod.outlook.com (2603:10b6:610:bf::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15; Sat, 27 Aug 2022 16:59:31 +0000 Received: from DM6NAM11FT065.eop-nam11.prod.protection.outlook.com (2603:10b6:4:60:cafe::9f) by DM5PR08CA0055.outlook.office365.com (2603:10b6:4:60::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15 via Frontend Transport; Sat, 27 Aug 2022 16:59: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=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by DM6NAM11FT065.mail.protection.outlook.com (10.13.172.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5566.15 via Frontend Transport; Sat, 27 Aug 2022 16:59:30 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sat, 27 Aug 2022 11:59:30 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sat, 27 Aug 2022 11:59:30 -0500 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.28 via Frontend Transport; Sat, 27 Aug 2022 11:59:26 -0500 From: Syed Saba Kareem To: , Subject: [PATCH v2 02/13] ASoC: amd: add Pink Sardine ACP PCI driver Date: Sat, 27 Aug 2022 22:26:46 +0530 Message-ID: <20220827165657.2343818-3-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220827165657.2343818-1-Syed.SabaKareem@amd.com> References: <20220827165657.2343818-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 58409804-eda3-4af8-52b1-08da884d827b X-MS-TrafficTypeDiagnostic: CH0PR12MB5140:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ee4hU6DXvDQii0xBKQ2au8gYS3sMecK0jQrQ9jNPBiLSB7AEvk59aOASKomMNmHOzuJ+HM38cFRuNYYB6BPJYo/XgzupyjdhNfvs6z2Oq6Ez6RQHCd73YKG9Z1kpX1JlTdePx5PFV+9SavEn5I3F2WB9GqoN/E1xAjmCEUhLWg2RC6jiKnvIsxGIT/LSTVJNGKLrlTbK3w3oFCJMBG8ekcdbbA4m5rQeWUYkgiUy0Qp1bI/9yMrvEKYIEMz3XbhRqeIWC6AoJHzjcy4ZVxwHYrXU5ymk3wykAopGkWpxA7g8QaBpa5D5aKhzvU2OBWlpwRTVN9KHyasj9Ysh/CvOPF/kxzSglTAS0regnjtvI6CZVA76VxaU/wcYeXM/b6Oe3GTvD4C84n8TZbpXNX84qbeadCc6uhO8gh5ZVv+v+mn7o8mkA8qWa5G+jq8m/Jpg4SWyN+V6YnLodtxDlZF+LBXaBqDRUkWVJ30JPVVMEbgg1V2pC5NbcTWW4UTRkjKeBdlxszQeBwpof50ogQ1xyTrI39Ldf59BGHk9+zwoRui03C4iuNdJfn0xBEsl07+YcsQdPeEosryPvLT25jtJq+NcV0VoEZBBlew+0UDrVG5g0XMOVeZ1m6cGgiWsII/oOVoqi+2Dsz0BxLgZGp1lUMTfR54KzTFt/eCr2reOaGFVGJlhpyA310Aroxl84QcRfCvMGRu90NWPquv4igVzRrvYTNjCZ3Q7cIpoKBye9lhnC7DTRSpQHhZ284SkikLZV+oKDRSFALZ9EH448xkap9vBzS5ibLctpYdv6jtwCQo= 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:(13230016)(4636009)(136003)(376002)(346002)(39860400002)(396003)(36840700001)(46966006)(40470700004)(7696005)(356005)(26005)(82310400005)(426003)(47076005)(2906002)(81166007)(83380400001)(54906003)(110136005)(82740400003)(36756003)(316002)(8676002)(4326008)(70586007)(70206006)(5660300002)(41300700001)(6666004)(8936002)(36860700001)(2616005)(186003)(1076003)(336012)(86362001)(478600001)(40460700003)(40480700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2022 16:59:30.8232 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 58409804-eda3-4af8-52b1-08da884d827b 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: DM6NAM11FT065.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5140 Cc: Sunil-kumar.Dommati@amd.com, open list , Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Liam Girdwood , mario.limonciello@amd.com, Vijendar.Mukunda@amd.com, alexander.deucher@amd.com, Syed Saba Kareem X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" ACP is a PCI audio device. This patch adds PCI driver to bind to this device and get PCI resources for Pink Sardine Platform. Signed-off-by: Syed Saba Kareem Signed-off-by: Vijendar Mukunda --- sound/soc/amd/ps/acp62.h | 20 +++++++++ sound/soc/amd/ps/pci-ps.c | 94 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+) create mode 100644 sound/soc/amd/ps/acp62.h create mode 100644 sound/soc/amd/ps/pci-ps.c diff --git a/sound/soc/amd/ps/acp62.h b/sound/soc/amd/ps/acp62.h new file mode 100644 index 000000000000..5291585f45f9 --- /dev/null +++ b/sound/soc/amd/ps/acp62.h @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * AMD ALSA SoC PDM Driver + * + * Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved. + */ + +#include + +#define ACP_DEVICE_ID 0x15E2 + +static inline u32 acp62_readl(void __iomem *base_addr) +{ + return readl(base_addr); +} + +static inline void acp62_writel(u32 val, void __iomem *base_addr) +{ + writel(val, base_addr); +} diff --git a/sound/soc/amd/ps/pci-ps.c b/sound/soc/amd/ps/pci-ps.c new file mode 100644 index 000000000000..8bb33845622a --- /dev/null +++ b/sound/soc/amd/ps/pci-ps.c @@ -0,0 +1,94 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * AMD Pink Sardine ACP PCI Driver + * + * Copyright 2022 Advanced Micro Devices, Inc. + */ + +#include +#include +#include + +#include "acp62.h" + +struct acp62_dev_data { + void __iomem *acp62_base; +}; + +static int snd_acp62_probe(struct pci_dev *pci, + const struct pci_device_id *pci_id) +{ + struct acp62_dev_data *adata; + u32 addr; + int ret; + + /* Pink Sardine device check */ + switch (pci->revision) { + case 0x63: + break; + default: + dev_dbg(&pci->dev, "acp62 pci device not found\n"); + return -ENODEV; + } + if (pci_enable_device(pci)) { + dev_err(&pci->dev, "pci_enable_device failed\n"); + return -ENODEV; + } + + ret = pci_request_regions(pci, "AMD ACP6.2 audio"); + if (ret < 0) { + dev_err(&pci->dev, "pci_request_regions failed\n"); + goto disable_pci; + } + adata = devm_kzalloc(&pci->dev, sizeof(struct acp62_dev_data), + GFP_KERNEL); + if (!adata) { + ret = -ENOMEM; + goto release_regions; + } + + addr = pci_resource_start(pci, 0); + adata->acp62_base = devm_ioremap(&pci->dev, addr, + pci_resource_len(pci, 0)); + if (!adata->acp62_base) { + ret = -ENOMEM; + goto release_regions; + } + pci_set_master(pci); + pci_set_drvdata(pci, adata); + return 0; +release_regions: + pci_release_regions(pci); +disable_pci: + pci_disable_device(pci); + + return ret; +} + +static void snd_acp62_remove(struct pci_dev *pci) +{ + pci_release_regions(pci); + pci_disable_device(pci); +} + +static const struct pci_device_id snd_acp62_ids[] = { + { PCI_DEVICE(PCI_VENDOR_ID_AMD, ACP_DEVICE_ID), + .class = PCI_CLASS_MULTIMEDIA_OTHER << 8, + .class_mask = 0xffffff }, + { 0, }, +}; +MODULE_DEVICE_TABLE(pci, snd_acp62_ids); + +static struct pci_driver ps_acp62_driver = { + .name = KBUILD_MODNAME, + .id_table = snd_acp62_ids, + .probe = snd_acp62_probe, + .remove = snd_acp62_remove, +}; + +module_pci_driver(ps_acp62_driver); + +MODULE_AUTHOR("Vijendar.Mukunda@amd.com"); +MODULE_AUTHOR("Syed.SabaKareem@amd.com"); +MODULE_DESCRIPTION("AMD ACP Pink Sardine PCI driver"); +MODULE_LICENSE("GPL v2"); From patchwork Sat Aug 27 16:56:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 12957057 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C8EB2C0502C for ; Sat, 27 Aug 2022 17:01:14 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 1C6771632; Sat, 27 Aug 2022 19:00:23 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1C6771632 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1661619673; bh=DnbB1BtF32KEkCsPtZMJSnmH637JvQyW2mtR3Y8++/k=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=sPmRxB+jPCeR26Hbn8/6lJA05eOZQTb0qOfCLATOBfMGn/+YMSEDHz6KJPB8M3m8Z eVP2+4AU8PXZHhnMnfjhzipGJojt8Hwk5+pntxmUtY1heSeza+SIaCnwRBG3bkuuRa l8b7m9Cakvmch56bNkBh3WkOe4o2bJD7EaO7Yz7g= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 5ABB2F80526; Sat, 27 Aug 2022 18:59:52 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id CBCD2F80537; Sat, 27 Aug 2022 18:59:50 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2069.outbound.protection.outlook.com [40.107.243.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A737FF80526 for ; Sat, 27 Aug 2022 18:59:43 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A737FF80526 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="fstcHhKK" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OyxVxeBuIYjq4IS91Gn77dyGoxNTOiq+/NH8XZQw/iCSLriGFNLLqKeMtKbMm49etWQA4nz0xPBYa2gD1B4XIJGQEphgtX+P9OZ5FW7DaiqL2c0fB9GTN0Y5Yi1Hd+hM1Q7TokUVY+3bpISYMVAiIm4Zm0UVe2ltOU1QYrj7Y4F581rpT6LyuCqtdXW+Kz7CEX5DxelR1bo5/4rwscSgV1jLFQH49fFGiuoCTfzcl/wJa1lnMpl3BpcZ1UCzypvho1sK8SSVrT63kyOMWuPRpppCpizrgK5wdPj5LUWg0RDkDgJlamG3m77M/y51Oqa56ToVxb72DTgTcxwS7W4wTA== 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=latV6WYjA2o+ZGnYqiQTzTTy9CSBYFpwdpKF+gZpscc=; b=HR3lh/kggp/47PTPzjHc7dA3FU04TANmjWBaIWxTQmwT4X9pVuWaiz+kmtxXUHG7ZgJIAhR9GVWvYn5OXIb+AJ+EnxLrk1CsQEA+lcVYiSvqyt/6tv+pRelPOI8rkZO88vtwDKLEt6A2pCAmJQ0vfGqzpQiyInVCdtpADr/UeHxQq8dLTGMPwJVLAHEznPcFJRHZo8r1KivTgg69VTj6ckHJSFuVrZUDsc+MQYfgYVmqAREZccqSPdA+6D43hMZbcgHepFicD8GKlKRqtlqKQX1kD7V5Cy64pbJD/w4KiPfsMJ+eB0ZjyxULk18NIrhBJ+luZltpTfYzaM2pfdFvtQ== 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=latV6WYjA2o+ZGnYqiQTzTTy9CSBYFpwdpKF+gZpscc=; b=fstcHhKKeoibueX2sNofzocxLyOPyNmZ+U+pJU8haVDFk7u4b6MjwyA9YyXu6tWr3qW0cxB2RK+J/SvwPQ7Je0uCKzDGQY9p+y3/2fR1PFpUmo+TsHh6w8IcZaF/405kTuCz7TSSgfsrx/igaviUc+lGvNAjRn8zUAOgf5QxDhE= Received: from DM5PR08CA0047.namprd08.prod.outlook.com (2603:10b6:4:60::36) by CY5PR12MB6382.namprd12.prod.outlook.com (2603:10b6:930:3e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.16; Sat, 27 Aug 2022 16:59:39 +0000 Received: from DM6NAM11FT060.eop-nam11.prod.protection.outlook.com (2603:10b6:4:60:cafe::4f) by DM5PR08CA0047.outlook.office365.com (2603:10b6:4:60::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15 via Frontend Transport; Sat, 27 Aug 2022 16:59: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=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by DM6NAM11FT060.mail.protection.outlook.com (10.13.173.63) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5566.15 via Frontend Transport; Sat, 27 Aug 2022 16:59:39 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sat, 27 Aug 2022 11:59:39 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sat, 27 Aug 2022 11:59:38 -0500 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.28 via Frontend Transport; Sat, 27 Aug 2022 11:59:34 -0500 From: Syed Saba Kareem To: , Subject: [PATCH v2 03/13] ASoC: amd: add acp6.2 init/de-init functions Date: Sat, 27 Aug 2022 22:26:47 +0530 Message-ID: <20220827165657.2343818-4-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220827165657.2343818-1-Syed.SabaKareem@amd.com> References: <20220827165657.2343818-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 419235a8-0f1f-4880-4cf1-08da884d87c2 X-MS-TrafficTypeDiagnostic: CY5PR12MB6382:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ViOa2R6UN/ykxd3UmlJ9Cr+NVSkGTlt+eGQiTVq/GrVfPXdV7xvY5M1tVkhzqoxe75zs6VnYH3vlCfPql5UP1CUVfyakFGqxDYs08DL6wOnVZm0oosRfuQrkx5A+ARa1gwAekkUlMIinEzD0iyzsE9w2a12ihqVo5yVsR8o+AHCfzXsNelRO+s0PrbkwD+UWP2k18QyS5Zjp22POpp7RmVqSbyvSPV07R/HLsVjgYBFhh/uj+EezeCS0yFjpZffRZUNzOkiMLklBRpil6Bc1C7Tc+z6sPM81z1IWjnJlQmH1SZ44y6uf9av1Tay5bAt5HuKhhOe28OjSuaJ+zwdhDG6Iq8nX8vkALDzjRg3bHQ692zA22ConWzHCjyYlsY3cxdWwW7zaSiSEmNRScOVX/tYRdohv3TaRMVC3vTMefjX27QgK7Mm3eRw0ZRfIk8Gd4DKtkiLMkPYLYm8FTs5hwbMqWl6dnRbneDl+CgWof79/+Muhvkeckj8lyY4/sIdJr8KpvRerVSnqWO1ai9KtXr+vt2pnEFvenyYPg7YCCnnMm9WTIpZKvzLPfGYFThHWTRZ2+tUe5r6dkNCGYZxwMZo6TOA4haOfhQjztqkh8qI6R8Y/fUeeQFTzWUcAnAHlZRjqOufMnAPo79aVwm6Du7LzhQBSA5DIxt73Uf0ayXnR4gXXVQZjBieinsGsurTKX0dUsvc+WaX3/I1yJd5C2RAETGc0wYhcSycESxDOXuKB3/X9/rygJ39OcLa4AEPapzrNvGqWG3zIIxfrrHvxTeWPU3j5tmPl2a22ZLsydyhN80J1JTg9f4HkH0vsxN/I 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:(13230016)(4636009)(39860400002)(136003)(346002)(396003)(376002)(40470700004)(46966006)(36840700001)(8936002)(7696005)(26005)(6666004)(40460700003)(40480700001)(478600001)(41300700001)(426003)(82310400005)(2616005)(47076005)(186003)(336012)(5660300002)(1076003)(4326008)(8676002)(2906002)(36756003)(110136005)(70206006)(70586007)(316002)(82740400003)(36860700001)(356005)(81166007)(86362001)(54906003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2022 16:59:39.6769 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 419235a8-0f1f-4880-4cf1-08da884d87c2 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: DM6NAM11FT060.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6382 Cc: Sunil-kumar.Dommati@amd.com, open list , Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Liam Girdwood , mario.limonciello@amd.com, Vijendar.Mukunda@amd.com, alexander.deucher@amd.com, Syed Saba Kareem X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Add Pink Sardine platform ACP6.2 PCI driver init/deinit functions. Signed-off-by: Syed Saba Kareem Signed-off-by: Vijendar Mukunda --- sound/soc/amd/ps/acp62.h | 12 +++++ sound/soc/amd/ps/pci-ps.c | 106 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 118 insertions(+) diff --git a/sound/soc/amd/ps/acp62.h b/sound/soc/amd/ps/acp62.h index 5291585f45f9..1f5e7d758f9f 100644 --- a/sound/soc/amd/ps/acp62.h +++ b/sound/soc/amd/ps/acp62.h @@ -9,6 +9,18 @@ #define ACP_DEVICE_ID 0x15E2 +#define ACP_SOFT_RESET_SOFTRESET_AUDDONE_MASK 0x00010001 +#define ACP_PGFSM_CNTL_POWER_ON_MASK 1 +#define ACP_PGFSM_CNTL_POWER_OFF_MASK 0 +#define ACP_PGFSM_STATUS_MASK 3 +#define ACP_POWERED_ON 0 +#define ACP_POWER_ON_IN_PROGRESS 1 +#define ACP_POWERED_OFF 2 +#define ACP_POWER_OFF_IN_PROGRESS 3 + +#define ACP_ERROR_MASK 0x20000000 +#define ACP_EXT_INTR_STAT_CLEAR_MASK 0xFFFFFFFF + static inline u32 acp62_readl(void __iomem *base_addr) { return readl(base_addr); diff --git a/sound/soc/amd/ps/pci-ps.c b/sound/soc/amd/ps/pci-ps.c index 8bb33845622a..a87dbf8847e6 100644 --- a/sound/soc/amd/ps/pci-ps.c +++ b/sound/soc/amd/ps/pci-ps.c @@ -8,6 +8,7 @@ #include #include #include +#include #include "acp62.h" @@ -15,6 +16,100 @@ struct acp62_dev_data { void __iomem *acp62_base; }; +static int acp62_power_on(void __iomem *acp_base) +{ + u32 val; + int timeout; + + val = acp62_readl(acp_base + ACP_PGFSM_STATUS); + + if (!val) + return val; + + if ((val & ACP_PGFSM_STATUS_MASK) != ACP_POWER_ON_IN_PROGRESS) + acp62_writel(ACP_PGFSM_CNTL_POWER_ON_MASK, acp_base + ACP_PGFSM_CONTROL); + timeout = 0; + while (++timeout < 500) { + val = acp62_readl(acp_base + ACP_PGFSM_STATUS); + if (!val) + return 0; + udelay(1); + } + return -ETIMEDOUT; +} + +static int acp62_reset(void __iomem *acp_base) +{ + u32 val; + int timeout; + + acp62_writel(1, acp_base + ACP_SOFT_RESET); + timeout = 0; + while (++timeout < 500) { + val = acp62_readl(acp_base + ACP_SOFT_RESET); + if (val & ACP_SOFT_RESET_SOFTRESET_AUDDONE_MASK) + break; + cpu_relax(); + } + acp62_writel(0, acp_base + ACP_SOFT_RESET); + timeout = 0; + while (++timeout < 500) { + val = acp62_readl(acp_base + ACP_SOFT_RESET); + if (!val) + return 0; + cpu_relax(); + } + return -ETIMEDOUT; +} + +static void acp62_enable_interrupts(void __iomem *acp_base) +{ + acp62_writel(1, acp_base + ACP_EXTERNAL_INTR_ENB); +} + +static void acp62_disable_interrupts(void __iomem *acp_base) +{ + acp62_writel(ACP_EXT_INTR_STAT_CLEAR_MASK, acp_base + + ACP_EXTERNAL_INTR_STAT); + acp62_writel(0, acp_base + ACP_EXTERNAL_INTR_CNTL); + acp62_writel(0, acp_base + ACP_EXTERNAL_INTR_ENB); +} + +static int acp62_init(void __iomem *acp_base, struct device *dev) +{ + int ret; + + ret = acp62_power_on(acp_base); + if (ret) { + dev_err(dev, "ACP power on failed\n"); + return ret; + } + acp62_writel(0x01, acp_base + ACP_CONTROL); + ret = acp62_reset(acp_base); + if (ret) { + dev_err(dev, "ACP reset failed\n"); + return ret; + } + acp62_writel(0x03, acp_base + ACP_CLKMUX_SEL); + acp62_enable_interrupts(acp_base); + return 0; +} + +static int acp62_deinit(void __iomem *acp_base, struct device *dev) +{ + int ret; + + acp62_disable_interrupts(acp_base); + ret = acp62_reset(acp_base); + if (ret) { + dev_err(dev, "ACP reset failed\n"); + return ret; + } + acp62_writel(0, acp_base + ACP_CLKMUX_SEL); + acp62_writel(0, acp_base + ACP_CONTROL); + return 0; +} + static int snd_acp62_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) { @@ -56,6 +151,10 @@ static int snd_acp62_probe(struct pci_dev *pci, } pci_set_master(pci); pci_set_drvdata(pci, adata); + ret = acp62_init(adata->acp62_base, &pci->dev); + if (ret) + goto release_regions; + return 0; release_regions: pci_release_regions(pci); @@ -67,6 +166,13 @@ static int snd_acp62_probe(struct pci_dev *pci, static void snd_acp62_remove(struct pci_dev *pci) { + struct acp62_dev_data *adata; + int ret; + + adata = pci_get_drvdata(pci); + ret = acp62_deinit(adata->acp62_base, &pci->dev); + if (ret) + dev_err(&pci->dev, "ACP de-init failed\n"); pci_release_regions(pci); pci_disable_device(pci); } From patchwork Sat Aug 27 16:56:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 12957058 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 681A7ECAAD1 for ; Sat, 27 Aug 2022 17:01:35 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id B53D282C; Sat, 27 Aug 2022 19:00:43 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B53D282C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1661619693; bh=PQ1noVpbjOyn9ljacpFYcbW+VYUE6O74rOoA0IeTpd8=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=hE61QgHBlYa+nJyCvLtULJuBYuvJIO2k+yuwSglTvElNC8BWZ2cowvx3NdlKaGfrn V4tyz3t6M1f6tpKjvctcSJCj1Vfd5PLzgigxQE3XMg1kAU2iikhGftG6r4GJyg9uAc hU4eUo/zMShlD1C2sYfV3pFdBX5lA0K0/JiuDqnI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D3802F8053B; Sat, 27 Aug 2022 19:00:00 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 59CF8F8053D; Sat, 27 Aug 2022 19:00:00 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2069.outbound.protection.outlook.com [40.107.244.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 3DE68F80536 for ; Sat, 27 Aug 2022 18:59:53 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3DE68F80536 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="UCvIjLR3" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CMNzcndOxoRvkgdHfOpNzQ6/5DeOpkqscwh7SnThhHZOUlqpDtPqzEPYwKMDDmuSbigNiSXKXbOSHZ62NsxUsARamdCV7lzthB22U5T7orPghg1AY1oZME28SqhmSWgd2R5SDZXqNk3vFyF61ojhKiJjQM78Sksk7ytlfr9/UgdoQDqfbZODQB4rw9CT+fPjxHS6St78lod9Qklt+n4jl6w8IFZYNb3Cgf1UHKTbzghOjwct+bMYIDiuk0VMeTtEgSr6M/FiLq503qZduaHwkaQH78OBxHOrUB9ZECdjHOPgvJTKF40FeDvNEtzZze98s1jbeJTwoRiRSyYEU56Dtw== 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=k1ZtCbAh6UmUBvQ8RjLjIlxg4WFKsFP5AKwFQeg847U=; b=Flgext3U89JqZnmb5+bqJK4eKA42soJwUizH+UTNokhp9ZxUmpBi1MgkvXSSyoR9SzI7xkk53mD28wVlsL7f1OyxgLy/qEMR1U8ZAq10oQxlkedwDp4ypAKzqQXSxj4AzWJArARMNhjxJahgcafDgKlgImpi94S+lMgzwAmt0F765CfW37BiMhS4pQKL/uVyXiiLwyagTR3v+DVc0/D5s20z0m/rNKT+tQpiWCtx1RfqWsbsyWWmap87g6vF/66mppbGSW3E9OpDFkM8TYUcSoeTe/Dh2HrVPCeFWXMGC8FPZJb+fWK+lO0yKKPA2wYPt5vfODKIDjmaaLbORUJVIQ== 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=k1ZtCbAh6UmUBvQ8RjLjIlxg4WFKsFP5AKwFQeg847U=; b=UCvIjLR3pqjB2rY/gH60hTV8t+/xBRrqiGS+7b9UWlRF9jkeudCneEHijfnitDVpZ/yK5/NUccwpWPkmWszh3UiQjJvQHZbdmU4+KX/MWxzs9Y7ydt/RPl9e3rt9gl/3FaIbA7B+VSBufwzx6CoHtzcpgnyqgBF/tnkffgDiwLQ= Received: from BN9PR03CA0904.namprd03.prod.outlook.com (2603:10b6:408:107::9) by MN2PR12MB4408.namprd12.prod.outlook.com (2603:10b6:208:26c::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15; Sat, 27 Aug 2022 16:59:49 +0000 Received: from BN8NAM11FT099.eop-nam11.prod.protection.outlook.com (2603:10b6:408:107:cafe::22) by BN9PR03CA0904.outlook.office365.com (2603:10b6:408:107::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15 via Frontend Transport; Sat, 27 Aug 2022 16:59:49 +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 BN8NAM11FT099.mail.protection.outlook.com (10.13.177.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5566.15 via Frontend Transport; Sat, 27 Aug 2022 16:59:48 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sat, 27 Aug 2022 11:59:47 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sat, 27 Aug 2022 11:59:46 -0500 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.28 via Frontend Transport; Sat, 27 Aug 2022 11:59:43 -0500 From: Syed Saba Kareem To: , Subject: [PATCH v2 04/13] ASoC: amd: add platform devices for acp6.2 pdm driver and dmic driver Date: Sat, 27 Aug 2022 22:26:48 +0530 Message-ID: <20220827165657.2343818-5-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220827165657.2343818-1-Syed.SabaKareem@amd.com> References: <20220827165657.2343818-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6bfb7a4f-dc89-4efa-3a2d-08da884d8cda X-MS-TrafficTypeDiagnostic: MN2PR12MB4408:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qg+6o1F+nelXaXC5VrVx+QVchR9Kn6fSpUaYgBr9pSBMiNP0hwbioooup5LHNp+XmI+6CJ7HCsfVR8WjXltKlwNSMeAskHIk9R0RmHx0eMmZvwOWEnw+cyXvWIXcw6PX0P0/dn2xG+zcCNZ8d52NtCK/iFAYXRc16AX1o9C/gRN92AQ8/nkkUZO4iktQsruW3zJSMwvmU/wM3GYZPEan4Z0Fh/ybvLbMHAQuXG8r8gmpDDabtXajNYgdTGIOor7+1tzB07uuodsBUd+dGQhTU8Fz0K6rrV/8GRMK414Dn8GGM7+sVdxjjEErqAu+nybgeW8SpAKiI+7rGrmv/Qgj5fXVl+7ZpzWOZlis9EfOEWa0RIN5iJKbusWilY/5XAv0fTxQ2q6ddKjUs7Yw8sG0EmV9A0rU0rUXKlXVX8w+QPKfEdCucG1c1cpY9bTHZ47OuPWYwEI05w2r+pMr9UjEhGNqnN8xEUoMpfv/g8HrCGUQSYRirFYs/F5r3UDrbCt9xj3lMUBiuCGyzDzG9EcARPQ9JQXtn6pb5LJYDA3e1jTprPO1HLAdBrWfXQ0++T22+fzbchY2nQX5mooSPR5xdLm6YaPSSVJvIx3x8bxN3a1OTgfixSThkUwEYz2c3Vw3OtBuyJGPoNPmh9rP6N00gz8/uDhYaHO2brceUBiZMV4a5tyiOk0yazQ1Ql0VlAkjgju5WJIOjOnLhQfzjUy64Y4D30AJuSg3fq8ZpIngkIFkGGmIrR/qeIeQN/Ff13jwY/Uy6mAnz7Uwa80KMRneh5KL4D8ai/WbuUFWr2M2Q62uR9SJOU/xPgWUar1ytrPN 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:(13230016)(4636009)(136003)(396003)(346002)(39860400002)(376002)(46966006)(36840700001)(40470700004)(336012)(1076003)(426003)(47076005)(186003)(83380400001)(81166007)(356005)(86362001)(36860700001)(82740400003)(2616005)(40480700001)(8676002)(40460700003)(4326008)(70586007)(70206006)(36756003)(316002)(54906003)(82310400005)(110136005)(2906002)(5660300002)(8936002)(41300700001)(478600001)(7696005)(26005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2022 16:59:48.2692 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6bfb7a4f-dc89-4efa-3a2d-08da884d8cda 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: BN8NAM11FT099.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4408 Cc: Sunil-kumar.Dommati@amd.com, open list , Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Liam Girdwood , mario.limonciello@amd.com, Vijendar.Mukunda@amd.com, alexander.deucher@amd.com, Syed Saba Kareem X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" ACP6.2 IP has PDM decoder block. Create a platform device for it, so that the PDM platform driver can be bound to this device. Pass PCI resources like MMIO to this platform device. Create a platform device for generic dmic codec driver. Signed-off-by: Syed Saba Kareem Signed-off-by: Vijendar Mukunda --- sound/soc/amd/ps/acp62.h | 23 +++++++++++ sound/soc/amd/ps/pci-ps.c | 81 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 102 insertions(+), 2 deletions(-) diff --git a/sound/soc/amd/ps/acp62.h b/sound/soc/amd/ps/acp62.h index 1f5e7d758f9f..79ad1bdb5b38 100644 --- a/sound/soc/amd/ps/acp62.h +++ b/sound/soc/amd/ps/acp62.h @@ -8,6 +8,10 @@ #include #define ACP_DEVICE_ID 0x15E2 +#define ACP6x_REG_START 0x1240000 +#define ACP6x_REG_END 0x1250200 +#define ACP6x_DEVS 2 +#define ACP6x_PDM_MODE 1 #define ACP_SOFT_RESET_SOFTRESET_AUDDONE_MASK 0x00010001 #define ACP_PGFSM_CNTL_POWER_ON_MASK 1 @@ -21,6 +25,25 @@ #define ACP_ERROR_MASK 0x20000000 #define ACP_EXT_INTR_STAT_CLEAR_MASK 0xFFFFFFFF +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, +}; + static inline u32 acp62_readl(void __iomem *base_addr) { return readl(base_addr); diff --git a/sound/soc/amd/ps/pci-ps.c b/sound/soc/amd/ps/pci-ps.c index a87dbf8847e6..adad29667791 100644 --- a/sound/soc/amd/ps/pci-ps.c +++ b/sound/soc/amd/ps/pci-ps.c @@ -9,11 +9,16 @@ #include #include #include +#include +#include #include "acp62.h" struct acp62_dev_data { void __iomem *acp62_base; + struct resource *res; + bool acp62_audio_mode; + struct platform_device *pdev[ACP6x_DEVS]; }; static int acp62_power_on(void __iomem *acp_base) @@ -114,8 +119,12 @@ static int snd_acp62_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) { struct acp62_dev_data *adata; + struct platform_device_info pdevinfo[ACP6x_DEVS]; + int index, ret; + int val = 0x00; + struct acpi_device *adev; + const union acpi_object *obj; u32 addr; - int ret; /* Pink Sardine device check */ switch (pci->revision) { @@ -154,8 +163,72 @@ static int snd_acp62_probe(struct pci_dev *pci, ret = acp62_init(adata->acp62_base, &pci->dev); if (ret) goto release_regions; + val = acp62_readl(adata->acp62_base + ACP_PIN_CONFIG); + switch (val) { + case ACP_CONFIG_0: + case ACP_CONFIG_1: + case ACP_CONFIG_2: + case ACP_CONFIG_3: + case ACP_CONFIG_9: + case ACP_CONFIG_15: + dev_info(&pci->dev, "Audio Mode %d\n", val); + break; + default: + + /* Checking DMIC hardware*/ + adev = acpi_find_child_device(ACPI_COMPANION(&pci->dev), 0x02, 0); + + if (!adev) + break; + + if (!acpi_dev_get_property(adev, "acp-audio-device-type", + ACPI_TYPE_INTEGER, &obj) && + obj->integer.value == 2) { + adata->res = devm_kzalloc(&pci->dev, sizeof(struct resource), GFP_KERNEL); + if (!adata->res) { + ret = -ENOMEM; + goto de_init; + } + + adata->res->name = "acp_iomem"; + adata->res->flags = IORESOURCE_MEM; + adata->res->start = addr; + adata->res->end = addr + (ACP6x_REG_END - ACP6x_REG_START); + adata->acp62_audio_mode = ACP6x_PDM_MODE; + memset(&pdevinfo, 0, sizeof(pdevinfo)); + pdevinfo[0].name = "acp_ps_pdm_dma"; + pdevinfo[0].id = 0; + pdevinfo[0].parent = &pci->dev; + pdevinfo[0].num_res = 1; + pdevinfo[0].res = adata->res; + + pdevinfo[1].name = "dmic-codec"; + pdevinfo[1].id = 0; + pdevinfo[1].parent = &pci->dev; + + for (index = 0; index < ACP6x_DEVS; index++) { + adata->pdev[index] = + platform_device_register_full(&pdevinfo[index]); + + if (IS_ERR(adata->pdev[index])) { + dev_err(&pci->dev, + "cannot register %s device\n", + pdevinfo[index].name); + ret = PTR_ERR(adata->pdev[index]); + goto unregister_devs; + } + } + } + break; + } return 0; +unregister_devs: + for (--index; index >= 0; index--) + platform_device_unregister(adata->pdev[index]); +de_init: + if (acp62_deinit(adata->acp62_base, &pci->dev)) + dev_err(&pci->dev, "ACP de-init failed\n"); release_regions: pci_release_regions(pci); disable_pci: @@ -167,9 +240,13 @@ static int snd_acp62_probe(struct pci_dev *pci, static void snd_acp62_remove(struct pci_dev *pci) { struct acp62_dev_data *adata; - int ret; + int ret, index; adata = pci_get_drvdata(pci); + if (adata->acp62_audio_mode == ACP6x_PDM_MODE) { + for (index = 0; index < ACP6x_DEVS; index++) + platform_device_unregister(adata->pdev[index]); + } ret = acp62_deinit(adata->acp62_base, &pci->dev); if (ret) dev_err(&pci->dev, "ACP de-init failed\n"); From patchwork Sat Aug 27 16:56:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 12957059 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 64F84C0502C for ; Sat, 27 Aug 2022 17:01:58 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 9EA191616; Sat, 27 Aug 2022 19:01:06 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9EA191616 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1661619716; bh=I0U3VKfdhzlV9P44l6ZU9ONGa5u5O8n6gDNBW66OxMM=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=tqZrqvlOEBXE6zow+eiFACut156lZbi/bkydwlzQ9AqjOdwMkhoed1SEEGqUBoDND /oYmOf4BMgM/dOeEYpDzK3NGxdopAbWnOEJbCrcRbmIITm2ub3yYXfzvcInMG2OZ8c c54OfZTJuV5PsV0XCnddDcxocUb/FJdhvB2dLhWI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D6062F80553; Sat, 27 Aug 2022 19:00:11 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9F3D0F80557; Sat, 27 Aug 2022 19:00:10 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2044.outbound.protection.outlook.com [40.107.92.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 8ED3FF80552 for ; Sat, 27 Aug 2022 19:00:04 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8ED3FF80552 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="2VqeZxh/" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PO03wBOMjEg3ZgB9nhxgB/rD7blTJiCSRMu+HJEVPh7gkdg0r2boCDW3jEJSzUI+UHA7R4jOJT1oPh5cxqF1iWuykaciinRJB9l5fI8I6QAQsYzoOcAkGifwTlXbu+1G5VkzOW5oKcviYEACaGtS8z/okEdMgHtmzZgTg4FyMRWe0TDtv4Hd8r3GQbd2KAGbLMnPruU7XPPR76/zdExIsncHIeYV8BREf1poy8n1BKXkRqCX2/PPn007P6xoo4iUVoCthnJ/T2yZvGe/jZX7mrdxG5AUseWFu6BnbW0zw7MAlAtVJ6th+HqX3bkyi5jtARJc5rlQ+13FSOLOyA/D4g== 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=x8Om7QRCObmIZziTvemxwt8Fm8tPDnab1fOTzQtloTI=; b=d+1odwuc79TLROp4boqAN70vOY5IO2gy1wiUrnq900mTpmbHvXMo3tlCK6vZmpTv+S3vt8sGzINlKpVdSu12/6SGW7y13mhp/4nUQ3R5dECGuKHUr0SiNkOhZojymbWQKNyL9ouz+uAzVBDH7Ijtqu4XfT4wDO7hsC1RgBnrfcgeW/p7mDghTBBJLw920MP5/gn0iV5ppMIvTgzomLCVTY8aCiOLTWjCazzU4ms08Witd9lixPbZdSPVjF+gBZCIi4v3NNHG/DT89QbWAL3YLT0+uX87i/qwJ6mZGAmOPKfyOokn61r/iRyU03vceFb5Y81XL5aGxPhnR+bg4iiUlw== 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=bestguesspass 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=x8Om7QRCObmIZziTvemxwt8Fm8tPDnab1fOTzQtloTI=; b=2VqeZxh/nhlkADFJmmd8Fnyu+sdewr8PqbZwAyqI22TPwrBz6v91XPdi8y1YkM9NH3oSS8pRRVegBnnufZLJsVIpI6FbFZ1CMrVY77vx6vOuU2GoG2BdqzTPD+lriFFzyuro7prJTjg/7kPwSCiG5U3B0hXPifsBh4Ok+RA3v78= Received: from BN9PR03CA0034.namprd03.prod.outlook.com (2603:10b6:408:fb::9) by MW4PR12MB6898.namprd12.prod.outlook.com (2603:10b6:303:207::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15; Sat, 27 Aug 2022 16:59:58 +0000 Received: from BN8NAM11FT048.eop-nam11.prod.protection.outlook.com (2603:10b6:408:fb:cafe::e4) by BN9PR03CA0034.outlook.office365.com (2603:10b6:408:fb::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15 via Frontend Transport; Sat, 27 Aug 2022 16:59:57 +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=bestguesspass 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 BN8NAM11FT048.mail.protection.outlook.com (10.13.177.117) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5566.15 via Frontend Transport; Sat, 27 Aug 2022 16:59:57 +0000 Received: from SATLEXMB07.amd.com (10.181.41.45) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sat, 27 Aug 2022 11:59:56 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB07.amd.com (10.181.41.45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sat, 27 Aug 2022 09:59:56 -0700 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.28 via Frontend Transport; Sat, 27 Aug 2022 11:59:52 -0500 From: Syed Saba Kareem To: , Subject: [PATCH v2 05/13] ASoC: amd: add acp6.2 pdm platform driver Date: Sat, 27 Aug 2022 22:26:49 +0530 Message-ID: <20220827165657.2343818-6-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220827165657.2343818-1-Syed.SabaKareem@amd.com> References: <20220827165657.2343818-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8b392923-3195-4aa0-6ee2-08da884d9216 X-MS-TrafficTypeDiagnostic: MW4PR12MB6898:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4IHFANGgBRRZt3oMI+vpT7N8dRbnmLJxRlXdhdlh4kFPtYbZdgIY3WfkuQcUAunphQgepKJicpqgpxgmuIbuHXT96ANYOlvxdau7AXe0BPtv3oQ7SlnIlBZPZYIuJ0Hf5ey7A6K0UZfO8qwZn0GEHNkF3FngnxNFhnHIW64dHLWaXiM/MMeT0GYbmLc76cUhTvq+ZfyNr/S8vqBdoo/jyT8o83N2ywtOH3kgZ4kQ8A4ePTdofdGGL+1JfdTyfOsz52rUFO5CQG1ClUSdjXl4ICHPdUKWfeh7h2A2qeEDGgC90xfCldD9wKHSRg7m6QelD5Et3VH3YkjEWGPNHAlW4ymid9wYiboOhSROQjK3JIcCul0fU0/wEL2Lsolgzg9EcJaxR5jCPbrxru2yyUJNCtuAVi0Y3l+Hk2JuqKJgWtktxEmS67Bui5vPCfwParA/9THTMqlxekxonw5O+XM8TkIVv3LJYOxukQCpQ89nktlsy2ToLHIxDp8oafDFLekBsgzoILsnIAYy+DYnyCWcNnTBSA183I0H1KZd6Ta1k1ITya1byBumaoQRrb999hIT6S5ZcmTXleWaYdh5WIlmBWK8YMPsWOSdpoj2LCFmdPQxdjRdREEZ1hoxRV08Bh4eC8VoXlN6wxs+Re6fzjvQi57/kK23Nyc9t8pIpP3Nq4LJZymNZAr4YnM3mgeMhfCKqvZf18eHNsg15XRsdT/d5axhjmcJ8oKW/I2fjlrqhXa7U1zvs/Dn5dD/hdmMH37HlYwFlFyBSp2Z1JnUzMOcryGxqEon6Q2CScp6xV32qAA= 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:(13230016)(4636009)(346002)(39860400002)(376002)(136003)(396003)(36840700001)(40470700004)(46966006)(478600001)(41300700001)(186003)(2906002)(47076005)(336012)(426003)(2616005)(1076003)(8676002)(4326008)(82310400005)(6666004)(7696005)(26005)(40460700003)(40480700001)(86362001)(36756003)(81166007)(356005)(82740400003)(36860700001)(110136005)(5660300002)(54906003)(70206006)(70586007)(8936002)(316002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2022 16:59:57.0524 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8b392923-3195-4aa0-6ee2-08da884d9216 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: BN8NAM11FT048.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB6898 Cc: Sunil-kumar.Dommati@amd.com, open list , Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Liam Girdwood , mario.limonciello@amd.com, Vijendar.Mukunda@amd.com, alexander.deucher@amd.com, Syed Saba Kareem X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" PDM platform driver binds to the platform device created by ACP6.2 PCI device. PDM driver registers ALSA DMA and CPU DAI components with ASoC framework. Signed-off-by: Syed Saba Kareem Reviewed-by: Vijendar Mukunda --- sound/soc/amd/ps/acp62.h | 5 +++ sound/soc/amd/ps/ps-pdm-dma.c | 82 +++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 sound/soc/amd/ps/ps-pdm-dma.c diff --git a/sound/soc/amd/ps/acp62.h b/sound/soc/amd/ps/acp62.h index 79ad1bdb5b38..9026df7ab169 100644 --- a/sound/soc/amd/ps/acp62.h +++ b/sound/soc/amd/ps/acp62.h @@ -44,6 +44,11 @@ enum acp_config { ACP_CONFIG_15, }; +struct pdm_dev_data { + void __iomem *acp62_base; + struct snd_pcm_substream *capture_stream; +}; + static inline u32 acp62_readl(void __iomem *base_addr) { return readl(base_addr); diff --git a/sound/soc/amd/ps/ps-pdm-dma.c b/sound/soc/amd/ps/ps-pdm-dma.c new file mode 100644 index 000000000000..964686b46097 --- /dev/null +++ b/sound/soc/amd/ps/ps-pdm-dma.c @@ -0,0 +1,82 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * AMD ALSA SoC Pink Sardine PDM Driver + * + * Copyright 2022 Advanced Micro Devices, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "acp62.h" + +#define DRV_NAME "acp_ps_pdm_dma" + +static struct snd_soc_dai_driver acp62_pdm_dai_driver = { + .name = "acp_ps_pdm_dma.0", + .capture = { + .rates = SNDRV_PCM_RATE_48000, + .formats = SNDRV_PCM_FMTBIT_S32_LE, + .channels_min = 2, + .channels_max = 2, + .rate_min = 48000, + .rate_max = 48000, + }, +}; + +static const struct snd_soc_component_driver acp62_pdm_component = { + .name = DRV_NAME, +}; + +static int acp62_pdm_audio_probe(struct platform_device *pdev) +{ + struct resource *res; + struct pdm_dev_data *adata; + int status; + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!res) { + dev_err(&pdev->dev, "IORESOURCE_MEM FAILED\n"); + return -ENODEV; + } + + adata = devm_kzalloc(&pdev->dev, sizeof(*adata), GFP_KERNEL); + if (!adata) + return -ENOMEM; + + adata->acp62_base = devm_ioremap(&pdev->dev, res->start, resource_size(res)); + if (!adata->acp62_base) + return -ENOMEM; + + adata->capture_stream = NULL; + + dev_set_drvdata(&pdev->dev, adata); + status = devm_snd_soc_register_component(&pdev->dev, + &acp62_pdm_component, + &acp62_pdm_dai_driver, 1); + if (status) { + dev_err(&pdev->dev, "Fail to register acp pdm dai\n"); + + return -ENODEV; + } + return 0; +} + +static struct platform_driver acp62_pdm_dma_driver = { + .probe = acp62_pdm_audio_probe, + .driver = { + .name = "acp_ps_pdm_dma", + }, +}; + +module_platform_driver(acp62_pdm_dma_driver); + +MODULE_AUTHOR("Syed.SabaKareem@amd.com"); +MODULE_DESCRIPTION("AMD PINK SARDINE PDM Driver"); +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRV_NAME); From patchwork Sat Aug 27 16:56:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 12957061 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CF243C0502C for ; Sat, 27 Aug 2022 17:02:28 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 1B0EB1630; Sat, 27 Aug 2022 19:01:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1B0EB1630 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1661619747; bh=fw9BZICWwpdJGftXf8kg28874IL17G9KryHyCAlD9Zk=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=GUK8fZXNwGjfw0L5W15E9uaKeIq6jZGO0Jt2PZjyGwtetDbmXB1UHGJXh3ZpIv1L2 QPDD48ztZyKtxlC2oX2YjeIFc17B4bt7NlO4eh9bVw5tW/Cq+UWYNMjUWrvmk7mtWW X5aCbewmEhm2rcCy7o4MmlufIBW7wtVoC3eQeoEQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id CD9B6F80557; Sat, 27 Aug 2022 19:00:31 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7D0BFF8055B; Sat, 27 Aug 2022 19:00:30 +0200 (CEST) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2040.outbound.protection.outlook.com [40.107.212.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 527C4F80130 for ; Sat, 27 Aug 2022 19:00:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 527C4F80130 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="v2Xo9tDP" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dvoKNe2Jmjra++t0YR3dC+MYzMDaOzbuGkGyQcTxl8hjEQskv3ozhp2xMGsIhAq2cpt4n6vsMYKcjhpoFhc0hjyvCcocU3mLXETPyV96SqKLaDnavkxpFs36LCV3/qp3cTOMrIs7m10VgOpMS+0E7bV3CoFVsX/Z32Q7HlDARBrllPMJHkoQm3UcPq0+xwi2jUWh37+2TZOw1eZY+eA/z63f3LbIulT2EX4NShqRFDY7r4bPJbNeuwHP1z+jKj3/n0cs7naY9qpp1yu8Pn1QyUiXcg7qwEWwISBg/ZwIdaEfaFTbmBGxWMpixP7NBu0e/zrO7N787RxlnzFP1ag26Q== 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=+A6pifyQDg/l63ROFoM82QaH3YUvAaLsMSM85BByALA=; b=THbZ55z+MOyaoWZoIa73FfSo7uTkLs0gpg35Cqs0x3ZAC/Qji8DX3jGfp6STeNx5jswF3THn72wtvWRj8qvCY+N9IpvukkQ9fi3076/5Ccu0EpGCIogFvhYq/Mi+Ebt+O5Iu9O1Jv9C173H1mr1sPdrvCQakKBFPtfIK7KeZtPybv/sZ2K9AjEFFlhIL/VMqz1fwe+YDICCiY3YFNZFNZI8+qwz0jn9vAfaUO/tTGOpAfh3+rpTPfBktxnyUcTkvKf22P08RAm8rtSNBxYgNTWRSaBKONKSzNXcw5KhpwGqZo89FbimIgjzvusTd49mzopm3/OOgfCEn/Xm71B/JFA== 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=+A6pifyQDg/l63ROFoM82QaH3YUvAaLsMSM85BByALA=; b=v2Xo9tDPcsgErtAwjKNznDLyu2+Yk76aYpuFOF5wWSMp6WgAw/lWGDJBsTPSU2bdznXKTR9pYDJ20T2MXqhPjDZPKT0e1jg/VPdPpC3PqgRCE9J5rqGzdab+qUBOi658FuhPlVmbC9We+i17lbrI8ziyYf82dBJ4xwn1in6wRZ0= Received: from DM6PR17CA0012.namprd17.prod.outlook.com (2603:10b6:5:1b3::25) by BL0PR12MB2497.namprd12.prod.outlook.com (2603:10b6:207:4c::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.16; Sat, 27 Aug 2022 17:00:11 +0000 Received: from DM6NAM11FT038.eop-nam11.prod.protection.outlook.com (2603:10b6:5:1b3:cafe::8d) by DM6PR17CA0012.outlook.office365.com (2603:10b6:5:1b3::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.19 via Frontend Transport; Sat, 27 Aug 2022 17:00:10 +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 DM6NAM11FT038.mail.protection.outlook.com (10.13.173.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5566.15 via Frontend Transport; Sat, 27 Aug 2022 17:00:10 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sat, 27 Aug 2022 12:00:04 -0500 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.28 via Frontend Transport; Sat, 27 Aug 2022 12:00:01 -0500 From: Syed Saba Kareem To: , Subject: [PATCH v2 06/13] ASoC: amd: add acp6.2 irq handler Date: Sat, 27 Aug 2022 22:26:50 +0530 Message-ID: <20220827165657.2343818-7-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220827165657.2343818-1-Syed.SabaKareem@amd.com> References: <20220827165657.2343818-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 210e3286-30c8-4281-1c14-08da884d9a4e X-MS-TrafficTypeDiagnostic: BL0PR12MB2497:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /lV41KBYRliCHrbrZUp+i4YfAsenWJxBUUrOs3YWzP3kpXuDDUeIgcjKgUCZLN4UK10xWHoDsc+HkSV63eKgLc4F4OQEZ4OY4DHZBbKrz2/Qs8H5S6g6CFNnHeQzOXEkHH81UCTQfAj+T5y7SJ71GUXOeMxEMznqj+q48DVgf4fgrAx/R5r6qmnaEAzgiYQKilxUFPAXPguTeo9qmPqR3NiO/XHJ6oxF1BGZxR9flTq5WnuzkxuRoUGOaTeRso1nrkM7vhgnGhf/ca+1hVdJZ6ItYwFY6Dv+BPuNhzMNqVRU3hJbna/PBp1rVvOHg+cwuHiWd1r2Hi1IFY3L9Ki+4UVR+LGsFBXvPIcz2fcSQFOPIxTuiiHKinorbyZxDZTaQRIPDQWpLOSr0LoJqkoBRRYqnvrHmE48tW2d0RE0Qr4dsCAjWSRgvN5NotEq3h0eLymXYLgW3cF8Rtg1rrT+xsF804WMXZfqNcYdwGvWih6XJWdyS+p+dDMjUzNupr3JO6tZsIeAkv/rVxK2J38AKIn7/YdNFUpjARyvjV2PY92AI0oxZzkLRXNC2B7061LYrDr80QCYsgv98mNMrxxwUBv9HGLirrP2PuH0Z5SdHbNOqKqcRlVCRDb25sQnWL/Yv/RFSnDPHUww3S6ES3y4HrFBiaarcvZ4a7W6MLp7sb1WIUQ2ObdCR6a/fFNhf60loWXRynG4WYNUTowJmg4JjC7lxps2/L+qXKq0RfrYkJAWyLhWnI1HjRfBf7H69qWpniMpRFuuGRu11UnpVKEHK1zzuwpTq5keQqeG9EpzkVOOe0E1538ItY6v0sShuUnX 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:(13230016)(4636009)(376002)(39860400002)(136003)(396003)(346002)(36840700001)(40470700004)(46966006)(83380400001)(478600001)(336012)(1076003)(426003)(186003)(47076005)(2616005)(36860700001)(5660300002)(4326008)(54906003)(316002)(110136005)(70586007)(70206006)(8676002)(81166007)(2906002)(36756003)(40460700003)(82310400005)(82740400003)(8936002)(41300700001)(26005)(356005)(7696005)(6666004)(86362001)(40480700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2022 17:00:10.7922 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 210e3286-30c8-4281-1c14-08da884d9a4e 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: DM6NAM11FT038.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB2497 Cc: Sunil-kumar.Dommati@amd.com, open list , Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Liam Girdwood , mario.limonciello@amd.com, Vijendar.Mukunda@amd.com, alexander.deucher@amd.com, Syed Saba Kareem X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Add ACP6.2 irq handler for handling irq events for ACP IP. Add pdm irq events handling. Whenever audio data equal to the PDM watermark level are consumed, interrupt is generated. Acknowledge the interrupt. Signed-off-by: Syed Saba Kareem Signed-off-by: Vijendar Mukunda --- sound/soc/amd/ps/acp62.h | 2 ++ sound/soc/amd/ps/pci-ps.c | 31 +++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/sound/soc/amd/ps/acp62.h b/sound/soc/amd/ps/acp62.h index 9026df7ab169..9e359006b06b 100644 --- a/sound/soc/amd/ps/acp62.h +++ b/sound/soc/amd/ps/acp62.h @@ -24,6 +24,7 @@ #define ACP_ERROR_MASK 0x20000000 #define ACP_EXT_INTR_STAT_CLEAR_MASK 0xFFFFFFFF +#define PDM_DMA_STAT 0x10 enum acp_config { ACP_CONFIG_0 = 0, @@ -45,6 +46,7 @@ enum acp_config { }; struct pdm_dev_data { + u32 pdm_irq; void __iomem *acp62_base; struct snd_pcm_substream *capture_stream; }; diff --git a/sound/soc/amd/ps/pci-ps.c b/sound/soc/amd/ps/pci-ps.c index adad29667791..e4ddd80d0dd4 100644 --- a/sound/soc/amd/ps/pci-ps.c +++ b/sound/soc/amd/ps/pci-ps.c @@ -11,6 +11,8 @@ #include #include #include +#include +#include #include "acp62.h" @@ -115,6 +117,27 @@ static int acp62_deinit(void __iomem *acp_base, struct device *dev) return 0; } +static irqreturn_t acp62_irq_handler(int irq, void *dev_id) +{ + struct acp62_dev_data *adata; + struct pdm_dev_data *ps_pdm_data; + u32 val; + + adata = dev_id; + if (!adata) + return IRQ_NONE; + + val = acp62_readl(adata->acp62_base + ACP_EXTERNAL_INTR_STAT); + if (val & BIT(PDM_DMA_STAT)) { + ps_pdm_data = dev_get_drvdata(&adata->pdev[0]->dev); + acp62_writel(BIT(PDM_DMA_STAT), adata->acp62_base + ACP_EXTERNAL_INTR_STAT); + if (ps_pdm_data->capture_stream) + snd_pcm_period_elapsed(ps_pdm_data->capture_stream); + return IRQ_HANDLED; + } + return IRQ_NONE; +} + static int snd_acp62_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) { @@ -125,7 +148,9 @@ static int snd_acp62_probe(struct pci_dev *pci, struct acpi_device *adev; const union acpi_object *obj; u32 addr; + unsigned int irqflags; + irqflags = IRQF_SHARED; /* Pink Sardine device check */ switch (pci->revision) { case 0x63: @@ -218,6 +243,12 @@ static int snd_acp62_probe(struct pci_dev *pci, ret = PTR_ERR(adata->pdev[index]); goto unregister_devs; } + ret = devm_request_irq(&pci->dev, pci->irq, acp62_irq_handler, + irqflags, "ACP_PCI_IRQ", adata); + if (ret) { + dev_err(&pci->dev, "ACP PCI IRQ request failed\n"); + goto unregister_devs; + } } } break; From patchwork Sat Aug 27 16:56:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 12957060 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D8448C0502C for ; Sat, 27 Aug 2022 17:02:06 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 17176162F; Sat, 27 Aug 2022 19:01:15 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 17176162F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1661619725; bh=7D+obFcdUrOL8WhCrTVjfgZQl/vL/wpH3SXer8LP3AU=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=mlm1dk9EE/Yq/MCQS6u7UWRIiRfVCvbhNvJPbDa/lYy8zE6B0/aM3np70iqU6wRmo W0A4aPFs3ea945Bj/3Y6C05+ZbDp6eUh+7vkloEpYc963PQo9hGWLbBY4ABDq5tx79 m5C++TzOAilWyRqqM38WX0LeSeEEgYeqa9i5iWPI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 5C53FF80301; Sat, 27 Aug 2022 19:00:28 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 355B4F80301; Sat, 27 Aug 2022 19:00:27 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2081.outbound.protection.outlook.com [40.107.243.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id E42C5F80301 for ; Sat, 27 Aug 2022 19:00:20 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E42C5F80301 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="vm+leOwN" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JNqTZd0AJoPQ1JGFEtHtCIdITjs9Qs0oP4bnZYFdmE8/T327JVVTN3Eehl523XeD9z7abHXigzcLYz/JfLjJN1H/nERjJbkzog/oDMDZ/MYV7g/qdbFMoNksfxkA/aVxoZdafu71ZQIH5ygQ43fEzj59cYlIjKV0FRa/6hGALef3H9QyMuEA3328SWOE7lW3N33hnwf2Qy2p9KcdNUxyhF1qWPYjOzMlekuravy5VOTeIkb9WoBf2Kf9KOpyPuEvE2F37kDMR1ZPHp6KEdTAb5owOgxkGJNPfj5oFKVHHX4YPzlFmkoMuEH27yhayA4bvSERIWq99z239LJS+EQc4w== 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=mK2hOgeN7vclhULylIgWyEs3QJOWRqEDOULg4OqfuKQ=; b=mTCT/uup2BXi5BDCpLNVzJAOIagkCyHVjiVxhTAwPmVOrXDwRWBB3gQnnm358ySb+F6nfcMh77NYJJBwC430sN10JW1ZSbMadALlDnSjlglGML/ATjGowmyLtTz/2D1JvoEw+Kvb2E7QRCIx48jZkIEdFJJ5Jpkoh2LtcJhxatw/zh/DLxfsDZGdH56WMXyfWrrcOD/zAOTPGDojvhjj4cSJCcM/ovmqtvEkDkYeqQyWOjsSw+c+e6mGubpgffGRlyI053rXo05lMIQqHJp+6Oa+tG++1sHntl+w0Zf2WJvWqxfa1g88SgQ4aU1RZEDQW+bldGKJKUa5ltmc/Ev16w== 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=mK2hOgeN7vclhULylIgWyEs3QJOWRqEDOULg4OqfuKQ=; b=vm+leOwNhVeDu5TYx5YXaWU2fj89lzAiAIH8vzs6RGL39lUecp4FjNPxR1FygpywJarejeTLTzkStt+UUuh2DSpW2P9BuW+dQpoZ9khRgG/aktkCcYInGR6fqjevabrIf2nryWBY/Cw+rBqNNHxj5rP9LP7eJuLVFVZiAY6JZmk= Received: from DM6PR02CA0154.namprd02.prod.outlook.com (2603:10b6:5:332::21) by PH7PR12MB7113.namprd12.prod.outlook.com (2603:10b6:510:1ec::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15; Sat, 27 Aug 2022 17:00:14 +0000 Received: from DM6NAM11FT019.eop-nam11.prod.protection.outlook.com (2603:10b6:5:332:cafe::1d) by DM6PR02CA0154.outlook.office365.com (2603:10b6:5:332::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15 via Frontend Transport; Sat, 27 Aug 2022 17:00:14 +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 DM6NAM11FT019.mail.protection.outlook.com (10.13.172.172) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5566.15 via Frontend Transport; Sat, 27 Aug 2022 17:00:13 +0000 Received: from SATLEXMB08.amd.com (10.181.40.132) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sat, 27 Aug 2022 12:00:13 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB08.amd.com (10.181.40.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sat, 27 Aug 2022 10:00:13 -0700 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.28 via Frontend Transport; Sat, 27 Aug 2022 12:00:09 -0500 From: Syed Saba Kareem To: , Subject: [PATCH v2 07/13] ASoC: amd: add acp6.2 pdm driver dma ops Date: Sat, 27 Aug 2022 22:26:51 +0530 Message-ID: <20220827165657.2343818-8-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220827165657.2343818-1-Syed.SabaKareem@amd.com> References: <20220827165657.2343818-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f4330fd6-7d29-46f6-7764-08da884d9c19 X-MS-TrafficTypeDiagnostic: PH7PR12MB7113:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eN2YfAieaf+2R2bqXj0QI6qwCcSJncNmzjn9Ld1/tvIhBVTg26E2BKZgzbSRiC3pAzAOjIixgsxTLZj6m84HkoqgP8Ygc/OmuRtlcP66gM4Oci9/PNpTBNrE9kjNfwqzarya0VLWAQDvAduZc94q69ZDQO7aY/u+uU89iqMZbkgzCMpwvawPyS4pRwVLBG8EZF5Ku4vFL73IUIM0pOj0mBiuspdD7gXcR8MhMQLy7FlMn66g17pq/qpEHKpRZaJsXZJ99Pp/Az9H6y4XD3E6Yyb9n56EKThIo8nq4Aooir4QFsRKAiMdsk8e4iF7r8FM0U4dswZj/maYukM7Kg5rMLACWMZ7F30G69DFhThtYFL+uF7hvBZYfjdjElD+ZynmLvbbolNDA835/oN+wKM1BfWaBofkL/6ZZjEC+yCpicChLIwotmeCDutWTLtNine6OOKNYZyRpzNnrjEhc+OOL/NRXFNZ4SiMYwRXIkSaWLsIVZ1Gaj7PEP79EHsOuRT7GeZ+Vs03WWKvypkm2OtEj+0A1vsFjjphzd5YJ8UZjud3OCc8Ve8ywfuIiaJFMaawE616RiOeHBb/OHmXOlWdjdawzpC25bY4VQjSchUOFonE1tqU0oVSb8nNVjnehDHrWIrkHn+onShZS+Ic0ToiInbXYL/rC9hxI/wrO573EqUfFqfe4J+ToHk5Q9XaUOb63ODXjKmZPMrNajGM+sKPVtugotWv5FEpkyEQHWi6dEthlMFZUKyh3DNymFkG6i9syWnddQwf4xxhHfF+TrDh/W7e3AnpxwNNe/B2duy/11g62ZrI8x5wnYy7mrpl2E+w 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:(13230016)(4636009)(376002)(346002)(39860400002)(136003)(396003)(40470700004)(36840700001)(46966006)(7696005)(36756003)(6666004)(26005)(40460700003)(47076005)(186003)(336012)(1076003)(2616005)(426003)(110136005)(70206006)(70586007)(2906002)(316002)(54906003)(4326008)(8676002)(82310400005)(41300700001)(478600001)(30864003)(5660300002)(36860700001)(86362001)(82740400003)(356005)(81166007)(8936002)(83380400001)(40480700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2022 17:00:13.8026 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f4330fd6-7d29-46f6-7764-08da884d9c19 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: DM6NAM11FT019.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7113 Cc: Sunil-kumar.Dommati@amd.com, open list , Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Liam Girdwood , mario.limonciello@amd.com, Vijendar.Mukunda@amd.com, alexander.deucher@amd.com, Syed Saba Kareem X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" This patch adds PDM driver DMA operations for Pink Sardine Platform. Signed-off-by: Syed Saba Kareem Reviewed-by: Vijendar Mukunda --- sound/soc/amd/ps/acp62.h | 33 ++++ sound/soc/amd/ps/ps-pdm-dma.c | 313 ++++++++++++++++++++++++++++++++++ 2 files changed, 346 insertions(+) diff --git a/sound/soc/amd/ps/acp62.h b/sound/soc/amd/ps/acp62.h index 9e359006b06b..589c974f9997 100644 --- a/sound/soc/amd/ps/acp62.h +++ b/sound/soc/amd/ps/acp62.h @@ -26,6 +26,31 @@ #define ACP_EXT_INTR_STAT_CLEAR_MASK 0xFFFFFFFF #define PDM_DMA_STAT 0x10 +#define PDM_DMA_INTR_MASK 0x10000 +#define ACP_ERROR_STAT 29 +#define PDM_DECIMATION_FACTOR 2 +#define ACP_PDM_CLK_FREQ_MASK 7 +#define ACP_WOV_MISC_CTRL_MASK 0x10 +#define ACP_PDM_ENABLE 1 +#define ACP_PDM_DISABLE 0 +#define ACP_PDM_DMA_EN_STATUS 2 +#define TWO_CH 2 +#define DELAY_US 5 +#define ACP_COUNTER 20000 + +#define ACP_SRAM_PTE_OFFSET 0x03800000 +#define PAGE_SIZE_4K_ENABLE 2 +#define PDM_PTE_OFFSET 0 +#define PDM_MEM_WINDOW_START 0x4000000 + +#define CAPTURE_MIN_NUM_PERIODS 4 +#define CAPTURE_MAX_NUM_PERIODS 4 +#define CAPTURE_MAX_PERIOD_SIZE 8192 +#define CAPTURE_MIN_PERIOD_SIZE 4096 + +#define MAX_BUFFER (CAPTURE_MAX_PERIOD_SIZE * CAPTURE_MAX_NUM_PERIODS) +#define MIN_BUFFER MAX_BUFFER + enum acp_config { ACP_CONFIG_0 = 0, ACP_CONFIG_1, @@ -45,6 +70,14 @@ enum acp_config { ACP_CONFIG_15, }; +struct pdm_stream_instance { + u16 num_pages; + u16 channels; + dma_addr_t dma_addr; + u64 bytescount; + void __iomem *acp62_base; +}; + struct pdm_dev_data { u32 pdm_irq; void __iomem *acp62_base; diff --git a/sound/soc/amd/ps/ps-pdm-dma.c b/sound/soc/amd/ps/ps-pdm-dma.c index 964686b46097..f0ec1a4f3b9d 100644 --- a/sound/soc/amd/ps/ps-pdm-dma.c +++ b/sound/soc/amd/ps/ps-pdm-dma.c @@ -17,6 +17,313 @@ #define DRV_NAME "acp_ps_pdm_dma" +static const struct snd_pcm_hardware acp62_pdm_hardware_capture = { + .info = SNDRV_PCM_INFO_INTERLEAVED | + SNDRV_PCM_INFO_BLOCK_TRANSFER | + SNDRV_PCM_INFO_MMAP | + SNDRV_PCM_INFO_MMAP_VALID | + SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME, + .formats = SNDRV_PCM_FMTBIT_S32_LE, + .channels_min = 2, + .channels_max = 2, + .rates = SNDRV_PCM_RATE_48000, + .rate_min = 48000, + .rate_max = 48000, + .buffer_bytes_max = CAPTURE_MAX_NUM_PERIODS * CAPTURE_MAX_PERIOD_SIZE, + .period_bytes_min = CAPTURE_MIN_PERIOD_SIZE, + .period_bytes_max = CAPTURE_MAX_PERIOD_SIZE, + .periods_min = CAPTURE_MIN_NUM_PERIODS, + .periods_max = CAPTURE_MAX_NUM_PERIODS, +}; + +static void acp62_init_pdm_ring_buffer(u32 physical_addr, u32 buffer_size, + u32 watermark_size, void __iomem *acp_base) +{ + acp62_writel(physical_addr, acp_base + ACP_WOV_RX_RINGBUFADDR); + acp62_writel(buffer_size, acp_base + ACP_WOV_RX_RINGBUFSIZE); + acp62_writel(watermark_size, acp_base + ACP_WOV_RX_INTR_WATERMARK_SIZE); + acp62_writel(0x01, acp_base + ACPAXI2AXI_ATU_CTRL); +} + +static void acp62_enable_pdm_clock(void __iomem *acp_base) +{ + u32 pdm_clk_enable, pdm_ctrl; + + pdm_clk_enable = ACP_PDM_CLK_FREQ_MASK; + pdm_ctrl = 0x00; + + acp62_writel(pdm_clk_enable, acp_base + ACP_WOV_CLK_CTRL); + pdm_ctrl = acp62_readl(acp_base + ACP_WOV_MISC_CTRL); + pdm_ctrl |= ACP_WOV_MISC_CTRL_MASK; + acp62_writel(pdm_ctrl, acp_base + ACP_WOV_MISC_CTRL); +} + +static void acp62_enable_pdm_interrupts(void __iomem *acp_base) +{ + u32 ext_int_ctrl; + + ext_int_ctrl = acp62_readl(acp_base + ACP_EXTERNAL_INTR_CNTL); + ext_int_ctrl |= PDM_DMA_INTR_MASK; + acp62_writel(ext_int_ctrl, acp_base + ACP_EXTERNAL_INTR_CNTL); +} + +static void acp62_disable_pdm_interrupts(void __iomem *acp_base) +{ + u32 ext_int_ctrl; + + ext_int_ctrl = acp62_readl(acp_base + ACP_EXTERNAL_INTR_CNTL); + ext_int_ctrl &= ~PDM_DMA_INTR_MASK; + acp62_writel(ext_int_ctrl, acp_base + ACP_EXTERNAL_INTR_CNTL); +} + +static bool acp62_check_pdm_dma_status(void __iomem *acp_base) +{ + bool pdm_dma_status; + u32 pdm_enable, pdm_dma_enable; + + pdm_dma_status = false; + pdm_enable = acp62_readl(acp_base + ACP_WOV_PDM_ENABLE); + pdm_dma_enable = acp62_readl(acp_base + ACP_WOV_PDM_DMA_ENABLE); + if ((pdm_enable & ACP_PDM_ENABLE) && (pdm_dma_enable & ACP_PDM_DMA_EN_STATUS)) + pdm_dma_status = true; + + return pdm_dma_status; +} + +static int acp62_start_pdm_dma(void __iomem *acp_base) +{ + u32 pdm_enable; + u32 pdm_dma_enable; + int timeout; + + pdm_enable = 0x01; + pdm_dma_enable = 0x01; + + acp62_enable_pdm_clock(acp_base); + acp62_writel(pdm_enable, acp_base + ACP_WOV_PDM_ENABLE); + acp62_writel(pdm_dma_enable, acp_base + ACP_WOV_PDM_DMA_ENABLE); + timeout = 0; + while (++timeout < ACP_COUNTER) { + pdm_dma_enable = acp62_readl(acp_base + ACP_WOV_PDM_DMA_ENABLE); + if ((pdm_dma_enable & 0x02) == ACP_PDM_DMA_EN_STATUS) + return 0; + udelay(DELAY_US); + } + return -ETIMEDOUT; +} + +static int acp62_stop_pdm_dma(void __iomem *acp_base) +{ + u32 pdm_enable, pdm_dma_enable; + int timeout; + + pdm_enable = 0x00; + pdm_dma_enable = 0x00; + + pdm_enable = acp62_readl(acp_base + ACP_WOV_PDM_ENABLE); + pdm_dma_enable = acp62_readl(acp_base + ACP_WOV_PDM_DMA_ENABLE); + if (pdm_dma_enable & 0x01) { + pdm_dma_enable = 0x02; + acp62_writel(pdm_dma_enable, acp_base + ACP_WOV_PDM_DMA_ENABLE); + timeout = 0; + while (++timeout < ACP_COUNTER) { + pdm_dma_enable = acp62_readl(acp_base + ACP_WOV_PDM_DMA_ENABLE); + if ((pdm_dma_enable & 0x02) == 0x00) + break; + udelay(DELAY_US); + } + if (timeout == ACP_COUNTER) + return -ETIMEDOUT; + } + if (pdm_enable == ACP_PDM_ENABLE) { + pdm_enable = ACP_PDM_DISABLE; + acp62_writel(pdm_enable, acp_base + ACP_WOV_PDM_ENABLE); + } + acp62_writel(0x01, acp_base + ACP_WOV_PDM_FIFO_FLUSH); + return 0; +} + +static void acp62_config_dma(struct pdm_stream_instance *rtd, int direction) +{ + u16 page_idx; + u32 low, high, val; + dma_addr_t addr; + + addr = rtd->dma_addr; + val = PDM_PTE_OFFSET; + + /* Group Enable */ + acp62_writel(ACP_SRAM_PTE_OFFSET | BIT(31), rtd->acp62_base + + ACPAXI2AXI_ATU_BASE_ADDR_GRP_1); + acp62_writel(PAGE_SIZE_4K_ENABLE, rtd->acp62_base + + ACPAXI2AXI_ATU_PAGE_SIZE_GRP_1); + for (page_idx = 0; page_idx < rtd->num_pages; page_idx++) { + /* Load the low address of page int ACP SRAM through SRBM */ + low = lower_32_bits(addr); + high = upper_32_bits(addr); + + acp62_writel(low, rtd->acp62_base + ACP_SCRATCH_REG_0 + val); + high |= BIT(31); + acp62_writel(high, rtd->acp62_base + ACP_SCRATCH_REG_0 + val + 4); + val += 8; + addr += PAGE_SIZE; + } +} + +static int acp62_pdm_dma_open(struct snd_soc_component *component, + struct snd_pcm_substream *substream) +{ + struct snd_pcm_runtime *runtime; + struct pdm_dev_data *adata; + struct pdm_stream_instance *pdm_data; + int ret; + + runtime = substream->runtime; + adata = dev_get_drvdata(component->dev); + pdm_data = kzalloc(sizeof(*pdm_data), GFP_KERNEL); + if (!pdm_data) + return -EINVAL; + + if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + runtime->hw = acp62_pdm_hardware_capture; + + ret = snd_pcm_hw_constraint_integer(runtime, + SNDRV_PCM_HW_PARAM_PERIODS); + if (ret < 0) { + dev_err(component->dev, "set integer constraint failed\n"); + kfree(pdm_data); + return ret; + } + + acp62_enable_pdm_interrupts(adata->acp62_base); + + if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + adata->capture_stream = substream; + + pdm_data->acp62_base = adata->acp62_base; + runtime->private_data = pdm_data; + return ret; +} + +static int acp62_pdm_dma_hw_params(struct snd_soc_component *component, + struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params) +{ + struct pdm_stream_instance *rtd; + size_t size, period_bytes; + + rtd = substream->runtime->private_data; + if (!rtd) + return -EINVAL; + size = params_buffer_bytes(params); + period_bytes = params_period_bytes(params); + rtd->dma_addr = substream->runtime->dma_addr; + rtd->num_pages = (PAGE_ALIGN(size) >> PAGE_SHIFT); + acp62_config_dma(rtd, substream->stream); + acp62_init_pdm_ring_buffer(PDM_MEM_WINDOW_START, size, + period_bytes, rtd->acp62_base); + return 0; +} + +static u64 acp62_pdm_get_byte_count(struct pdm_stream_instance *rtd, + int direction) +{ + u32 high, low; + u64 byte_count; + + high = acp62_readl(rtd->acp62_base + ACP_WOV_RX_LINEARPOSITIONCNTR_HIGH); + byte_count = high; + low = acp62_readl(rtd->acp62_base + ACP_WOV_RX_LINEARPOSITIONCNTR_LOW); + byte_count = (byte_count << 32) | low; + return byte_count; +} + +static snd_pcm_uframes_t acp62_pdm_dma_pointer(struct snd_soc_component *comp, + struct snd_pcm_substream *stream) +{ + struct pdm_stream_instance *rtd; + u32 pos, buffersize; + u64 bytescount; + + rtd = stream->runtime->private_data; + buffersize = frames_to_bytes(stream->runtime, + stream->runtime->buffer_size); + bytescount = acp62_pdm_get_byte_count(rtd, stream->stream); + if (bytescount > rtd->bytescount) + bytescount -= rtd->bytescount; + pos = do_div(bytescount, buffersize); + return bytes_to_frames(stream->runtime, pos); +} + +static int acp62_pdm_dma_new(struct snd_soc_component *component, + struct snd_soc_pcm_runtime *rtd) +{ + struct device *parent = component->dev->parent; + + snd_pcm_set_managed_buffer_all(rtd->pcm, SNDRV_DMA_TYPE_DEV, + parent, MIN_BUFFER, MAX_BUFFER); + return 0; +} + +static int acp62_pdm_dma_close(struct snd_soc_component *component, + struct snd_pcm_substream *substream) +{ + struct pdm_dev_data *adata = dev_get_drvdata(component->dev); + struct snd_pcm_runtime *runtime = substream->runtime; + + acp62_disable_pdm_interrupts(adata->acp62_base); + adata->capture_stream = NULL; + kfree(runtime->private_data); + return 0; +} + +static int acp62_pdm_dai_trigger(struct snd_pcm_substream *substream, + int cmd, struct snd_soc_dai *dai) +{ + struct pdm_stream_instance *rtd; + int ret; + bool pdm_status; + unsigned int ch_mask; + + rtd = substream->runtime->private_data; + ret = 0; + switch (substream->runtime->channels) { + case TWO_CH: + ch_mask = 0x00; + break; + default: + return -EINVAL; + } + switch (cmd) { + case SNDRV_PCM_TRIGGER_START: + case SNDRV_PCM_TRIGGER_RESUME: + case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: + acp62_writel(ch_mask, rtd->acp62_base + ACP_WOV_PDM_NO_OF_CHANNELS); + acp62_writel(PDM_DECIMATION_FACTOR, rtd->acp62_base + + ACP_WOV_PDM_DECIMATION_FACTOR); + rtd->bytescount = acp62_pdm_get_byte_count(rtd, substream->stream); + pdm_status = acp62_check_pdm_dma_status(rtd->acp62_base); + if (!pdm_status) + ret = acp62_start_pdm_dma(rtd->acp62_base); + break; + case SNDRV_PCM_TRIGGER_STOP: + case SNDRV_PCM_TRIGGER_SUSPEND: + case SNDRV_PCM_TRIGGER_PAUSE_PUSH: + pdm_status = acp62_check_pdm_dma_status(rtd->acp62_base); + if (pdm_status) + ret = acp62_stop_pdm_dma(rtd->acp62_base); + break; + default: + ret = -EINVAL; + break; + } + return ret; +} + +static const struct snd_soc_dai_ops acp62_pdm_dai_ops = { + .trigger = acp62_pdm_dai_trigger, +}; + static struct snd_soc_dai_driver acp62_pdm_dai_driver = { .name = "acp_ps_pdm_dma.0", .capture = { @@ -27,10 +334,16 @@ static struct snd_soc_dai_driver acp62_pdm_dai_driver = { .rate_min = 48000, .rate_max = 48000, }, + .ops = &acp62_pdm_dai_ops, }; static const struct snd_soc_component_driver acp62_pdm_component = { .name = DRV_NAME, + .open = acp62_pdm_dma_open, + .close = acp62_pdm_dma_close, + .hw_params = acp62_pdm_dma_hw_params, + .pointer = acp62_pdm_dma_pointer, + .pcm_construct = acp62_pdm_dma_new, }; static int acp62_pdm_audio_probe(struct platform_device *pdev) From patchwork Sat Aug 27 16:56:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 12957062 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B3265C0502C for ; Sat, 27 Aug 2022 17:02:39 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 0A3A5850; Sat, 27 Aug 2022 19:01:48 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0A3A5850 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1661619758; bh=B2E9l8xGAnjFlfpWR4CnaDLYx5WkuCCGC+b8ts6Lf88=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=QMYtQ3iWwlPI/LGPdnHzLJ6jaFiZksqCbfi0ayj5OxE7Tm2MYWLVA25RD6WPMk6oG SRJXtBdmlldX7r1Dz4DG/4af7sdCdMdKEOhW3ajXAoqFf7D53zSyeTRHwx6CSRcEzH FFxKrzuekNpm2tddYsQFY/QuwLRCeZSBaSjvw1vY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 88D46F80564; Sat, 27 Aug 2022 19:00:41 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 60693F80567; Sat, 27 Aug 2022 19:00:40 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2051.outbound.protection.outlook.com [40.107.220.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 23B53F80564 for ; Sat, 27 Aug 2022 19:00:28 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 23B53F80564 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="WJOhrhLF" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=So6PpzVYuvEv0bBhpOKR6/4gjiGL4c4Y7rzVBGc19SBjw+y66OFk4L9ZdxiGgO3NS4LuOq+s/pr0n8vncLwuLzJYledqUBEwh5GLD5XIE17sP1JYkcKB/KATxDScNh+JE8h974zC02wD9AcSDkHIbPz95UD/aWZ7SqQYhfeYG3CLaJnF2zFDRQpr0dL1kvFF/Sjc4yxUBpXBuRlkwXH9kwPwrnRJgAhdhm+zBVDvZtriXjvCuvPfDNPMAIGs/cXxD8sn41NEZWZG5FHOtwfl988B/md4VgL9PtrW2yW1ad1Qu3qp8SewC2KCuw68qHgFpXw7wqwJ9NapHVET4ZJHCQ== 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=J7vhFRkqFyHu7AN+afeQ91y0G2jtowyCxHTF+C3uNNA=; b=M2iEjDg7USzepefFBwNPw+cfYoUVgBl6RDf1BGhKvM1lSi3mPcTp/kXsEE6S+O+WOT4OQxjFmSoJV/4MCUPjdstRPTlYF3TQobLf5BO9k/qJ8lWw0G60n2ZSYx6tDcR5E1iN6K/kKFqvLwWpKwdzl57uvy+8B0h5VVsiV5MbSn/tjGEbP5tDN2lJXefrts7IDf0Wu785dEzxoIjoLZEQIw1CkGXNiQVPdmd/FmxPh57cZZsp++wTg0R823/aZ9NjFKJ/EzgK63Etlv7l16r+lUUg43Y5WNbWzXeClaY2JG5kq23LNvxbkTTdmjIKiK9mM7mCiu+cDSR0Y3J8Xc7Rgw== 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=J7vhFRkqFyHu7AN+afeQ91y0G2jtowyCxHTF+C3uNNA=; b=WJOhrhLF3iHYO+oPqy3i1LUfcPPvqIxuwd/IPRuBffjiO2MqcSu0C0ULo47rWRK0AofO8sNFnIMY8kHOXcNvlnvtmyigj2bFheatmEtN6Oc1DajE/geqNb5VrayyTydhF40HcfEgNZTOSfv/FyQI99/vVvmp/lAQ6HzgYt+h/BY= Received: from BN9PR03CA0718.namprd03.prod.outlook.com (2603:10b6:408:ef::33) by CO6PR12MB5411.namprd12.prod.outlook.com (2603:10b6:5:356::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15; Sat, 27 Aug 2022 17:00:24 +0000 Received: from BN8NAM11FT078.eop-nam11.prod.protection.outlook.com (2603:10b6:408:ef:cafe::9) by BN9PR03CA0718.outlook.office365.com (2603:10b6:408:ef::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15 via Frontend Transport; Sat, 27 Aug 2022 17:00: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 BN8NAM11FT078.mail.protection.outlook.com (10.13.176.251) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5566.15 via Frontend Transport; Sat, 27 Aug 2022 17:00:22 +0000 Received: from SATLEXMB07.amd.com (10.181.41.45) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sat, 27 Aug 2022 12:00:21 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB07.amd.com (10.181.41.45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sat, 27 Aug 2022 10:00:21 -0700 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.28 via Frontend Transport; Sat, 27 Aug 2022 12:00:18 -0500 From: Syed Saba Kareem To: , Subject: [PATCH v2 08/13] ASoC: amd: add acp6.2 pci driver pm ops Date: Sat, 27 Aug 2022 22:26:52 +0530 Message-ID: <20220827165657.2343818-9-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220827165657.2343818-1-Syed.SabaKareem@amd.com> References: <20220827165657.2343818-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3d8d50e5-e372-4a0f-0875-08da884da11f X-MS-TrafficTypeDiagnostic: CO6PR12MB5411:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jFl+HDr8Tjfgh5kwrSq4vDAt8vxmR0rRv+6SxWZJCATrVXGa6BewLKe96pgy2ORbFsDfgqkXYwXT4x0HKvPFpXjPFQOD72vuV7oJO7oOQWQDuEguky8X9LD+GP7Jy7cUjNRI8iqwImhuBSNP62fvtwCygOozHbRDtSywyFWoAmks0lQKqv67xyy1VOUsq4Yj/C9QUbYlEAWdeF6qG9mGeDjmD5IF3g0vtIh02EuLm6ipPTCvYZgYWs0oJFY8HZMBGtPPO99gyT8lkl76fJ8Dnwi4sW79ja3ojaEkDBv9ul+wLg/8TyMLg9Xb8FDzAid9Feu24/yMejsIAPJkNPDa6IBVH9V8IQfT4FSim/yH81BWuS+LazC0U/wZBVSQ1CN1eFsgL4ILds9tdR5GlNcf+Z1X+F18Xyd3dlBFbb0/ayuBumry4/mE5f33br+MGCb980HtN+zHqi8UA90fdPzcK6qMODZQrYht2GLGT0eDOrPs0/5jZx0QLoxLjwaio6hweYfHQ8tLl8fvXRV8oyRO15TaUSl+esRsHnc+zWbwx9eehigfUWOfENZckcWP0CsYN3RCcJ7T/HWIZLYkzy6IK1Ik/q7Fb+toJZ1+pQv2I0qhmSIjAtiWCISkg74Drq+sqNRNUrZBuIbmPh8LWBX6mOb3IAbVC5Br+Q+sC5fE715ewJT81b+wMmp6Ry8mg56ZrH0Vbhpxg22OtT4sFNYSWOm6QXIDmmjq8ID9J9MedSM70s36j2rpN98Jovt80decLMfBU/axo1hbamYvIRtoAQFlKSpk5gZsKhngyfXgTt8= 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:(13230016)(4636009)(136003)(376002)(346002)(39860400002)(396003)(36840700001)(46966006)(40470700004)(7696005)(356005)(26005)(82310400005)(426003)(47076005)(2906002)(81166007)(83380400001)(54906003)(110136005)(82740400003)(36756003)(316002)(8676002)(4326008)(70586007)(70206006)(5660300002)(41300700001)(6666004)(8936002)(36860700001)(2616005)(186003)(1076003)(336012)(86362001)(478600001)(40460700003)(40480700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2022 17:00:22.2746 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3d8d50e5-e372-4a0f-0875-08da884da11f 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: BN8NAM11FT078.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR12MB5411 Cc: Sunil-kumar.Dommati@amd.com, open list , Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Liam Girdwood , mario.limonciello@amd.com, Vijendar.Mukunda@amd.com, alexander.deucher@amd.com, Syed Saba Kareem X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Add acp6.2 pci driver pm ops. Signed-off-by: Syed Saba Kareem Signed-off-by: Vijendar Mukunda --- sound/soc/amd/ps/acp62.h | 3 +++ sound/soc/amd/ps/pci-ps.c | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/sound/soc/amd/ps/acp62.h b/sound/soc/amd/ps/acp62.h index 589c974f9997..89ff14007e5c 100644 --- a/sound/soc/amd/ps/acp62.h +++ b/sound/soc/amd/ps/acp62.h @@ -51,6 +51,9 @@ #define MAX_BUFFER (CAPTURE_MAX_PERIOD_SIZE * CAPTURE_MAX_NUM_PERIODS) #define MIN_BUFFER MAX_BUFFER +/* time in ms for runtime suspend delay */ +#define ACP_SUSPEND_DELAY_MS 2000 + enum acp_config { ACP_CONFIG_0 = 0, ACP_CONFIG_1, diff --git a/sound/soc/amd/ps/pci-ps.c b/sound/soc/amd/ps/pci-ps.c index e4ddd80d0dd4..075d9a23205d 100644 --- a/sound/soc/amd/ps/pci-ps.c +++ b/sound/soc/amd/ps/pci-ps.c @@ -13,6 +13,7 @@ #include #include #include +#include #include "acp62.h" @@ -253,6 +254,10 @@ static int snd_acp62_probe(struct pci_dev *pci, } break; } + pm_runtime_set_autosuspend_delay(&pci->dev, ACP_SUSPEND_DELAY_MS); + pm_runtime_use_autosuspend(&pci->dev); + pm_runtime_put_noidle(&pci->dev); + pm_runtime_allow(&pci->dev); return 0; unregister_devs: for (--index; index >= 0; index--) @@ -268,6 +273,35 @@ static int snd_acp62_probe(struct pci_dev *pci, return ret; } +static int __maybe_unused snd_acp62_suspend(struct device *dev) +{ + struct acp62_dev_data *adata; + int ret; + + adata = dev_get_drvdata(dev); + ret = acp62_deinit(adata->acp62_base, dev); + if (ret) + dev_err(dev, "ACP de-init failed\n"); + return ret; +} + +static int __maybe_unused snd_acp62_resume(struct device *dev) +{ + struct acp62_dev_data *adata; + int ret; + + adata = dev_get_drvdata(dev); + ret = acp62_init(adata->acp62_base, dev); + if (ret) + dev_err(dev, "ACP init failed\n"); + return ret; +} + +static const struct dev_pm_ops acp62_pm_ops = { + SET_RUNTIME_PM_OPS(snd_acp62_suspend, snd_acp62_resume, NULL) + SET_SYSTEM_SLEEP_PM_OPS(snd_acp62_suspend, snd_acp62_resume) +}; + static void snd_acp62_remove(struct pci_dev *pci) { struct acp62_dev_data *adata; @@ -281,6 +315,8 @@ static void snd_acp62_remove(struct pci_dev *pci) ret = acp62_deinit(adata->acp62_base, &pci->dev); if (ret) dev_err(&pci->dev, "ACP de-init failed\n"); + pm_runtime_forbid(&pci->dev); + pm_runtime_get_noresume(&pci->dev); pci_release_regions(pci); pci_disable_device(pci); } @@ -298,6 +334,9 @@ static struct pci_driver ps_acp62_driver = { .id_table = snd_acp62_ids, .probe = snd_acp62_probe, .remove = snd_acp62_remove, + .driver = { + .pm = &acp62_pm_ops, + } }; module_pci_driver(ps_acp62_driver); From patchwork Sat Aug 27 16:56:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 12957063 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5F77AECAAD1 for ; Sat, 27 Aug 2022 17:02:57 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 9ED4F85D; Sat, 27 Aug 2022 19:02:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9ED4F85D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1661619775; bh=NEKYxU2SETSFP1UyqL23X/dNj3dkVyS3MM8rH1ipZSg=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=sJ19nv3OscGYIs6W7IXZFZ/5mGyulF4CPCwfocLUbd7dXSYKQXRYttzI+DwN94R2s 2QrReWc0ufbA1JyXOgg5pNl6Vrgei2tHo50yFMqS5q5C0qXH5HX9gtyqu/eu5rNSnD kKfEn9EmCT4oM5ZcwbQYtpatoR8tjyhNITPHqRaE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 530B1F80568; Sat, 27 Aug 2022 19:00:50 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 04DB0F8056F; Sat, 27 Aug 2022 19:00:49 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2041.outbound.protection.outlook.com [40.107.92.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id E0A41F80290 for ; Sat, 27 Aug 2022 19:00:42 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E0A41F80290 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="N4HYffOP" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O9jnk8RXadKmr759ZD2ILDJTx6Sd1xO+P7nff9KhXNhGKe3bE1vLTFUyvA7VnVPNEm0pk70Wq4zYZ4WRCZubQ8dtb1BtwRSBunr/EbZaveu48TdiImi1z3J3+OVdyHj7nFY7XbOZVSVIhjYdgVnuw9G3nUUGs0rMJ7jJVHOT6OYCvCxUjszJQkg2n4riF/ZVt1J0LejWESri1LLCtv991v0ZKax2Jsi5RNlNVEtJM9G4E45Jg/mJlBfmm4Bghr+znXfYPVuyEjJD9saMjnlqcFFtZb2sLYBwouPCnVZxI5CagYn+k2fBtaJU2xqbNfXSXObxe+kmRmTJbAyDG273NA== 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=PXGjTHeX6pb44lYunRSKdKZY77FFDMm2Tlgyls6mclI=; b=HDoWjpZc4eZgCyUkcNYe1ivq2z0TaDOTcfWH5py6LsEDjWB+nV1u71NwSVXw5itTLPwxAgoW9TRwCVxtracCrtvB5+5Y3YOqMX445qlJAS3cAee/zfbZjcNYFdA9pvkYahU7H4YKFExJf5IIKXza/4e36ClUfkuUdeUDqId5j2uu6qO8slDkDDsLSgLsdRRzbu83MGwcQMnM++GiLfeHkc+knBu6m0Z/QAUG186r45hEvbVmjWniIZ69XqP12IFaj2Kc8LUxPYG8VU5+sJHYWpj6KmFqYT31MZhBg7x+9cWcKuOIcJ/OqrmSt4QuNacrM+n7G4YsPs5SZF7j6K+LcA== 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=PXGjTHeX6pb44lYunRSKdKZY77FFDMm2Tlgyls6mclI=; b=N4HYffOP1IRG7uTSVJWHXIv9pORtjV7TlJmQLfSSzHVU+1e2bX5OKAnNIhNT1lsnWkh2lhflHZFDegMF8mnMZodhuZa56wmT+wAjbooKCE0RmX3DjihB4llXQXNMFxT3E70Wn2riuwr3Py6U5o8BVhIFzAqRhOVvEqxcIJab5io= Received: from DS7PR03CA0320.namprd03.prod.outlook.com (2603:10b6:8:2b::15) by CY8PR12MB7122.namprd12.prod.outlook.com (2603:10b6:930:61::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.18; Sat, 27 Aug 2022 17:00:29 +0000 Received: from DM6NAM11FT089.eop-nam11.prod.protection.outlook.com (2603:10b6:8:2b:cafe::9e) by DS7PR03CA0320.outlook.office365.com (2603:10b6:8:2b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15 via Frontend Transport; Sat, 27 Aug 2022 17:00:29 +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 DM6NAM11FT089.mail.protection.outlook.com (10.13.173.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5566.15 via Frontend Transport; Sat, 27 Aug 2022 17:00:28 +0000 Received: from SATLEXMB08.amd.com (10.181.40.132) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sat, 27 Aug 2022 12:00:28 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB08.amd.com (10.181.40.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sat, 27 Aug 2022 10:00:28 -0700 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.28 via Frontend Transport; Sat, 27 Aug 2022 12:00:24 -0500 From: Syed Saba Kareem To: , Subject: [PATCH v2 09/13] ASoC: amd: add acp6.2 pdm driver pm ops Date: Sat, 27 Aug 2022 22:26:53 +0530 Message-ID: <20220827165657.2343818-10-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220827165657.2343818-1-Syed.SabaKareem@amd.com> References: <20220827165657.2343818-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4c1ea1e1-ba2a-46fa-21c1-08da884da51a X-MS-TrafficTypeDiagnostic: CY8PR12MB7122:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: po7IXpSnkBbErRVEgMvy2Bf+nZb9Fzo0gkZaKf5yVstDnIK9FeW6gd5WuGUTQQ/ZlnlKTrdC8oKu/FSal+djBYJgqy7kt5Xhy/btIRdjpM8BHpxVQNpi/pS0zDX0l8CnOedJFS9874fY5KWxuDYiYAhSigkCzIle7PMgvX3/qkrSpaFMCPAUx+9YdIaHT0doJTzgltlGYAro8DZpsfK+Adx72jEOwfS2aPqq2L4W9h4RhlecDgLdehswgZgx7SvsR2atxSNokNrIysKpLTETY+Sua76yFJw/p9CpyvRTlA7HIgroi0tVcLBbscAVI8iHbu6quJMMjGsUSANtCQC8eM6k5n7qY3Fqcg5XPrOXUxHgyGODUxx5x70IWTDhzNVuz1vajVDrLJWHk5WTwpN5zbFzW/s9ybFX/m4FOGXQFNuBq8Bjp/pXu2KYqcudGdkqw+1/+e4K2Jd5aIqp8oF5Kb2mrWdWnxbNH+xAr23MDc4Tod66d89Q7HeGChpWjE8tbdWvQQAw8sJrCaUVRZpFNkKRMuY4ncJt28iPjZxhj/415KMYn7K7xMwoX9xMgVjddHZEtkkOJYmJzOh/Pyub0SFn2Sg7GNTmvalKf76pZEGkg5060luTzDIW+Mw5RjfaD1P4PsngmZ/RwSSZ6SsIYDl5c63rJ0gI5a2dv8+2OMsFr0x66lXOyhnc2uqrxxUwiaJX8mrTA6/Q+Wja+rP5/9gxQ4nHJozZvr+0o4IJnQEAJRpXeocFbUJNwk3TczYVq9PD2KbygcIovD4GXxdidQpNJjfYxniXEkszjwhVHcVdCe6fpVoix2TPVTlFzKvE 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:(13230016)(4636009)(39860400002)(396003)(136003)(346002)(376002)(36840700001)(46966006)(40470700004)(2616005)(7696005)(6666004)(316002)(83380400001)(186003)(426003)(1076003)(26005)(336012)(47076005)(41300700001)(478600001)(5660300002)(40460700003)(82310400005)(8936002)(2906002)(40480700001)(70586007)(54906003)(110136005)(82740400003)(4326008)(8676002)(81166007)(356005)(86362001)(36756003)(36860700001)(70206006)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2022 17:00:28.9065 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4c1ea1e1-ba2a-46fa-21c1-08da884da51a 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: DM6NAM11FT089.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7122 Cc: Sunil-kumar.Dommati@amd.com, open list , Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Liam Girdwood , mario.limonciello@amd.com, Vijendar.Mukunda@amd.com, alexander.deucher@amd.com, Syed Saba Kareem X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Add acp6.2 pdm driver pm ops. Signed-off-by: Syed Saba Kareem Reviewed-by: Vijendar Mukunda --- sound/soc/amd/ps/ps-pdm-dma.c | 57 +++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/sound/soc/amd/ps/ps-pdm-dma.c b/sound/soc/amd/ps/ps-pdm-dma.c index f0ec1a4f3b9d..b207b726cd82 100644 --- a/sound/soc/amd/ps/ps-pdm-dma.c +++ b/sound/soc/amd/ps/ps-pdm-dma.c @@ -12,6 +12,7 @@ #include #include #include +#include #include "acp62.h" @@ -377,13 +378,69 @@ static int acp62_pdm_audio_probe(struct platform_device *pdev) return -ENODEV; } + pm_runtime_set_autosuspend_delay(&pdev->dev, ACP_SUSPEND_DELAY_MS); + pm_runtime_use_autosuspend(&pdev->dev); + pm_runtime_enable(&pdev->dev); + pm_runtime_allow(&pdev->dev); return 0; } +static int acp62_pdm_audio_remove(struct platform_device *pdev) +{ + pm_runtime_disable(&pdev->dev); + return 0; +} + +static int __maybe_unused acp62_pdm_resume(struct device *dev) +{ + struct pdm_dev_data *adata; + struct snd_pcm_runtime *runtime; + struct pdm_stream_instance *rtd; + u32 period_bytes, buffer_len; + + adata = dev_get_drvdata(dev); + if (adata->capture_stream && adata->capture_stream->runtime) { + runtime = adata->capture_stream->runtime; + rtd = runtime->private_data; + period_bytes = frames_to_bytes(runtime, runtime->period_size); + buffer_len = frames_to_bytes(runtime, runtime->buffer_size); + acp62_config_dma(rtd, SNDRV_PCM_STREAM_CAPTURE); + acp62_init_pdm_ring_buffer(PDM_MEM_WINDOW_START, buffer_len, + period_bytes, adata->acp62_base); + } + acp62_enable_pdm_interrupts(adata->acp62_base); + return 0; +} + +static int __maybe_unused acp62_pdm_suspend(struct device *dev) +{ + struct pdm_dev_data *adata; + + adata = dev_get_drvdata(dev); + acp62_disable_pdm_interrupts(adata->acp62_base); + return 0; +} + +static int __maybe_unused acp62_pdm_runtime_resume(struct device *dev) +{ + struct pdm_dev_data *adata; + + adata = dev_get_drvdata(dev); + acp62_enable_pdm_interrupts(adata->acp62_base); + return 0; +} + +static const struct dev_pm_ops acp62_pdm_pm_ops = { + SET_RUNTIME_PM_OPS(acp62_pdm_suspend, acp62_pdm_runtime_resume, NULL) + SET_SYSTEM_SLEEP_PM_OPS(acp62_pdm_suspend, acp62_pdm_resume) +}; + static struct platform_driver acp62_pdm_dma_driver = { .probe = acp62_pdm_audio_probe, + .remove = acp62_pdm_audio_remove, .driver = { .name = "acp_ps_pdm_dma", + .pm = &acp62_pdm_pm_ops, }, }; From patchwork Sat Aug 27 16:56:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 12957064 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3CEBFC0502C for ; Sat, 27 Aug 2022 17:03:23 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 87725839; Sat, 27 Aug 2022 19:02:31 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 87725839 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1661619801; bh=i+mAwXJow1pzaEGFP2dbEBahvDTAlOh2He3rXMCU4jA=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=OtldRD9hYTvPahNPkOfPie2FRVo0IsgbYfTu17xXcSs89Ep0m18wl7zb7TQL42hlw /oyjMFjqJUOU5xxykgA8p5tkvUSmFivJaB+Z/29wghb9m5GbncXLUYbVCS5LG1Z4PO Zu9Sh1S+SliDMkzgy0eHs0WtmX9esHYmtBkLQFaY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 42F3EF80132; Sat, 27 Aug 2022 19:01:01 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 00267F802E8; Sat, 27 Aug 2022 19:00:51 +0200 (CEST) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2046.outbound.protection.outlook.com [40.107.212.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id D65B2F802E8 for ; Sat, 27 Aug 2022 19:00:43 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D65B2F802E8 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="41jwp1/h" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c0VkAMu4Ar2Q75qGc4V9jzeRauePHEw4AWOHXQ3FZ6d1iu5eZm5N4MpAY6fqqnYX6evbFKjA+S401Z0vxqOIfIeXzsYaYq00miQQKz73Oh7+V31J74TwfioUIEU5J9nfifCmiKDXOcYGcCt8/tsc5eQtkZfSi/iZ1glchClT238N5QFfaVoS8qIXgwDYsUTEsOW1Uov/GpKwsKmfiuewxaMkq7uAhUjIeUixzsSrGy3AQZI+Pmac0IU+zWtUzeCVoDULXMcAIBoSYSB6BxL9orXHlB9tl9h1FQ6VgRh7tdaetEeYm4rWtl9vs5hBLadKRG/TcbNu9Z8NmV/lI7gzBw== 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=GUVqbegoaAbedst9IwEttr4om4QfKduQQCj3uRVe758=; b=EG5+t77Tj6b8IS3Zv+951k12HzoxfeV3JgreMSNl4Kyv+/rFB+GMg2MigI0YTwNu+grzq02J2LnFRmwcnUgXS3gxGY1nRd4MORCn/1OOo1+TZBVGDM1IEMEdjDS6zKgW0tkjGGGPKU02x3JhSJbmQMY1aFXfoAOoepssx42zwU41PNU5XqNrfRa1n7uyLT0/85O9+2RejShnFFmYoaX/UL7WIXnmY/wNWDHs1GhY2ihqMdlyy3w7XMCY7bDoCnRtY3qASbUGUckSseUifL5yybOseDkwfwhDuFYnITOaknJZbF5O4AD2LybY8j0MKLrl20NFM3W0j77K4wWjtVtsLQ== 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=GUVqbegoaAbedst9IwEttr4om4QfKduQQCj3uRVe758=; b=41jwp1/h3QCD9gtt9rkHdu11OW9SYwYZe6FDyyt05GXujSj3VTEINSeF3m+QyFDDGpFugCH4OM+6X0tj26OFunNgwOfFTnBtwZHc+sa9r3NJlFQCKs9BofbU3lfOR/vwaff2xTfUtrA9yB1ShA1MczXaY9NpGf74TrUJHht8V10= Received: from DM6PR08CA0030.namprd08.prod.outlook.com (2603:10b6:5:80::43) by BN9PR12MB5242.namprd12.prod.outlook.com (2603:10b6:408:11f::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15; Sat, 27 Aug 2022 17:00:40 +0000 Received: from DM6NAM11FT101.eop-nam11.prod.protection.outlook.com (2603:10b6:5:80:cafe::18) by DM6PR08CA0030.outlook.office365.com (2603:10b6:5:80::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.19 via Frontend Transport; Sat, 27 Aug 2022 17:00:40 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by DM6NAM11FT101.mail.protection.outlook.com (10.13.172.208) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5566.15 via Frontend Transport; Sat, 27 Aug 2022 17:00:40 +0000 Received: from SATLEXMB07.amd.com (10.181.41.45) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sat, 27 Aug 2022 12:00:39 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB07.amd.com (10.181.41.45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sat, 27 Aug 2022 10:00:39 -0700 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.28 via Frontend Transport; Sat, 27 Aug 2022 12:00:33 -0500 From: Syed Saba Kareem To: , Subject: [PATCH v2 10/13] ASoC: amd: enable Pink Sardine acp6.2 drivers build Date: Sat, 27 Aug 2022 22:26:54 +0530 Message-ID: <20220827165657.2343818-11-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220827165657.2343818-1-Syed.SabaKareem@amd.com> References: <20220827165657.2343818-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4acafe1b-eee6-47ab-4617-08da884dabbb X-MS-TrafficTypeDiagnostic: BN9PR12MB5242:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FTEXyRE74hAslhxAbroZHVd2V6/fxj+eRmjR7/wXUysah0Fv/rHB9ygUw/u0euZhO77IPK4dGc3A7BDe4EiLOHYgpeSaqRYnQ3BS340QXwDfo/J4R1x9RG++H7EOf/vpfByPcq4ed7fGbJAGvczuNRtFZ52fEzIzzJHy73DJNAhhDmX9Ncxv/XiSJwFzz3tNfUV3/r88ALMuqrX60oH5wwKEgOLRuDvRxJY4QUjPViHx50/GPj+TjNKnAuxI/4VSUjWAijLEl1Z2o3iRk+qWd/+bHh84HyRaUwWwcIGA9NanWF/e7qeSCrofHiJ4TLnV5sFzmEmnodS7A8B1No8f3fGeh+JZJeHqhpZXPWnh6KYrA7gpJLMOvWa4btWt0LGGR95cRTdRhs3a+hJI8/I9JjEwXVcQXI6akAbz6T0HvnROuc2dIh+ORM9XisKdKeVpbXq041Hg1ZElU2dTR/gdqEo8K0gT8eOLBurjS2DnS1MQPReYo9D49m1tBTnTFFFtG3UdKiFPdBdQ260TepfPr729cei2tgWDw8zsd+SLv3qJbsWigaHJVp7dyi4csICU4lU8XfJKWEkCbh0yo2zitHntYE9lqR0UZAjwuQ4Gg0w1X3PYF+sgdBINFkOrlLUQOCwR89A/kC18Ks/u4x8VygpCYr1Pub2lN2RWQbLtuTTd/zM9tBY4ZrvcySPcXb46CGCMeYywsSmXWhBO5qvJq/oM8wd2Ag8DVDvWDS1pV9jAoSCZagB+kGxmJ2Pnb5BX9m931HlXNgSQdGAMUtmFxpZlbrhA1muX1a9T+e7EDEI/nx0Ey/mS/SW8bNjjMBVc 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:(13230016)(4636009)(376002)(136003)(396003)(39860400002)(346002)(46966006)(36840700001)(40470700004)(336012)(110136005)(54906003)(4326008)(70586007)(70206006)(8676002)(86362001)(36756003)(356005)(82740400003)(478600001)(81166007)(7416002)(41300700001)(5660300002)(8936002)(6666004)(82310400005)(2906002)(83380400001)(36860700001)(40460700003)(316002)(7696005)(186003)(1076003)(26005)(40480700001)(47076005)(2616005)(426003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2022 17:00:40.0445 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4acafe1b-eee6-47ab-4617-08da884dabbb 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: DM6NAM11FT101.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5242 Cc: Pierre-Louis Bossart , Sunil-kumar.Dommati@amd.com, Kai Vehmanen , Ajit Kumar Pandey , open list , Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Liam Girdwood , Bard Liao , Randy Dunlap , mario.limonciello@amd.com, Vijendar.Mukunda@amd.com, alexander.deucher@amd.com, Julian Braha , Lucas Tanure , Syed Saba Kareem X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Pink Sardine ACP6.2 drivers can be built by selecting necessary kernel config option. The patch enables build support of the same. Signed-off-by: Syed Saba Kareem Reviewed-by: Vijendar Mukunda --- sound/soc/amd/Kconfig | 10 ++++++++++ sound/soc/amd/Makefile | 1 + sound/soc/amd/ps/Makefile | 7 +++++++ 3 files changed, 18 insertions(+) create mode 100644 sound/soc/amd/ps/Makefile diff --git a/sound/soc/amd/Kconfig b/sound/soc/amd/Kconfig index 08f5289dac54..bd785a0efb67 100644 --- a/sound/soc/amd/Kconfig +++ b/sound/soc/amd/Kconfig @@ -127,3 +127,13 @@ config SND_SOC_AMD_RPL_ACP6x triggered for ACP PCI driver. Say m if you have such a device. If unsure select "N". + +config SND_SOC_AMD_PS + tristate "AMD Audio Coprocessor-v6.2 Pink Sardine support" + depends on X86 && PCI && ACPI + help + This option enables Audio Coprocessor i.e ACP v6.2 support on + AMD Pink sardine platform. By enabling this flag build will be + triggered for ACP PCI driver, ACP PDM DMA driver. + Say m if you have such a device. + If unsure select "N". diff --git a/sound/soc/amd/Makefile b/sound/soc/amd/Makefile index 0592e7c5c407..82e1cf864a40 100644 --- a/sound/soc/amd/Makefile +++ b/sound/soc/amd/Makefile @@ -18,3 +18,4 @@ obj-$(CONFIG_SND_SOC_AMD_ACP6x) += yc/ obj-$(CONFIG_SND_SOC_AMD_ACP_COMMON) += acp/ obj-$(CONFIG_SND_AMD_ACP_CONFIG) += snd-acp-config.o obj-$(CONFIG_SND_SOC_AMD_RPL_ACP6x) += rpl/ +obj-$(CONFIG_SND_SOC_AMD_PS) += ps/ diff --git a/sound/soc/amd/ps/Makefile b/sound/soc/amd/ps/Makefile new file mode 100644 index 000000000000..23afa5e32ffa --- /dev/null +++ b/sound/soc/amd/ps/Makefile @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: GPL-2.0+ +# Pink Sardine platform Support +snd-pci-ps-objs := pci-ps.o +snd-ps-pdm-dma-objs := ps-pdm-dma.o + +obj-$(CONFIG_SND_SOC_AMD_PS) += snd-pci-ps.o +obj-$(CONFIG_SND_SOC_AMD_PS) += snd-ps-pdm-dma.o From patchwork Sat Aug 27 16:56:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 12957065 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A2217ECAAD1 for ; Sat, 27 Aug 2022 17:03:30 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id F0C6584D; Sat, 27 Aug 2022 19:02:38 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz F0C6584D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1661619809; bh=OvCM8+jHAKicG03G1CLNLj2GHS0oYNFl4k+OMvwPuGQ=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=vB2OjSW3ucG4J/KDXvLe/andOrKPcxNuaajzMNj0V3uVchd26vggUGsYbJmeD7zFF GJ1t6nENDEtRSUUt9CRGGP1uhccgACv1Y3RSrNwkv70ErO1PhptZPJkEJuCirrn+oV tvgHw0aBstp4hjyKUuEvcdYC44lvjuXofeudqqzA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C5D88F8052D; Sat, 27 Aug 2022 19:01:08 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B7FB8F80563; Sat, 27 Aug 2022 19:01:07 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2047.outbound.protection.outlook.com [40.107.94.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 9C501F8057B for ; Sat, 27 Aug 2022 19:01:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9C501F8057B Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="wdwASXuQ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eL9+mNzyMA6uUwhV6Z1Fq/AYuEQGyx077PwaFNEziZM226+r9e++UgSZXjIACM72mxb2Ld/FneoQqhRmDN5MD6UIkJRe266I51Ubqm5ETvH16RcVGppuLbLgK/DQ5L171lL/pGruvS7m++peiBAaPIs8lT6p/9jposd0YFQL0wfX7lnZPJzduurWX+363Z3DBAP/5IKIeszg8Rr98H+cVxEpQfZhlii978pqcX3c5JTiIBx6woNuQS/cL3HaLA/7XqwkGXsQL1xNKOLKi/hapDFP9MGj78Jwb4fronsIKz/hikKIb/HHvHBZBQptfBXECz2cQAXYkMElim3RaVFagg== 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=uPdOrEjLaJBYDsM63g08H5HJ8KJyoqYWsQZx4mpXhG0=; b=RbrUE1C5omVxuuPrZajhQSEEMNS33yDAF3p7H2V+zalRmzWpLIN4Dv3lQIIMxjk85U0kAF1vThAevJ2AVwIKWAPXNnm0+1/EDJqMa+gHFIxh07AnESw937g2DPqzRWDGTL5yrEc1yzxWP1u3SuFtKfC69VT1WzNHdn+CXH3+a3+GSWfnwfhICqUQGCQzdx6YhajQHxiCiHDnUSbPi8X91E68dpPqDMu44UNWfal9v+UtCsy0zcXcNW9rbJvSWzO7KThK06qfGtbn7yeeCJue/9juZfKH3Ts7hZovxSnBZBmJrFIgJQdC154FMJjocqPFXAxC44Alu6YjANSsGMPLLw== 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=uPdOrEjLaJBYDsM63g08H5HJ8KJyoqYWsQZx4mpXhG0=; b=wdwASXuQ1kjqTy+uiXntdbHDyyC7Wt2F1Apd3UUdTY8YOsoAKb7LYQ4rIPQjf10BmJnplbJ4Ziq6PH7h0oQziAwf0J55tJhyXkE8Z3RPvu8NXetTITwHEY0+gqjjCjeenVvnjDklqIqUwq9qFvlgFjl0e03WGXJXJ0Tcn6AoVLU= Received: from BN9PR03CA0656.namprd03.prod.outlook.com (2603:10b6:408:13b::31) by PH8PR12MB7351.namprd12.prod.outlook.com (2603:10b6:510:215::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.19; Sat, 27 Aug 2022 17:00:50 +0000 Received: from BN8NAM11FT070.eop-nam11.prod.protection.outlook.com (2603:10b6:408:13b:cafe::b8) by BN9PR03CA0656.outlook.office365.com (2603:10b6:408:13b::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.14 via Frontend Transport; Sat, 27 Aug 2022 17:00: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=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT070.mail.protection.outlook.com (10.13.177.50) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5566.15 via Frontend Transport; Sat, 27 Aug 2022 17:00:48 +0000 Received: from SATLEXMB07.amd.com (10.181.41.45) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sat, 27 Aug 2022 12:00:47 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB07.amd.com (10.181.41.45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sat, 27 Aug 2022 10:00:47 -0700 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.28 via Frontend Transport; Sat, 27 Aug 2022 12:00:44 -0500 From: Syed Saba Kareem To: , Subject: [PATCH v2 11/13] ASoC: amd: create platform device for acp6.2 machine driver Date: Sat, 27 Aug 2022 22:26:55 +0530 Message-ID: <20220827165657.2343818-12-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220827165657.2343818-1-Syed.SabaKareem@amd.com> References: <20220827165657.2343818-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9e475aaa-04e3-4493-b635-08da884db09a X-MS-TrafficTypeDiagnostic: PH8PR12MB7351:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LEybCL12TcXbIANlm7qlx8tiXJewdNcrDJbrbzCdaRraQuXyPSFkeOsERTNe0UWwekpB3GGcIj8qKiHWhS5Z5EF0YEHyQPuIFqps/Jcy+W2m6jT/AP/nKDwMR5xHz4J4fZZa05ZnhpPC/v7kaKTq19hfoMoRo56Oe4TYuZzbpvatLPoUoH8ROcXoQHvynhPx49PSJsn43/sBFTqRChdWR6u7Vixz5sKjv3uFLAz7n1BDMQaLnUzGzdB0AiWb7PV+IsjhbV37qipjYH/I7og/TsoVw2/OcRHqXi4PDsnX84sP4odjW6fbZ8R0uFdA4CnPmGyGiysMBpQLaJ+uzPsTeYbmaoyDJ4dVYbx+H0m6+Sn9O5baaEdRBsXFqkWBeXEk07Kta/lKkAZugEiuSs1CINVx9DDhxu1YzuewOU8RUvyiMHyzaf2R1BWV/918BQ3IfAOW2lL96010hvzYgYQENJJo9olmAC8ElQVvGti50DkvEM1Fzj25EvWuPjE76UEuIxT4Vwkh/4GPxNpt5+bELzCxqjXZHkgNwP0kJAvxD48SpPh3DsSGrnafJImsKF1nIU4gWmshzCnT+4jBfIiHi4tvGHwO4MOC5UCB4i8Y9xrCOdkVjUKhlgrdVB5JkukqLAh+18sdIy09O4+rzrn+IxnvOxEY060N90IHPl+m2lKL2dAMxXOh2Z8og7B979VWy6lAoI8kzKSyLK0mZIN1UY927Ab7rxcDDPaTmicG8svcYrjVOwA7Gxt7dv5vAoSouW6rU57/JRX7v5YKJspPKt9FRIxqKtMyRM1i+OePMUnbiqqMx8YYXYlHqcSjhXhX 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:(13230016)(4636009)(39860400002)(376002)(396003)(136003)(346002)(46966006)(36840700001)(40470700004)(356005)(478600001)(82740400003)(81166007)(4326008)(8676002)(70206006)(70586007)(36860700001)(86362001)(316002)(36756003)(83380400001)(47076005)(426003)(336012)(186003)(1076003)(26005)(6666004)(7696005)(41300700001)(40460700003)(82310400005)(110136005)(54906003)(40480700001)(2616005)(2906002)(5660300002)(8936002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2022 17:00:48.2353 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9e475aaa-04e3-4493-b635-08da884db09a 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: BN8NAM11FT070.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB7351 Cc: Sunil-kumar.Dommati@amd.com, open list , Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Liam Girdwood , mario.limonciello@amd.com, Vijendar.Mukunda@amd.com, alexander.deucher@amd.com, Syed Saba Kareem X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Create platform device for acp6.2 machine driver. Signed-off-by: Syed Saba Kareem Signed-off-by: Vijendar Mukunda --- sound/soc/amd/ps/acp62.h | 2 +- sound/soc/amd/ps/pci-ps.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/sound/soc/amd/ps/acp62.h b/sound/soc/amd/ps/acp62.h index 89ff14007e5c..75a07445e44b 100644 --- a/sound/soc/amd/ps/acp62.h +++ b/sound/soc/amd/ps/acp62.h @@ -10,7 +10,7 @@ #define ACP_DEVICE_ID 0x15E2 #define ACP6x_REG_START 0x1240000 #define ACP6x_REG_END 0x1250200 -#define ACP6x_DEVS 2 +#define ACP6x_DEVS 3 #define ACP6x_PDM_MODE 1 #define ACP_SOFT_RESET_SOFTRESET_AUDDONE_MASK 0x00010001 diff --git a/sound/soc/amd/ps/pci-ps.c b/sound/soc/amd/ps/pci-ps.c index 075d9a23205d..dff2e2376bbf 100644 --- a/sound/soc/amd/ps/pci-ps.c +++ b/sound/soc/amd/ps/pci-ps.c @@ -233,6 +233,10 @@ static int snd_acp62_probe(struct pci_dev *pci, pdevinfo[1].id = 0; pdevinfo[1].parent = &pci->dev; + pdevinfo[2].name = "acp_ps_mach"; + pdevinfo[2].id = 0; + pdevinfo[2].parent = &pci->dev; + for (index = 0; index < ACP6x_DEVS; index++) { adata->pdev[index] = platform_device_register_full(&pdevinfo[index]); From patchwork Sat Aug 27 16:56:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 12957066 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BF32FECAAD1 for ; Sat, 27 Aug 2022 17:03:48 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 0688386E; Sat, 27 Aug 2022 19:02:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0688386E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1661619827; bh=cyor6tWthoEO11hrB8lgvNfkmbe5AWrf4BcdWbI6QNY=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=JkSV3j0IsOQFOqsKM7iEzAB6pCtIwOxhr0vL981Pt32oTcTJ6sLnqWPwFyc6f5Vli td8RNI4qfMiYq7pIstI962mMUarvdPy5mvdzijiz+fj/emG+Ur0jOEVpdYWYqtgpEp B2LoXe/h6On74GKhPdaHMQUhwQwEPlCFEzaadgI4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 633B6F8057C; Sat, 27 Aug 2022 19:01:11 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3AF2FF8057B; Sat, 27 Aug 2022 19:01:10 +0200 (CEST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1anam02on2069.outbound.protection.outlook.com [40.107.96.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id F32A1F80549 for ; Sat, 27 Aug 2022 19:01:03 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz F32A1F80549 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="V856GmCk" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JN/OOAUoBa5vMyT7BYQzvJ7ujV4N20P9XAviWju9eOJgz1NCaC3uw2MSJWqhKrhcYVT3a0YHRGj7+0koInpsHRlgF3veIx+zXfMD5RrGGx+Zt2fVw0ETcbTByiXn6LtZEy5DfmIytbBIzFiCcOL8RRa3XN0hqEyjM2nHiiueCFgcP+JXIpuay2KSiUzLSrzYggf4xJY5qzdb3zGMmm8m/NpS+DCYCEi5FExEgnObfz+1bQfBUVQ+sjARnYdP/oR5cx8Vn9YAFQH81Wqbu3wP1Y0cGJA7VLB3GpsW7MbE6NgsO2ZE14qTItv8L53cHN8r7JKdny3QeAvu3U1iSp4Gyw== 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=lWsqTp3JjopfvN6pja74ulXjVHjiAtsPGjew8/PpDO4=; b=TXKIB5e0Oc48OORPA8UHI9jS/XkUxWYdKF8ZQA3zFg0agUEy3mKirzFQsmOo0JHI+0sXjs9nZYaam+TVbyN3BAFV+LxJ0ONps4VC0VnYojQ/INAVqVo1zHsD7dKP9KDAplZSr/Rsl3fVAaAOmVNJBYRbKuQESOMAF1W2Ft36MY9mbkPVp/lE5IXEVH1laKI6fgF3k1ng1OgIYvpQ4F7O92UDolCd8jwTWyEyMXP+9MsgGEZs3dXfID6PkQsqIW4ly+7wVvoE/zGRmrM03fT1cIMYduEI6lhVAVkOSISiVIQlybg5tbmjAOhLjU9LUNSxXVml0wWq7eSq0GhdiHbVGQ== 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=lWsqTp3JjopfvN6pja74ulXjVHjiAtsPGjew8/PpDO4=; b=V856GmCkpHTlIhg+R18A/+oGRPfvV/arumHn6RrYT60PWXTM2GMG18nrmz/VkXxmEWVvQuPTXzqjOaJkjhWNHYddObTetPDg9eaUluP4vnCw0RBm4Kfjxa95cO8/sYSS47IwkkOmYx9RUqyTuP90MiouzoJUg7IPYHqhOzeKe8Y= Received: from BN9P221CA0024.NAMP221.PROD.OUTLOOK.COM (2603:10b6:408:10a::23) by CY4PR1201MB0151.namprd12.prod.outlook.com (2603:10b6:910:1e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15; Sat, 27 Aug 2022 17:00:57 +0000 Received: from BN8NAM11FT050.eop-nam11.prod.protection.outlook.com (2603:10b6:408:10a:cafe::6e) by BN9P221CA0024.outlook.office365.com (2603:10b6:408:10a::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15 via Frontend Transport; Sat, 27 Aug 2022 17:00:57 +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 BN8NAM11FT050.mail.protection.outlook.com (10.13.177.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5566.15 via Frontend Transport; Sat, 27 Aug 2022 17:00:55 +0000 Received: from SATLEXMB08.amd.com (10.181.40.132) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sat, 27 Aug 2022 12:00:55 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB08.amd.com (10.181.40.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sat, 27 Aug 2022 10:00:55 -0700 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.28 via Frontend Transport; Sat, 27 Aug 2022 12:00:51 -0500 From: Syed Saba Kareem To: , Subject: [PATCH v2 12/13] ASoC: amd: add Pink Sardine machine driver using dmic Date: Sat, 27 Aug 2022 22:26:56 +0530 Message-ID: <20220827165657.2343818-13-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220827165657.2343818-1-Syed.SabaKareem@amd.com> References: <20220827165657.2343818-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 83020c03-326f-43b7-baaf-08da884db521 X-MS-TrafficTypeDiagnostic: CY4PR1201MB0151:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8B1hRD28cFULcBCxEBQ89SukpDwBaxDa6LV9AvjaJdyiHlUOS5+7JfFNVvzvP7V2cUCt/IPyKU1oB7Ebwoc8ax7+EqWxwBiyqzHextjoq4aEaRmaQCGQNO/04oYT/Iydm94YkjZQI9lD9g58tOicR17jvaf4U8Hy7NzWpqeycYkSSUqUWhgFdY8HTTq1nBbAwi7U24VEEd3L3nJTdOYUU4tkeEUNrXK2OAJUsYh7XQl//jPByQhXHlv8ujYcsufLEyVLblAxe5C/ReWfHG3t5Mis60T/lOMGVaui/t98RdsbWR5cNMoEjdz2ZXkFXzHKXntqiFnwPhkqCXJJNKzsWarotwio24gY4axVEFV5ySmQMIc/STSNLLYSVKh58oSl4zUXQdOdANZL9MNEg4piMPoV6Hx2adMZMOT4QTF+jnHMlzftcnZoVvtkyb1AmrRkDIu9nIFtRJUrjceKTVigSEWcGJbDdhQ+ouLS8xU13/37SGQKDFtLSnjyC3c0dNHSfrCeeWGSB241MQ1PHNlmQl+E6iXqWMh7q8Fvbi1e2yDmJ1/IeEsHmABPbDIgYuXqpWLdQSjVHKpFT+Ep6DBxaUi2Tb0Cwv3Odfzm3WhKfJNiMmP0e59ljdxs4s3gsYx5hclTtmuDMWQ2FSalYXWyNPdGqOwPlIu0FGnDBeSfduz/F4clD9OJKkCURIaICyAfMSc/rZJXs6tp68aACNvzdfeMQD90vje3G8/yCXzSHQvpHJ0/Oauj1MMksvV/qvXuPpTRQNl0FRmBbGAsE4Boo93EG4rJSIEz/popJTkVVm8= 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:(13230016)(4636009)(396003)(136003)(39860400002)(346002)(376002)(36840700001)(40470700004)(46966006)(82310400005)(36860700001)(40480700001)(86362001)(478600001)(356005)(82740400003)(70586007)(81166007)(8676002)(40460700003)(70206006)(8936002)(41300700001)(110136005)(5660300002)(54906003)(4326008)(316002)(1076003)(336012)(186003)(2616005)(47076005)(426003)(7696005)(26005)(2906002)(36756003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2022 17:00:55.8467 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 83020c03-326f-43b7-baaf-08da884db521 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: BN8NAM11FT050.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1201MB0151 Cc: Sunil-kumar.Dommati@amd.com, open list , Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Liam Girdwood , mario.limonciello@amd.com, Vijendar.Mukunda@amd.com, alexander.deucher@amd.com, Syed Saba Kareem X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Add Pink Sardine platform machine driver using dmic. Signed-off-by: Syed Saba Kareem Reviewed-by: Vijendar Mukunda --- sound/soc/amd/ps/ps-mach.c | 79 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 sound/soc/amd/ps/ps-mach.c diff --git a/sound/soc/amd/ps/ps-mach.c b/sound/soc/amd/ps/ps-mach.c new file mode 100644 index 000000000000..b3e97093481d --- /dev/null +++ b/sound/soc/amd/ps/ps-mach.c @@ -0,0 +1,79 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Machine driver for AMD Pink Sardine platform using DMIC + * + * Copyright 2022 Advanced Micro Devices, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "acp62.h" + +#define DRV_NAME "acp_ps_mach" + +SND_SOC_DAILINK_DEF(acp62_pdm, + DAILINK_COMP_ARRAY(COMP_CPU("acp_ps_pdm_dma.0"))); + +SND_SOC_DAILINK_DEF(dmic_codec, + DAILINK_COMP_ARRAY(COMP_CODEC("dmic-codec.0", + "dmic-hifi"))); + +SND_SOC_DAILINK_DEF(pdm_platform, + DAILINK_COMP_ARRAY(COMP_PLATFORM("acp_ps_pdm_dma.0"))); + +static struct snd_soc_dai_link acp62_dai_pdm[] = { + { + .name = "acp62-dmic-capture", + .stream_name = "DMIC capture", + .capture_only = 1, + SND_SOC_DAILINK_REG(acp62_pdm, dmic_codec, pdm_platform), + }, +}; + +static struct snd_soc_card acp62_card = { + .name = "acp62", + .owner = THIS_MODULE, + .dai_link = acp62_dai_pdm, + .num_links = 1, +}; + +static int acp62_probe(struct platform_device *pdev) +{ + struct acp62_pdm *machine = NULL; + struct snd_soc_card *card; + int ret; + + platform_set_drvdata(pdev, &acp62_card); + card = platform_get_drvdata(pdev); + acp62_card.dev = &pdev->dev; + + snd_soc_card_set_drvdata(card, machine); + ret = devm_snd_soc_register_card(&pdev->dev, card); + if (ret) { + return dev_err_probe(&pdev->dev, ret, + "snd_soc_register_card(%s) failed\n", + card->name); + } + + return 0; +} + +static struct platform_driver acp62_mach_driver = { + .driver = { + .name = "acp_ps_mach", + .pm = &snd_soc_pm_ops, + }, + .probe = acp62_probe, +}; + +module_platform_driver(acp62_mach_driver); + +MODULE_AUTHOR("Syed.SabaKareem@amd.com"); +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRV_NAME); From patchwork Sat Aug 27 16:56:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 12957067 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 27D02ECAAD1 for ; Sat, 27 Aug 2022 17:04:15 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 777DA850; Sat, 27 Aug 2022 19:03:23 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 777DA850 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1661619853; bh=8L/jS3VWht9BhyWJ1vQ2YkA9QgJHIIllucnBmB/CYsI=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=MYdKcegcd7jMqEMmP0zSmJfMeAAg5lo5ybc7mobMqJ2N6CtETB7v7EHwzfOEEffPZ hEkofeEdf2OR/NZpuQWyTwZJ4WGfR5bm+4eJN5poah62Ieiv5UdkpUO8Ez4BObstn9 nUPb18jGB1qFGBRCxMqtpwfgyR7NpYjaaTkg9oyc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 83807F80551; Sat, 27 Aug 2022 19:01:22 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id CFD89F80551; Sat, 27 Aug 2022 19:01:20 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2055.outbound.protection.outlook.com [40.107.94.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 31176F80526 for ; Sat, 27 Aug 2022 19:01:13 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 31176F80526 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="iCT32Rp9" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Zj9pq72ZRAUJkl5l4IK6zdVB9m4U7cpQL7sBTL52XE0UnsjnM0MKe+5Sn56/0++Nr1cYVf0opWYHwJ2P9otQLtrp9QUEDaQoo06B7pPvG2kfuXRR0uW/V1DdMQOBOqxmHjrn+SI/1sE2T3z9leYkMtKV0w8K7HPQbiUXHcPkGhgMFNXRZQ2+S9fcX2aijzjJUd2O4XJSS3ZuujMzrJieg6IQmu7NiX6GaRSrRj/TiSawWdCEQPHK99sRKb5HjSBksp3n3XkyphUNP9kbCUjNFa9q9ermlf7CkTR9d3lnneDNKyjFdiodmmhG5FhVYSFQy7nJiN1cl1hXtHtC6O/2sQ== 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=Lz7OJOfGf4ps/Au4KkYHj79h5U+ZA7XRPNKk8EuGins=; b=EbkQuI0lfujfqwxX8AjQeSyT3z00w/HAdGZuPZnb2AWHFu3VlW2QauuLBLUHFUnGIf+giVICTitUljl3pZsG60JsjP2RAeGMzBdH+m7eIo/V8rvwApSaU5PRZhFhZHVJAQNRpNjOE+0vNbpQCrJlnqzQQH+Lsjnk9zYmZbQZ4xa/wH9c8YpwxWS9/lUKLBobdCDBXnCkUXt+hJaqn21rWxXnah57IGXXRB5yW9weFnhLf4S47QiyGlOZ5c0+MiAkp5JhAS+fZtQiQUDdeiQ1ZQNH1Jor3bSLvaeh2evKpon9QiKAOUJNNaaxBhdtEFUXvd23rUETomSIIwDshlupMw== 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=Lz7OJOfGf4ps/Au4KkYHj79h5U+ZA7XRPNKk8EuGins=; b=iCT32Rp9mdAtPdn4hzNAbQYeexGccwjphoAHR2003C8Xzu9ozORaWbyWmfQEFqo5xpFqBNzR5daZ4uUrmtGh6JRl0zlZSCKSaJD8rW8kqVHf5nD7XuzvXs+bpkyXv064Xf/sG0D7iLq013gbJ/vXWYzhNu0p0Ew+7TgHMGJxTSg= Received: from BN0PR04CA0193.namprd04.prod.outlook.com (2603:10b6:408:e9::18) by BN8PR12MB2977.namprd12.prod.outlook.com (2603:10b6:408:4a::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.19; Sat, 27 Aug 2022 17:01:04 +0000 Received: from BN8NAM11FT005.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e9:cafe::1e) by BN0PR04CA0193.outlook.office365.com (2603:10b6:408:e9::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.16 via Frontend Transport; Sat, 27 Aug 2022 17:01:04 +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 BN8NAM11FT005.mail.protection.outlook.com (10.13.176.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5566.15 via Frontend Transport; Sat, 27 Aug 2022 17:01:04 +0000 Received: from SATLEXMB07.amd.com (10.181.41.45) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sat, 27 Aug 2022 12:01:03 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB07.amd.com (10.181.41.45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sat, 27 Aug 2022 10:01:03 -0700 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.28 via Frontend Transport; Sat, 27 Aug 2022 12:00:58 -0500 From: Syed Saba Kareem To: , Subject: [PATCH v2 13/13] ASoC: amd: enable Pink sardine platform machine driver build. Date: Sat, 27 Aug 2022 22:26:57 +0530 Message-ID: <20220827165657.2343818-14-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220827165657.2343818-1-Syed.SabaKareem@amd.com> References: <20220827165657.2343818-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 883ce161-ab42-4f2f-d7c6-08da884dba1d X-MS-TrafficTypeDiagnostic: BN8PR12MB2977:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: V/zL/YW+ScawkQ4ZeABpX0DNj3RmgmmbEdWPpX0fIm2yCTdvCHfK9kAmMAk65gRe1/8V8nrCE2EJfbeuDtbVjvCAkGoxPOd2+BKstxcdTNDONUfaLYgya5xY0MKmanFHQ7F6h527XabgbbOwsIMzAUuOgFgSGQNN4NRmZSWyeJoIugtWkUTbb/RsHOzisMT6L10ArSlQYK60OpA4YobNcS7zDLXNm8svhmYEO4JGTVUx1amR/vHD7yekeRmQwC3VQgdM924awc9AcgqdIf8yXNN6fX0gSPyoe9KUfl095SyLnRHB1ZqwNlV0gpiBTqOA/7IaxvVhPcLA/kn0NqqWtpk5YKKgxX4k5TJumEQ0JUZI/fP6EDZPtRlykHt/rP9dv+IB00uYbrEIrLtAoJoRlFTbKy8kktGr0BHC6peKBWlosNdIAcgVvAq/j1qiBwfs/hyC1GwFiKlIx7w0ADhkEIzaI4GPqoX+xeKWgcUfuLWc/UUdt9yl5d3iHdqM2C0m384o02z9eckIuUT4f4Y7vcTzW5BnA74GtZW2wJV5gfUT+3NYPEER8IPD627cn45aPHyAXIzLXGmfQcXdIGqW1M8uOZduDwK5Wyzp1xJqqbICQiuzByeXLcj//CV616UzUAVTigabQDkn0IVWCvRdJ87x+mWYwGiE+JZe00mRAoTQ2+djCUU6wVGP0kLQbMLFKRw/C+XfDh8JvMvIf7b59/8lFaQ4SkDhbfIqwcozGhxaM+Oj+q1CEZPLarLo1GiBU6J6ckdmWBTC/TKfAQNkU6QEL/94s2cAfxwY2pyfsbOGv0M0KrGou6rswtcWL+5v 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:(13230016)(4636009)(39860400002)(136003)(396003)(376002)(346002)(46966006)(40470700004)(36840700001)(83380400001)(36860700001)(82740400003)(81166007)(356005)(5660300002)(316002)(110136005)(7416002)(8936002)(70206006)(54906003)(8676002)(70586007)(4326008)(1076003)(2906002)(47076005)(426003)(336012)(186003)(2616005)(41300700001)(478600001)(7696005)(40460700003)(26005)(82310400005)(40480700001)(86362001)(36756003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2022 17:01:04.2098 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 883ce161-ab42-4f2f-d7c6-08da884dba1d 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: BN8NAM11FT005.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB2977 Cc: Pierre-Louis Bossart , Sunil-kumar.Dommati@amd.com, Lucas Tanure , Ajit Kumar Pandey , open list , Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Liam Girdwood , Randy Dunlap , mario.limonciello@amd.com, Vijendar.Mukunda@amd.com, alexander.deucher@amd.com, Julian Braha , Syed Saba Kareem X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" This patch enables Pink Sardine platform machine driver build. Signed-off-by: Syed Saba Kareem Reviewed-by: Vijendar Mukunda --- sound/soc/amd/Kconfig | 11 +++++++++++ sound/soc/amd/ps/Makefile | 2 ++ 2 files changed, 13 insertions(+) diff --git a/sound/soc/amd/Kconfig b/sound/soc/amd/Kconfig index bd785a0efb67..68837d42736d 100644 --- a/sound/soc/amd/Kconfig +++ b/sound/soc/amd/Kconfig @@ -137,3 +137,14 @@ config SND_SOC_AMD_PS triggered for ACP PCI driver, ACP PDM DMA driver. Say m if you have such a device. If unsure select "N". + +config SND_SOC_AMD_PS_MACH + tristate "AMD PINK SARDINE support for DMIC" + select SND_SOC_DMIC + depends on SND_SOC_AMD_PS + help + This option enables machine driver for Pink Sardine platform + using dmic. ACP IP has PDM Decoder block with DMA controller. + DMIC can be connected directly to ACP IP. + Say m if you have such a device. + If unsure select "N". diff --git a/sound/soc/amd/ps/Makefile b/sound/soc/amd/ps/Makefile index 23afa5e32ffa..383973a12f6a 100644 --- a/sound/soc/amd/ps/Makefile +++ b/sound/soc/amd/ps/Makefile @@ -2,6 +2,8 @@ # Pink Sardine platform Support snd-pci-ps-objs := pci-ps.o snd-ps-pdm-dma-objs := ps-pdm-dma.o +snd-soc-ps-mach-objs := ps-mach.o obj-$(CONFIG_SND_SOC_AMD_PS) += snd-pci-ps.o obj-$(CONFIG_SND_SOC_AMD_PS) += snd-ps-pdm-dma.o +obj-$(CONFIG_SND_SOC_AMD_PS_MACH) += snd-soc-ps-mach.o