diff options
Diffstat (limited to 'drivers/video/au1100fb.c')
-rw-r--r-- | drivers/video/au1100fb.c | 44 |
1 files changed, 40 insertions, 4 deletions
diff --git a/drivers/video/au1100fb.c b/drivers/video/au1100fb.c index 789450bb0bc9..9ef68cd83bb4 100644 --- a/drivers/video/au1100fb.c +++ b/drivers/video/au1100fb.c | |||
@@ -7,6 +7,8 @@ | |||
7 | * Karl Lessard <klessard@sunrisetelecom.com> | 7 | * Karl Lessard <klessard@sunrisetelecom.com> |
8 | * <c.pellegrin@exadron.com> | 8 | * <c.pellegrin@exadron.com> |
9 | * | 9 | * |
10 | * PM support added by Rodolfo Giometti <giometti@linux.it> | ||
11 | * | ||
10 | * Copyright 2002 MontaVista Software | 12 | * Copyright 2002 MontaVista Software |
11 | * Author: MontaVista Software, Inc. | 13 | * Author: MontaVista Software, Inc. |
12 | * ppopov@mvista.com or source@mvista.com | 14 | * ppopov@mvista.com or source@mvista.com |
@@ -602,17 +604,52 @@ int au1100fb_drv_remove(struct device *dev) | |||
602 | return 0; | 604 | return 0; |
603 | } | 605 | } |
604 | 606 | ||
607 | #ifdef CONFIG_PM | ||
608 | static u32 sys_clksrc; | ||
609 | static struct au1100fb_regs fbregs; | ||
610 | |||
605 | int au1100fb_drv_suspend(struct device *dev, pm_message_t state) | 611 | int au1100fb_drv_suspend(struct device *dev, pm_message_t state) |
606 | { | 612 | { |
607 | /* TODO */ | 613 | struct au1100fb_device *fbdev = dev_get_drvdata(dev); |
614 | |||
615 | if (!fbdev) | ||
616 | return 0; | ||
617 | |||
618 | /* Save the clock source state */ | ||
619 | sys_clksrc = au_readl(SYS_CLKSRC); | ||
620 | |||
621 | /* Blank the LCD */ | ||
622 | au1100fb_fb_blank(VESA_POWERDOWN, &fbdev->info); | ||
623 | |||
624 | /* Stop LCD clocking */ | ||
625 | au_writel(sys_clksrc & ~SYS_CS_ML_MASK, SYS_CLKSRC); | ||
626 | |||
627 | memcpy(&fbregs, fbdev->regs, sizeof(struct au1100fb_regs)); | ||
628 | |||
608 | return 0; | 629 | return 0; |
609 | } | 630 | } |
610 | 631 | ||
611 | int au1100fb_drv_resume(struct device *dev) | 632 | int au1100fb_drv_resume(struct device *dev) |
612 | { | 633 | { |
613 | /* TODO */ | 634 | struct au1100fb_device *fbdev = dev_get_drvdata(dev); |
635 | |||
636 | if (!fbdev) | ||
637 | return 0; | ||
638 | |||
639 | memcpy(fbdev->regs, &fbregs, sizeof(struct au1100fb_regs)); | ||
640 | |||
641 | /* Restart LCD clocking */ | ||
642 | au_writel(sys_clksrc, SYS_CLKSRC); | ||
643 | |||
644 | /* Unblank the LCD */ | ||
645 | au1100fb_fb_blank(VESA_NO_BLANKING, &fbdev->info); | ||
646 | |||
614 | return 0; | 647 | return 0; |
615 | } | 648 | } |
649 | #else | ||
650 | #define au1100fb_drv_suspend NULL | ||
651 | #define au1100fb_drv_resume NULL | ||
652 | #endif | ||
616 | 653 | ||
617 | static struct device_driver au1100fb_driver = { | 654 | static struct device_driver au1100fb_driver = { |
618 | .name = "au1100-lcd", | 655 | .name = "au1100-lcd", |
@@ -706,8 +743,7 @@ void __exit au1100fb_cleanup(void) | |||
706 | { | 743 | { |
707 | driver_unregister(&au1100fb_driver); | 744 | driver_unregister(&au1100fb_driver); |
708 | 745 | ||
709 | if (drv_info.opt_mode) | 746 | kfree(drv_info.opt_mode); |
710 | kfree(drv_info.opt_mode); | ||
711 | } | 747 | } |
712 | 748 | ||
713 | module_init(au1100fb_init); | 749 | module_init(au1100fb_init); |