Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Mark Brown and committed by
Florian Tobias Schandinat
69166ed0 4277f2c4

+1 -74
+1 -74
drivers/video/s3c-fb.c
··· 1590 1590 1591 1591 return 0; 1592 1592 } 1593 - 1594 - static 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 - 1617 - static 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 1593 #else 1660 1594 #define s3c_fb_suspend NULL 1661 1595 #define s3c_fb_resume NULL 1662 - #define s3c_fb_runtime_suspend NULL 1663 - #define s3c_fb_runtime_resume NULL 1664 1596 #endif 1665 1597 1666 1598 ··· 1917 1985 }; 1918 1986 MODULE_DEVICE_TABLE(platform, s3c_fb_driver_ids); 1919 1987 1920 - static const struct dev_pm_ops s3cfb_pm_ops = { 1921 - .suspend = s3c_fb_suspend, 1922 - .resume = s3c_fb_resume, 1923 - .runtime_suspend = s3c_fb_runtime_suspend, 1924 - .runtime_resume = s3c_fb_runtime_resume, 1925 - }; 1988 + static UNIVERSAL_DEV_PM_OPS(s3cfb_pm_ops, s3c_fb_suspend, s3c_fb_resume, NULL); 1926 1989 1927 1990 static struct platform_driver s3c_fb_driver = { 1928 1991 .probe = s3c_fb_probe,