Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 94174
b: refs/heads/master
c: cf19a37
h: refs/heads/master
v: v3
  • Loading branch information
David Brownell authored and Linus Torvalds committed Apr 28, 2008
1 parent 6345097 commit 8ff24c8
Show file tree
Hide file tree
Showing 3 changed files with 36 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: 01d3a5e7fab7732cfc5d5d4533e9378ea435295a
refs/heads/master: cf19a37e0641d975d271a5a30f097dd6b96d232f
36 changes: 34 additions & 2 deletions trunk/drivers/video/atmel_lcdfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -909,10 +909,42 @@ static int __exit atmel_lcdfb_remove(struct platform_device *pdev)
return 0;
}

#ifdef CONFIG_PM

static int atmel_lcdfb_suspend(struct platform_device *pdev, pm_message_t mesg)
{
struct fb_info *info = platform_get_drvdata(pdev);
struct atmel_lcdfb_info *sinfo = info->par;

sinfo->saved_lcdcon = lcdc_readl(sinfo, ATMEL_LCDC_CONTRAST_VAL);
lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, 0);
if (sinfo->atmel_lcdfb_power_control)
sinfo->atmel_lcdfb_power_control(0);
atmel_lcdfb_stop_clock(sinfo);
return 0;
}

static int atmel_lcdfb_resume(struct platform_device *pdev)
{
struct fb_info *info = platform_get_drvdata(pdev);
struct atmel_lcdfb_info *sinfo = info->par;

atmel_lcdfb_start_clock(sinfo);
if (sinfo->atmel_lcdfb_power_control)
sinfo->atmel_lcdfb_power_control(1);
lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, sinfo->saved_lcdcon);
return 0;
}

#else
#define atmel_lcdfb_suspend NULL
#define atmel_lcdfb_resume NULL
#endif

static struct platform_driver atmel_lcdfb_driver = {
.remove = __exit_p(atmel_lcdfb_remove),

// FIXME need suspend, resume
.suspend = atmel_lcdfb_suspend,
.resume = atmel_lcdfb_resume,

.driver = {
.name = "atmel_lcdfb",
Expand Down
1 change: 1 addition & 0 deletions trunk/include/video/atmel_lcdc.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ struct atmel_lcdfb_info {
u8 bl_power;
#endif
bool lcdcon_is_backlight;
u8 saved_lcdcon;

u8 default_bpp;
unsigned int default_lcdcon2;
Expand Down

0 comments on commit 8ff24c8

Please sign in to comment.