From patchwork Tue Jun 6 06:07:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 689775 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 79C0AC7EE24 for ; Tue, 6 Jun 2023 06:12:16 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 48496844; Tue, 6 Jun 2023 08:11:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 48496844 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1686031934; bh=0S1CLR2GwO920MJhiuLB8iJV22ipzGUHfDQpTAXBIS4=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=dk9LKiHORSrZTj46JTmpxY48scVZ9QS3PnG/HXVJkN3g38HEwEmNJ+ogqo3PRChzW qMmX6zORKTsRADxnX0JGgAy3Cyw8QTTzdSmn5KWX4+w/Ca4hp/+bQj7OvZqxJSuxL0 PPf2Do7ghwlNc7frc0KWUSN81FeQrXfnKsIn/XeA= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6B17FF805DF; Tue, 6 Jun 2023 08:09:14 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 062E9F805CA; Tue, 6 Jun 2023 08:09:14 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1D022F80199; Tue, 6 Jun 2023 08:04:00 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2060c.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe5b::60c]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id EE06CF800C8 for ; Tue, 6 Jun 2023 08:03:55 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz EE06CF800C8 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=TIFCs7zu ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QjN7sETqQjN+0Tk5cIqWoYkN9Qr6IIKrvc245AfYHCzGxTTtyVqQbV2ym9THrAYvaoUrYJsCNIARtwoGYA2S1Ovh30CJakYmqwD/8eqnVf1SZLrIlvOkhxYrq5gLhr8tbGqvGB7jKueWt7eWTWR93geNLSciqDyZfxbGSZAKALVhQZWp0KXBzrJ31Ztjktevw5+ueUsQlApb8eEGcgok56MfL3y84XvDjCKmgCboeWv7qTRPURA9JLjYlHPYD2K1UtE4zVZPBAcPuO8aeWX4mzpj23UEzNBHp0els+DXqxTIGaDNWcmlNP/yrK3uVaVs9voWYUTtOWpSqbXwhF2sEQ== 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=QfBlY1Gx+MjR87EMVid2SbT2roCNykSYFrwd1Z3V1AA=; b=mAmwTGxEhXqumVdDQXX597RXgQMFqJYxOM8CyWNpBaRc7wa6QKYgJu6uDozMQRUUH1eXx/+rRIMMd/V55VjA/1CPLytcyyfQ4nrUB8Ex4ZzB0Po8gVXNL91gkkeAZzbeGvvQ+bXsD6qa3UuTruw5z1rDlFNZZeHgtpUW6tkBCx2i1jYQ+gHX3hFNi6+R6aGyVgbKcl2xk+B/R+nJp96luS93QL1i8n8jZh+Cdc3qYSs6r0VNUw38z8mzX5BSCqGbvhBGOnaQ8V1i5U0nByWux5wTkylxAJ2KW1xDkWn0JK7kpmIzfIMl+dgORIO8SZ9K4VDJalgpZ2vZHFvlBW9kGg== 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=QfBlY1Gx+MjR87EMVid2SbT2roCNykSYFrwd1Z3V1AA=; b=TIFCs7zuckXPGqD451Lg1zfZ87krZIVLpBm9iw78V3TopB87gQSiQw219ot1IZtlNjjHExkMd80P6rWzT1D5Y0uwkMhfi94ZNMrBwZu6Mjklr4ZPVQvIJ+2UvGAoQSh+001El5nLMrKRDBlbASomDiJcMtKb6szbb6/m252f8tg= Received: from DM6PR04CA0001.namprd04.prod.outlook.com (2603:10b6:5:334::6) by SA1PR12MB8641.namprd12.prod.outlook.com (2603:10b6:806:388::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.32; Tue, 6 Jun 2023 06:03:50 +0000 Received: from CY4PEPF0000EDD2.namprd03.prod.outlook.com (2603:10b6:5:334:cafe::ed) by DM6PR04CA0001.outlook.office365.com (2603:10b6:5:334::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.33 via Frontend Transport; Tue, 6 Jun 2023 06:03:50 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CY4PEPF0000EDD2.mail.protection.outlook.com (10.167.241.206) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6477.13 via Frontend Transport; Tue, 6 Jun 2023 06:03:50 +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; Tue, 6 Jun 2023 01:03:39 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) 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; Tue, 6 Jun 2023 01:03:39 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Tue, 6 Jun 2023 01:03:35 -0500 From: Vijendar Mukunda To: CC: , , , , , , , Vijendar Mukunda , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Syed Saba Kareem , open list Subject: [PATCH V3 9/9] ASoC: amd: ps: Add SoundWire specific checks in pci driver in pm ops. Date: Tue, 6 Jun 2023 11:37:24 +0530 Message-ID: <20230606060724.2038680-10-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230606060724.2038680-1-Vijendar.Mukunda@amd.com> References: <20230606060724.2038680-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EDD2:EE_|SA1PR12MB8641:EE_ X-MS-Office365-Filtering-Correlation-Id: 7404d5a3-6691-4510-13f0-08db6653cc9d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qsmXgiOv1/w6QTgq5d3MtLHeo5xa/xGAViZWugJS+w9fG4QU/l870wUwj3Ce0MtkeMllwBQ1WnA1ihbkeTSI06AAUrvjjRjWc+3DDOXsyhepbREdz7QReES2AOe3y4ATgccYc8pncMuS1IT8iw7zUFFtROeQ0/dMyWO5vEitMOwB4V9d75J68IM9wcVeUU4ToRgQ8x7fU2VbJe+9HjQaSNIylK1UQ6XrH0aM9qSVyP8jADdw8bBX1Ls9hAZlZVddqVK+Bv5WPlNREkr7wavL4sZTKhZciySIx+53q8IwxknZA6C4Gz4+JxNCsJ/ZldE+v3iiHUlwpg6SCP3w5AEkCqZUGuHnnHBzZFEs0IFSPoiFE6aA9cdu1Yk8al33cWJFLPkb3ifxQ29pFa7vWDG54IhUX88JzAY8o7rTjNEAudwGhOVTL7O6FFUllC4/2VZtJZal0kRNVhORhEdVgqa8fCS31RHAeG+0c6DMQVkSY3GpmkocIXMaCdWpbm+qjokMMoCT69HALojqLWHCIEm6V4k2hgt99pNBQhtH8s2fkjvFNkvcYrYSst35kQC0TzkCie4X720LiSBTnOBYK7udyxM2g7Xmlo57QqRC3jXtQ4Vplg7RzEE/SNViRmmPGrLot2oHfJw2hZz03odwzKZ95Nt2NmUsV1Omq/T+24Tsm1Nvwrwuku/xBHKFowNIgiw+lGilmRflP1dAc/zTc/JcGW67Sq0Qgo3IGnMyy8XWWevFG2CAXIzVrCubzvFOPZquscuthTYvDIIaWNLs51kwGw== 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)(396003)(376002)(346002)(136003)(39860400002)(451199021)(40470700004)(36840700001)(46966006)(41300700001)(316002)(54906003)(81166007)(356005)(82740400003)(5660300002)(8676002)(2906002)(70586007)(6916009)(70206006)(4326008)(8936002)(478600001)(6666004)(40460700003)(82310400005)(7696005)(86362001)(186003)(2616005)(36756003)(426003)(336012)(36860700001)(40480700001)(1076003)(26005)(47076005)(83380400001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2023 06:03:50.3284 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7404d5a3-6691-4510-13f0-08db6653cc9d 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: CY4PEPF0000EDD2.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB8641 Message-ID-Hash: ZH7M2XYLKDQQBGNFL4ARV6UFSXYHOXQF X-Message-ID-Hash: ZH7M2XYLKDQQBGNFL4ARV6UFSXYHOXQF X-MailFrom: Vijendar.Mukunda@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 daf54fe9cafd..5802a701b3b1 100644 --- a/sound/soc/amd/ps/pci-ps.c +++ b/sound/soc/amd/ps/pci-ps.c @@ -662,10 +662,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; @@ -674,10 +679,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;