LF-300-1 media: mipi csi: make the csi clock usecount to 0 when it's not used
Balance the clocks enable/disable to make sure clock use count is 0 when the module is not used. This applies for imx8mq. Signed-off-by: Robby Cai <robby.cai@nxp.com> Reviewed-by: Guoniu.zhou <guoniu.zhou@nxp.com> (cherry picked from commit f7b9503f39836e6e84bd1302f3a9eeee9f87b060)5.4-rM2-2.2.x-imx-squashed
parent
7b246b74e8
commit
94716420dc
|
@ -623,6 +623,7 @@ static int mipi_csi2_probe(struct platform_device *pdev)
|
|||
csi2dev->running = 0;
|
||||
csi2dev->flags = MXC_MIPI_CSI2_PM_POWERED;
|
||||
pm_runtime_enable(&pdev->dev);
|
||||
mipi_csi2_clk_disable(csi2dev);
|
||||
|
||||
return 0;
|
||||
|
||||
|
@ -678,7 +679,6 @@ static int __maybe_unused mipi_csi2_pm_suspend(struct device *dev)
|
|||
dev_warn(dev, "running, prevent entering suspend.\n");
|
||||
return -EAGAIN;
|
||||
}
|
||||
mipi_csi2_clk_disable(csi2dev);
|
||||
csi2dev->flags &= ~MXC_MIPI_CSI2_PM_POWERED;
|
||||
csi2dev->flags |= MXC_MIPI_CSI2_PM_SUSPENDED;
|
||||
|
||||
|
@ -693,12 +693,6 @@ static int __maybe_unused mipi_csi2_pm_resume(struct device *dev)
|
|||
if (csi2dev->flags & MXC_MIPI_CSI2_PM_POWERED)
|
||||
return 0;
|
||||
|
||||
ret = mipi_csi2_clk_enable(csi2dev);
|
||||
if (ret < 0) {
|
||||
dev_info(dev, "%s:%d fail\n", __func__, __LINE__);
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
csi2dev->flags |= MXC_MIPI_CSI2_PM_POWERED;
|
||||
csi2dev->flags &= ~MXC_MIPI_CSI2_PM_SUSPENDED;
|
||||
|
||||
|
|
Loading…
Reference in New Issue