Skip to content

Commit

Permalink
[PATCH] au1100fb: add power management support
Browse files Browse the repository at this point in the history
Add power management support

[akpm@osdl.org: cleanup]
Signed-off-by: Rodolfo Giometti <giometti@linux.it>
Signed-off-by: Antonino Daplas <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Rodolfo Giometti authored and Linus Torvalds committed Jun 26, 2006
1 parent 137a889 commit f77f50c
Showing 1 changed file with 39 additions and 2 deletions.
41 changes: 39 additions & 2 deletions 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 f77f50c

Please sign in to comment.