From patchwork Mon May 22 13:31:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 97443 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1464326vqo; Mon, 22 May 2023 06:51:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5PhIgq01mMv7N0x0lE3QFoy3PlxP9L7lB3yiz5Z8WnSl2vkwdGchgQXyMtc3wyqAq0yOyJ X-Received: by 2002:a05:6a20:8f05:b0:10c:49e:6c67 with SMTP id b5-20020a056a208f0500b0010c049e6c67mr1558196pzk.33.1684763512612; Mon, 22 May 2023 06:51:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1684763512; cv=pass; d=google.com; s=arc-20160816; b=QhC/qqzcgP/YEM+uExRF25HSPHpRaiYFz/e4CxLhL3EemY+aC0di0WrVnnQ/iX3Bf6 Cn+ToPMHJnvZ0YJ5WgAgNRF3MjrCifhrxhp+lH7MvZEng2vVwfZ4xcPJUI3Y8cxgDvtb YkMOifC08D6A+B8e0mGXB/f9jj4X3zdTOst5dxeycq+HxXewhoUBVwLF55tklmGeksS9 M0TbTlhkEJJUYzpRKo0M4pAd08nfUDJCnm28LgzodcV0GDYFAA/4dh925mx0rfTBW8mH 9iqrD/ggJPcdWh6X/GNqmhpNMI7XbNXhRQpwyB3EYWRv4cqC7lc/6rQlJ9ufD2i0fqGg oYlQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dFjgBf5rzC2g499HzD32HCzf4G5YJ746PChmBWX7gi0=; b=ywOtmkuxGeCdsV3zQtCQkYKDQZ/gONVic4UlQ8DxTNL1+zTAYZCMsYdHetXG4D566u IkyQYS8Oge6oMQtusdnoVA23bcpaqLJ2z18fkIXbwukufuhfPvTTmRIc/NZF0doSNLgU FEZcfMxrr1ChgfJZPbojmPu8UzIAKe4kVZw2CTteAZiH3ij1GX+CSJVmDxtHe7EeMFEH D+dIqI3C259eto2xbNgCL+83TVbI3CtPf8shg1PB9uAlIxPQU7sZtOU8N1nxomA+krJI PcKqJPP6IQrymKNeWDtnlYNEY5zuOHGHrjyryww+ZkRDxbmqpEXS7FzMtJVtwgy9jwZP YjHg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=arWoSQvF; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o25-20020aa79799000000b0064cc2c0c815si4744091pfp.396.2023.05.22.06.51.36; Mon, 22 May 2023 06:51:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=arWoSQvF; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233555AbjEVN0m (ORCPT + 99 others); Mon, 22 May 2023 09:26:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233781AbjEVN0j (ORCPT ); Mon, 22 May 2023 09:26:39 -0400 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2056.outbound.protection.outlook.com [40.107.101.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9803B7 for ; Mon, 22 May 2023 06:26:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U4VKEGISxigXoueGEE4CZfyhP93sg+ncDgcRHWwDh8zEa7+D2I23D3XxZW6IZA7V7clxM+j6dnuhe6KfScOxalAErQ3wo59a23ntaIuYIfi+hSisAuqkQ+JgrjAQWfqnF45/EjM6MYqg+pRQ7c4Nr9kGyfB/zHiWCvu2ra1HSqWgiNnxIaghR+Or6PfQXb9q6HthbcfsB8NwwcBrCpAVTa/OPQ2pp3nygGvaMVGiqhbK61GkF2y1fUUMVLB+lt+vRXR1jwZHkhviZG0BR/cONp1winesb59w10Y3sJNvEJyXzFqGflSXIOLquzZxg/M53djioDpd3Cp89jrEbK7G8A== 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=dFjgBf5rzC2g499HzD32HCzf4G5YJ746PChmBWX7gi0=; b=Lo0bmP4r3DspH7JfVve4cNK/GHipjvpnllx2SuAEaX44XW6CZNgiOR4VR/70ZLBpQirdF9ADaMPUV6dwafyeiVWdGH6m6faIggnwJ8OFslp5zC/HhG1iuSONJqGfDKgj/IM5I0MIftoomwEjfQgYTknld3XZeeSTDMawsof/6CroggsTrGzM10WaammyczV3tcGW8wntZ27rbJToCb/+EZNBRTzkpfQ1CKz1m6LwiMdfFEFrEBlSzntyYDfzZkzFuX6BaQr2NvLH0YZS/j84SGoHIn4ai/1JuOT74IJO6++zxrgXVE2l19aKyrAs6BWEND/EzpvmmkIJYZbNGMoMNg== 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=dFjgBf5rzC2g499HzD32HCzf4G5YJ746PChmBWX7gi0=; b=arWoSQvFHMQgasyy1VSu2yG8QqA7TT3pMFAEOF/6XxHWKueDq0u8aRsHnTRJAI2NLXtRWTF14ZWyL/qlMcXjlOfqey+qMKEl6TYTeug6sTC3dj/be9j8N07rUH87vzKk8eccuGUkGo2E/GxijJo2FP3iUy63BnCti3lSQwZyi9I= Received: from MW4PR03CA0297.namprd03.prod.outlook.com (2603:10b6:303:b5::32) by PH7PR12MB5974.namprd12.prod.outlook.com (2603:10b6:510:1d9::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28; Mon, 22 May 2023 13:26:27 +0000 Received: from CO1NAM11FT056.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b5:cafe::3b) by MW4PR03CA0297.outlook.office365.com (2603:10b6:303:b5::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28 via Frontend Transport; Mon, 22 May 2023 13:26:27 +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 CO1NAM11FT056.mail.protection.outlook.com (10.13.175.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6411.28 via Frontend Transport; Mon, 22 May 2023 13:26:27 +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.34; Mon, 22 May 2023 08:26:26 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 22 May 2023 08:26:22 -0500 From: Vijendar Mukunda To: CC: , , , , , , , Vijendar Mukunda , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Syed Saba Kareem , open list Subject: [PATCH V2 1/9] ASoC: amd: ps: create platform devices based on acp config Date: Mon, 22 May 2023 19:01:14 +0530 Message-ID: <20230522133122.166841-2-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230522133122.166841-1-Vijendar.Mukunda@amd.com> References: <20230522133122.166841-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT056:EE_|PH7PR12MB5974:EE_ X-MS-Office365-Filtering-Correlation-Id: 851364de-1f68-45ac-ca51-08db5ac82592 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SSVqcerr4Tvns3yMEKCFd/YAQAIeGmd74HCeNPBoZ8IpKUZhaWj+vhK/wuBH1v2QWg/gOUjJuGrA/DRlUxcUnqTxJ4rTpJcfvbIX0/ZSjgl99nrt0o18hropRseEwprxTXjf+sjwm0IjRKRwZo++9deyVb5uYUKUcuwhUi7QAlz7NElUIpFepV/o0IqLS7lNChWtY35kVHePescLSegqygwdnjevt0doLWYBfAEX7De8w+I6HCdg7teuke0lWEFSmzCtAKBqppnsNruxw0CPYhaPWMIBb+p9CbRXWBgb8qA/GumOzTiV8k/NclDEkj9tstk7VrCCOyZBRBb7pxK7iW8QY/UHaUzG0sj3oQyA7PPKuxctmeEMdNw0ANyAf30aZZ0ds636qtpHptVC08+T9AE1/eC1FAPh/6d+ZZQzKLI4GDrAmidjUD7Hmb8eiPb7/1XT0Dc/0k4A37CT3mF+X/9WObFnbjizSIXhYEtMnfCUi8hgNHTngnPxJmtERTwFsgGgIfqnyJwPAeiwEPgot6bTW89y5vj4XDqRSmP+Xl3z5JID+wf8TjK+jQdx7td3OaChObinAMKZUUTpcremEBKN1B79OoJLc0F5NVkzqwZmneNVaXX4BxsRwZeB+oZL0AZ3HZkDNxlaWo+oQE2NeaRTGJkBDzZ8/dTZqfxb1lLRumMxQCYEwpeqcEcfbTiGKRGbSyPUdG+kQlooV5k32pjCYwIwdQI8ctS+/bkN0Z0dbvxQFIhmEn2WLkaw0r5aUUpoRYg+Xzl5wNnLxbAFpw== 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:(13230028)(4636009)(376002)(39860400002)(136003)(346002)(396003)(451199021)(46966006)(36840700001)(40470700004)(478600001)(82740400003)(356005)(81166007)(82310400005)(4326008)(70586007)(70206006)(6916009)(54906003)(6666004)(36860700001)(47076005)(83380400001)(7696005)(316002)(41300700001)(336012)(426003)(40460700003)(2616005)(40480700001)(86362001)(8936002)(5660300002)(8676002)(36756003)(186003)(30864003)(26005)(2906002)(1076003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2023 13:26:27.1987 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 851364de-1f68-45ac-ca51-08db5ac82592 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: CO1NAM11FT056.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5974 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766602584788050365?= X-GMAIL-MSGID: =?utf-8?q?1766602584788050365?= Based on ACP pin configuration and scanning child devices under ACP pci device ACPI scope, platform device mask(pdev_mask) and platform device count(pdev_count) will be calculated. Using pdev_mask and pdev_count values, ACP PCI driver will create platform devices for Pink Sardine platform. Signed-off-by: Vijendar Mukunda --- sound/soc/amd/ps/acp63.h | 81 +++++++++++- sound/soc/amd/ps/pci-ps.c | 252 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 318 insertions(+), 15 deletions(-) diff --git a/sound/soc/amd/ps/acp63.h b/sound/soc/amd/ps/acp63.h index 2f94448102d0..95bb1cef900a 100644 --- a/sound/soc/amd/ps/acp63.h +++ b/sound/soc/amd/ps/acp63.h @@ -10,7 +10,7 @@ #define ACP_DEVICE_ID 0x15E2 #define ACP63_REG_START 0x1240000 #define ACP63_REG_END 0x1250200 -#define ACP63_DEVS 3 +#define ACP63_DEVS 5 #define ACP_SOFT_RESET_SOFTRESET_AUDDONE_MASK 0x00010001 #define ACP_PGFSM_CNTL_POWER_ON_MASK 1 @@ -53,11 +53,38 @@ /* time in ms for runtime suspend delay */ #define ACP_SUSPEND_DELAY_MS 2000 -#define ACP63_DMIC_ADDR 2 -#define ACP63_PDM_MODE_DEVS 3 -#define ACP63_PDM_DEV_MASK 1 #define ACP_DMIC_DEV 2 +/* ACP63_PDM_MODE_DEVS corresponds to platform devices count for ACP PDM configuration */ +#define ACP63_PDM_MODE_DEVS 3 + +/* + * ACP63_SDW0_MODE_DEVS corresponds to platform devices count for + * SW0 SoundWire manager instance configuration + */ +#define ACP63_SDW0_MODE_DEVS 2 + +/* + * ACP63_SDW0_SDW1_MODE_DEVS corresponds to platform devices count for SW0 + SW1 SoundWire manager + * instances configuration + */ +#define ACP63_SDW0_SDW1_MODE_DEVS 3 + +/* + * ACP63_SDW0_PDM_MODE_DEVS corresponds to platform devices count for SW0 manager + * instance + ACP PDM controller configuration + */ +#define ACP63_SDW0_PDM_MODE_DEVS 4 + +/* + * ACP63_SDW0_SDW1_PDM_MODE_DEVS corresponds to platform devices count for + * SW0 + SW1 SoundWire manager instances + ACP PDM controller configuration + */ +#define ACP63_SDW0_SDW1_PDM_MODE_DEVS 5 +#define ACP63_DMIC_ADDR 2 +#define ACP63_SDW_ADDR 5 +#define AMD_SDW_MAX_MANAGERS 2 + /* time in ms for acp timeout */ #define ACP_TIMEOUT 500 @@ -80,6 +107,28 @@ enum acp_config { ACP_CONFIG_15, }; +/** + * acp_pdev_mask corresponds to platform device mask based on audio endpoint combinations. + * acp_pdev_mask will be calculated based on ACPI Scan under ACP PCI device and + * ACP PIN Configuration. + * Based acp_pdev_mask, platform devices will be created. + * Below are possible platform device combinations. + * 1) ACP PDM Controller, dmic-codec, machine driver platform device node + * 2) ACP PDM Controller , dmic-codec, SW0 SoundWire manager instance, platform device for + * SoundWire DMA driver + * 3) SW0, SW1 SoundWire manager instances, platform device for SoundWire DMA driver + * 4) ACP PDM Controller, dmic-codec, SDW0, SDW1 manager instances, platform device for + * SoundWire DMA driver + * ACP63_PDM_DEV_MASK corresponds to platform device mask for ACP PDM controller. + * ACP63_SDW_DEV_MASK corresponds to platform device mask for SDW manager instances. + * ACP63_SDW_PDM_DEV_MASK corresponds to platform device mask for ACP PDM + SDW manager combination + */ +enum acp_pdev_mask { + ACP63_PDM_DEV_MASK = 1, + ACP63_SDW_DEV_MASK, + ACP63_SDW_PDM_DEV_MASK, +}; + struct pdm_stream_instance { u16 num_pages; u16 channels; @@ -95,14 +144,38 @@ struct pdm_dev_data { struct snd_pcm_substream *capture_stream; }; +/** + * struct acp63_dev_data - acp pci driver context + * @acp63_base: acp mmio base + * @res: resource + * @pdev: array of child platform device node structures + * @acp_lock: used to protect acp common registers + * @sdw_fw_node: SoundWire controller fw node handle + * @pdev_mask: platform device mask + * @pdev_count: platform devices count + * @pdm_dev_index: pdm platform device index + * @sdw_manager_count: SoundWire manager instance count + * @sdw0_dev_index: SoundWire Manager-0 platform device index + * @sdw1_dev_index: SoundWire Manager-1 platform device index + * @sdw_dma_dev_index: SoundWire DMA controller platform device index + * @acp_reset: flag set to true when bus reset is applied across all + * the active SoundWire manager instances + */ + struct acp63_dev_data { void __iomem *acp63_base; struct resource *res; struct platform_device *pdev[ACP63_DEVS]; struct mutex acp_lock; /* protect shared registers */ + struct fwnode_handle *sdw_fw_node; u16 pdev_mask; u16 pdev_count; u16 pdm_dev_index; + u8 sdw_manager_count; + u16 sdw0_dev_index; + u16 sdw1_dev_index; + u16 sdw_dma_dev_index; + bool acp_reset; }; int snd_amd_acp_find_config(struct pci_dev *pci); diff --git a/sound/soc/amd/ps/pci-ps.c b/sound/soc/amd/ps/pci-ps.c index c957718abefc..02caae6968ad 100644 --- a/sound/soc/amd/ps/pci-ps.c +++ b/sound/soc/amd/ps/pci-ps.c @@ -6,6 +6,7 @@ */ #include +#include #include #include #include @@ -15,6 +16,7 @@ #include #include #include +#include #include "acp63.h" @@ -119,37 +121,158 @@ static irqreturn_t acp63_irq_handler(int irq, void *dev_id) return IRQ_NONE; } -static void get_acp63_device_config(u32 config, struct pci_dev *pci, - struct acp63_dev_data *acp_data) +static int sdw_amd_scan_controller(struct device *dev) +{ + struct acp63_dev_data *acp_data; + struct fwnode_handle *link; + char name[32]; + u32 sdw_manager_bitmap; + u8 count = 0; + u32 acp_sdw_power_mode = 0; + int index; + int ret; + + acp_data = dev_get_drvdata(dev); + acp_data->acp_reset = true; + /* Found controller, find links supported */ + ret = fwnode_property_read_u32_array((acp_data->sdw_fw_node), "mipi-sdw-manager-list", + &sdw_manager_bitmap, 1); + + if (ret) { + dev_err(dev, "Failed to read mipi-sdw-manager-list: %d\n", ret); + return -EINVAL; + } + count = hweight32(sdw_manager_bitmap); + /* Check count is within bounds */ + if (count > AMD_SDW_MAX_MANAGERS) { + dev_err(dev, "Manager count %d exceeds max %d\n", count, AMD_SDW_MAX_MANAGERS); + return -EINVAL; + } + + if (!count) { + dev_dbg(dev, "No SoundWire Managers detected\n"); + return -EINVAL; + } + dev_dbg(dev, "ACPI reports %d SoundWire Manager devices\n", count); + acp_data->sdw_manager_count = count; + for (index = 0; index < count; index++) { + snprintf(name, sizeof(name), "mipi-sdw-link-%d-subproperties", index); + link = fwnode_get_named_child_node(acp_data->sdw_fw_node, name); + if (!link) { + dev_err(dev, "Manager node %s not found\n", name); + return -EIO; + } + + fwnode_property_read_u32(link, "amd-sdw-power-mode", + &acp_sdw_power_mode); + /* + * when SoundWire configuration is selected from acp pin config, + * based on manager instances count, acp init/de-init sequence should be + * executed as part of PM ops only when Bus reset is applied for the active + * SoundWire manager instances. + */ + if (acp_sdw_power_mode != AMD_SDW_POWER_OFF_MODE) + acp_data->acp_reset = false; + } + return 0; +} + +static int get_acp63_device_config(u32 config, struct pci_dev *pci, struct acp63_dev_data *acp_data) { struct acpi_device *dmic_dev; + struct acpi_device *sdw_dev; const union acpi_object *obj; bool is_dmic_dev = false; + bool is_sdw_dev = false; + int ret; dmic_dev = acpi_find_child_device(ACPI_COMPANION(&pci->dev), ACP63_DMIC_ADDR, 0); if (dmic_dev) { + /* is_dmic_dev flag will be set when ACP PDM controller device exists */ if (!acpi_dev_get_property(dmic_dev, "acp-audio-device-type", ACPI_TYPE_INTEGER, &obj) && obj->integer.value == ACP_DMIC_DEV) is_dmic_dev = true; } + sdw_dev = acpi_find_child_device(ACPI_COMPANION(&pci->dev), ACP63_SDW_ADDR, 0); + if (sdw_dev) { + acp_data->sdw_fw_node = acpi_fwnode_handle(sdw_dev); + ret = sdw_amd_scan_controller(&pci->dev); + /* is_sdw_dev flag will be set when SoundWire Manager device exists */ + if (!ret) + is_sdw_dev = true; + } + + dev_dbg(&pci->dev, "Audio Mode %d\n", config); switch (config) { - case ACP_CONFIG_0: - case ACP_CONFIG_1: + case ACP_CONFIG_4: + case ACP_CONFIG_5: + case ACP_CONFIG_10: + case ACP_CONFIG_11: + if (is_dmic_dev) { + acp_data->pdev_mask = ACP63_PDM_DEV_MASK; + acp_data->pdev_count = ACP63_PDM_MODE_DEVS; + } + break; case ACP_CONFIG_2: case ACP_CONFIG_3: - case ACP_CONFIG_9: - case ACP_CONFIG_15: - dev_dbg(&pci->dev, "Audio Mode %d\n", config); + if (is_sdw_dev) { + switch (acp_data->sdw_manager_count) { + case 1: + acp_data->pdev_mask = ACP63_SDW_DEV_MASK; + acp_data->pdev_count = ACP63_SDW0_MODE_DEVS; + break; + case 2: + acp_data->pdev_mask = ACP63_SDW_DEV_MASK; + acp_data->pdev_count = ACP63_SDW0_SDW1_MODE_DEVS; + break; + default: + return -EINVAL; + } + } break; - default: - if (is_dmic_dev) { + case ACP_CONFIG_6: + case ACP_CONFIG_7: + case ACP_CONFIG_12: + case ACP_CONFIG_8: + case ACP_CONFIG_13: + case ACP_CONFIG_14: + if (is_dmic_dev && is_sdw_dev) { + switch (acp_data->sdw_manager_count) { + case 1: + acp_data->pdev_mask = ACP63_SDW_PDM_DEV_MASK; + acp_data->pdev_count = ACP63_SDW0_PDM_MODE_DEVS; + break; + case 2: + acp_data->pdev_mask = ACP63_SDW_PDM_DEV_MASK; + acp_data->pdev_count = ACP63_SDW0_SDW1_PDM_MODE_DEVS; + break; + default: + return -EINVAL; + } + } else if (is_dmic_dev) { acp_data->pdev_mask = ACP63_PDM_DEV_MASK; acp_data->pdev_count = ACP63_PDM_MODE_DEVS; + } else if (is_sdw_dev) { + switch (acp_data->sdw_manager_count) { + case 1: + acp_data->pdev_mask = ACP63_SDW_DEV_MASK; + acp_data->pdev_count = ACP63_SDW0_MODE_DEVS; + break; + case 2: + acp_data->pdev_mask = ACP63_SDW_DEV_MASK; + acp_data->pdev_count = ACP63_SDW0_SDW1_MODE_DEVS; + break; + default: + return -EINVAL; + } } break; + default: + break; } + return 0; } static void acp63_fill_platform_dev_info(struct platform_device_info *pdevinfo, @@ -173,6 +296,7 @@ static void acp63_fill_platform_dev_info(struct platform_device_info *pdevinfo, static int create_acp63_platform_devs(struct pci_dev *pci, struct acp63_dev_data *adata, u32 addr) { + struct acp_sdw_pdata *sdw_pdata; struct platform_device_info pdevinfo[ACP63_DEVS]; struct device *parent; int index; @@ -205,8 +329,110 @@ static int create_acp63_platform_devs(struct pci_dev *pci, struct acp63_dev_data acp63_fill_platform_dev_info(&pdevinfo[2], parent, NULL, "acp_ps_mach", 0, NULL, 0, NULL, 0); break; + case ACP63_SDW_DEV_MASK: + if (adata->pdev_count == ACP63_SDW0_MODE_DEVS) { + sdw_pdata = devm_kzalloc(&pci->dev, sizeof(struct acp_sdw_pdata), + GFP_KERNEL); + if (!sdw_pdata) { + ret = -ENOMEM; + goto de_init; + } + + sdw_pdata->instance = 0; + sdw_pdata->acp_sdw_lock = &adata->acp_lock; + adata->sdw0_dev_index = 0; + adata->sdw_dma_dev_index = 1; + acp63_fill_platform_dev_info(&pdevinfo[0], parent, adata->sdw_fw_node, + "amd_sdw_manager", 0, adata->res, 1, + sdw_pdata, sizeof(struct acp_sdw_pdata)); + acp63_fill_platform_dev_info(&pdevinfo[1], parent, NULL, "amd_ps_sdw_dma", + 0, adata->res, 1, &adata->acp_lock, + sizeof(adata->acp_lock)); + } else if (adata->pdev_count == ACP63_SDW0_SDW1_MODE_DEVS) { + sdw_pdata = devm_kzalloc(&pci->dev, sizeof(struct acp_sdw_pdata) * 2, + GFP_KERNEL); + if (!sdw_pdata) { + ret = -ENOMEM; + goto de_init; + } + + sdw_pdata[0].instance = 0; + sdw_pdata[1].instance = 1; + sdw_pdata[0].acp_sdw_lock = &adata->acp_lock; + sdw_pdata[1].acp_sdw_lock = &adata->acp_lock; + sdw_pdata->acp_sdw_lock = &adata->acp_lock; + adata->sdw0_dev_index = 0; + adata->sdw1_dev_index = 1; + adata->sdw_dma_dev_index = 2; + acp63_fill_platform_dev_info(&pdevinfo[0], parent, adata->sdw_fw_node, + "amd_sdw_manager", 0, adata->res, 1, + &sdw_pdata[0], sizeof(struct acp_sdw_pdata)); + acp63_fill_platform_dev_info(&pdevinfo[1], parent, adata->sdw_fw_node, + "amd_sdw_manager", 1, adata->res, 1, + &sdw_pdata[1], sizeof(struct acp_sdw_pdata)); + acp63_fill_platform_dev_info(&pdevinfo[2], parent, NULL, "amd_ps_sdw_dma", + 0, adata->res, 1, &adata->acp_lock, + sizeof(adata->acp_lock)); + } + break; + case ACP63_SDW_PDM_DEV_MASK: + if (adata->pdev_count == ACP63_SDW0_PDM_MODE_DEVS) { + sdw_pdata = devm_kzalloc(&pci->dev, sizeof(struct acp_sdw_pdata), + GFP_KERNEL); + if (!sdw_pdata) { + ret = -ENOMEM; + goto de_init; + } + + sdw_pdata->instance = 0; + sdw_pdata->acp_sdw_lock = &adata->acp_lock; + adata->pdm_dev_index = 0; + adata->sdw0_dev_index = 1; + adata->sdw_dma_dev_index = 2; + acp63_fill_platform_dev_info(&pdevinfo[0], parent, NULL, "acp_ps_pdm_dma", + 0, adata->res, 1, &adata->acp_lock, + sizeof(adata->acp_lock)); + acp63_fill_platform_dev_info(&pdevinfo[1], parent, adata->sdw_fw_node, + "amd_sdw_manager", 0, adata->res, 1, + sdw_pdata, sizeof(struct acp_sdw_pdata)); + acp63_fill_platform_dev_info(&pdevinfo[2], parent, NULL, "amd_ps_sdw_dma", + 0, adata->res, 1, &adata->acp_lock, + sizeof(adata->acp_lock)); + acp63_fill_platform_dev_info(&pdevinfo[3], parent, NULL, "dmic-codec", + 0, NULL, 0, NULL, 0); + } else if (adata->pdev_count == ACP63_SDW0_SDW1_PDM_MODE_DEVS) { + sdw_pdata = devm_kzalloc(&pci->dev, sizeof(struct acp_sdw_pdata) * 2, + GFP_KERNEL); + if (!sdw_pdata) { + ret = -ENOMEM; + goto de_init; + } + sdw_pdata[0].instance = 0; + sdw_pdata[1].instance = 1; + sdw_pdata[0].acp_sdw_lock = &adata->acp_lock; + sdw_pdata[1].acp_sdw_lock = &adata->acp_lock; + adata->pdm_dev_index = 0; + adata->sdw0_dev_index = 1; + adata->sdw1_dev_index = 2; + adata->sdw_dma_dev_index = 3; + acp63_fill_platform_dev_info(&pdevinfo[0], parent, NULL, "acp_ps_pdm_dma", + 0, adata->res, 1, &adata->acp_lock, + sizeof(adata->acp_lock)); + acp63_fill_platform_dev_info(&pdevinfo[1], parent, adata->sdw_fw_node, + "amd_sdw_manager", 0, adata->res, 1, + &sdw_pdata[0], sizeof(struct acp_sdw_pdata)); + acp63_fill_platform_dev_info(&pdevinfo[2], parent, adata->sdw_fw_node, + "amd_sdw_manager", 1, adata->res, 1, + &sdw_pdata[1], sizeof(struct acp_sdw_pdata)); + acp63_fill_platform_dev_info(&pdevinfo[3], parent, NULL, "amd_ps_sdw_dma", + 0, adata->res, 1, &adata->acp_lock, + sizeof(adata->acp_lock)); + acp63_fill_platform_dev_info(&pdevinfo[4], parent, NULL, "dmic-codec", + 0, NULL, 0, NULL, 0); + } + break; default: - dev_dbg(&pci->dev, "No PDM devices found\n"); + dev_dbg(&pci->dev, "No PDM or SoundWire manager devices found\n"); return 0; } @@ -290,7 +516,11 @@ static int snd_acp63_probe(struct pci_dev *pci, goto de_init; } val = readl(adata->acp63_base + ACP_PIN_CONFIG); - get_acp63_device_config(val, pci, adata); + ret = get_acp63_device_config(val, pci, adata); + if (ret) { + dev_err(&pci->dev, "get acp device config failed:%d\n", ret); + goto de_init; + } ret = create_acp63_platform_devs(pci, adata, addr); if (ret < 0) { dev_err(&pci->dev, "ACP platform devices creation failed\n"); From patchwork Mon May 22 13:31:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 97435 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1454254vqo; Mon, 22 May 2023 06:35:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6oFs/WBYVxyBt27KJ57ruAHHv/5Tqo+WhewDpSlCAQ79O6XKmag1/PSV1kZTWm6ZQApKNK X-Received: by 2002:a17:902:ebd2:b0:1ad:c627:87de with SMTP id p18-20020a170902ebd200b001adc62787demr10162005plg.32.1684762534845; Mon, 22 May 2023 06:35:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1684762534; cv=pass; d=google.com; s=arc-20160816; b=xvQOLisztS/AtdHQ1ZnvYjOh+SnGxyBImRiba7rL2DChngoOsevBy+/C9AKFi7ufN9 Pp7q61KK2PrJXNasGRSYdDmmhSLUvJZH9gFXz+Z2l9bC17ZmEgeiGo9WgIYGj6gysknm m7Jlgp6KU0008cEhLjMlAdQbg1P/FK0amYOXBgCPLAOZsdDGk4XWYGzI7lKyEK7i6MKw fZkp3YeQQnr+1kufvKPc1lCfnh0UbGO3mL0mw4ocxFYz1cSTwS6HLfYckgQ1NXczH7EM /n2VDodv9ijwcjVrmxSdh6rvgwG0QOkYRrwk/mXRH//V/l0wKmoYxrqJRlf6xahQoQfA nTHA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=y/ofSN9zfDdAe7BRAIYTLFaYuoG8RAQs1kvAFiSqByE=; b=tGP7CBOaxg++RqAW8bI1QRyRtbTyU5PwU/1T1VKP1zTq8x4lxFYPllkf6ImRZuzO0z 8Kx/tVeNvjIiwENRLU/uhcVS+BB7rdAaG5Ku3NSxglrpRpKVD2YNcpIlh2hUH9j3b4oN NCJL1yvDPPw0taFTlXoXnMnwdIDpBtqvZ6abdej+GgX3Dk19w524C9S5d1Iqets1r9nl n2LD4ziphTGp2kgB1qoYLs80VswErJyxOUEruWaOWfLHuJqe/7dMvzCW4COLglhEyOLo u7Zcj7J+obZ9IWhqjhG3zGl9JlWgxXN+IGh1ZdKkBwg4TNFezFcxw56lGk1NrjsSfNgO xk9w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=fS8+NYki; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o1-20020a170902d4c100b001a9b29b675csi4861884plg.317.2023.05.22.06.35.21; Mon, 22 May 2023 06:35:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=fS8+NYki; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233425AbjEVN1A (ORCPT + 99 others); Mon, 22 May 2023 09:27:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233176AbjEVN0s (ORCPT ); Mon, 22 May 2023 09:26:48 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2073.outbound.protection.outlook.com [40.107.220.73]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6323CD for ; Mon, 22 May 2023 06:26:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HSwFulvY3E3OJe7p4HwTGJ2rNEm+HsY1y1ba3z0cXTL1WYW9qQOJ8eTKuLSOqQXMM4mNsD66LuyWJGwqLzp8jhAWXY/r+yQGlZan5pDS+wGaHO+LYiXWlPeGwiNCCLd4ZQ/7sihJQCxolfbx2DJrCTExtpoWLIU/FoGt+CO6sOgoX5O9qJCNXebS1lfrl0E9+qT3QzJDgBe/9x+OJrfgcAfW65sv1/8HLJFhcK0g/GbOhBTDQtgWl32QY5FyJRNej4xMjf6XKpcwlVGqvsD2c7gREJsECDh2ghdm3UU9q9duzzxjwaeDRqcn1oWHFC+6CXHqni6EXzoS6qsivxx+xQ== 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=y/ofSN9zfDdAe7BRAIYTLFaYuoG8RAQs1kvAFiSqByE=; b=IwJGhVqOu/enlTTPgzxxt6ax+9U60vtvmtQCB7A6Y6v8EAA44/P4ziZXAZtPK1lHZoQqui2Dh0KC+POJvq9RU1KWBbDI6l1WyDlsf0fcrEw2iiXrpattgoZ37sOzH+ZK3e/K0R6RV7FzlXG3o5EkDTyhMP+ZhnUQRPBykZXbL7edr8IbLxeY+jOLu4g/9LB8wAI2O48uN57X+1L5RJ+H92sErNxvQZ0ehOCpWlIU0tCMDML9in3nkjfjOEQQ9tyK5pheXzMEF+1OsWrDvq5iXmiq0d6Wk/qmZ3ZOMJNzzaUxsp1b6dYfAAIDVoVJOCfZ+rVRcKKva1n9S2WU2R7GqA== 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=y/ofSN9zfDdAe7BRAIYTLFaYuoG8RAQs1kvAFiSqByE=; b=fS8+NYkifSLkwKk0CGHrYv+PjUgOmfKhv/Z1ZYbmJKPp7uMJtOlAkVrCtqMN1qXr54jig+dqGpv/je1ZO/VorHC1St+BKggbvAMFq/lK6Q5Vt+Jdq5VGkb7w3+ho/63TVIbCr0py9f3lQ4kTdyfzKdRwXRn1hXtaiIjju7ejyi8= Received: from MW4PR02CA0017.namprd02.prod.outlook.com (2603:10b6:303:16d::24) by IA0PR12MB7556.namprd12.prod.outlook.com (2603:10b6:208:43c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28; Mon, 22 May 2023 13:26:36 +0000 Received: from CO1NAM11FT052.eop-nam11.prod.protection.outlook.com (2603:10b6:303:16d:cafe::79) by MW4PR02CA0017.outlook.office365.com (2603:10b6:303:16d::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28 via Frontend Transport; Mon, 22 May 2023 13:26:35 +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 CO1NAM11FT052.mail.protection.outlook.com (10.13.174.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6411.28 via Frontend Transport; Mon, 22 May 2023 13:26:35 +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.34; Mon, 22 May 2023 08:26:34 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 22 May 2023 08:26:31 -0500 From: Vijendar Mukunda To: CC: , , , , , , , Vijendar Mukunda , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Syed Saba Kareem , open list Subject: [PATCH V2 2/9] ASoC: amd: ps: handle SoundWire interrupts in acp pci driver Date: Mon, 22 May 2023 19:01:15 +0530 Message-ID: <20230522133122.166841-3-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230522133122.166841-1-Vijendar.Mukunda@amd.com> References: <20230522133122.166841-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT052:EE_|IA0PR12MB7556:EE_ X-MS-Office365-Filtering-Correlation-Id: 2b2ebdb2-dad4-4115-5c16-08db5ac82a99 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Enu3MmLXC43MfIrDJNFeY7ly5avHLq/C+rHADwr0e+D1BsZ8kNM65GpZHeUNBV9BJknzU/VMiXodO3ghLHqRnoKkBv47hhCa9UOYoSKaTxqK29B9mgEnm40OLCC32wXXgZnNXcJ5sC/uyRMp29ejt0+QXHjzrmuHVTUZPH0IalKe2usCwm9fM95FKu6W6NvfxMA+7zUnnUo0pWrDlBjrK5oO3V/slG3TNGoAhkRm4cLtrVqFdK+NKnws6YTpDikEIa4CWrNmgqEScya/Sy/Tg29+9+eTbh3VdnJY8TeBrOpMNFLPrS1ujivzHI4uT8Wc73OGDAK3xUzR5/iPM8Lrwm3970Xax+O75Qjh7EGrzow4Xed+qbfLfSCuPf4jUzxZWBUK/pReyeQ6ebNKTu/c8N1dxYd0bRff4Q1ntyJCuowGc0DqGwFhmdGjoI29RYBRfNacJr9pVsvvaOLa/uqwZvlDH5rqfDmRHUzUpqZy62Q+7cw5g7UYczg/lgIluMbvMl81UE4hQOHMKPNITspOMiJqjykNVqIbAUklgWVcwFtTTtfTXToBZNAlYzs4slEbdRSKyKzn5tdMomxXQk5pDS7VEN3QL8kKFi6xpmcIBRLjmV6AW3QPTORIJlGAkQET7na6COiru+hn4sOwhD9YaN6mVJZw3TiRkYo/sLvXKQBsT/5U58bm/ywBTUAmwbtzn2K5NR6k2K66yvN9GsUUYRDqTZJ5GNuL5grKtSNPzGniBM3uQ4rh4Y/bn50RyiGOrkNgTmnJVSr9GxUIKtQqLg== 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:(13230028)(4636009)(346002)(376002)(396003)(136003)(39860400002)(451199021)(36840700001)(46966006)(40470700004)(2906002)(5660300002)(83380400001)(8676002)(8936002)(82310400005)(36756003)(70586007)(70206006)(4326008)(6916009)(54906003)(316002)(478600001)(41300700001)(6666004)(40480700001)(7696005)(426003)(86362001)(336012)(26005)(2616005)(356005)(81166007)(82740400003)(1076003)(36860700001)(47076005)(186003)(40460700003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2023 13:26:35.6303 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2b2ebdb2-dad4-4115-5c16-08db5ac82a99 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: CO1NAM11FT052.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB7556 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766601559690564918?= X-GMAIL-MSGID: =?utf-8?q?1766601559690564918?= Handle SoundWire manager related interrupts in ACP PCI driver interrupt handler and schedule SoundWire manager work queue for further processing. Signed-off-by: Vijendar Mukunda --- sound/soc/amd/ps/acp63.h | 4 ++++ sound/soc/amd/ps/pci-ps.c | 43 ++++++++++++++++++++++++++++++++++----- 2 files changed, 42 insertions(+), 5 deletions(-) diff --git a/sound/soc/amd/ps/acp63.h b/sound/soc/amd/ps/acp63.h index 95bb1cef900a..d296059be4f0 100644 --- a/sound/soc/amd/ps/acp63.h +++ b/sound/soc/amd/ps/acp63.h @@ -88,6 +88,10 @@ /* time in ms for acp timeout */ #define ACP_TIMEOUT 500 +#define ACP_SDW0_STAT BIT(21) +#define ACP_SDW1_STAT BIT(2) +#define ACP_ERROR_IRQ BIT(29) + 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 02caae6968ad..26514e340a33 100644 --- a/sound/soc/amd/ps/pci-ps.c +++ b/sound/soc/amd/ps/pci-ps.c @@ -56,6 +56,7 @@ static int acp63_reset(void __iomem *acp_base) static void acp63_enable_interrupts(void __iomem *acp_base) { writel(1, acp_base + ACP_EXTERNAL_INTR_ENB); + writel(ACP_ERROR_IRQ, acp_base + ACP_EXTERNAL_INTR_CNTL); } static void acp63_disable_interrupts(void __iomem *acp_base) @@ -102,23 +103,55 @@ static irqreturn_t acp63_irq_handler(int irq, void *dev_id) { struct acp63_dev_data *adata; struct pdm_dev_data *ps_pdm_data; - u32 val; + struct amd_sdw_manager *amd_manager; + u32 ext_intr_stat, ext_intr_stat1; + u16 irq_flag = 0; u16 pdev_index; adata = dev_id; if (!adata) return IRQ_NONE; + ext_intr_stat = readl(adata->acp63_base + ACP_EXTERNAL_INTR_STAT); + if (ext_intr_stat & ACP_SDW0_STAT) { + writel(ACP_SDW0_STAT, adata->acp63_base + ACP_EXTERNAL_INTR_STAT); + pdev_index = adata->sdw0_dev_index; + amd_manager = dev_get_drvdata(&adata->pdev[pdev_index]->dev); + if (amd_manager) + schedule_work(&amd_manager->amd_sdw_irq_thread); + irq_flag = 1; + } - val = readl(adata->acp63_base + ACP_EXTERNAL_INTR_STAT); - if (val & BIT(PDM_DMA_STAT)) { + ext_intr_stat1 = readl(adata->acp63_base + ACP_EXTERNAL_INTR_STAT1); + if (ext_intr_stat1 & ACP_SDW1_STAT) { + writel(ACP_SDW1_STAT, adata->acp63_base + ACP_EXTERNAL_INTR_STAT1); + pdev_index = adata->sdw1_dev_index; + amd_manager = dev_get_drvdata(&adata->pdev[pdev_index]->dev); + if (amd_manager) + schedule_work(&amd_manager->amd_sdw_irq_thread); + irq_flag = 1; + } + + if (ext_intr_stat & ACP_ERROR_IRQ) { + writel(ACP_ERROR_IRQ, adata->acp63_base + ACP_EXTERNAL_INTR_STAT); + /* TODO: Report SoundWire Manager instance errors */ + writel(0, adata->acp63_base + ACP_SW0_I2S_ERROR_REASON); + writel(0, adata->acp63_base + ACP_SW1_I2S_ERROR_REASON); + writel(0, adata->acp63_base + ACP_ERROR_STATUS); + irq_flag = 1; + } + + if (ext_intr_stat & BIT(PDM_DMA_STAT)) { pdev_index = adata->pdm_dev_index; ps_pdm_data = dev_get_drvdata(&adata->pdev[pdev_index]->dev); writel(BIT(PDM_DMA_STAT), adata->acp63_base + ACP_EXTERNAL_INTR_STAT); if (ps_pdm_data->capture_stream) snd_pcm_period_elapsed(ps_pdm_data->capture_stream); - return IRQ_HANDLED; + irq_flag = 1; } - return IRQ_NONE; + if (irq_flag) + return IRQ_HANDLED; + else + return IRQ_NONE; } static int sdw_amd_scan_controller(struct device *dev) From patchwork Mon May 22 13:31:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 97436 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1454261vqo; Mon, 22 May 2023 06:35:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4zP3n6A2FaqTLCf6pvFtz/TpqDijC7taLRa5wLHBQTa4Gj/pmtTO7JlHLHY8qyMrL0hTbm X-Received: by 2002:a17:903:1d1:b0:1a1:d54b:71df with SMTP id e17-20020a17090301d100b001a1d54b71dfmr11913475plh.0.1684762535261; Mon, 22 May 2023 06:35:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1684762535; cv=pass; d=google.com; s=arc-20160816; b=HtP/jyJNdRBF3rr4aO/yBWdSnH+7SCJF4bRy5hyYPuKeVcxj9nA7fpXm0Fd9ooGyv/ Sf/FMUl5m9wGjJ5b8DpxuyppTVY7/DYLM0x2+IQv996xMjn6i7aDVks9TY+kSoNhDwM9 fGgvVDq+DbCEGljtBF44RAol5WNWfvobV+UERmkuis/Uzh183/qAznVSfkwvq02sbxYV ko9beGuRiOxS9mXyNA80xTjJg/o4A+bTlCp5x7C1RAc/qGz8LCVWMvKvoaZ7BQUw/6SL Ew9rmB9U6df9jhMCWBWf8/hlYrxf7fbuQFfvSV510tkjbHtXpmyIn8A4OMasBG42KJEY /WiQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=oInXiL7CeKXlK9T9YeD3FEO2IDbCnscFb2CJJibNE4Y=; b=0wpLE/J9KF50f5R1BKHLuzszyd8bR4hyepzrTuFDeR8hLFWN6W4Djbb58LNwViLTkg Ms00C9Np040ToAG5TT3xKN0l8lbFLYHrO7aIRLsoX49rUvGgk/6SPOFra1HCSDC27kVN WsvB2ozwK+cZ5ztPIzYWlBz/wbJSGUuQ7DdkjvcaMzvd7il/eKzgj+PSlyCicW4GvvZV MMUWyAzHf33kw6uRgQyzKBCU8p53CQRuTmvJzdY2rfX6bWbZaCDCJuJNl0DFNcnNXOyH OFjR9kE0umoB4ER+d0AONza6feYkCpP3GQZukwdMVxVwMLXULJm2MZQyApdz+WudLM/p /nUw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=2l5a+dMy; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ij17-20020a170902ab5100b001aadf9e2d15si4586761plb.491.2023.05.22.06.35.21; Mon, 22 May 2023 06:35:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=2l5a+dMy; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233577AbjEVN1D (ORCPT + 99 others); Mon, 22 May 2023 09:27:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234012AbjEVN05 (ORCPT ); Mon, 22 May 2023 09:26:57 -0400 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2069.outbound.protection.outlook.com [40.107.212.69]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CDC5B4 for ; Mon, 22 May 2023 06:26:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KRqnkgyTINQVTiwWBZhPOmFDnIIn9mbil6oslz9yreVXNRgVUSkFTYSAUMTi55OwhKT0s12UhmLYueoschEt+k4F78P11hNUKw/Ajmh8lXABZ6sIPfjm6CRfXNst84Uu4t+wfs06PoIlbiOhWKWR5G0QUgoq8j1CXMwPqxXZrtw+Pgc/ebzX5us8v0T8jNCGHQQnc9U0pTSIiMJSBHkLeIOxd0Kelz0ka/JtxWIzNShYIJcaFGJJt5S12wOS2f0ihZvD3whJ9fJ41Iq2/uFpX9f/Pmr1oRWapwDJiRcUSaboScwV7k2THo5RghknnQ3FfQxhgEwqCJypWpJFKcC3Vg== 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=oInXiL7CeKXlK9T9YeD3FEO2IDbCnscFb2CJJibNE4Y=; b=IeOluBde6JIkXwvUtYzlvW7aiYLigW8BpWkpp7V0Sf1iXMzTf2hQzWL8Vk+3rmLcwGwV8Rng/F31aHKx7bZT3E/gfMiCTjSdg+MlbwWJMcZklA1RUt1v8Ss4zftWGHu5fOaT7EoA7BD4LLCdnrm915r44g+y1PS+qbRteoxhej5UTnrIaY1bx48P7u+W2ipFRKMs2NmT1Lc0XSVJjHuSuA2mJ8kZ3ufC425oXcDlFCSulBtC+kgbASEoOD7FdqwNMSbpFanh5rxzEaizBC14YycUHnXyOIlqPOHN9HIz8pPsSfEd2aiKcWjI8rphPnTQRcY4ZmCXXOh2v9fqVHwV3w== 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=oInXiL7CeKXlK9T9YeD3FEO2IDbCnscFb2CJJibNE4Y=; b=2l5a+dMyVx+7Eu5TLBGPhPnA0s5cwmsOfNHeM/xnXwE5+Lm0RwrFkLqTCXxb5RsBoC9XutVP0Mwnxl7/ecAtDDYXRiCAix2PWd2WAN8OKuSOXRWLwd8Nw6W0efOY6xeAgX4mbJshC9afB9rIGG5fC32t1BeK1eGF8MN8L5vgnOE= Received: from SJ0P220CA0009.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:41b::25) by CO6PR12MB5442.namprd12.prod.outlook.com (2603:10b6:5:35b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28; Mon, 22 May 2023 13:26:45 +0000 Received: from CO1NAM11FT003.eop-nam11.prod.protection.outlook.com (2603:10b6:a03:41b:cafe::5b) by SJ0P220CA0009.outlook.office365.com (2603:10b6:a03:41b::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28 via Frontend Transport; Mon, 22 May 2023 13:26:45 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by CO1NAM11FT003.mail.protection.outlook.com (10.13.175.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6411.28 via Frontend Transport; Mon, 22 May 2023 13:26:45 +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.34; Mon, 22 May 2023 08:26:44 -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.34; Mon, 22 May 2023 06:26:44 -0700 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 22 May 2023 08:26:40 -0500 From: Vijendar Mukunda To: CC: , , , , , , , Vijendar Mukunda , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Syed Saba Kareem , open list Subject: [PATCH V2 3/9] ASoC: amd: ps: add SoundWire dma driver Date: Mon, 22 May 2023 19:01:16 +0530 Message-ID: <20230522133122.166841-4-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230522133122.166841-1-Vijendar.Mukunda@amd.com> References: <20230522133122.166841-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT003:EE_|CO6PR12MB5442:EE_ X-MS-Office365-Filtering-Correlation-Id: 0c958248-513e-4870-7143-08db5ac8305c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1llBD0xI4Q/I7qIF2RdhyPQgmR0EvRe61GzFx/eWNopoPZVzNqnb9ZKEfAAjo3kxGEETpwy3Bzg5vK8dcQrXJVzjB6jQ8yAWQOzAT3nFH+1zEbJ3R8WNswCXHPSNNjkGkcVXJFtQP5PGKLrR0w0VQ0wD0boMh40+xtewktlGwBIs5KZ5kPJZQYNMRPQrFPfXpGeDwUtVzhC4pEBjZKKCAzyiA1QvQN1DsyID/h6qvilSVO1nYn+09PJ3xbobA1lxKO6J7zhOKnt2AE51RNEKzk1KQIqDSdNjk35eCRijHSJknrUEHekthbPivhdBMp5fCZSpe1g+0IAFJMBMXyfBR6lsRBrjrfQ66fnHkdJg6hgQpTd0IwbFg6EwXsbtbvZ7ezy2F5WJl8QLqp7r3w+S5PLtLTtKEEigrYw2bmHcUC2Fw8NN4TwUvHar7t+qtCFraMANGllv91E0fg8svSqBFYB4D/WrNxgvGd8GWNEG3sThEAHRvtMYJk2Bp4u5kbjn+1XTluNM8Oe5KAjG/bEeZ3zDqHcmQrQwe0sA75SmxMEtAegN1i4WHyuP5df58SJyEQv7YYdxZ5A+iM6DFFcIqzgd4pBsUC3DLf0Ox4c0iA3I41kIwxdIivhsS3GOFJ6LvdH4nXFFB3q29Qe7op+BM98s7UTOEunsiFVjbhviJUiJRYJYpmbHteQrnZBQDmg6PLRCaSUW+HlJycatqBJkdnMikySwb8e0PXp1wH019+RfoG/vApU9zY7dj/YAme8SfdXEqDqD8YAmTonrVrayRA== 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:(13230028)(4636009)(346002)(39860400002)(136003)(376002)(396003)(451199021)(40470700004)(46966006)(36840700001)(478600001)(54906003)(26005)(5660300002)(41300700001)(6666004)(7696005)(186003)(316002)(4326008)(6916009)(1076003)(336012)(8936002)(8676002)(426003)(2906002)(47076005)(2616005)(36860700001)(83380400001)(70206006)(70586007)(82740400003)(356005)(81166007)(36756003)(40460700003)(86362001)(82310400005)(40480700001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2023 13:26:45.2818 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0c958248-513e-4870-7143-08db5ac8305c 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: CO1NAM11FT003.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR12MB5442 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766601560006827711?= X-GMAIL-MSGID: =?utf-8?q?1766601560006827711?= SoundWire DMA platform driver binds to the platform device created by ACP PCI device. SoundWire DMA driver registers ALSA DMA component with ASoC framework. Signed-off-by: Vijendar Mukunda --- sound/soc/amd/ps/acp63.h | 5 +++ sound/soc/amd/ps/ps-sdw-dma.c | 70 +++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 sound/soc/amd/ps/ps-sdw-dma.c diff --git a/sound/soc/amd/ps/acp63.h b/sound/soc/amd/ps/acp63.h index d296059be4f0..eec58da7ec8b 100644 --- a/sound/soc/amd/ps/acp63.h +++ b/sound/soc/amd/ps/acp63.h @@ -148,6 +148,11 @@ struct pdm_dev_data { struct snd_pcm_substream *capture_stream; }; +struct sdw_dma_dev_data { + void __iomem *acp_base; + struct mutex *acp_lock; /* used to protect acp common register access */ +}; + /** * struct acp63_dev_data - acp pci driver context * @acp63_base: acp mmio base diff --git a/sound/soc/amd/ps/ps-sdw-dma.c b/sound/soc/amd/ps/ps-sdw-dma.c new file mode 100644 index 000000000000..f41849fd035c --- /dev/null +++ b/sound/soc/amd/ps/ps-sdw-dma.c @@ -0,0 +1,70 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * AMD ALSA SoC Pink Sardine SoundWire DMA Driver + * + * Copyright 2023 Advanced Micro Devices, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include +#include "acp63.h" + +#define DRV_NAME "amd_ps_sdw_dma" + +static const struct snd_soc_component_driver acp63_sdw_component = { + .name = DRV_NAME, +}; + +static int acp63_sdw_platform_probe(struct platform_device *pdev) +{ + struct resource *res; + struct sdw_dma_dev_data *sdw_data; + int status; + + if (!pdev->dev.platform_data) { + dev_err(&pdev->dev, "platform_data not retrieved\n"); + return -ENODEV; + } + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!res) { + dev_err(&pdev->dev, "IORESOURCE_MEM FAILED\n"); + return -ENODEV; + } + + sdw_data = devm_kzalloc(&pdev->dev, sizeof(*sdw_data), GFP_KERNEL); + if (!sdw_data) + return -ENOMEM; + + sdw_data->acp_base = devm_ioremap(&pdev->dev, res->start, resource_size(res)); + if (!sdw_data->acp_base) + return -ENOMEM; + + sdw_data->acp_lock = pdev->dev.platform_data; + dev_set_drvdata(&pdev->dev, sdw_data); + status = devm_snd_soc_register_component(&pdev->dev, + &acp63_sdw_component, + NULL, 0); + if (status) + dev_err(&pdev->dev, "Fail to register sdw dma component\n"); + + return status; +} + +static struct platform_driver acp63_sdw_dma_driver = { + .probe = acp63_sdw_platform_probe, + .driver = { + .name = "amd_ps_sdw_dma", + }, +}; + +module_platform_driver(acp63_sdw_dma_driver); + +MODULE_AUTHOR("Vijendar.Mukunda@amd.com"); +MODULE_DESCRIPTION("AMD ACP6.3 PS SDW DMA Driver"); +MODULE_LICENSE("GPL"); +MODULE_ALIAS("platform:" DRV_NAME); From patchwork Mon May 22 13:31:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 97445 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1464923vqo; Mon, 22 May 2023 06:52:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7G+XuFPB5guVmfvRpGbNdUiS7+9Xu/p/Y9kglvAwRsaZape4jAx4vTjNeJ42JNkTxZr0Zm X-Received: by 2002:a05:6a00:1783:b0:64d:2841:8380 with SMTP id s3-20020a056a00178300b0064d28418380mr14253691pfg.22.1684763569524; Mon, 22 May 2023 06:52:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1684763569; cv=pass; d=google.com; s=arc-20160816; b=ksGbfPr5AmKzniHMI1OYmszg1GpsJpbJo4f2o8MRhr5OIOCKfsW/iCKPb0VdvrDFx7 7CN5EIOJq+lC5YsIn8WniY8U2TsfAB6Ayht2n92jTAAFbWAfzztknxzZ4+NX9FcJBckX WqeAV06dsUiBLHhv4AFNQujpYf1AXLCjydiIF2EFK942qN5Z7/p/VEHskdujKf7rIV18 etQdU8ttCDdIrnBPlJytalbsFlfjGj7ROdwbiW4Cbi2OLJACPGjfw4uAEJ9CtaICylDl lFXLR8TYt3NhZ8GlMY1/vUAdTXHkvfTb36yLG3BYYLfVT3ikkeBifyWvgF76uRYZS40f yl4g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0gHlyCUdX3sMkmuI2CLi5T2X4erUJyrWTGCPJFnI7Yg=; b=HzVucVj73ziMpkAT64brLOtOgHWZ/tj8GOa0iM6qRszYPCQB+VW7OQp2Xpxn0/cv5f tlhbgf8rjICO+MGCDT7PQlwHKrjte14p+d8RUxsB5a9HXgrwXJFWhFW/bEwiXxeR2W3m yx2dp2EgJcoariIOt+wCCxjoj1I9V4/L/UJNtJ+Tl/x29q1pK5LkwtYG4oDogt1XcY1H cCSyMejfzA/r96A22yDG24ieQt4O2xTLv5evh6kx/apYBoqjHttP4cCkDO6sxQH8sO6y m9ie0Xl/RYkXVRfGB2Ub7Au5rDh95HPVKvClCgDkynACbFUSZYei4tkgyR9SBzZ06Izz T99w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=wf9gwWiG; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d64-20020a621d43000000b0064d6d833ae7si1926265pfd.22.2023.05.22.06.52.35; Mon, 22 May 2023 06:52:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=wf9gwWiG; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233559AbjEVN1H (ORCPT + 99 others); Mon, 22 May 2023 09:27:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233721AbjEVN1E (ORCPT ); Mon, 22 May 2023 09:27:04 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2072.outbound.protection.outlook.com [40.107.244.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3C97B3 for ; Mon, 22 May 2023 06:26:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Lu8wdA5YwxQb6++fiiApRJzuoHqZ+dsuLifgUgexYXEDZjX9z8rjhpzAKGt1wplXNleKRKffVNYwDDcgJ/4VTDLICyatkjJeezgGaceUKoGBnImELDk0vPu/BkvyMi72e17v34pIZgMFQup2Nja+p3lYIkx0xRwsQfbQPPvMAKzNB2fpNj6Ic08P/JfA5KG83Srk0958FWOqxfBnqwezxlk7yJB9sJPCCwegnr461xJf09NDqzzzHm0/J+HegnjVZyghYrOW4zKxK+Hqp22NFZRBvC/lEvXxzpVyvhwo9V5/zYvBlV7WZX6Bu1Ya1//LobQldWG+CDTf4g1AZcC9WQ== 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=0gHlyCUdX3sMkmuI2CLi5T2X4erUJyrWTGCPJFnI7Yg=; b=kqcqUdtlAkpVYG4MUnptuEAUsvFEZsdDCGcpPX48zPzeYW4XUqWdetOgT0CeblUITpH+5YA732nZvUZeIcZrUQj+V5v4Den/7RUeVA1xflaa26HAaQrJDnwVqX3f2tm+IK6NSsyWNNnkSv0KgWxa2nTWkqUFRecjES7w9zR7de4+1k02Hvn2MA0TWjIMEa2td1kw/4WnbY+bIF2pIRviLobHsGhAQObVv8Z3c266DJEf9HxsZ2eZyGGTKItKnAsadTxE3L4tW/QsedwcxYni57wuaGSYbNc+Tm3n6MaLYuFM88IRgtvet+ji6vJk+Hx9ktmy+tTDgQudQUHgnbyP5w== 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=0gHlyCUdX3sMkmuI2CLi5T2X4erUJyrWTGCPJFnI7Yg=; b=wf9gwWiGFKeKPLy/REphPsLtlwJRQ3pvaCAtD6kRJX9ixkZIrBwtlEbycjUXok7gucdoueS5zyUS8cS6dWOZTqsSDkBxm2lcIdqT9q/3hTvE8LMNYjoTlry3bgZocpFKZ4r1QJaWmjj1tjB6lGtqXQEctPNvqY2Wwmdv/MLZ6Ds= Received: from BYAPR05CA0028.namprd05.prod.outlook.com (2603:10b6:a03:c0::41) by BN9PR12MB5209.namprd12.prod.outlook.com (2603:10b6:408:11a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28; Mon, 22 May 2023 13:26:54 +0000 Received: from CO1NAM11FT085.eop-nam11.prod.protection.outlook.com (2603:10b6:a03:c0:cafe::1d) by BYAPR05CA0028.outlook.office365.com (2603:10b6:a03:c0::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.13 via Frontend Transport; Mon, 22 May 2023 13:26:53 +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 CO1NAM11FT085.mail.protection.outlook.com (10.13.174.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6411.28 via Frontend Transport; Mon, 22 May 2023 13:26:53 +0000 Received: from SATLEXMB07.amd.com (10.181.41.45) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 22 May 2023 08:26:52 -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.34; Mon, 22 May 2023 06:26:52 -0700 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 22 May 2023 08:26:48 -0500 From: Vijendar Mukunda To: CC: , , , , , , , Vijendar Mukunda , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Syed Saba Kareem , open list Subject: [PATCH V2 4/9] ASoC: amd: ps: add SoundWire dma driver dma ops Date: Mon, 22 May 2023 19:01:17 +0530 Message-ID: <20230522133122.166841-5-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230522133122.166841-1-Vijendar.Mukunda@amd.com> References: <20230522133122.166841-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT085:EE_|BN9PR12MB5209:EE_ X-MS-Office365-Filtering-Correlation-Id: 0dea96f0-2cff-49d2-9dad-08db5ac8354f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZOLiBVGlC64l5Eb2O+JiyJFX4EQU/G8Ix01RmzltxWBeX6sKbWaQaonatQxYnYCgRPyz5v/ROX+0l4RJBhAD/x2TotmoLJlqGcgKODvesDcYCsK/bVwO3ZJVjJRknntJsUI6WyRqV627Ffiic6w68eJzxuN5UicIdNuNrEE7nvQgFMPRSbzNiwgaFBQAbkMMQCs9KM07kFADb2g4qpQvNvfAqdWwcsNzDNsb95EsrXuHjfwVzrTt4Lk3W4p/4h0n9zFAfr+iK1x7Rwpqa2oI2l7E+cCsAo7bGbt8QRWqoA8gTlxj81JZXfctScDYjo44fxk3HugFuH/rdeorkdgmPeruHOGHfLiXGQtSVjhZ6RQutvGm9JZUfqu6FspgefNkTro315jW2wi4erkl+mvLmSw0EmGNLZBUauvjP3aCKMnPS6HfgnJ7ack99PFNEbP7LCxFO/nfN/r96x0n6vaAx2h6Ip09FAWOHzY/114vD6NLBDjIVpvgJ69gIuKX8r/2pUpySJIUBo9caB+gieoM1fGUt1Fsz1Y/1VpZC0OJ75rfqoXC4EDN2zTw/MBDyq5ZdVJ8wyaaz+PEuEh7A6F41rw4XKLT+ahzfx3QW/Gz1mTVMA1GSvij3WzhHQsGnHTbCxpXNTD5+rmoMAFxhMeFr5+YVuSffXzuUejcGIuRwYOryR68QgCgNUn/gCk/MoFN9CaU5sVppNwRlVT1EtOlBZJ/R7L+EzIFJm7RuhXm5Hg9hQ0vTG+YIL05L40YFV50rOOY19PnK8B8cMK9UgEZcA== 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:(13230028)(4636009)(39860400002)(136003)(376002)(396003)(346002)(451199021)(36840700001)(40470700004)(46966006)(30864003)(2906002)(54906003)(5660300002)(36860700001)(82310400005)(47076005)(8676002)(8936002)(40460700003)(41300700001)(316002)(70206006)(70586007)(478600001)(6916009)(4326008)(36756003)(40480700001)(6666004)(7696005)(336012)(1076003)(81166007)(86362001)(2616005)(26005)(186003)(83380400001)(82740400003)(356005)(426003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2023 13:26:53.6020 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0dea96f0-2cff-49d2-9dad-08db5ac8354f 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: CO1NAM11FT085.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5209 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766602644662971110?= X-GMAIL-MSGID: =?utf-8?q?1766602644662971110?= Add SoundWire DMA driver dma ops for Pink Sardine platform. Signed-off-by: Vijendar Mukunda --- sound/soc/amd/ps/acp63.h | 70 ++++++ sound/soc/amd/ps/ps-sdw-dma.c | 415 ++++++++++++++++++++++++++++++++++ 2 files changed, 485 insertions(+) diff --git a/sound/soc/amd/ps/acp63.h b/sound/soc/amd/ps/acp63.h index eec58da7ec8b..37ae8f18225a 100644 --- a/sound/soc/amd/ps/acp63.h +++ b/sound/soc/amd/ps/acp63.h @@ -91,6 +91,46 @@ #define ACP_SDW0_STAT BIT(21) #define ACP_SDW1_STAT BIT(2) #define ACP_ERROR_IRQ BIT(29) +#define ACP_AUDIO0_TX_THRESHOLD 0x1c +#define ACP_AUDIO1_TX_THRESHOLD 0x1a +#define ACP_AUDIO2_TX_THRESHOLD 0x18 +#define ACP_AUDIO0_RX_THRESHOLD 0x1b +#define ACP_AUDIO1_RX_THRESHOLD 0x19 +#define ACP_AUDIO2_RX_THRESHOLD 0x17 +#define ACP_P1_AUDIO1_TX_THRESHOLD BIT(6) +#define ACP_P1_AUDIO1_RX_THRESHOLD BIT(5) +#define ACP_SDW_DMA_IRQ_MASK 0x1F800000 +#define ACP_P1_SDW_DMA_IRQ_MASK 0x60 +#define ACP63_SDW0_DMA_MAX_STREAMS 6 +#define ACP63_SDW1_DMA_MAX_STREAMS 2 +#define ACP_P1_AUDIO_TX_THRESHOLD 6 +#define SDW0_DMA_TX_IRQ_MASK(i) (ACP_AUDIO0_TX_THRESHOLD - (2 * (i))) +#define SDW0_DMA_RX_IRQ_MASK(i) (ACP_AUDIO0_RX_THRESHOLD - (2 * (i))) +#define SDW1_DMA_IRQ_MASK(i) (ACP_P1_AUDIO_TX_THRESHOLD - (i)) + +#define ACP_DELAY_US 5 +#define ACP_SDW_RING_BUFF_ADDR_OFFSET (128 * 1024) +#define SDW0_MEM_WINDOW_START 0x4800000 +#define ACP_SDW_SRAM_PTE_OFFSET 0x03800400 +#define SDW0_PTE_OFFSET 0x400 +#define SDW_FIFO_SIZE 0x100 +#define SDW_DMA_SIZE 0x40 +#define ACP_SDW0_FIFO_OFFSET 0x100 +#define SDW_PTE_OFFSET(i) (SDW0_PTE_OFFSET + ((i) * 0x600)) +#define ACP_SDW_FIFO_OFFSET(i) (ACP_SDW0_FIFO_OFFSET + ((i) * 0x500)) +#define SDW_MEM_WINDOW_START(i) (SDW0_MEM_WINDOW_START + ((i) * 0xC0000)) + +#define SDW_PLAYBACK_MIN_NUM_PERIODS 2 +#define SDW_PLAYBACK_MAX_NUM_PERIODS 8 +#define SDW_PLAYBACK_MAX_PERIOD_SIZE 8192 +#define SDW_PLAYBACK_MIN_PERIOD_SIZE 1024 +#define SDW_CAPTURE_MIN_NUM_PERIODS 2 +#define SDW_CAPTURE_MAX_NUM_PERIODS 8 +#define SDW_CAPTURE_MAX_PERIOD_SIZE 8192 +#define SDW_CAPTURE_MIN_PERIOD_SIZE 1024 + +#define SDW_MAX_BUFFER (SDW_PLAYBACK_MAX_PERIOD_SIZE * SDW_PLAYBACK_MAX_NUM_PERIODS) +#define SDW_MIN_BUFFER SDW_MAX_BUFFER enum acp_config { ACP_CONFIG_0 = 0, @@ -151,6 +191,36 @@ struct pdm_dev_data { struct sdw_dma_dev_data { void __iomem *acp_base; struct mutex *acp_lock; /* used to protect acp common register access */ + struct snd_pcm_substream *sdw0_dma_stream[ACP63_SDW0_DMA_MAX_STREAMS]; + struct snd_pcm_substream *sdw1_dma_stream[ACP63_SDW1_DMA_MAX_STREAMS]; +}; + +struct acp_sdw_dma_stream { + u16 num_pages; + u16 channels; + u32 stream_id; + u32 instance; + dma_addr_t dma_addr; + u64 bytescount; +}; + +union acp_sdw_dma_count { + struct { + u32 low; + u32 high; + } bcount; + u64 bytescount; +}; + +struct sdw_dma_ring_buf_reg { + u32 reg_dma_size; + u32 reg_fifo_addr; + u32 reg_fifo_size; + u32 reg_ring_buf_size; + u32 reg_ring_buf_addr; + u32 water_mark_size_reg; + u32 pos_low_reg; + u32 pos_high_reg; }; /** diff --git a/sound/soc/amd/ps/ps-sdw-dma.c b/sound/soc/amd/ps/ps-sdw-dma.c index f41849fd035c..be68003cbd67 100644 --- a/sound/soc/amd/ps/ps-sdw-dma.c +++ b/sound/soc/amd/ps/ps-sdw-dma.c @@ -12,12 +12,427 @@ #include #include #include +#include #include "acp63.h" #define DRV_NAME "amd_ps_sdw_dma" +static struct sdw_dma_ring_buf_reg sdw0_dma_ring_buf_reg[ACP63_SDW0_DMA_MAX_STREAMS] = { + {ACP_AUDIO0_TX_DMA_SIZE, ACP_AUDIO0_TX_FIFOADDR, ACP_AUDIO0_TX_FIFOSIZE, + ACP_AUDIO0_TX_RINGBUFSIZE, ACP_AUDIO0_TX_RINGBUFADDR, ACP_AUDIO0_TX_INTR_WATERMARK_SIZE, + ACP_AUDIO0_TX_LINEARPOSITIONCNTR_LOW, ACP_AUDIO0_TX_LINEARPOSITIONCNTR_HIGH}, + {ACP_AUDIO1_TX_DMA_SIZE, ACP_AUDIO1_TX_FIFOADDR, ACP_AUDIO1_TX_FIFOSIZE, + ACP_AUDIO1_TX_RINGBUFSIZE, ACP_AUDIO1_TX_RINGBUFADDR, ACP_AUDIO1_TX_INTR_WATERMARK_SIZE, + ACP_AUDIO1_TX_LINEARPOSITIONCNTR_LOW, ACP_AUDIO1_TX_LINEARPOSITIONCNTR_HIGH}, + {ACP_AUDIO2_TX_DMA_SIZE, ACP_AUDIO2_TX_FIFOADDR, ACP_AUDIO2_TX_FIFOSIZE, + ACP_AUDIO2_TX_RINGBUFSIZE, ACP_AUDIO2_TX_RINGBUFADDR, ACP_AUDIO2_TX_INTR_WATERMARK_SIZE, + ACP_AUDIO2_TX_LINEARPOSITIONCNTR_LOW, ACP_AUDIO2_TX_LINEARPOSITIONCNTR_HIGH}, + {ACP_AUDIO0_RX_DMA_SIZE, ACP_AUDIO0_RX_FIFOADDR, ACP_AUDIO0_RX_FIFOSIZE, + ACP_AUDIO0_RX_RINGBUFSIZE, ACP_AUDIO0_RX_RINGBUFADDR, ACP_AUDIO0_RX_INTR_WATERMARK_SIZE, + ACP_AUDIO0_TX_LINEARPOSITIONCNTR_LOW, ACP_AUDIO0_TX_LINEARPOSITIONCNTR_HIGH}, + {ACP_AUDIO1_RX_DMA_SIZE, ACP_AUDIO1_RX_FIFOADDR, ACP_AUDIO1_RX_FIFOSIZE, + ACP_AUDIO1_RX_RINGBUFSIZE, ACP_AUDIO1_RX_RINGBUFADDR, ACP_AUDIO1_RX_INTR_WATERMARK_SIZE, + ACP_AUDIO1_RX_LINEARPOSITIONCNTR_LOW, ACP_AUDIO1_RX_LINEARPOSITIONCNTR_HIGH}, + {ACP_AUDIO2_RX_DMA_SIZE, ACP_AUDIO2_RX_FIFOADDR, ACP_AUDIO2_RX_FIFOSIZE, + ACP_AUDIO2_RX_RINGBUFSIZE, ACP_AUDIO2_RX_RINGBUFADDR, ACP_AUDIO2_RX_INTR_WATERMARK_SIZE, + ACP_AUDIO2_RX_LINEARPOSITIONCNTR_LOW, ACP_AUDIO2_RX_LINEARPOSITIONCNTR_HIGH} +}; + +static struct sdw_dma_ring_buf_reg sdw1_dma_ring_buf_reg[ACP63_SDW1_DMA_MAX_STREAMS] = { + {ACP_P1_AUDIO1_TX_DMA_SIZE, ACP_P1_AUDIO1_TX_FIFOADDR, ACP_P1_AUDIO1_TX_FIFOSIZE, + ACP_P1_AUDIO1_TX_RINGBUFSIZE, ACP_P1_AUDIO1_TX_RINGBUFADDR, + ACP_P1_AUDIO1_TX_INTR_WATERMARK_SIZE, + ACP_P1_AUDIO1_TX_LINEARPOSITIONCNTR_LOW, ACP_P1_AUDIO1_TX_LINEARPOSITIONCNTR_HIGH}, + {ACP_P1_AUDIO1_RX_DMA_SIZE, ACP_P1_AUDIO1_RX_FIFOADDR, ACP_P1_AUDIO1_RX_FIFOSIZE, + ACP_P1_AUDIO1_RX_RINGBUFSIZE, ACP_P1_AUDIO1_RX_RINGBUFADDR, + ACP_P1_AUDIO1_RX_INTR_WATERMARK_SIZE, + ACP_P1_AUDIO1_RX_LINEARPOSITIONCNTR_LOW, ACP_P1_AUDIO1_RX_LINEARPOSITIONCNTR_HIGH}, +}; + +static u32 sdw0_dma_enable_reg[ACP63_SDW0_DMA_MAX_STREAMS] = { + ACP_SW0_AUDIO0_TX_EN, + ACP_SW0_AUDIO1_TX_EN, + ACP_SW0_AUDIO2_TX_EN, + ACP_SW0_AUDIO0_RX_EN, + ACP_SW0_AUDIO1_RX_EN, + ACP_SW0_AUDIO2_RX_EN, +}; + +static u32 sdw1_dma_enable_reg[ACP63_SDW1_DMA_MAX_STREAMS] = { + ACP_SW1_AUDIO1_TX_EN, + ACP_SW1_AUDIO1_RX_EN, +}; + +static const struct snd_pcm_hardware acp63_sdw_hardware_playback = { + .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_S16_LE | SNDRV_PCM_FMTBIT_S8 | + SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S24_LE | 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 = SDW_PLAYBACK_MAX_NUM_PERIODS * SDW_PLAYBACK_MAX_PERIOD_SIZE, + .period_bytes_min = SDW_PLAYBACK_MIN_PERIOD_SIZE, + .period_bytes_max = SDW_PLAYBACK_MAX_PERIOD_SIZE, + .periods_min = SDW_PLAYBACK_MIN_NUM_PERIODS, + .periods_max = SDW_PLAYBACK_MAX_NUM_PERIODS, +}; + +static const struct snd_pcm_hardware acp63_sdw_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_S16_LE | SNDRV_PCM_FMTBIT_S8 | + SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S24_LE | 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 = SDW_CAPTURE_MAX_NUM_PERIODS * SDW_CAPTURE_MAX_PERIOD_SIZE, + .period_bytes_min = SDW_CAPTURE_MIN_PERIOD_SIZE, + .period_bytes_max = SDW_CAPTURE_MAX_PERIOD_SIZE, + .periods_min = SDW_CAPTURE_MIN_NUM_PERIODS, + .periods_max = SDW_CAPTURE_MAX_NUM_PERIODS, +}; + +static void acp63_config_dma(struct acp_sdw_dma_stream *stream, void __iomem *acp_base, + u32 stream_id) +{ + u16 page_idx; + u32 low, high, val; + u32 sdw_dma_pte_offset; + dma_addr_t addr; + + addr = stream->dma_addr; + sdw_dma_pte_offset = SDW_PTE_OFFSET(stream->instance); + val = sdw_dma_pte_offset + (stream_id * 256); + + /* Group Enable */ + writel(ACP_SDW_SRAM_PTE_OFFSET | BIT(31), acp_base + ACPAXI2AXI_ATU_BASE_ADDR_GRP_2); + writel(PAGE_SIZE_4K_ENABLE, acp_base + ACPAXI2AXI_ATU_PAGE_SIZE_GRP_2); + for (page_idx = 0; page_idx < stream->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); + + writel(low, acp_base + ACP_SCRATCH_REG_0 + val); + high |= BIT(31); + writel(high, acp_base + ACP_SCRATCH_REG_0 + val + 4); + val += 8; + addr += PAGE_SIZE; + } + writel(0x1, acp_base + ACPAXI2AXI_ATU_CTRL); +} + +static int acp63_configure_sdw_ringbuffer(void __iomem *acp_base, u32 stream_id, u32 size, + u32 manager_instance) +{ + u32 reg_dma_size; + u32 reg_fifo_addr; + u32 reg_fifo_size; + u32 reg_ring_buf_size; + u32 reg_ring_buf_addr; + u32 sdw_fifo_addr; + u32 sdw_fifo_offset; + u32 sdw_ring_buf_addr; + u32 sdw_ring_buf_size; + u32 sdw_mem_window_offset; + + switch (manager_instance) { + case ACP_SDW0: + reg_dma_size = sdw0_dma_ring_buf_reg[stream_id].reg_dma_size; + reg_fifo_addr = sdw0_dma_ring_buf_reg[stream_id].reg_fifo_addr; + reg_fifo_size = sdw0_dma_ring_buf_reg[stream_id].reg_fifo_size; + reg_ring_buf_size = sdw0_dma_ring_buf_reg[stream_id].reg_ring_buf_size; + reg_ring_buf_addr = sdw0_dma_ring_buf_reg[stream_id].reg_ring_buf_addr; + break; + case ACP_SDW1: + reg_dma_size = sdw1_dma_ring_buf_reg[stream_id].reg_dma_size; + reg_fifo_addr = sdw1_dma_ring_buf_reg[stream_id].reg_fifo_addr; + reg_fifo_size = sdw1_dma_ring_buf_reg[stream_id].reg_fifo_size; + reg_ring_buf_size = sdw1_dma_ring_buf_reg[stream_id].reg_ring_buf_size; + reg_ring_buf_addr = sdw1_dma_ring_buf_reg[stream_id].reg_ring_buf_addr; + break; + default: + return -EINVAL; + } + sdw_fifo_offset = ACP_SDW_FIFO_OFFSET(manager_instance); + sdw_mem_window_offset = SDW_MEM_WINDOW_START(manager_instance); + sdw_fifo_addr = sdw_fifo_offset + (stream_id * 256); + sdw_ring_buf_addr = sdw_mem_window_offset + (stream_id * ACP_SDW_RING_BUFF_ADDR_OFFSET); + sdw_ring_buf_size = size; + writel(sdw_ring_buf_size, acp_base + reg_ring_buf_size); + writel(sdw_ring_buf_addr, acp_base + reg_ring_buf_addr); + writel(sdw_fifo_addr, acp_base + reg_fifo_addr); + writel(SDW_DMA_SIZE, acp_base + reg_dma_size); + writel(SDW_FIFO_SIZE, acp_base + reg_fifo_size); + return 0; +} + +static int acp63_sdw_dma_open(struct snd_soc_component *component, + struct snd_pcm_substream *substream) +{ + struct snd_pcm_runtime *runtime; + struct acp_sdw_dma_stream *stream; + struct snd_soc_dai *cpu_dai; + struct amd_sdw_manager *amd_manager; + struct snd_soc_pcm_runtime *prtd = substream->private_data; + int ret; + + runtime = substream->runtime; + cpu_dai = asoc_rtd_to_cpu(prtd, 0); + amd_manager = snd_soc_dai_get_drvdata(cpu_dai); + stream = kzalloc(sizeof(*stream), GFP_KERNEL); + if (!stream) + return -ENOMEM; + + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + runtime->hw = acp63_sdw_hardware_playback; + else + runtime->hw = acp63_sdw_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(stream); + return ret; + } + + stream->stream_id = cpu_dai->id; + stream->instance = amd_manager->instance; + runtime->private_data = stream; + return ret; +} + +static int acp63_sdw_dma_hw_params(struct snd_soc_component *component, + struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params) +{ + struct acp_sdw_dma_stream *stream; + struct sdw_dma_dev_data *sdw_data; + u32 period_bytes; + u32 water_mark_size_reg; + u32 irq_mask, ext_intr_ctrl; + u64 size; + u32 stream_id; + u32 acp_ext_intr_cntl_reg; + int ret; + + sdw_data = dev_get_drvdata(component->dev); + stream = substream->runtime->private_data; + if (!stream) + return -EINVAL; + stream_id = stream->stream_id; + switch (stream->instance) { + case ACP_SDW0: + sdw_data->sdw0_dma_stream[stream_id] = substream; + water_mark_size_reg = sdw0_dma_ring_buf_reg[stream_id].water_mark_size_reg; + acp_ext_intr_cntl_reg = ACP_EXTERNAL_INTR_CNTL; + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + irq_mask = BIT(SDW0_DMA_TX_IRQ_MASK(stream_id)); + else + irq_mask = BIT(SDW0_DMA_RX_IRQ_MASK(stream_id)); + break; + case ACP_SDW1: + sdw_data->sdw1_dma_stream[stream_id] = substream; + acp_ext_intr_cntl_reg = ACP_EXTERNAL_INTR_CNTL1; + water_mark_size_reg = sdw1_dma_ring_buf_reg[stream_id].water_mark_size_reg; + irq_mask = BIT(SDW1_DMA_IRQ_MASK(stream_id)); + break; + default: + return -EINVAL; + } + size = params_buffer_bytes(params); + period_bytes = params_period_bytes(params); + stream->dma_addr = substream->runtime->dma_addr; + stream->num_pages = (PAGE_ALIGN(size) >> PAGE_SHIFT); + acp63_config_dma(stream, sdw_data->acp_base, stream_id); + ret = acp63_configure_sdw_ringbuffer(sdw_data->acp_base, stream_id, size, + stream->instance); + if (ret) { + dev_err(component->dev, "Invalid DMA channel\n"); + return -EINVAL; + } + ext_intr_ctrl = readl(sdw_data->acp_base + acp_ext_intr_cntl_reg); + ext_intr_ctrl |= irq_mask; + writel(ext_intr_ctrl, sdw_data->acp_base + acp_ext_intr_cntl_reg); + writel(period_bytes, sdw_data->acp_base + water_mark_size_reg); + return 0; +} + +static u64 acp63_sdw_get_byte_count(struct acp_sdw_dma_stream *stream, void __iomem *acp_base) +{ + union acp_sdw_dma_count byte_count; + u32 pos_low_reg, pos_high_reg; + + byte_count.bytescount = 0; + switch (stream->instance) { + case ACP_SDW0: + pos_low_reg = sdw0_dma_ring_buf_reg[stream->stream_id].pos_low_reg; + pos_high_reg = sdw0_dma_ring_buf_reg[stream->stream_id].pos_high_reg; + break; + case ACP_SDW1: + pos_low_reg = sdw1_dma_ring_buf_reg[stream->stream_id].pos_low_reg; + pos_high_reg = sdw1_dma_ring_buf_reg[stream->stream_id].pos_high_reg; + break; + default: + return -EINVAL; + } + if (pos_low_reg) { + byte_count.bcount.high = readl(acp_base + pos_high_reg); + byte_count.bcount.low = readl(acp_base + pos_low_reg); + } + return byte_count.bytescount; +} + +static snd_pcm_uframes_t acp63_sdw_dma_pointer(struct snd_soc_component *comp, + struct snd_pcm_substream *substream) +{ + struct sdw_dma_dev_data *sdw_data; + struct acp_sdw_dma_stream *stream; + u32 pos, buffersize; + u64 bytescount; + + sdw_data = dev_get_drvdata(comp->dev); + stream = substream->runtime->private_data; + buffersize = frames_to_bytes(substream->runtime, + substream->runtime->buffer_size); + bytescount = acp63_sdw_get_byte_count(stream, sdw_data->acp_base); + if (bytescount > stream->bytescount) + bytescount -= stream->bytescount; + pos = do_div(bytescount, buffersize); + return bytes_to_frames(substream->runtime, pos); +} + +static int acp63_sdw_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, SDW_MIN_BUFFER, SDW_MAX_BUFFER); + return 0; +} + +static int acp63_sdw_dma_close(struct snd_soc_component *component, + struct snd_pcm_substream *substream) +{ + struct sdw_dma_dev_data *sdw_data; + struct acp_sdw_dma_stream *stream; + + sdw_data = dev_get_drvdata(component->dev); + stream = substream->runtime->private_data; + if (!stream) + return -EINVAL; + switch (stream->instance) { + case ACP_SDW0: + sdw_data->sdw0_dma_stream[stream->stream_id] = NULL; + break; + case ACP_SDW1: + sdw_data->sdw1_dma_stream[stream->stream_id] = NULL; + break; + default: + return -EINVAL; + } + kfree(stream); + return 0; +} + +static int acp63_sdw_dma_start(struct snd_pcm_substream *substream, void __iomem *acp_base) +{ + struct acp_sdw_dma_stream *stream; + u32 stream_id; + u32 sdw_dma_en_reg; + u32 sdw_dma_en_stat_reg; + u32 sdw_dma_stat; + + stream = substream->runtime->private_data; + stream_id = stream->stream_id; + switch (stream->instance) { + case ACP_SDW0: + sdw_dma_en_reg = sdw0_dma_enable_reg[stream_id]; + break; + case ACP_SDW1: + sdw_dma_en_reg = sdw1_dma_enable_reg[stream_id]; + break; + default: + return -EINVAL; + } + writel(0x01, acp_base + sdw_dma_en_reg); + sdw_dma_en_stat_reg = sdw_dma_en_reg + 4; + return readl_poll_timeout(acp_base + sdw_dma_en_stat_reg, sdw_dma_stat, + (sdw_dma_stat & BIT(0)), ACP_DELAY_US, ACP_COUNTER); +} + +static int acp63_sdw_dma_stop(struct snd_pcm_substream *substream, void __iomem *acp_base) +{ + struct acp_sdw_dma_stream *stream; + u32 stream_id; + u32 sdw_dma_en_reg; + u32 sdw_dma_en_stat_reg; + u32 sdw_dma_stat; + + stream = substream->runtime->private_data; + stream_id = stream->stream_id; + switch (stream->instance) { + case ACP_SDW0: + sdw_dma_en_reg = sdw0_dma_enable_reg[stream_id]; + break; + case ACP_SDW1: + sdw_dma_en_reg = sdw1_dma_enable_reg[stream_id]; + break; + default: + return -EINVAL; + } + + writel(0, acp_base + sdw_dma_en_reg); + sdw_dma_en_stat_reg = sdw_dma_en_reg + 4; + return readl_poll_timeout(acp_base + sdw_dma_en_stat_reg, sdw_dma_stat, !sdw_dma_stat, + ACP_DELAY_US, ACP_COUNTER); +} + +static int acp63_sdw_dma_trigger(struct snd_soc_component *comp, + struct snd_pcm_substream *substream, + int cmd) +{ + struct sdw_dma_dev_data *sdw_data; + int ret; + + sdw_data = dev_get_drvdata(comp->dev); + switch (cmd) { + case SNDRV_PCM_TRIGGER_START: + case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: + case SNDRV_PCM_TRIGGER_RESUME: + ret = acp63_sdw_dma_start(substream, sdw_data->acp_base); + break; + case SNDRV_PCM_TRIGGER_PAUSE_PUSH: + case SNDRV_PCM_TRIGGER_SUSPEND: + case SNDRV_PCM_TRIGGER_STOP: + ret = acp63_sdw_dma_stop(substream, sdw_data->acp_base); + break; + default: + ret = -EINVAL; + } + if (ret) + dev_err(comp->dev, "trigger %d failed: %d", cmd, ret); + return ret; +} + static const struct snd_soc_component_driver acp63_sdw_component = { .name = DRV_NAME, + .open = acp63_sdw_dma_open, + .close = acp63_sdw_dma_close, + .hw_params = acp63_sdw_dma_hw_params, + .trigger = acp63_sdw_dma_trigger, + .pointer = acp63_sdw_dma_pointer, + .pcm_construct = acp63_sdw_dma_new, }; static int acp63_sdw_platform_probe(struct platform_device *pdev) From patchwork Mon May 22 13:31:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 97442 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1462236vqo; Mon, 22 May 2023 06:48:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6X/2B6KSke9j1vp3E50/WpE5Ou5mM8+rT83YpXTtOmpzHPJP8Jtf3P33vwGk5hzyCH52GO X-Received: by 2002:a05:6a20:a12a:b0:104:b7b4:e044 with SMTP id q42-20020a056a20a12a00b00104b7b4e044mr11180442pzk.48.1684763319739; Mon, 22 May 2023 06:48:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1684763319; cv=pass; d=google.com; s=arc-20160816; b=V47RHfmuguBFGI7Rg4N9Cdw83he4ybNsOLQk5cbB346srhuQwvPWFTCtNbjpX7xM45 9CYLftWOoIji7Rmnz9+lvnDBDDB6w9mokqBOfaNUSFJK8EfA6qTGInL+jmKm7iKx9HNM LK0zuJ7z3mLuE0kZr9lnBjozQmTlOQybbhv1J7Ne9OydGupivSjzfX6+hgN3wkQIhSgk I+1JvjpEG1/3VeOVWA2cqR/RvZz23CjP0Y2+EQJKXCRFTpEY1RYp+Qv/kb3rkMKn16uq DclWoVOxK1thdd+2ZhRp2hioHJS+ppNFmMi2xij8yYGMcVGk3nGqSwq7OcwjWdsazbiN +jmQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=eZbxvAxYZC0EpswSIYqHHjUHd+fyDNp2Fy3fyBpR4L4=; b=UZdAcZaO+5XZlAp1wvIWqQdcZJn/Nt4ZwHf1pGGBiJ6f3Yx36+ji84orfN9/eMnaIP b/XolW7XnjkkNapkwJ36gCYK1Skxd+Fg3fGLbmjPIdceNWrK+cXmela2R5+r9pPzrqAH sfYKjqiMqnXMv3fEVaKoiZeKOFII2t0JiKJKYSD6WfgCAQbaSsyolC7O9XpRrvt0pWbm Ee03Dw1uJtUShtLbszofIEWlsxljKV1DmCXiLQ2gRfq4vOizw8rBW+enTnkC77RKq63e 9LnJnWh02eRFQMoA4LqY15XTfQxtuxIr/iR084HUzYs1+92nctLWCJ4WMMUVTh58evUJ g7SA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=hdv6bWQR; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w71-20020a63824a000000b005347ac15c24si4743057pgd.421.2023.05.22.06.48.25; Mon, 22 May 2023 06:48:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=hdv6bWQR; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233893AbjEVN1X (ORCPT + 99 others); Mon, 22 May 2023 09:27:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234040AbjEVN1R (ORCPT ); Mon, 22 May 2023 09:27:17 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2059.outbound.protection.outlook.com [40.107.244.59]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2A8A129 for ; Mon, 22 May 2023 06:27:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NG2xw7i3D8UBJ9tPn0tFmFnh5FZByNGVkhfwALmmSodjawhUj1PdraNb4mzivg3rFEARF9Tbm+QJkDxvNvp8Xtj4lV0Sh/on6DBl/rgqJIIEQTAuU6DrNuQl2jg2fcvDQPfuNQqzfvlUgrsAd5Snve8SO8jk1qEzG/g+GTXf7XAZRZKPWaRSOh7qiDk10zeYRFOfCxpmhFz6tPuEPXQkUN3zVoFcqg/d+KXkrE6jztBLTowzCSJkAlUWd1Gs9DElN5QwrdYfNpH0BUcUlPHsmtbhaJsA2LTIBoE/pac4wkhUrL0KUaGJQ+xGmW+puXYYDFZISuB48rp9f+PNGW7zRg== 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=eZbxvAxYZC0EpswSIYqHHjUHd+fyDNp2Fy3fyBpR4L4=; b=PY3N8piMpkeI4AeFBc3BwF52Fe4E5MOjatxx3PVV4mzWxmAueJkT8SAf4dOj5ElZg5e1E9iF4dfN3h+8DRKbYGw1EjDhglXxtc4F+fchLOH30RHiuSTRuK8KKEZp8WcQnFIpr70EVmUve+5dVFuZyzM0bFSrI1EPuw/7WbGAM8hloDeHgSrtkyhUw6r5Wp1mV2iMiEfGPAK22n2slmoDirUNrJ5oruxQqMdBVv2Ju+yMEwrNprRZ1X1NAGBbbVAhKx0WtSSTzkiGN0ZyzaDHKGlcKHD6bcmniRn8mSQj5+Ri/ZoJcwc+UZIieVHJdQerSxoSFET+pcPjngaYws+gpA== 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=eZbxvAxYZC0EpswSIYqHHjUHd+fyDNp2Fy3fyBpR4L4=; b=hdv6bWQRVOFjDz0JavZi0s0yL3r+wYuSfXzVtMnSjhGmCMAXj3C6l2FYURAyjxKAs1K9j9dYY55P5RRdhI58tA/1EkDZcVmCfNNFtlVI/1ff/6cgA9F/AYt3DUQ2S7JTq5AmgCq4ALI0JXV0AZKAFYdhAxVoOZdUCH3OGsHmdtE= Received: from MW4PR03CA0071.namprd03.prod.outlook.com (2603:10b6:303:b6::16) by CH3PR12MB8512.namprd12.prod.outlook.com (2603:10b6:610:158::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28; Mon, 22 May 2023 13:27:02 +0000 Received: from CO1NAM11FT058.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b6:cafe::21) by MW4PR03CA0071.outlook.office365.com (2603:10b6:303:b6::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28 via Frontend Transport; Mon, 22 May 2023 13:27:02 +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 CO1NAM11FT058.mail.protection.outlook.com (10.13.174.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6411.28 via Frontend Transport; Mon, 22 May 2023 13:27:01 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 22 May 2023 08:27:01 -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.34; Mon, 22 May 2023 08:27:00 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 22 May 2023 08:26:57 -0500 From: Vijendar Mukunda To: CC: , , , , , , , Vijendar Mukunda , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Syed Saba Kareem , open list Subject: [PATCH V2 5/9] ASoC: amd: ps: add support for SoundWire DMA interrupts Date: Mon, 22 May 2023 19:01:18 +0530 Message-ID: <20230522133122.166841-6-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230522133122.166841-1-Vijendar.Mukunda@amd.com> References: <20230522133122.166841-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT058:EE_|CH3PR12MB8512:EE_ X-MS-Office365-Filtering-Correlation-Id: 60dfc6bf-138b-4e20-1376-08db5ac83a46 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: a7nXXbzDgGH3X1E4y1d8JJ6qRDLAPUwlq+2xmgUwV3DK5CpEC5u8+WAo3ZCMEDijv9jdB3E7v5FyTyAS0oNyKad0Aje/U426zinsve7AsjkE7TqbQmxK2Ehhuc+FNfMuJfFHFYJlNyLVMaB3xg5XYENtRyh2ebKS4Q8UbUqgcNtOBFv/ANW4+36/Pa+G/BB6qG3DG5E6jW6yEZn623h2rRTega9PEKNHPfE+LP0ltjgxhC1DVH8a/uD5TnZ6v68KK5VyoYnd902gu5gtxtQpmXBGYSfuwHY1woFVsa9COGoPmOEGu4g/nXfyfjF9FnqYymP2Pj26lqA4QiszDMHd2kr3MUBMUEYZCSRI+wp3klq6E6K4M2Rnb/j0a6MkNamb9x91b1gQIjAj16VSNLQXmzDf+ngs0Q9GKZ2xjvBnUZkygJbVi/9cC2UzYk4Y84dDfkwhlDTI7X5EHpcCUuutYEEayRIvyN3It+EqXLgSXF1QHJ3R6MTlCwoYyFBmZNH45lOC1Bv+rXDPCHynXUTOlonSQcwoFAqbTFO03TuEW5ZbIBSC+nIWEm6cbWFy7VgKqBranPIbj23HLlZ0SLCkt5WXuExcVy7hui/KdWZIiPX97dkjxfS6ZlaOVjwf84asY6MefZqy6DupLgZmI2AI70bovYz/Vp4tsg5kSLyXjzSrnY7VOz30a5GVz3eDL5yphpNq1qQJ90ydRHdq8MJyuiXgFws5Dwka3dIg3xt4dNizsiav+LbWvLf6zq2d9HCJDAxQwKIAtp2wkEYxQA06bA== 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:(13230028)(4636009)(136003)(346002)(396003)(39860400002)(376002)(451199021)(36840700001)(46966006)(40470700004)(6666004)(316002)(478600001)(1076003)(26005)(54906003)(41300700001)(6916009)(4326008)(7696005)(70586007)(70206006)(40460700003)(8676002)(8936002)(5660300002)(82310400005)(40480700001)(86362001)(2906002)(83380400001)(47076005)(36860700001)(82740400003)(81166007)(186003)(36756003)(2616005)(356005)(426003)(336012)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2023 13:27:01.9281 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 60dfc6bf-138b-4e20-1376-08db5ac83a46 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: CO1NAM11FT058.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8512 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766602382412924372?= X-GMAIL-MSGID: =?utf-8?q?1766602382412924372?= Initialize workqueue for SoundWire DMA interrupts handling. Whenever audio data equal to the SoundWire FIFO watermark level are produced/consumed, interrupt is generated. Acknowledge the interrupt and schedule the workqueue. Signed-off-by: Vijendar Mukunda --- sound/soc/amd/ps/acp63.h | 20 +++++++++ sound/soc/amd/ps/pci-ps.c | 87 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 106 insertions(+), 1 deletion(-) diff --git a/sound/soc/amd/ps/acp63.h b/sound/soc/amd/ps/acp63.h index 37ae8f18225a..1a3e47fb9d02 100644 --- a/sound/soc/amd/ps/acp63.h +++ b/sound/soc/amd/ps/acp63.h @@ -173,6 +173,20 @@ enum acp_pdev_mask { ACP63_SDW_PDM_DEV_MASK, }; +enum amd_sdw0_channel { + ACP_SDW0_AUDIO0_TX = 0, + ACP_SDW0_AUDIO1_TX, + ACP_SDW0_AUDIO2_TX, + ACP_SDW0_AUDIO0_RX, + ACP_SDW0_AUDIO1_RX, + ACP_SDW0_AUDIO2_RX, +}; + +enum amd_sdw1_channel { + ACP_SDW1_AUDIO1_TX, + ACP_SDW1_AUDIO1_RX, +}; + struct pdm_stream_instance { u16 num_pages; u16 channels; @@ -230,6 +244,7 @@ struct sdw_dma_ring_buf_reg { * @pdev: array of child platform device node structures * @acp_lock: used to protect acp common registers * @sdw_fw_node: SoundWire controller fw node handle + * @acp_sdw_dma_work: SoundWire DMA interrupts workqueue * @pdev_mask: platform device mask * @pdev_count: platform devices count * @pdm_dev_index: pdm platform device index @@ -237,6 +252,8 @@ struct sdw_dma_ring_buf_reg { * @sdw0_dev_index: SoundWire Manager-0 platform device index * @sdw1_dev_index: SoundWire Manager-1 platform device index * @sdw_dma_dev_index: SoundWire DMA controller platform device index + * @sdw0-dma_intr_stat: DMA interrupt status array for SoundWire manager-SW0 instance + * @sdw_dma_intr_stat: DMA interrupt status array for SoundWire manager-SW1 instance * @acp_reset: flag set to true when bus reset is applied across all * the active SoundWire manager instances */ @@ -247,6 +264,7 @@ struct acp63_dev_data { struct platform_device *pdev[ACP63_DEVS]; struct mutex acp_lock; /* protect shared registers */ struct fwnode_handle *sdw_fw_node; + struct work_struct acp_sdw_dma_work; u16 pdev_mask; u16 pdev_count; u16 pdm_dev_index; @@ -254,6 +272,8 @@ struct acp63_dev_data { u16 sdw0_dev_index; u16 sdw1_dev_index; u16 sdw_dma_dev_index; + u16 sdw0_dma_intr_stat[ACP63_SDW0_DMA_MAX_STREAMS]; + u16 sdw1_dma_intr_stat[ACP63_SDW1_DMA_MAX_STREAMS]; bool acp_reset; }; diff --git a/sound/soc/amd/ps/pci-ps.c b/sound/soc/amd/ps/pci-ps.c index 26514e340a33..c99ac5d90097 100644 --- a/sound/soc/amd/ps/pci-ps.c +++ b/sound/soc/amd/ps/pci-ps.c @@ -99,14 +99,44 @@ static int acp63_deinit(void __iomem *acp_base, struct device *dev) return 0; } +static void acp63_sdw_dma_workthread(struct work_struct *work) +{ + struct acp63_dev_data *adata = container_of(work, struct acp63_dev_data, + acp_sdw_dma_work); + struct sdw_dma_dev_data *sdw_dma_data; + u32 stream_index; + u16 pdev_index; + + pdev_index = adata->sdw_dma_dev_index; + sdw_dma_data = dev_get_drvdata(&adata->pdev[pdev_index]->dev); + + for (stream_index = 0; stream_index < ACP63_SDW0_DMA_MAX_STREAMS; stream_index++) { + if (adata->sdw0_dma_intr_stat[stream_index]) { + if (sdw_dma_data->sdw0_dma_stream[stream_index]) + snd_pcm_period_elapsed(sdw_dma_data->sdw0_dma_stream[stream_index]); + adata->sdw0_dma_intr_stat[stream_index] = 0; + } + } + for (stream_index = 0; stream_index < ACP63_SDW1_DMA_MAX_STREAMS; stream_index++) { + if (adata->sdw1_dma_intr_stat[stream_index]) { + if (sdw_dma_data->sdw1_dma_stream[stream_index]) + snd_pcm_period_elapsed(sdw_dma_data->sdw1_dma_stream[stream_index]); + adata->sdw1_dma_intr_stat[stream_index] = 0; + } + } +} + static irqreturn_t acp63_irq_handler(int irq, void *dev_id) { struct acp63_dev_data *adata; struct pdm_dev_data *ps_pdm_data; struct amd_sdw_manager *amd_manager; u32 ext_intr_stat, ext_intr_stat1; + u32 stream_id = 0; u16 irq_flag = 0; + u16 sdw_dma_irq_flag = 0; u16 pdev_index; + u16 index; adata = dev_id; if (!adata) @@ -148,7 +178,57 @@ static irqreturn_t acp63_irq_handler(int irq, void *dev_id) snd_pcm_period_elapsed(ps_pdm_data->capture_stream); irq_flag = 1; } - if (irq_flag) + if (ext_intr_stat & ACP_SDW_DMA_IRQ_MASK) { + for (index = ACP_AUDIO2_RX_THRESHOLD; index <= ACP_AUDIO0_TX_THRESHOLD; index++) { + if (ext_intr_stat & BIT(index)) { + writel(BIT(index), adata->acp63_base + ACP_EXTERNAL_INTR_STAT); + switch (index) { + case ACP_AUDIO0_TX_THRESHOLD: + stream_id = ACP_SDW0_AUDIO0_TX; + break; + case ACP_AUDIO1_TX_THRESHOLD: + stream_id = ACP_SDW0_AUDIO1_TX; + break; + case ACP_AUDIO2_TX_THRESHOLD: + stream_id = ACP_SDW0_AUDIO2_TX; + break; + case ACP_AUDIO0_RX_THRESHOLD: + stream_id = ACP_SDW0_AUDIO0_RX; + break; + case ACP_AUDIO1_RX_THRESHOLD: + stream_id = ACP_SDW0_AUDIO1_RX; + break; + case ACP_AUDIO2_RX_THRESHOLD: + stream_id = ACP_SDW0_AUDIO2_RX; + break; + } + + adata->sdw0_dma_intr_stat[stream_id] = 1; + sdw_dma_irq_flag = 1; + } + } + } + + /* SDW1 BT RX */ + if (ext_intr_stat1 & ACP_P1_AUDIO1_RX_THRESHOLD) { + writel(ACP_P1_AUDIO1_RX_THRESHOLD, + adata->acp63_base + ACP_EXTERNAL_INTR_STAT1); + adata->sdw1_dma_intr_stat[ACP_SDW1_AUDIO1_RX] = 1; + sdw_dma_irq_flag = 1; + } + + /* SDW1 BT TX*/ + if (ext_intr_stat1 & ACP_P1_AUDIO1_TX_THRESHOLD) { + writel(ACP_P1_AUDIO1_TX_THRESHOLD, + adata->acp63_base + ACP_EXTERNAL_INTR_STAT1); + adata->sdw1_dma_intr_stat[ACP_SDW1_AUDIO1_TX] = 1; + sdw_dma_irq_flag = 1; + } + + if (sdw_dma_irq_flag) + schedule_work(&adata->acp_sdw_dma_work); + + if (irq_flag || sdw_dma_irq_flag) return IRQ_HANDLED; else return IRQ_NONE; @@ -231,6 +311,7 @@ static int get_acp63_device_config(u32 config, struct pci_dev *pci, struct acp63 sdw_dev = acpi_find_child_device(ACPI_COMPANION(&pci->dev), ACP63_SDW_ADDR, 0); if (sdw_dev) { acp_data->sdw_fw_node = acpi_fwnode_handle(sdw_dev); + INIT_WORK(&acp_data->acp_sdw_dma_work, acp63_sdw_dma_workthread); ret = sdw_amd_scan_controller(&pci->dev); /* is_sdw_dev flag will be set when SoundWire Manager device exists */ if (!ret) @@ -610,6 +691,10 @@ static void snd_acp63_remove(struct pci_dev *pci) int ret, index; adata = pci_get_drvdata(pci); + + if (adata->pdev_mask & ACP63_SDW_DEV_MASK) + cancel_work_sync(&adata->acp_sdw_dma_work); + for (index = 0; index < adata->pdev_count; index++) platform_device_unregister(adata->pdev[index]); ret = acp63_deinit(adata->acp63_base, &pci->dev); From patchwork Mon May 22 13:31:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 97437 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1454636vqo; Mon, 22 May 2023 06:36:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5+wW+yKmHodjY1TfsHEYhjHoS4XDFf/2DbxWMnM69mMqiIOnr5KG21TSrA2+Swww6dwr/8 X-Received: by 2002:a17:90b:4d8f:b0:253:3e9d:f925 with SMTP id oj15-20020a17090b4d8f00b002533e9df925mr9915357pjb.31.1684762568889; Mon, 22 May 2023 06:36:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1684762568; cv=pass; d=google.com; s=arc-20160816; b=ka0FQ5eZRjgtpUiLtI9yYmWiTwjc4awKP/H9KWpd29BIz2tupS0N9atIXsgb6Dv7je rcAMvlI/DGiGpHTws743MqCy62P4W0BoRHdUyJw1zUAWA2pJvgxnTQfLLjJMyCoPDKWv OBL5et6gETNFLZ4aa8MgyY704pB7FhVkjgJbZEq2sH6Axc/VpCJJ5OXwzKPVYPSCy939 XwP+RbSO+73+5TI/6GB05PoPwzuyMt/7zjQfthp1EOTpsmV2Rkkx3HLZfBkGR6Z/Wr9J kfO/kxKtFh5a3mGOHZa3SvKl3zC38gqSqZSvp7SccvX6RTQe8ivSe3Unvc3U8jog+9RH Nrvw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=P9pq5lYF0uuopdRMs91mGerNUEwlLmqZ0IhzMdamLmc=; b=vq7zHfnyDIt8lR/U7lJKOIhOgWd3/YkHvRllaF9WhAUUAsa/6/Df2v16ydfIo9SNPM r5h3m7+Av9cMZ3D+CS+7Y6C4l5BaVfdWKMVymREwhxCA0N/RCozjsHH9xk0cDbfBj8Dt yN95bLI1ODd3O7LJ8T6UINkcG+7YEtUDOwqegPPkrx3e8RxlPLrPzwbusH2xnPvP6ZOr N6w6dAKiAGaAnAp5h09Mg29g9e9zr8XrUQN1V0/NziT7gmHf1FjjNdzLikFCzJPHPnvu h2psVMcevBCdXRHY0+ngVN02OfS3ygtszebXeAe0MATjjRAEL0uMaMN9paWBd+P7/qV7 1wQw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=yYcuw3lk; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mg16-20020a17090b371000b002535d0a89f8si583125pjb.186.2023.05.22.06.35.56; Mon, 22 May 2023 06:36:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=yYcuw3lk; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233852AbjEVN1Z (ORCPT + 99 others); Mon, 22 May 2023 09:27:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233897AbjEVN1V (ORCPT ); Mon, 22 May 2023 09:27:21 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2044.outbound.protection.outlook.com [40.107.237.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8DA21A1 for ; Mon, 22 May 2023 06:27:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Yg5ypslMDfkV9j8bvfAgOsIv9T5sg9NgB6hCGyVNjY/vOOMTnVcveRW1SHJk4lTQauATSvAPnBFmg8eV3CoIRA6k8A6IlbwFK+NtwPSPtm42JETbSyqLbgeQVDr8dcxKqCyEAsYLENonZuGlTgjo/KNjSVHVCvWkBFoD07PAionYebBOAsDbBWPQlGzm2x2uedWisiYPOg3jwSFBkf0C4V2NjUJQwLmE2TjMJ8cAkcBSBlmBPv4t9snBpb04l1JUiOSQId6wv/iZRKCnUdLyN/QMP5QUrj/0DNqQiny/YwfbLcXpZF71GpPWkXMgox0FT4419xvh20BvSIeDWLTTsw== 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=P9pq5lYF0uuopdRMs91mGerNUEwlLmqZ0IhzMdamLmc=; b=jMQqSXewNxfpnb/spL7MM0atO5JMCwPeLzq4S4/6cNsBZ9XewVO1Z5qEJzER+qCmk17Vv7cHQxKJacG7rvt+Xx3QFJKi/dpC1lD7Oq+8kQpS84pktV5k7is2UpyudNfF+Dfg4Q+N9DdVAPeV2BV0YmhdZ/PoITirLBx6B9p7dHK2Og9rxlY6n4mOSqe565eV5SLBxXAiWaRJZ9E/N6uve+J+CfIubBN7SD7tifuFYwu304JUYx9FQTCnDwFfwn6p+JeI+2hE8IH8wEeUrZdiGHtexNhy2vSzz9zpi7nFDU7Tl4dwUg5euJFvAl1iAb0mca0a2asyFc3oVI/xBwd0UA== 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=P9pq5lYF0uuopdRMs91mGerNUEwlLmqZ0IhzMdamLmc=; b=yYcuw3lkQTw4dOCNwZ610/4oJ5121Qd/LVXTTUXmGDjSYSwX5Lf1R7Y/WHXJVV57kCbf+mFDoUosAJNXJJBk6fHxmKXKw7x6p8zWv0TfLWutppsYgdzoyAYNuMVVP6TVBtRa//b8SFEt5zm0VeI4kBM3X/fr5w1sa6HJbdWAVwE= Received: from MW4PR03CA0333.namprd03.prod.outlook.com (2603:10b6:303:dc::8) by DM8PR12MB5480.namprd12.prod.outlook.com (2603:10b6:8:24::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28; Mon, 22 May 2023 13:27:08 +0000 Received: from CO1NAM11FT106.eop-nam11.prod.protection.outlook.com (2603:10b6:303:dc:cafe::5a) by MW4PR03CA0333.outlook.office365.com (2603:10b6:303:dc::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28 via Frontend Transport; Mon, 22 May 2023 13:27:07 +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 CO1NAM11FT106.mail.protection.outlook.com (10.13.175.44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6411.28 via Frontend Transport; Mon, 22 May 2023 13:27:07 +0000 Received: from SATLEXMB08.amd.com (10.181.40.132) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 22 May 2023 08:27:06 -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.34; Mon, 22 May 2023 06:27:06 -0700 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 22 May 2023 08:27:03 -0500 From: Vijendar Mukunda To: CC: , , , , , , , Vijendar Mukunda , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , open list Subject: [PATCH V2 6/9] ASoC: amd: ps: add pm ops support for SoundWire dma driver Date: Mon, 22 May 2023 19:01:19 +0530 Message-ID: <20230522133122.166841-7-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230522133122.166841-1-Vijendar.Mukunda@amd.com> References: <20230522133122.166841-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT106:EE_|DM8PR12MB5480:EE_ X-MS-Office365-Filtering-Correlation-Id: db3a02c3-15d8-42c9-4870-08db5ac83daf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cTHdXZdva8D0A7QjDjjiFZ1u8njv7b+bISgeWoa4+LogoIWs5KSizn6UwP2RyzR7It/YsUYkwqg54eV2V1qd5ZLE1Mo+lQVNR1nXZCfct6MvX70msV5N4Mnm0E2mE0RaSlWnXBLardSgsgPitoLZ7mpWFzhFU4bsREaW+2KhobWFKsMfq2msUseHia/MKeYuNHP70fNL/wFrfKn1cJL4hdRFHhEwHsiC8YbF5OxEA7xwTDY7Jd53p2480YyPptiaG0SrSk/WkmBgiT2JHtsTvNDspHjx8cBVpn2Afn4x7S+WeHH5X7ElBfDX54zdUqTrWEJnbC/NCQmcv8+p2g7ms4AS6teIO/+QVLuGvbDo6or2DX7aJOHUvKgN6TyFOnUJDyC/EcK4XTtckDg7X2igMIsfB+05mHewtgQJOgWd2nhXZ4G4DiO0kbEQAFZnTgxlFYNcP1QQIMbwCEnl3Bru3qvExvgE7ofSVWKqavvUwV7M32UkbQQ3zW9GpKvWjQB8Pt6IF4B89oVQKkwGczeNvqajqi8+WAuSuB8H5ms23W0zZPIX6QeEv5DUbQ1sGoEPgQumBoTHOhd/YiW9oRgvLoULAWt8eRT0oE0AyJ56R8VAVhhh6ToQw0AIonHW93g2z2f2CfEzeZ+7y+hwPKj9cUf0Ou6pRiAFXKRuxe2d6Hejf90W7Yfm4WzQtLNirnwd2OJf+rMdAadbVGXFXiQpT+etn3TWRxN6f1Pg6j9p8Bf2ohSYv97nbB899pzhqrVH9zf4LmmSLtUfuX40hJ6zQg== 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:(13230028)(4636009)(39860400002)(136003)(376002)(396003)(346002)(451199021)(36840700001)(40470700004)(46966006)(2906002)(54906003)(5660300002)(36860700001)(82310400005)(47076005)(8676002)(8936002)(40460700003)(41300700001)(316002)(70206006)(70586007)(478600001)(6916009)(4326008)(36756003)(40480700001)(6666004)(7696005)(336012)(1076003)(81166007)(86362001)(2616005)(26005)(186003)(83380400001)(82740400003)(356005)(426003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2023 13:27:07.6507 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: db3a02c3-15d8-42c9-4870-08db5ac83daf 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: CO1NAM11FT106.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR12MB5480 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766601595421653508?= X-GMAIL-MSGID: =?utf-8?q?1766601595421653508?= Add support pm ops support for SoundWire dma driver. Signed-off-by: Vijendar Mukunda --- sound/soc/amd/ps/ps-sdw-dma.c | 91 ++++++++++++++++++++++++++++++++++- 1 file changed, 89 insertions(+), 2 deletions(-) diff --git a/sound/soc/amd/ps/ps-sdw-dma.c b/sound/soc/amd/ps/ps-sdw-dma.c index be68003cbd67..54cf971589c0 100644 --- a/sound/soc/amd/ps/ps-sdw-dma.c +++ b/sound/soc/amd/ps/ps-sdw-dma.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include "acp63.h" @@ -102,6 +103,29 @@ static const struct snd_pcm_hardware acp63_sdw_hardware_capture = { .periods_max = SDW_CAPTURE_MAX_NUM_PERIODS, }; +static void acp63_enable_disable_sdw_dma_interrupts(void __iomem *acp_base, bool enable) +{ + u32 ext_intr_cntl, ext_intr_cntl1; + u32 irq_mask = ACP_SDW_DMA_IRQ_MASK; + u32 irq_mask1 = ACP_P1_SDW_DMA_IRQ_MASK; + + if (enable) { + ext_intr_cntl = readl(acp_base + ACP_EXTERNAL_INTR_CNTL); + ext_intr_cntl |= irq_mask; + writel(ext_intr_cntl, acp_base + ACP_EXTERNAL_INTR_CNTL); + ext_intr_cntl1 = readl(acp_base + ACP_EXTERNAL_INTR_CNTL1); + ext_intr_cntl1 |= irq_mask1; + writel(ext_intr_cntl1, acp_base + ACP_EXTERNAL_INTR_CNTL1); + } else { + ext_intr_cntl = readl(acp_base + ACP_EXTERNAL_INTR_CNTL); + ext_intr_cntl &= ~irq_mask; + writel(ext_intr_cntl, acp_base + ACP_EXTERNAL_INTR_CNTL); + ext_intr_cntl1 = readl(acp_base + ACP_EXTERNAL_INTR_CNTL1); + ext_intr_cntl1 &= ~irq_mask1; + writel(ext_intr_cntl1, acp_base + ACP_EXTERNAL_INTR_CNTL1); + } +} + static void acp63_config_dma(struct acp_sdw_dma_stream *stream, void __iomem *acp_base, u32 stream_id) { @@ -464,16 +488,79 @@ static int acp63_sdw_platform_probe(struct platform_device *pdev) status = devm_snd_soc_register_component(&pdev->dev, &acp63_sdw_component, NULL, 0); - if (status) + if (status) { dev_err(&pdev->dev, "Fail to register sdw dma component\n"); + return status; + } + 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; +} - return status; +static int acp63_sdw_platform_remove(struct platform_device *pdev) +{ + pm_runtime_disable(&pdev->dev); + return 0; } +static int __maybe_unused acp63_sdw_pcm_resume(struct device *dev) +{ + struct sdw_dma_dev_data *sdw_data; + struct acp_sdw_dma_stream *stream; + struct snd_pcm_runtime *runtime; + u32 period_bytes, buf_size, water_mark_size_reg; + int ret; + int index; + + sdw_data = dev_get_drvdata(dev); + for (index = 0; index < ACP63_SDW0_DMA_MAX_STREAMS; index++) { + if (sdw_data->sdw0_dma_stream[index] && + sdw_data->sdw0_dma_stream[index]->runtime) { + water_mark_size_reg = sdw0_dma_ring_buf_reg[index].water_mark_size_reg; + runtime = sdw_data->sdw0_dma_stream[index]->runtime; + stream = runtime->private_data; + period_bytes = frames_to_bytes(runtime, runtime->period_size); + buf_size = frames_to_bytes(runtime, runtime->buffer_size); + acp63_config_dma(stream, sdw_data->acp_base, index); + ret = acp63_configure_sdw_ringbuffer(sdw_data->acp_base, index, + buf_size, ACP_SDW0); + if (ret) + return ret; + writel(period_bytes, sdw_data->acp_base + water_mark_size_reg); + } + } + for (index = 0; index < ACP63_SDW1_DMA_MAX_STREAMS; index++) { + if (sdw_data->sdw1_dma_stream[index] && + sdw_data->sdw1_dma_stream[index]->runtime) { + water_mark_size_reg = sdw1_dma_ring_buf_reg[index].water_mark_size_reg; + runtime = sdw_data->sdw1_dma_stream[index]->runtime; + stream = runtime->private_data; + period_bytes = frames_to_bytes(runtime, runtime->period_size); + buf_size = frames_to_bytes(runtime, runtime->buffer_size); + acp63_config_dma(stream, sdw_data->acp_base, index); + ret = acp63_configure_sdw_ringbuffer(sdw_data->acp_base, index, + buf_size, ACP_SDW1); + if (ret) + return ret; + writel(period_bytes, sdw_data->acp_base + water_mark_size_reg); + } + } + acp63_enable_disable_sdw_dma_interrupts(sdw_data->acp_base, true); + return 0; +} + +static const struct dev_pm_ops acp63_pm_ops = { + SET_SYSTEM_SLEEP_PM_OPS(NULL, acp63_sdw_pcm_resume) +}; + static struct platform_driver acp63_sdw_dma_driver = { .probe = acp63_sdw_platform_probe, + .remove = acp63_sdw_platform_remove, .driver = { .name = "amd_ps_sdw_dma", + .pm = &acp63_pm_ops, }, }; From patchwork Mon May 22 13:31:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 97438 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1455311vqo; Mon, 22 May 2023 06:37:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5U8G391Jk3XkoI9Cg2ym7Qv5X60tJ2zuo+K/tBrTnr56aY9C3bH3pLmLH9EJ9PBByytsU0 X-Received: by 2002:a17:902:db07:b0:1ac:8dae:d842 with SMTP id m7-20020a170902db0700b001ac8daed842mr13249416plx.46.1684762635767; Mon, 22 May 2023 06:37:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1684762635; cv=pass; d=google.com; s=arc-20160816; b=xIQz+EFwFggxANkcNDwW5IbvhL2h71jyVEQ6JToC8kzHfiNxrxKodmeieE5MwsvC3w C2LrBf7e+k+zlLyq/dWKOjuQhq0dN9rdSK9ochLeHEmsESrIcRXTOp3ylC+nh10Crdk9 ES5WSCZ95GJ1/Fnrq/TnbdJ7gC9kj/xRlS+RD8wGbxKcxwUgiOzhOM7xwO625419A3AQ PRU+/olGe/LjStAX/bivN0BiKZs2Um8y4BT6t4md7cz8T2zjIikQaz+0CfEJlTiaDjTL OpHHpxxsR/BASZK02o4U4dcg/2RJNoh/RuHVXKk+Bo8HyBVbLZdO/bN1U8hPCylt1hdo 5rmQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=lJPO76LeVbRLT6xdNfAEfol9vXoNWf/MqxjxFnE4yls=; b=z79z8uAJOcdiI681beBlPPLH/Jad4iKFyU5QF0X8rmesUqV6RtAZ9z1/0CE+OJFMSy WJ8M7Lx3+3tFW+ExtIGuPEplB4gcsiW/fpIfp2uk6UxniLoDPISIhQYkVcNSnT0s5dYH yQe953IdWe7UrRVB1Jnul8R9L3RR5EnqnTF7C6q4/s/iAJzqx2j3mFh+bipQ+nxGNizl FxDQA5BvR0w65FfZagEbGHcCxTd+hxtG7clt2ca4a5GD1XscWUpYMeEOk2ZujOUfBn+I Z8/Ljnxmf0cddm5umTE5T8V3TbVSbTzIGA2FQQMWZXzL8dxpQ/+LJENESbChcI183iq/ A0rQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=QuN+DVNI; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ij17-20020a170902ab5100b001aadf9e2d15si4586761plb.491.2023.05.22.06.37.02; Mon, 22 May 2023 06:37:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=QuN+DVNI; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233585AbjEVN1h (ORCPT + 99 others); Mon, 22 May 2023 09:27:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233657AbjEVN12 (ORCPT ); Mon, 22 May 2023 09:27:28 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on20601.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eab::601]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43EB2A0 for ; Mon, 22 May 2023 06:27:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=To6Ao062k8aQ5gGTaEDEdiY53NByrXepevaas/yS88nk+7WdKJpg0ZWE873bUinaxPwh7Ms+QzwW5Tf+A5uw/tZ5QFViErzDYo2R6/bpmNQ7UW1zHPtjLXd0QQZjNV6JWAZSDVR3f6ZK4j2Kas4/z6C78+Bv0Ed9wlmsgkRPS19iwnWVdwEc1iu0QKb7qubw8excbE4HIg6tVeXJZJX6Yohf50LPQVQlWstgZ+r1k6YDoT+vYloU9K+ynr2CZEZrx93yEzaG1CZPTHbN28x+/F2fkgKR9Wi6LBTWYzw7RxY+WHk6JbrtURZqQToJtu8jdIoJUx9yXj5ovawFPZBwzg== 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=lJPO76LeVbRLT6xdNfAEfol9vXoNWf/MqxjxFnE4yls=; b=Ob01qGYA+zCkAUJwlQ/rojKz69OQ8cI5zddpeE7ld1LD4o8XGCBdWhikP1CwMdSiBjohomDRG0v6oYWYYh9pXC0AFNop0e+JP0wGu4xWgCIYutUVcTwh6XLZeT2FY42kJlMR3vnh2WQSNfWfpbjRurv3kIU6thB5IgG0I0vjNO3veZ3fgdrvoF5SXYTqIFgQWS1QwBSMYFoKa8LtOVA3OAbfPNgD/yIkXlpwGNFO3RwjFD4vqjHrh3bZT2m3o4hHSs5lsAzBiKOknba7OkKupWsydXcE6lLUcFcFg/pjBuIQv/vhWMvW3DpJky+E/UCdOj+mq8auZuIRsvFUBLkfhg== 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=lJPO76LeVbRLT6xdNfAEfol9vXoNWf/MqxjxFnE4yls=; b=QuN+DVNI4tl8Oh6E60aFNMKOiCn+3ZuXHH2ENaIs/scuH8HqkpzXiQovxXhni+qMCJBiX1aSwVjVDDDLnCKwzxyXEi2AaiIAamJG85PH3iJzYtSSXbWY8AKDJlKojEKhN/vOoTVK/97n1DDmcf9qAllA5F6quBiqoe6IsJSjjLw= Received: from BYAPR07CA0075.namprd07.prod.outlook.com (2603:10b6:a03:12b::16) by DS7PR12MB8275.namprd12.prod.outlook.com (2603:10b6:8:ec::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28; Mon, 22 May 2023 13:27:13 +0000 Received: from CO1NAM11FT081.eop-nam11.prod.protection.outlook.com (2603:10b6:a03:12b:cafe::bf) by BYAPR07CA0075.outlook.office365.com (2603:10b6:a03:12b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28 via Frontend Transport; Mon, 22 May 2023 13:27:12 +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 CO1NAM11FT081.mail.protection.outlook.com (10.13.174.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6411.28 via Frontend Transport; Mon, 22 May 2023 13:27:12 +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.34; Mon, 22 May 2023 08:27:12 -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.34; Mon, 22 May 2023 08:27:12 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 22 May 2023 08:27:08 -0500 From: Vijendar Mukunda To: CC: , , , , , , , Vijendar Mukunda , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Syed Saba Kareem , open list Subject: [PATCH V2 7/9] ASoC: amd: ps: enable SoundWire dma driver build Date: Mon, 22 May 2023 19:01:20 +0530 Message-ID: <20230522133122.166841-8-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230522133122.166841-1-Vijendar.Mukunda@amd.com> References: <20230522133122.166841-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT081:EE_|DS7PR12MB8275:EE_ X-MS-Office365-Filtering-Correlation-Id: a33dd319-4eb1-4235-766f-08db5ac840ac X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6eZGlCNSQoQVeW2U2LtXELpH1Dj0mFfbc9iiStlAg+s120cNJQWWyXtUACMQG9Mw2xjp0VkYiFvIZO6VHRbSobdkScmdgpsMf6hfUozB9TEB/EH5dGZx6bqXdfvx6GtsTtHlaijXCb6OVKvLAyyd54/isjg/XJfA7NnBYidiKpbmxx6rOxOijMUHgbB5HA2oW77EU1Ybef0yv8tsUzkGa8XtQ+oabYFiXMV2J5ZC5MPxizIcNFayB0PcKBCNHPJT4517R9J48hSQJuBSS0qtoHQsZvcpSlxQTYHyNlLI0Adx1KPDHPiRTCButSq7nyFjbk4vQaoHzkO9Nu9nLEJG1pRXUHt3z5EavXdIbfc8BfaG9F1u3/6G8/8Db5Dr2vbY5DOwggiRgOQp+YMAKYWUk4aqnl/bGj1KiX6QCimFnJxy5WKorm05DdFSPknyt66R2vzPFj/IyaEU/fa2/Vh5XpRIq703j1g1l8YBXN5+wi6e2TfoaAVwDtOc/8HCCudpg9oyigT8FTcbxjuIFYkYRg4PbBD9I2WeNGmTJOO8BbLtFcgBtgpp9ZXDphP26wlE9FjDr/m1P3FIRMWs9LkKlcEXNmAOaXlujwotM7kptwhSapeBFii/YaA/UiedarsVeS2hEvib85myHvYyntLgZIzD3d7sc8t5Y7QOqMZbEamAoWZBQk+7NDmfqX6UEGShcEXXb5tl8AX3ItjHBIllgCVNa2yhmOTlBtdfRyA3QLslnz+KVvF2MQ1y6zuV4T52NM3S6c/DsLeTXvyKMxW4GQ== 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:(13230028)(4636009)(136003)(376002)(346002)(396003)(39860400002)(451199021)(40470700004)(36840700001)(46966006)(6666004)(86362001)(36860700001)(316002)(54906003)(478600001)(41300700001)(7696005)(70206006)(4326008)(6916009)(70586007)(8676002)(8936002)(81166007)(356005)(5660300002)(82740400003)(40460700003)(426003)(336012)(2616005)(36756003)(82310400005)(47076005)(26005)(2906002)(4744005)(186003)(1076003)(40480700001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2023 13:27:12.6654 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a33dd319-4eb1-4235-766f-08db5ac840ac 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: CO1NAM11FT081.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB8275 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,SPF_HELO_PASS, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766601665391918999?= X-GMAIL-MSGID: =?utf-8?q?1766601665391918999?= Enable SoundWire dma driver build for PS platform. Signed-off-by: Vijendar Mukunda --- sound/soc/amd/ps/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/amd/ps/Makefile b/sound/soc/amd/ps/Makefile index 383973a12f6a..f2a5eaf2fa4d 100644 --- a/sound/soc/amd/ps/Makefile +++ b/sound/soc/amd/ps/Makefile @@ -3,7 +3,9 @@ snd-pci-ps-objs := pci-ps.o snd-ps-pdm-dma-objs := ps-pdm-dma.o snd-soc-ps-mach-objs := ps-mach.o +snd-ps-sdw-dma-objs := ps-sdw-dma.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) += snd-ps-sdw-dma.o obj-$(CONFIG_SND_SOC_AMD_PS_MACH) += snd-soc-ps-mach.o From patchwork Mon May 22 13:31:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 97440 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1460219vqo; Mon, 22 May 2023 06:45:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5l0GVU9nrXulf4AZD0CWGeFPByrdEikiCH1q4VN+Hm/j52O57m8yT4q2NLe1vLrsISUuJB X-Received: by 2002:a05:6a00:986:b0:64a:7723:fe04 with SMTP id u6-20020a056a00098600b0064a7723fe04mr15990305pfg.4.1684763128984; Mon, 22 May 2023 06:45:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1684763128; cv=pass; d=google.com; s=arc-20160816; b=h1q2Yg8kTy0nizmxEMHWdeX1B+j3TCV5hF1k6hGKrvVN4/qrNDOSdKuccO/GeJr0JN khFlTbeUdScrNtxW9d7nKoqeWb4fXzt85tR3B8aSJBSGhFhAiFiktb8tlUEDomQHVF89 zjE3Y6WKNOBNFjSB7u6ApDEug0PpSqgx4GNEonOzH/mte8GqDKd6o3pRbkcPs100P9bM 5DiD91RvY1S5hntPmbzcSUJezFEzKELAebmsNCH/nCn+E+WpCaLhuz50wN+QB77VuFVT hIp7uUI/3gWD8wLRdxZiJSl9oNKIs85xyZYrkhQ9Kn4cmQHD4t2yZibP1Le9nP0jERsN ezSA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=PrAlUYHeUtL4gjAn69ALnx0Pg3K5Pqzd2f5iFioh42E=; b=ut7kbc1uRgaUfkFXOI+BTvHn1KfOR2BIHaYVmqfIDDK+zDUbgroQiSwokBYnriNAlB 0R8QhJruI9L4f3BICzjFCZZuXC03tLU7XMhxVJ/FDjSb/3YRwwpHZ6jJd7hiJfkonBxB XXDOM9NU9yliQcK9PZr0YgTrSbSS9EFlsEwwhb2WVjxxFdN0AZBhIE/8ZxqO/unPClGz x5DXB2wnt4OOxMaxqaEyM4LdFsmZicKBkOIhMYmlT6MMmSO+9YHQPDhl7gl4sVDvCYH0 kTYelOWX3HsmVunUDhch/cVblReQvUOrIJaP6z1RrW4nX3adtPx0PJFXtEPLCVddWt25 cUxg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=LgMSEegM; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v15-20020a63bf0f000000b0052c9458bc03si4678178pgf.278.2023.05.22.06.45.16; Mon, 22 May 2023 06:45:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=LgMSEegM; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233761AbjEVN17 (ORCPT + 99 others); Mon, 22 May 2023 09:27:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229999AbjEVN1h (ORCPT ); Mon, 22 May 2023 09:27:37 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2073.outbound.protection.outlook.com [40.107.244.73]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85B63185 for ; Mon, 22 May 2023 06:27:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CFvbqoy8ZIFtjuHV8M2vfOYzTQmSjcKA9Gms2SEEaIF7tDAKWxbbQZ4gVT1traG0CuM7o1xCSPCfsPci83KXz848ucysB04vsg9ju/UpU+Lu3kngKch1ItRsMCSc6tksei7xG9c9VJ0sW8uq8o152NWbW/kghBo7D4k5uE3XDDx1stWg+vLL4hdiAKfCE/zNzxqXLAmkpmDo0EMHG0EKi71ih9AJ0Aa/5sd3cJ7aQ6kQTQMn6oN2ypl+mV8Ud93nv3aQtC8EuQVNRh4ad91GWkLan3ZW68YJqDoD5GFM4NLyzbh19ukkbwfHCAo0WRQskTjXGazD0xiYvnxNOJS7jA== 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=PrAlUYHeUtL4gjAn69ALnx0Pg3K5Pqzd2f5iFioh42E=; b=GX/F5+A1u1tOoHqJ0YWVl+Edko74i72BFUZRmBlhKBhlURTzLuoZ5VPxuJ4SCC4EMtG273IpQObOQvp4DVStZ7usxpVesWrBlU1+fiSgHEUonxRNwI0uXRNVGceWJiW4Mh7XmEOZ4uz7MSQH7x0DNVvmnrXgwe0LAzcgV5HPbuzjaoKdwIEZk2qhkIsykz0x+/i1xU+29cEzIT51PrtA0RCu0ujT9WeijipOKJz/pk1xkqCIPBHhibilq5nZaYdY3bpwK2rA55FYVwxuYt651t1cqrx6mtq/jUcnTqrIl+zTEiHUD5CMFowm9Y5GmOs6oLgkzm3I/hAKeLJ+vWMo/A== 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=PrAlUYHeUtL4gjAn69ALnx0Pg3K5Pqzd2f5iFioh42E=; b=LgMSEegMNMoAO8+Lx7gred81bKYHIun7OFGhjS692h7EFgH0axQCCVEbNW9yjO20VJ7Kp3VMt4uf3Mv94x0NyaIgZIVJxpJ2UcmAG1E14ousd3po6C+M/gXQ0vsfz2ub9+vPr3/6qcnq/lhaJAYo5UEiIEwu+6hfC1y3dsK2hZM= Received: from MW4P222CA0021.NAMP222.PROD.OUTLOOK.COM (2603:10b6:303:114::26) by MN0PR12MB5812.namprd12.prod.outlook.com (2603:10b6:208:378::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28; Mon, 22 May 2023 13:27:18 +0000 Received: from CO1NAM11FT008.eop-nam11.prod.protection.outlook.com (2603:10b6:303:114:cafe::24) by MW4P222CA0021.outlook.office365.com (2603:10b6:303:114::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28 via Frontend Transport; Mon, 22 May 2023 13:27:18 +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 CO1NAM11FT008.mail.protection.outlook.com (10.13.175.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6411.28 via Frontend Transport; Mon, 22 May 2023 13:27:18 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 22 May 2023 08:27:17 -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.34; Mon, 22 May 2023 08:27:17 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 22 May 2023 08:27:13 -0500 From: Vijendar Mukunda To: CC: , , , , , , , Vijendar Mukunda , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Syed Saba Kareem , Randy Dunlap , open list Subject: [PATCH V2 8/9] ASoC: amd: update comments in Kconfig file Date: Mon, 22 May 2023 19:01:21 +0530 Message-ID: <20230522133122.166841-9-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230522133122.166841-1-Vijendar.Mukunda@amd.com> References: <20230522133122.166841-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT008:EE_|MN0PR12MB5812:EE_ X-MS-Office365-Filtering-Correlation-Id: 27cee10f-5dfa-4d3a-e6db-08db5ac84426 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: d+gJUabAwTIGrWUY5uGWkO6/bxMKFMwX2b7Cstns/StMFBf8V7lZ4Bvi9qV1pTUeRhd9TCQCrteBA+3Nqy/lK/Yh1fMSVAbb754eeWJGNnqh/8/Wbgu/JX/56qyubDSAd/RB76gIjVbxgrpU/GtlM7E1Qwb9ozcUGrlDsS4m3Luhe+ekm2AVUjPqyFcT+SYiBhN7sYUBN6sGv3vxymgfB6c+ZffRL/6tbn5hvQSqvvJ5AMIGeTAMWkwIlAB63978vLeueyMuZIWIGtIZBef2cN+1nc/D1gm0f0WK6WKohH/X63cKsPTkHKO9BMdFlS95lLThYYfp6xSGP8GsPXkQ1OzAh9ofa1lsq7hPU4rv3+gX1z8q0sFc5bfDzUfMjc9YJzNKT+JvgXAt4Q61ZQUADAVaVrItxT/3NgxX+VoPPE35FOgLxu8D9pJFs0psZW/UhO614zPo7Npx4A+VPGFyAlAYjjqVwrahcFCgHnbtosy7zLp3B1HIV//aBFd3LHaBW29GfMNGDRGoTuZDxWaHo0YRtKT6eh/pJDSn+p5PdjRTjlqA1dl9NzdIvn8vyYk9tfF9SSlwhNX/tCM1cPMkquYsuA2n9s4MWX735tJ0ry30yMb97+1zKSGTXNrNLLkXCar1FDSQI48eMcW/Brqp8EymGJvGmD6iC45yG3rHCzlvMjso+ALlLXWdwxC5LtaTO5RbG00p0/xnaaHG8HXf9hjj274Xyk8+VYxGk3yIZ5gk7VdbIPS1l1N/Y8mswbTs9UIzWVSOLOEdqPCDIjdj1g== 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:(13230028)(4636009)(346002)(376002)(396003)(136003)(39860400002)(451199021)(36840700001)(46966006)(40470700004)(4744005)(2906002)(15650500001)(5660300002)(83380400001)(8676002)(8936002)(82310400005)(36756003)(70586007)(70206006)(4326008)(6916009)(54906003)(316002)(478600001)(41300700001)(6666004)(40480700001)(7696005)(426003)(86362001)(336012)(26005)(2616005)(356005)(81166007)(82740400003)(1076003)(36860700001)(47076005)(186003)(40460700003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2023 13:27:18.5010 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 27cee10f-5dfa-4d3a-e6db-08db5ac84426 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: CO1NAM11FT008.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB5812 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766602182644112349?= X-GMAIL-MSGID: =?utf-8?q?1766602182644112349?= Update comments in Kconfig file for Pink Sardine platform. Signed-off-by: Vijendar Mukunda --- sound/soc/amd/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/soc/amd/Kconfig b/sound/soc/amd/Kconfig index 08e42082f5e9..2f0d444b21fa 100644 --- a/sound/soc/amd/Kconfig +++ b/sound/soc/amd/Kconfig @@ -136,7 +136,8 @@ config SND_SOC_AMD_PS help This option enables Audio Coprocessor i.e ACP v6.3 support on AMD Pink sardine platform. By enabling this flag build will be - triggered for ACP PCI driver, ACP PDM DMA driver. + triggered for ACP PCI driver, ACP PDM DMA driver, ACP SoundWire + DMA driver. Say m if you have such a device. If unsure select "N". From patchwork Mon May 22 13:31:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 97439 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1455643vqo; Mon, 22 May 2023 06:37:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4n+G9ncwdrnAetFzBT4hZzzsqXcRlSIBbK1FFxdYZ/9GT8XRwNAQOOlcb+PuV8Zbst5jru X-Received: by 2002:a17:90b:1003:b0:253:34da:487 with SMTP id gm3-20020a17090b100300b0025334da0487mr8775312pjb.35.1684762669337; Mon, 22 May 2023 06:37:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1684762669; cv=pass; d=google.com; s=arc-20160816; b=jseuCytGTFiptYARmR4OGqd9oD2k8VL/qNdIpTk7hwFcmn5vzheWpxTM3B3sJnySLT HOcB+76SHeH1UsN6MRsIT0QDux0ya8bQcvDjYYnKC/vgqxgXsrJ59dg4uEHQolGcscGf VAQuLE8ss4HDZNUizDv4UjT9/EJ7VyaQnFWovxpTRPXk62Zv0NfMOvLdFYwhWNzQa1cJ Q85zDl9BP2m1sxSi2OV/Eg9SGa5In+LU+XVAEgyc3O8HAWTDPoQ9PPXbB9SKy7X0cJ3J rfPbps8iNzjXJimGcMod+TA7DlgUa0bIBGIWVbZT45er0HZ9NJQ1iswyI06ukhZm5NAE KVSw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XgZh2m1ue2OnvyVEBBAWUfeFVyNibjtPlMMW0oX3v90=; b=hFNCNfTNSViTcTLHQQmiX/fRnd1BB/7cwMXWOoDhviX5MGR+shd9sADGJs3n3MoYpp Y10QrJNthcW+fvcAvex8rMlbYSavgBQnFjqO8TGm+Z0D6acSWnZug/n1LaYRsQgNDEzc q/iLAw4eMYj+XhhG3FcvizL8JmN9s0AEfL7EFWzwK2BZSgCH/uy+XNKmdGmv/yNRkbTt NOs2bXgEp0/bbKjp1I3xR1ZaS/RkOenx34mdY051yZGbZNoT9Rxeg695+81iAic3Gbih fcODb89tOWwlUj2PeILbJomDoRACSZCTfkugtNWguGLPDmaz0gcWz0U685QEVV00SXnd xa1g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=bdzwZHGz; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mg16-20020a17090b371000b002535d0a89f8si583125pjb.186.2023.05.22.06.37.36; Mon, 22 May 2023 06:37:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=bdzwZHGz; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233778AbjEVN2E (ORCPT + 99 others); Mon, 22 May 2023 09:28:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234015AbjEVN1u (ORCPT ); Mon, 22 May 2023 09:27:50 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2046.outbound.protection.outlook.com [40.107.244.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 731EFE45 for ; Mon, 22 May 2023 06:27:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V4jXxA6TU9bRsY7ZE3Y+1Dpqs4GCA9vzoVEBYOai5QBESAy9b5boGg6Y14iMKojf1Ug722DJcYAiNdbEx3HhRC6HF7tmzryt6i3uRffU4cj+8n55/I+E9b/wYNWn1nxDASjS3N3PYim3TArnDU60foJdMPgcvFBrP2au419Pjqepm83YCWyq5/znZHP9TY5YGtuyRS0vvqBoXk4Kr95FI2SAAFgqCPUSLnoOT+Ax1BvWCMPi591ev6Z92yYrjmh4UDF+QyAjTSFHkFiNQZx2UKNJCLstMreiTc+FTRKn5ge3p6W8Csmn1F2fkiNSAONhuGKr/YpYg64mR1/V1sxVEQ== 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=XgZh2m1ue2OnvyVEBBAWUfeFVyNibjtPlMMW0oX3v90=; b=lEu4rS4Ab5ujbhsBEa5ZervW6zDP+JeYzkthCMFrl+jaRKhDxD271cKNDQTeVUWEmKdcAQ8r0M560hkGVqljl97Ft1WyJK1s/e1AwO4IBdKbelHf+XUTN8FHnPzyCYRrxeovtO3ks+HcWdNHbALw2k21rOZMwM2+TeChRHu6S2rsptd6saO1V+n1Xc/Jejm00gBWXUkEsHu1oN6l5eOe1iEo8D1uia7/i34kgBkB2h7ydR43gta82jXU5+Dy5zZz8YN52XtyxY6cMD5mnZtmJe/JS0OqS27f5W9krntmfChEyqPnhmizCCcN7lTObFHayfLypSKmcMYgpXOLpv+rsQ== 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=XgZh2m1ue2OnvyVEBBAWUfeFVyNibjtPlMMW0oX3v90=; b=bdzwZHGz06ZZ6khfZVsfeyVmjOILTC3p8kV5BZDompbq7rDuKIOUmvtxuakeK7X4mKUKSDHHy7b3ld6U+07Q1LFZYrDQGMl5xgmObQ5bTb5r0UmRK09Pc4qvVyq40tMo95iLDf7GF7ThZwq7KVzcwQESjcyxoZmwQf//HId+jNc= Received: from MW4PR04CA0213.namprd04.prod.outlook.com (2603:10b6:303:87::8) by SN7PR12MB7130.namprd12.prod.outlook.com (2603:10b6:806:2a2::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28; Mon, 22 May 2023 13:27:24 +0000 Received: from CO1NAM11FT014.eop-nam11.prod.protection.outlook.com (2603:10b6:303:87:cafe::ee) by MW4PR04CA0213.outlook.office365.com (2603:10b6:303:87::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28 via Frontend Transport; Mon, 22 May 2023 13:27: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=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by CO1NAM11FT014.mail.protection.outlook.com (10.13.175.99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6411.29 via Frontend Transport; Mon, 22 May 2023 13:27:24 +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.34; Mon, 22 May 2023 08:27:23 -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.34; Mon, 22 May 2023 06:27:23 -0700 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 22 May 2023 08:27:19 -0500 From: Vijendar Mukunda To: CC: , , , , , , , Vijendar Mukunda , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Syed Saba Kareem , open list Subject: [PATCH V2 9/9] ASoC: amd: ps: Add SoundWire specific checks in pci driver in pm ops. Date: Mon, 22 May 2023 19:01:22 +0530 Message-ID: <20230522133122.166841-10-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230522133122.166841-1-Vijendar.Mukunda@amd.com> References: <20230522133122.166841-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT014:EE_|SN7PR12MB7130:EE_ X-MS-Office365-Filtering-Correlation-Id: 72e48deb-7c10-4b60-8127-08db5ac847be X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0QNdF8xR6bK7iDeKxXSW2Fui1ngVHyuIt4eXiXFJTon9J2R9h6XZ1joM8vBoOLRwbaGQrDir9VmApwsFLlO1OPNBXbYy9muwSgDTfH4/A8V7zJUmAvDhZC1819zD88+IepLiCjvcy4fClqx31noTFScDUNg3QRF8J+i597qE14Xlz3fFrkBB8n+G96Pe0v662BmGSO3w8tyJ3zUTk3nvv+paekawrke3y3HFT4g3dX9eqj6fR73Q+HiP595IcmvIzfVfusnDVM+EsrLDvMMsLFs2tlCLSzRijhu0/6WpkSMXvgRHSN42qW8KSJS50XlMped5OKcjJd8yhcY8hNTvqbkv0JEKcmsn/PZDyh0cfXEgFh6ehQrt0FSw+S8O8Q5/v/5XHLPCpvjLcGEbZaGLI2X1Y9n/PnGa551MYVOuD8hcHXvjgT8rhhLV9bRyyCFDoaLcNS10UwzROW+Bu8xh8qs1c+M6vyqaJAbooe723ds3GGaKr8VClfRoDSGIz7xGNprisCqwakC3qP/zXLAD5HE4xG/l2jrXmXGCMFFOKvmvEKSk7fsN8xkE5Hc+VSAy/ooDUVBoB2FKjmCwSzGBjzBCjYqy2lC7qspXKh2rmqA+l68Gl4OUtgAh63kRUigFQnuBngQYGU7oaNP+ehKUWT7XPFQs0fSdy2JfNMSCZNh/9eZ1v2xWId+PdNjCFuDy4jw6bhDVm9LaDhuXN6p2MHA9JUBwpZFeq5SFyiNn77+a6HUQ2tfgbcv1trap84Q5vPnPLkQafEfJnUclAEzzSw== 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:(13230028)(4636009)(376002)(39860400002)(346002)(396003)(136003)(451199021)(36840700001)(46966006)(40470700004)(40480700001)(1076003)(26005)(316002)(6666004)(7696005)(41300700001)(54906003)(478600001)(6916009)(4326008)(70206006)(70586007)(8936002)(8676002)(40460700003)(81166007)(5660300002)(36860700001)(82740400003)(83380400001)(47076005)(86362001)(356005)(2616005)(426003)(336012)(2906002)(36756003)(82310400005)(186003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2023 13:27:24.5277 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 72e48deb-7c10-4b60-8127-08db5ac847be 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: CO1NAM11FT014.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7130 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766601700952271435?= X-GMAIL-MSGID: =?utf-8?q?1766601700952271435?= AMD SoundWire manager supports different power modes. In case of SoundWire Power off Mode, ACP pci parent driver should invoke acp de-init and init sequence during suspend/resume callbacks. Signed-off-by: Vijendar Mukunda --- sound/soc/amd/ps/pci-ps.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/sound/soc/amd/ps/pci-ps.c b/sound/soc/amd/ps/pci-ps.c index c99ac5d90097..f6d14baf2c2e 100644 --- a/sound/soc/amd/ps/pci-ps.c +++ b/sound/soc/amd/ps/pci-ps.c @@ -659,10 +659,15 @@ static int snd_acp63_probe(struct pci_dev *pci, static int __maybe_unused snd_acp63_suspend(struct device *dev) { struct acp63_dev_data *adata; - int ret; + int ret = 0; adata = dev_get_drvdata(dev); - ret = acp63_deinit(adata->acp63_base, dev); + if (adata->pdev_mask & ACP63_SDW_DEV_MASK) { + if (adata->acp_reset) + ret = acp63_deinit(adata->acp63_base, dev); + } else { + ret = acp63_deinit(adata->acp63_base, dev); + } if (ret) dev_err(dev, "ACP de-init failed\n"); return ret; @@ -671,10 +676,15 @@ static int __maybe_unused snd_acp63_suspend(struct device *dev) static int __maybe_unused snd_acp63_resume(struct device *dev) { struct acp63_dev_data *adata; - int ret; + int ret = 0; adata = dev_get_drvdata(dev); - ret = acp63_init(adata->acp63_base, dev); + if (adata->pdev_mask & ACP63_SDW_DEV_MASK) { + if (adata->acp_reset) + ret = acp63_init(adata->acp63_base, dev); + } else { + ret = acp63_init(adata->acp63_base, dev); + } if (ret) dev_err(dev, "ACP init failed\n"); return ret;