aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Chen <b02280@freescale.com>2011-10-27 10:25:33 +0800
committerJason Chen <b02280@freescale.com>2011-11-16 16:32:04 +0800
commitd195754075184f475cb243ebb6f9c32410604606 (patch)
treea0b97c4416119888f6f0c75cdbe736cb63fee6fc
parentda33a1456bba25c7961a1c8073eb95b46565077d (diff)
downloadlinux-linaro-d195754075184f475cb243ebb6f9c32410604606.tar.gz
ENGR00160877 ipuv3: pm method change
1. use late suspend early resume 2. disable/enable clk when suspend/resume with clk on. Signed-off-by: Jason Chen <b02280@freescale.com>
-rw-r--r--drivers/mxc/ipu3/ipu_common.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/mxc/ipu3/ipu_common.c b/drivers/mxc/ipu3/ipu_common.c
index 0911a15f480..d198366bac7 100644
--- a/drivers/mxc/ipu3/ipu_common.c
+++ b/drivers/mxc/ipu3/ipu_common.c
@@ -2779,8 +2779,9 @@ bool ipu_pixel_format_has_alpha(uint32_t fmt)
return false;
}
-static int ipu_suspend(struct platform_device *pdev, pm_message_t state)
+static int ipu_suspend_noirq(struct device *dev)
{
+ struct platform_device *pdev = to_platform_device(dev);
struct imx_ipuv3_platform_data *plat_data = pdev->dev.platform_data;
struct ipu_soc *ipu = platform_get_drvdata(pdev);
@@ -2849,6 +2850,8 @@ static int ipu_suspend(struct platform_device *pdev, pm_message_t state)
ipu->buf_ready_reg[7] = ipu_cm_read(ipu, IPU_ALT_CHA_BUF1_RDY(32));
ipu->buf_ready_reg[8] = ipu_cm_read(ipu, IPU_CHA_BUF2_RDY(0));
ipu->buf_ready_reg[9] = ipu_cm_read(ipu, IPU_CHA_BUF2_RDY(32));
+
+ clk_disable(ipu->ipu_clk);
}
if (plat_data->pg)
@@ -2857,8 +2860,9 @@ static int ipu_suspend(struct platform_device *pdev, pm_message_t state)
return 0;
}
-static int ipu_resume(struct platform_device *pdev)
+static int ipu_resume_noirq(struct device *dev)
{
+ struct platform_device *pdev = to_platform_device(dev);
struct imx_ipuv3_platform_data *plat_data = pdev->dev.platform_data;
struct ipu_soc *ipu = platform_get_drvdata(pdev);
@@ -2866,6 +2870,8 @@ static int ipu_resume(struct platform_device *pdev)
plat_data->pg(0);
if (atomic_read(&ipu->ipu_use_count)) {
+ clk_enable(ipu->ipu_clk);
+
/* restore buf ready regs */
ipu_cm_write(ipu, ipu->buf_ready_reg[0], IPU_CHA_BUF0_RDY(0));
ipu_cm_write(ipu, ipu->buf_ready_reg[1], IPU_CHA_BUF0_RDY(32));
@@ -2916,17 +2922,21 @@ static int ipu_resume(struct platform_device *pdev)
return 0;
}
+static const struct dev_pm_ops mxcipu_pm_ops = {
+ .suspend_noirq = ipu_suspend_noirq,
+ .resume_noirq = ipu_resume_noirq,
+};
+
/*!
* This structure contains pointers to the power management callback functions.
*/
static struct platform_driver mxcipu_driver = {
.driver = {
.name = "imx-ipuv3",
+ .pm = &mxcipu_pm_ops,
},
.probe = ipu_probe,
.remove = ipu_remove,
- .suspend = ipu_suspend,
- .resume = ipu_resume,
};
int32_t __init ipu_gen_init(void)