diff options
author | Stefan Agner <stefan.agner@toradex.com> | 2014-12-12 11:33:48 +0100 |
---|---|---|
committer | Stefan Agner <stefan.agner@toradex.com> | 2014-12-12 11:33:48 +0100 |
commit | 5663b6e69c8b72cefc22be7ebff02438d40e441a (patch) | |
tree | b5964f687f8b907a62df923bdadda27d676433f8 /drivers | |
parent | 99313393207f6f05a3e7163376f88126abe58879 (diff) | |
parent | 118a17e4a8d9f91cc7c72e6f02134f17a0198ca2 (diff) |
Merge branch 'vf610-dcu-3.18-2' into toradex_vf_3.18-next
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/fbdev/fsl-dcu-fb.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/drivers/video/fbdev/fsl-dcu-fb.c b/drivers/video/fbdev/fsl-dcu-fb.c index 78a534fcfefb..9c7e9b8cf31e 100644 --- a/drivers/video/fbdev/fsl-dcu-fb.c +++ b/drivers/video/fbdev/fsl-dcu-fb.c @@ -22,6 +22,7 @@ #include <video/of_display_timing.h> #include <video/videomode.h> #include <linux/pm_runtime.h> +#include <linux/console.h> #define DRIVER_NAME "fsl-dcu-fb" @@ -968,6 +969,42 @@ static int fsl_dcu_runtime_resume(struct device *dev) } #endif +#ifdef CONFIG_PM_SLEEP +static int fsl_dcu_suspend(struct device *dev) +{ + struct dcu_fb_data *dcufb = dev_get_drvdata(dev); + struct fb_info *fbi = dcufb->fsl_dcu_info[0]; + + console_lock(); + fb_set_suspend(fbi, 1); + console_unlock(); + + disable_panel(fbi); + + disable_controller(dcufb->fsl_dcu_info[0]); + clk_disable_unprepare(dcufb->clk); + + return 0; +} + +static int fsl_dcu_resume(struct device *dev) +{ + struct dcu_fb_data *dcufb = dev_get_drvdata(dev); + struct fb_info *fbi = dcufb->fsl_dcu_info[0]; + + clk_prepare_enable(dcufb->clk); + enable_controller(dcufb->fsl_dcu_info[0]); + + console_lock(); + fb_set_suspend(fbi, 0); + console_unlock(); + + fsl_dcu_set_par(fbi); + + return 0; +} +#endif + static int bypass_tcon(struct device_node *np) { struct device_node *tcon_np; @@ -998,6 +1035,7 @@ static int bypass_tcon(struct device_node *np) return PTR_ERR(tcon_reg); writel(TCON_BYPASS_ENABLE, tcon_reg + TCON_CTRL1); + clk_disable_unprepare(tcon_clk); return 0; } @@ -1147,6 +1185,7 @@ static int fsl_dcu_remove(struct platform_device *pdev) static const struct dev_pm_ops fsl_dcu_pm_ops = { SET_RUNTIME_PM_OPS(fsl_dcu_runtime_suspend, fsl_dcu_runtime_resume, NULL) + SET_SYSTEM_SLEEP_PM_OPS(fsl_dcu_suspend, fsl_dcu_resume) }; static struct of_device_id fsl_dcu_dt_ids[] = { |