Skip to content

Commit 503b128

Browse files
Cai YiWeinumbqq
authored andcommitted
media: rockchip: isp1: add suspend/resume to detach/attach isp iommu
when system goto suspend, isp will be powered off, isp iommu will be disabled, need to attach on resume, detach on suspend. Change-Id: I2b5e775b44d2b72df4ddcf2db12b54518c3e1f2e Signed-off-by: Cai YiWei <[email protected]>
1 parent a41abfe commit 503b128

File tree

1 file changed

+22
-2
lines changed
  • drivers/media/platform/rockchip/isp1

1 file changed

+22
-2
lines changed

drivers/media/platform/rockchip/isp1/dev.c

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,27 @@ static int rkisp1_plat_remove(struct platform_device *pdev)
697697
return 0;
698698
}
699699

700+
static int __maybe_unused rkisp1_suspend(struct device *dev)
701+
{
702+
struct rkisp1_device *isp_dev = dev_get_drvdata(dev);
703+
704+
if (isp_dev->domain)
705+
iommu_detach_device(isp_dev->domain, isp_dev->dev);
706+
707+
return 0;
708+
}
709+
710+
static int __maybe_unused rkisp1_resume(struct device *dev)
711+
{
712+
struct rkisp1_device *isp_dev = dev_get_drvdata(dev);
713+
int ret = 0;
714+
715+
if (isp_dev->domain)
716+
ret = iommu_attach_device(isp_dev->domain, isp_dev->dev);
717+
718+
return ret;
719+
}
720+
700721
static int __maybe_unused rkisp1_runtime_suspend(struct device *dev)
701722
{
702723
struct rkisp1_device *isp_dev = dev_get_drvdata(dev);
@@ -719,8 +740,7 @@ static int __maybe_unused rkisp1_runtime_resume(struct device *dev)
719740
}
720741

721742
static const struct dev_pm_ops rkisp1_plat_pm_ops = {
722-
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
723-
pm_runtime_force_resume)
743+
SET_SYSTEM_SLEEP_PM_OPS(rkisp1_suspend, rkisp1_resume)
724744
SET_RUNTIME_PM_OPS(rkisp1_runtime_suspend, rkisp1_runtime_resume, NULL)
725745
};
726746

0 commit comments

Comments
 (0)