diff options
author | Paul Kocialkowski <contact@paulk.fr> | 2014-06-29 23:14:51 +0200 |
---|---|---|
committer | Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> | 2017-05-11 14:01:35 +0200 |
commit | 55fc044b8102b29d164a6a724594292b3a8a8cc8 (patch) | |
tree | 7cf04131e705491f8be7f9d856ef2bf66aa31f55 /drivers/video/omap2 | |
parent | 091e56f981fc749865ada150dfe806f34e1dabb6 (diff) | |
download | kernel_samsung_tuna-55fc044b8102b29d164a6a724594292b3a8a8cc8.zip kernel_samsung_tuna-55fc044b8102b29d164a6a724594292b3a8a8cc8.tar.gz kernel_samsung_tuna-55fc044b8102b29d164a6a724594292b3a8a8cc8.tar.bz2 |
omap: dss: Suspend DSS with earlysuspend
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Diffstat (limited to 'drivers/video/omap2')
-rwxr-xr-x | drivers/video/omap2/dss/core.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c index 79cddac..6f3fd20 100755 --- a/drivers/video/omap2/dss/core.c +++ b/drivers/video/omap2/dss/core.c @@ -34,6 +34,9 @@ #include <linux/regulator/consumer.h> #include <plat/omap_hwmod.h> #include <plat/omap-pm.h> +#ifdef CONFIG_HAS_EARLYSUSPEND +#include <linux/earlysuspend.h> +#endif #include <video/omapdss.h> @@ -45,6 +48,10 @@ static struct { struct regulator *vdds_dsi_reg; struct regulator *vdds_sdi_reg; + +#ifdef CONFIG_HAS_EARLYSUSPEND + struct early_suspend dss_early_suspend_info; +#endif } core; static char *def_disp_name; @@ -337,12 +344,31 @@ static int omap_dss_resume(struct platform_device *pdev) return dss_resume_all_devices(); } +#ifdef CONFIG_HAS_EARLYSUSPEND +static void dss_early_suspend(struct early_suspend *h) +{ + DSSDBG("%s\n", __func__); + omap_dss_suspend(core.pdev, PMSG_SUSPEND); +} + +static void dss_late_resume(struct early_suspend *h) +{ + DSSDBG("%s\n", __func__); + omap_dss_resume(core.pdev); +} +#endif + static struct platform_driver omap_dss_driver = { .probe = omap_dss_probe, .remove = omap_dss_remove, .shutdown = omap_dss_shutdown, +#ifdef CONFIG_HAS_EARLYSUSPEND + .suspend = NULL, + .resume = NULL, +#else .suspend = omap_dss_suspend, .resume = omap_dss_resume, +#endif .driver = { .name = "omapdss", .owner = THIS_MODULE, @@ -585,6 +611,13 @@ static int omap_dss_bus_register(void) return r; } +#ifdef CONFIG_HAS_EARLYSUSPEND + core.dss_early_suspend_info.suspend = dss_early_suspend; + core.dss_early_suspend_info.resume = dss_late_resume; + core.dss_early_suspend_info.level = EARLY_SUSPEND_LEVEL_DISABLE_FB + 2; + register_early_suspend(&core.dss_early_suspend_info); +#endif + return 0; } @@ -593,6 +626,9 @@ static int omap_dss_bus_register(void) #ifdef CONFIG_OMAP2_DSS_MODULE static void omap_dss_bus_unregister(void) { +#ifdef CONFIG_HAS_EARLYSUSPEND + unregister_early_suspend(&core.dss_early_suspend_info); +#endif device_unregister(&dss_bus); bus_unregister(&dss_bus_type); |