aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/video/atmel_lcdfb.c36
-rw-r--r--include/video/atmel_lcdc.h1
2 files changed, 35 insertions, 2 deletions
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index 4d68b1b880d6..6fcf76c12910 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -909,10 +909,42 @@ static int __exit atmel_lcdfb_remove(struct platform_device *pdev)
909 return 0; 909 return 0;
910} 910}
911 911
912#ifdef CONFIG_PM
913
914static int atmel_lcdfb_suspend(struct platform_device *pdev, pm_message_t mesg)
915{
916 struct fb_info *info = platform_get_drvdata(pdev);
917 struct atmel_lcdfb_info *sinfo = info->par;
918
919 sinfo->saved_lcdcon = lcdc_readl(sinfo, ATMEL_LCDC_CONTRAST_VAL);
920 lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, 0);
921 if (sinfo->atmel_lcdfb_power_control)
922 sinfo->atmel_lcdfb_power_control(0);
923 atmel_lcdfb_stop_clock(sinfo);
924 return 0;
925}
926
927static int atmel_lcdfb_resume(struct platform_device *pdev)
928{
929 struct fb_info *info = platform_get_drvdata(pdev);
930 struct atmel_lcdfb_info *sinfo = info->par;
931
932 atmel_lcdfb_start_clock(sinfo);
933 if (sinfo->atmel_lcdfb_power_control)
934 sinfo->atmel_lcdfb_power_control(1);
935 lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, sinfo->saved_lcdcon);
936 return 0;
937}
938
939#else
940#define atmel_lcdfb_suspend NULL
941#define atmel_lcdfb_resume NULL
942#endif
943
912static struct platform_driver atmel_lcdfb_driver = { 944static struct platform_driver atmel_lcdfb_driver = {
913 .remove = __exit_p(atmel_lcdfb_remove), 945 .remove = __exit_p(atmel_lcdfb_remove),
914 946 .suspend = atmel_lcdfb_suspend,
915// FIXME need suspend, resume 947 .resume = atmel_lcdfb_resume,
916 948
917 .driver = { 949 .driver = {
918 .name = "atmel_lcdfb", 950 .name = "atmel_lcdfb",
diff --git a/include/video/atmel_lcdc.h b/include/video/atmel_lcdc.h
index 336c20db87f8..2fd9fad922e5 100644
--- a/include/video/atmel_lcdc.h
+++ b/include/video/atmel_lcdc.h
@@ -39,6 +39,7 @@ struct atmel_lcdfb_info {
39 u8 bl_power; 39 u8 bl_power;
40#endif 40#endif
41 bool lcdcon_is_backlight; 41 bool lcdcon_is_backlight;
42 u8 saved_lcdcon;
42 43
43 u8 default_bpp; 44 u8 default_bpp;
44 unsigned int default_lcdcon2; 45 unsigned int default_lcdcon2;