fbdev: bfin-t350mcqb-fb: handle all resources in suspend/resume
authorMichael Hennerich <michael.hennerich@analog.com>
Wed, 16 Dec 2009 00:46:21 +0000 (16:46 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 16 Dec 2009 15:20:01 +0000 (07:20 -0800)
The LCD commands DMA/timers as well as PPI which we need to save/restore.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/video/bfin-t350mcqb-fb.c

index 5cc36cfbf07be275ce2b8ea92104c41e4bda1996..46cb07f61b0f3e7b1ec4a1239315aab303cef92b 100644 (file)
@@ -634,17 +634,35 @@ static int __devexit bfin_t350mcqb_remove(struct platform_device *pdev)
 #ifdef CONFIG_PM
 static int bfin_t350mcqb_suspend(struct platform_device *pdev, pm_message_t state)
 {
-       bfin_t350mcqb_disable_ppi();
-       disable_dma(CH_PPI);
-       bfin_write_PPI_STATUS(0xFFFF);
+       struct fb_info *fbinfo = platform_get_drvdata(pdev);
+       struct bfin_t350mcqbfb_info *fbi = fbinfo->par;
+
+       if (fbi->lq043_open_cnt) {
+               bfin_t350mcqb_disable_ppi();
+               disable_dma(CH_PPI);
+               bfin_t350mcqb_stop_timers();
+               bfin_write_PPI_STATUS(-1);
+       }
+
 
        return 0;
 }
 
 static int bfin_t350mcqb_resume(struct platform_device *pdev)
 {
-       enable_dma(CH_PPI);
-       bfin_t350mcqb_enable_ppi();
+       struct fb_info *fbinfo = platform_get_drvdata(pdev);
+       struct bfin_t350mcqbfb_info *fbi = fbinfo->par;
+
+       if (fbi->lq043_open_cnt) {
+               bfin_t350mcqb_config_dma(fbi);
+               bfin_t350mcqb_config_ppi(fbi);
+               bfin_t350mcqb_init_timers();
+
+               /* start dma */
+               enable_dma(CH_PPI);
+               bfin_t350mcqb_enable_ppi();
+               bfin_t350mcqb_start_timers();
+       }
 
        return 0;
 }