Skip to content

Commit 34665c7

Browse files
YongWu-HFwilldeacon
authored andcommitted
iommu/mediatek: Add pm runtime callback
In pm runtime case, all the registers backup/restore and bclk are controlled in the pm_runtime callback, Rename the original suspend/resume to the runtime_suspend/resume. Use pm_runtime_force_suspend/resume as the normal suspend/resume. iommu should suspend after iommu consumer devices, thus use _LATE_. Signed-off-by: Yong Wu <[email protected]> Reviewed-by: Tomasz Figa <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent baf94e6 commit 34665c7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/iommu/mtk_iommu.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ static int mtk_iommu_remove(struct platform_device *pdev)
802802
return 0;
803803
}
804804

805-
static int __maybe_unused mtk_iommu_suspend(struct device *dev)
805+
static int __maybe_unused mtk_iommu_runtime_suspend(struct device *dev)
806806
{
807807
struct mtk_iommu_data *data = dev_get_drvdata(dev);
808808
struct mtk_iommu_suspend_reg *reg = &data->reg;
@@ -820,7 +820,7 @@ static int __maybe_unused mtk_iommu_suspend(struct device *dev)
820820
return 0;
821821
}
822822

823-
static int __maybe_unused mtk_iommu_resume(struct device *dev)
823+
static int __maybe_unused mtk_iommu_runtime_resume(struct device *dev)
824824
{
825825
struct mtk_iommu_data *data = dev_get_drvdata(dev);
826826
struct mtk_iommu_suspend_reg *reg = &data->reg;
@@ -848,7 +848,9 @@ static int __maybe_unused mtk_iommu_resume(struct device *dev)
848848
}
849849

850850
static const struct dev_pm_ops mtk_iommu_pm_ops = {
851-
SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(mtk_iommu_suspend, mtk_iommu_resume)
851+
SET_RUNTIME_PM_OPS(mtk_iommu_runtime_suspend, mtk_iommu_runtime_resume, NULL)
852+
SET_LATE_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
853+
pm_runtime_force_resume)
852854
};
853855

854856
static const struct mtk_iommu_plat_data mt2712_data = {

0 commit comments

Comments
 (0)