From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.179 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796383029; b=aAoPiUiezYMrNx9wa9JIArpXXM9ScQmtcaoalJGdr/61MLHXNdggRaEoCxYOYEbqnypv xIXh2dC4xKdEPeFHTftWAc3TmAYLqn11nWPjqWmHH7MG1ierlVPPqeBoBGK9GSF7xZTDs 9L1a/nJ3YsWDCeHhv34FA/6CrtWO/S1hcoFmVzr2WNzP244WU9xD9ge/4ixWkrYTmcuwA GVBOX7v4Mm80yQgI1qqSfGwlQgjnmauC3FvU5x1qwn4lKyU9NKvvpa54OcwHoZpCcPu8K DdcIjrSB5n0VvBRXlyFI4bvWjd8RUpHqq78vjZQCZ7prLTr6dSx3v3lG9NZ0hAotwtw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796383029; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=pfXsqAbtHi4wljtAUBcE4uzUw+NrKt85Qbziz1C77a0=; b=F6La8UPE5zyIfxPbGtwOMdx1bUxOIGZ2MSyCmqTqTNBHUNQ+/LDADsHakvn2U3HNLG9d 1ZlaFHT5blCfb6uICk99yPxAoX7pX9FsknRH4G3rFxHJzeoAr66tV/M3ZcztzXO+w1u1O NApdcLjKfhNcCLvHCYcyLVi5sJtTCrkMK3IaWP4eJug8zcaAbBDczhg9vUxBhj3G6JpGN ubFU+kdAgexsfL0cANDnJFEHnBPT6Me+OoqlW3ZfS6qIJx1cikQK5kw+3L9x8vB/biJLw 33JV+iS9Xutx5S9eUr3liARirYS4aZq4D3ZzgyboeuAYLziSy4E6uGzktW2hKZCtX8w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=oxlo2Z8y; arc=none smtp.remote-ip=209.85.210.179 Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D6953606A332 for ; Fri, 4 Dec 2026 11:17:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D6953606A332 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=oxlo2Z8y Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-8a0880a46e7so579298b3a.1 for ; Fri, 04 Dec 2026 03:17:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796383028; x=1796987828; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=pfXsqAbtHi4wljtAUBcE4uzUw+NrKt85Qbziz1C77a0=; b=oxlo2Z8yewVk9nJ8lSKcfoY5cVv67Dk7+VMjxrRCb2zUsnLgNms29d+vBW28rgZMZQ 5jguBEfEi2SFyx3901vuy2tgvq3e6ngoHM1Eynygu/MadwtDOkb2gKvahNhtnJBzqT8s Dxa6w6b2HxAmafQd1E6PYNc6alOuQeo985HGys5de2LDJ9CK9GVfGX5VxkeDd6FFdqCC nflaXync+5nnHPrnhklAOFoUQxb0X0KAJnn97rSaBYEBPDlUgGDLvL/GQ8ixVyOlzLvG njSl0//xYYloU5o/+P2rD3QaMncOKKDsl+bVyj8WuaQWBZgd9MM2o97+4l1M6btJFacN Vvgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796383028; x=1796987828; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=pfXsqAbtHi4wljtAUBcE4uzUw+NrKt85Qbziz1C77a0=; b=EQ6AREcPsJsRJOQ2iy2Ord/GqJVhvqOM7ULXwXQm+piVGG4M5CXUuBSNK7EwEhKj4P QuA6oOUaDWvFoYDXQ30pOOFy6BAp3/DlKrUnTF9UYGDv4UUXwwt5yhjL/jKrQdO3ezRs FAmJc8zOB9OkvgO+bymC1VMYPAy0uHCsY8phIq7TYMF9OfQPJsyZVtgjXsZjhwGos2xp QozRGuzq+KZs49BIyfnZHmnAS7qVU/g/Oqw3dJKZ8LNo8dvrpQHSh2Uo50sqM7gKnlqz hHPJ/QOmb+ohcAqQaGD491muuQgH8WQcsU4Xsgwq4kbGNTyc33H7TxLG8os7BKp4GLPB f3nA== X-Forwarded-Encrypted: i=1; AL+hErHecE0xT8FNs4oE9vtPosKZotvIwwDwXiY+n92ucV5kmH6SA9PMhrcn32RKD7ptNwAFLpy1qHL3Zsp+Wgc=@vger.kernel.org X-Gm-Message-State: APuU4Z8NZn+2akY7JH1D3mtr7hdKH9a0BTAuEzsOBT/86bJczFXGMQaW 5PSL+1zWvIgyLa/Ahyy3UtTsJ2QJbx4Vnr+lhmbmhmD/KSAfv104K00p X-Gm-Gg: AZFdTZdemsh6b5r/pFjBwA7l6cptCVvVaNFvn96PtVzxWCGKhoX3pOFpiNEQYwa1IKz BeWS8mR4gbc2Jx/1svkgswmQt6pPgyDAyUCMaDMBKp0Tmrwhtx4BUq30tp9L2T3hXnxT7AFd7FF xJq1i14O6p2Glwk/gB2DirDCXO9Vncmmlnyc9GFZ22w93k1xs1mqyltarfAG9NeRhqNkf14n6vB 7H1Waivwyub3QGJv8YCtxgzGk62F9voYTEwyXiSwCvviWVYwvjoucncWa7z7i1ivV5vdERfCh8T RrGu1AQCijQPuyL/gzul4MPKJx7ipondE7eh1Cjm/U01ruQgVZlFXfRX8QBoO4669B7uQW6hqNl wzcKFemJHnM0aF/91i8H/J/mU2ZZn1WgzqFdZR3WiHAqbEvvb4TyQM1GfcjAYRv3FnCC7MotoFF H813vupUxbzaVtBBSzpwnXilbfuGNoFKPKLXd/96smtfZNKrrf0qVgp1gOo7nqkmfFf1BF8SmFI 0V/EcVD6DmpsiwP47633SPIoGoMAxIxG6LphkSk453uaZ//YFl7SW8lmhmIfLvZP32YoQBLlY0T a0PIQMu1YHFbxKEBTk4KRIi6N3S3gRFtC30e4sRZOXO7bpR0jewNBOgf2BqDIKTT2A+hv2lStCJ F6govlKf+ontNG+X4tqqJUrMmIHbORuZDJqBgz1GrWXzXYA== X-Received: by 2002:a05:6a00:3e16:b0:89f:526f:d6cf with SMTP id d2e1a72fcca58-8dcce0745c0mr3344329b3a.42.1796383027974; Fri, 04 Dec 2026 03:17:07 -0800 (PST) Received: from phuc-desktop.. ([183.91.15.56]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8de127ca8e6sm1317298b3a.21.2026.12.04.03.17.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2026 03:17:07 -0800 (PST) From: phucduc.bui@gmail.com To: Mark Brown , Vijendar Mukunda , Venkata Prasad Potturu , Syed Saba Kareem Cc: Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Kees Cook , Kuninori Morimoto , wangdicheng , Chris Bainbridge , linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, bui duc phuc Subject: [PATCH v2 1/9] ASoC: amd: ps: Use devm_pm_runtime_enable() Date: Fri, 4 Dec 2026 18:16:36 +0700 Message-ID: <20261204111644.63432-2-phucduc.bui@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261204111644.63432-1-phucduc.bui@gmail.com> References: <20261204111644.63432-1-phucduc.bui@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: bui duc phuc Use devm_pm_runtime_enable() in the PDM and SoundWire DMA drivers to automatically disable runtime PM when the devices are removed. This allows removing their remove callbacks. Signed-off-by: bui duc phuc --- Changes in v2: - Enable runtime PM before registering components. sound/soc/amd/ps/ps-pdm-dma.c | 21 ++++++++++----------- sound/soc/amd/ps/ps-sdw-dma.c | 21 ++++++++++----------- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/sound/soc/amd/ps/ps-pdm-dma.c b/sound/soc/amd/ps/ps-pdm-dma.c index 359ca10b9ba4..6e2e08c097a0 100644 --- a/sound/soc/amd/ps/ps-pdm-dma.c +++ b/sound/soc/amd/ps/ps-pdm-dma.c @@ -388,6 +388,15 @@ static int acp63_pdm_audio_probe(struct platform_device *pdev) adata->capture_stream = NULL; adata->acp_lock = &acp_data->acp_lock; dev_set_drvdata(&pdev->dev, adata); + + pm_runtime_set_autosuspend_delay(&pdev->dev, ACP_SUSPEND_DELAY_MS); + pm_runtime_use_autosuspend(&pdev->dev); + pm_runtime_mark_last_busy(&pdev->dev); + pm_runtime_set_active(&pdev->dev); + status = devm_pm_runtime_enable(&pdev->dev); + if (status) + return status; + status = devm_snd_soc_register_component(&pdev->dev, &acp63_pdm_component, &acp63_pdm_dai_driver, 1); @@ -396,17 +405,8 @@ static int acp63_pdm_audio_probe(struct platform_device *pdev) return -ENODEV; } - pm_runtime_set_autosuspend_delay(&pdev->dev, ACP_SUSPEND_DELAY_MS); - pm_runtime_use_autosuspend(&pdev->dev); - pm_runtime_mark_last_busy(&pdev->dev); - pm_runtime_set_active(&pdev->dev); - pm_runtime_enable(&pdev->dev); - return 0; -} -static void acp63_pdm_audio_remove(struct platform_device *pdev) -{ - pm_runtime_disable(&pdev->dev); + return 0; } static int acp63_pdm_resume(struct device *dev) @@ -455,7 +455,6 @@ static const struct dev_pm_ops acp63_pdm_pm_ops = { static struct platform_driver acp63_pdm_dma_driver = { .probe = acp63_pdm_audio_probe, - .remove = acp63_pdm_audio_remove, .driver = { .name = "acp_ps_pdm_dma", .pm = pm_ptr(&acp63_pdm_pm_ops), diff --git a/sound/soc/amd/ps/ps-sdw-dma.c b/sound/soc/amd/ps/ps-sdw-dma.c index 6c510e6d9a18..6b78b2d49b12 100644 --- a/sound/soc/amd/ps/ps-sdw-dma.c +++ b/sound/soc/amd/ps/ps-sdw-dma.c @@ -672,6 +672,15 @@ static int acp63_sdw_platform_probe(struct platform_device *pdev) sdw_data->acp_lock = &acp_data->acp_lock; sdw_data->acp_rev = acp_data->acp_rev; dev_set_drvdata(&pdev->dev, sdw_data); + + pm_runtime_set_autosuspend_delay(&pdev->dev, ACP_SUSPEND_DELAY_MS); + pm_runtime_use_autosuspend(&pdev->dev); + pm_runtime_mark_last_busy(&pdev->dev); + pm_runtime_set_active(&pdev->dev); + status = devm_pm_runtime_enable(&pdev->dev); + if (status) + return status; + status = devm_snd_soc_register_component(&pdev->dev, &acp63_sdw_component, NULL, 0); @@ -679,17 +688,8 @@ static int acp63_sdw_platform_probe(struct platform_device *pdev) 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_mark_last_busy(&pdev->dev); - pm_runtime_set_active(&pdev->dev); - pm_runtime_enable(&pdev->dev); - return 0; -} -static void acp63_sdw_platform_remove(struct platform_device *pdev) -{ - pm_runtime_disable(&pdev->dev); + return 0; } static int acp63_restore_sdw_dma_config(struct sdw_dma_dev_data *sdw_data) @@ -795,7 +795,6 @@ static const struct dev_pm_ops acp63_pm_ops = { 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 = pm_ptr(&acp63_pm_ops), -- 2.43.0