* [PATCH 0/1] drivers: dma: change pm registration for dw-axi-dmac-platform's suspend
@ 2025-08-26 10:26 Artem Shimko
0 siblings, 0 replies; 3+ messages in thread
From: Artem Shimko @ 2025-08-26 10:26 UTC (permalink / raw)
To: dmaengine; +Cc: Artem Shimko, linux-kernel, vkoul, eugeniy.paltsev
From: Artem Shimko <artyom.shimko@gmail.com>
The SET_RUNTIME_PM_OPS macro has been deprecated in favor of
DEFINE_RUNTIME_DEV_PM_OPS which provides equivalent functionality
while also supporting system suspend mode.
This change modernizes the power management implementation by:
1. Replacing SET_RUNTIME_PM_OPS with DEFINE_RUNTIME_DEV_PM_OPS
2. Removing wrapper runtime suspend/resume functions
3. Adding __maybe_unused attribute to PM functions
4. Converting direct chip access to device-based access in PM functions
5. Using pm_ptr() for PM ops pointer registration
The refactoring maintains all existing functionality while improving
code maintainability and following current kernel best practices.
Artem Shimko (1):
drivers: dma: change pm registration for dw-axi-dmac-platform's
suspend
.../dma/dw-axi-dmac/dw-axi-dmac-platform.c | 31 ++++++-------------
1 file changed, 9 insertions(+), 22 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 0/1] drivers: dma: change pm registration for dw-axi-dmac-platform's suspend
@ 2025-08-26 10:30 Artem Shimko
2025-08-26 10:30 ` [PATCH 1/1] " Artem Shimko
0 siblings, 1 reply; 3+ messages in thread
From: Artem Shimko @ 2025-08-26 10:30 UTC (permalink / raw)
To: dmaengine; +Cc: Artem Shimko, linux-kernel, vkoul, eugeniy.paltsev
From: Artem Shimko <artyom.shimko@gmail.com>
The SET_RUNTIME_PM_OPS macro has been deprecated in favor of
DEFINE_RUNTIME_DEV_PM_OPS which provides equivalent functionality
while also supporting system suspend mode.
This change modernizes the power management implementation by:
1. Replacing SET_RUNTIME_PM_OPS with DEFINE_RUNTIME_DEV_PM_OPS
2. Removing wrapper runtime suspend/resume functions
3. Adding __maybe_unused attribute to PM functions
4. Converting direct chip access to device-based access in PM functions
5. Using pm_ptr() for PM ops pointer registration
The refactoring maintains all existing functionality while improving
code maintainability and following current kernel best practices.
Artem Shimko (1):
drivers: dma: change pm registration for dw-axi-dmac-platform's
suspend
.../dma/dw-axi-dmac/dw-axi-dmac-platform.c | 31 ++++++-------------
1 file changed, 9 insertions(+), 22 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/1] drivers: dma: change pm registration for dw-axi-dmac-platform's suspend
2025-08-26 10:30 [PATCH 0/1] drivers: dma: change pm registration for dw-axi-dmac-platform's suspend Artem Shimko
@ 2025-08-26 10:30 ` Artem Shimko
0 siblings, 0 replies; 3+ messages in thread
From: Artem Shimko @ 2025-08-26 10:30 UTC (permalink / raw)
To: dmaengine; +Cc: Artem Shimko, linux-kernel, vkoul, eugeniy.paltsev
From: Artem Shimko <artyom.shimko@gmail.com>
Replaced the deprecated SET_RUNTIME_PM_OPS macro with the
DEFINE_RUNTIME_DEV_PM_OPS macro for defining device power
management operations.
The DEFINE_RUNTIME_DEV_PM_OPS macro provides the same functionality
to support system suspend mode.
Signed-off-by: Artem Shimko <artyom.shimko@gmail.com>
---
.../dma/dw-axi-dmac/dw-axi-dmac-platform.c | 31 ++++++-------------
1 file changed, 9 insertions(+), 22 deletions(-)
diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
index c8eaa9c14c03..eeba28a1d2c8 100644
--- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
+++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
@@ -1400,8 +1400,10 @@ static int dma_chan_resume(struct dma_chan *dchan)
return 0;
}
-static int axi_dma_suspend(struct axi_dma_chip *chip)
+static int __maybe_unused axi_dma_suspend(struct device *dev)
{
+ struct axi_dma_chip *chip = dev_get_drvdata(dev);
+
axi_dma_irq_disable(chip);
axi_dma_disable(chip);
@@ -1411,9 +1413,10 @@ static int axi_dma_suspend(struct axi_dma_chip *chip)
return 0;
}
-static int axi_dma_resume(struct axi_dma_chip *chip)
+static int __maybe_unused axi_dma_resume(struct device *dev)
{
int ret;
+ struct axi_dma_chip *chip = dev_get_drvdata(dev);
ret = clk_prepare_enable(chip->cfgr_clk);
if (ret < 0)
@@ -1429,20 +1432,6 @@ static int axi_dma_resume(struct axi_dma_chip *chip)
return 0;
}
-static int __maybe_unused axi_dma_runtime_suspend(struct device *dev)
-{
- struct axi_dma_chip *chip = dev_get_drvdata(dev);
-
- return axi_dma_suspend(chip);
-}
-
-static int __maybe_unused axi_dma_runtime_resume(struct device *dev)
-{
- struct axi_dma_chip *chip = dev_get_drvdata(dev);
-
- return axi_dma_resume(chip);
-}
-
static struct dma_chan *dw_axi_dma_of_xlate(struct of_phandle_args *dma_spec,
struct of_dma *ofdma)
{
@@ -1676,7 +1665,7 @@ static int dw_probe(struct platform_device *pdev)
* driver to work also without Runtime PM.
*/
pm_runtime_get_noresume(chip->dev);
- ret = axi_dma_resume(chip);
+ ret = axi_dma_resume(chip->dev);
if (ret < 0)
goto err_pm_disable;
@@ -1724,7 +1713,7 @@ static void dw_remove(struct platform_device *pdev)
axi_dma_disable(chip);
pm_runtime_disable(chip->dev);
- axi_dma_suspend(chip);
+ axi_dma_suspend(chip->dev);
for (i = 0; i < DMAC_MAX_CHANNELS; i++)
if (chip->irq[i] > 0)
@@ -1739,9 +1728,7 @@ static void dw_remove(struct platform_device *pdev)
}
}
-static const struct dev_pm_ops dw_axi_dma_pm_ops = {
- SET_RUNTIME_PM_OPS(axi_dma_runtime_suspend, axi_dma_runtime_resume, NULL)
-};
+static DEFINE_RUNTIME_DEV_PM_OPS(dw_axi_dma_pm_ops, axi_dma_suspend, axi_dma_resume, NULL);
static const struct of_device_id dw_dma_of_id_table[] = {
{
@@ -1766,7 +1753,7 @@ static struct platform_driver dw_driver = {
.driver = {
.name = KBUILD_MODNAME,
.of_match_table = dw_dma_of_id_table,
- .pm = &dw_axi_dma_pm_ops,
+ .pm = pm_ptr(&dw_axi_dma_pm_ops),
},
};
module_platform_driver(dw_driver);
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-08-26 10:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-26 10:30 [PATCH 0/1] drivers: dma: change pm registration for dw-axi-dmac-platform's suspend Artem Shimko
2025-08-26 10:30 ` [PATCH 1/1] " Artem Shimko
-- strict thread matches above, loose matches on Subject: below --
2025-08-26 10:26 [PATCH 0/1] " Artem Shimko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).