Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 30306
b: refs/heads/master
c: f77f50c
h: refs/heads/master
v: v3
  • Loading branch information
Rodolfo Giometti authored and Linus Torvalds committed Jun 26, 2006
1 parent 1790177 commit cef363e
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 137a8899b1dba82b54463811844995a33b21ca39
refs/heads/master: f77f50ca1a236ae213d1b9cef4ac042090c98ae6
41 changes: 39 additions & 2 deletions trunk/drivers/video/au1100fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
* Karl Lessard <klessard@sunrisetelecom.com>
* <c.pellegrin@exadron.com>
*
* PM support added by Rodolfo Giometti <giometti@linux.it>
*
* Copyright 2002 MontaVista Software
* Author: MontaVista Software, Inc.
* ppopov@mvista.com or source@mvista.com
Expand Down Expand Up @@ -602,17 +604,52 @@ int au1100fb_drv_remove(struct device *dev)
return 0;
}

#ifdef CONFIG_PM
static u32 sys_clksrc;
static struct au1100fb_regs fbregs;

int au1100fb_drv_suspend(struct device *dev, pm_message_t state)
{
/* TODO */
struct au1100fb_device *fbdev = dev_get_drvdata(dev);

if (!fbdev)
return 0;

/* Save the clock source state */
sys_clksrc = au_readl(SYS_CLKSRC);

/* Blank the LCD */
au1100fb_fb_blank(VESA_POWERDOWN, &fbdev->info);

/* Stop LCD clocking */
au_writel(sys_clksrc & ~SYS_CS_ML_MASK, SYS_CLKSRC);

memcpy(&fbregs, fbdev->regs, sizeof(struct au1100fb_regs));

return 0;
}

int au1100fb_drv_resume(struct device *dev)
{
/* TODO */
struct au1100fb_device *fbdev = dev_get_drvdata(dev);

if (!fbdev)
return 0;

memcpy(fbdev->regs, &fbregs, sizeof(struct au1100fb_regs));

/* Restart LCD clocking */
au_writel(sys_clksrc, SYS_CLKSRC);

/* Unblank the LCD */
au1100fb_fb_blank(VESA_NO_BLANKING, &fbdev->info);

return 0;
}
#else
#define au1100fb_drv_suspend NULL
#define au1100fb_drv_resume NULL
#endif

static struct device_driver au1100fb_driver = {
.name = "au1100-lcd",
Expand Down

0 comments on commit cef363e

Please sign in to comment.