aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/s3c-fb.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-11-27 17:51:07 -0500
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2011-12-03 17:09:50 -0500
commit69166ed01949fdb9df17b5b87d64b27501bc6f53 (patch)
treea29d3ee6d8ba128fdf2463cce3e888689da534b4 /drivers/video/s3c-fb.c
parent4277f2c4667187cbbdd3da3be31ee681bc6b8300 (diff)
video: s3c-fb: Unify runtime and system PM functions
The s3c-fb driver has separate runtime and system PM functions but the implementations are identical so far as I can tell so unify them for simplicity. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Diffstat (limited to 'drivers/video/s3c-fb.c')
-rw-r--r--drivers/video/s3c-fb.c75
1 files changed, 1 insertions, 74 deletions
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
index cf1d11f5bfb8..e84677e6f5ed 100644
--- a/drivers/video/s3c-fb.c
+++ b/drivers/video/s3c-fb.c
@@ -1590,77 +1590,9 @@ static int s3c_fb_resume(struct device *dev)
1590 1590
1591 return 0; 1591 return 0;
1592} 1592}
1593
1594static int s3c_fb_runtime_suspend(struct device *dev)
1595{
1596 struct platform_device *pdev = to_platform_device(dev);
1597 struct s3c_fb *sfb = platform_get_drvdata(pdev);
1598 struct s3c_fb_win *win;
1599 int win_no;
1600
1601 for (win_no = S3C_FB_MAX_WIN - 1; win_no >= 0; win_no--) {
1602 win = sfb->windows[win_no];
1603 if (!win)
1604 continue;
1605
1606 /* use the blank function to push into power-down */
1607 s3c_fb_blank(FB_BLANK_POWERDOWN, win->fbinfo);
1608 }
1609
1610 if (!sfb->variant.has_clksel)
1611 clk_disable(sfb->lcd_clk);
1612
1613 clk_disable(sfb->bus_clk);
1614 return 0;
1615}
1616
1617static int s3c_fb_runtime_resume(struct device *dev)
1618{
1619 struct platform_device *pdev = to_platform_device(dev);
1620 struct s3c_fb *sfb = platform_get_drvdata(pdev);
1621 struct s3c_fb_platdata *pd = sfb->pdata;
1622 struct s3c_fb_win *win;
1623 int win_no;
1624
1625 clk_enable(sfb->bus_clk);
1626
1627 if (!sfb->variant.has_clksel)
1628 clk_enable(sfb->lcd_clk);
1629
1630 /* setup gpio and output polarity controls */
1631 pd->setup_gpio();
1632 writel(pd->vidcon1, sfb->regs + VIDCON1);
1633
1634 /* zero all windows before we do anything */
1635 for (win_no = 0; win_no < sfb->variant.nr_windows; win_no++)
1636 s3c_fb_clear_win(sfb, win_no);
1637
1638 for (win_no = 0; win_no < sfb->variant.nr_windows - 1; win_no++) {
1639 void __iomem *regs = sfb->regs + sfb->variant.keycon;
1640
1641 regs += (win_no * 8);
1642 writel(0xffffff, regs + WKEYCON0);
1643 writel(0xffffff, regs + WKEYCON1);
1644 }
1645
1646 /* restore framebuffers */
1647 for (win_no = 0; win_no < S3C_FB_MAX_WIN; win_no++) {
1648 win = sfb->windows[win_no];
1649 if (!win)
1650 continue;
1651
1652 dev_dbg(&pdev->dev, "resuming window %d\n", win_no);
1653 s3c_fb_set_par(win->fbinfo);
1654 }
1655
1656 return 0;
1657}
1658
1659#else 1593#else
1660#define s3c_fb_suspend NULL 1594#define s3c_fb_suspend NULL
1661#define s3c_fb_resume NULL 1595#define s3c_fb_resume NULL
1662#define s3c_fb_runtime_suspend NULL
1663#define s3c_fb_runtime_resume NULL
1664#endif 1596#endif
1665 1597
1666 1598
@@ -1985,12 +1917,7 @@ static struct platform_device_id s3c_fb_driver_ids[] = {
1985}; 1917};
1986MODULE_DEVICE_TABLE(platform, s3c_fb_driver_ids); 1918MODULE_DEVICE_TABLE(platform, s3c_fb_driver_ids);
1987 1919
1988static const struct dev_pm_ops s3cfb_pm_ops = { 1920static UNIVERSAL_DEV_PM_OPS(s3cfb_pm_ops, s3c_fb_suspend, s3c_fb_resume, NULL);
1989 .suspend = s3c_fb_suspend,
1990 .resume = s3c_fb_resume,
1991 .runtime_suspend = s3c_fb_runtime_suspend,
1992 .runtime_resume = s3c_fb_runtime_resume,
1993};
1994 1921
1995static struct platform_driver s3c_fb_driver = { 1922static struct platform_driver s3c_fb_driver = {
1996 .probe = s3c_fb_probe, 1923 .probe = s3c_fb_probe,