mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 11:50:43 +09:00
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 <cyw@rock-chips.com>
This commit is contained in:
@@ -697,6 +697,27 @@ static int rkisp1_plat_remove(struct platform_device *pdev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __maybe_unused rkisp1_suspend(struct device *dev)
|
||||
{
|
||||
struct rkisp1_device *isp_dev = dev_get_drvdata(dev);
|
||||
|
||||
if (isp_dev->domain)
|
||||
iommu_detach_device(isp_dev->domain, isp_dev->dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __maybe_unused rkisp1_resume(struct device *dev)
|
||||
{
|
||||
struct rkisp1_device *isp_dev = dev_get_drvdata(dev);
|
||||
int ret = 0;
|
||||
|
||||
if (isp_dev->domain)
|
||||
ret = iommu_attach_device(isp_dev->domain, isp_dev->dev);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int __maybe_unused rkisp1_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct rkisp1_device *isp_dev = dev_get_drvdata(dev);
|
||||
@@ -719,8 +740,7 @@ static int __maybe_unused rkisp1_runtime_resume(struct device *dev)
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops rkisp1_plat_pm_ops = {
|
||||
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
|
||||
pm_runtime_force_resume)
|
||||
SET_SYSTEM_SLEEP_PM_OPS(rkisp1_suspend, rkisp1_resume)
|
||||
SET_RUNTIME_PM_OPS(rkisp1_runtime_suspend, rkisp1_runtime_resume, NULL)
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user