diff options
Diffstat (limited to 'drivers/video/omap2/dss/core.c')
-rw-r--r-- | 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 2a1e6ed..d2cba40 100644 --- a/drivers/video/omap2/dss/core.c +++ b/drivers/video/omap2/dss/core.c @@ -32,6 +32,9 @@ #include <linux/io.h> #include <linux/device.h> #include <linux/regulator/consumer.h> +#ifdef CONFIG_HAS_EARLYSUSPEND +#include <linux/earlysuspend.h> +#endif #include <video/omapdss.h> @@ -43,6 +46,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; @@ -301,12 +308,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, @@ -539,6 +565,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; } @@ -547,6 +580,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); |