linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
To: linux-fbdev@vger.kernel.org
Subject: Re: [PATCH 1/2] video: s3c-fb: Unify runtime and system PM functions
Date: Sun, 04 Dec 2011 00:39:27 +0000	[thread overview]
Message-ID: <4EDAC13F.4060102@gmx.de> (raw)
In-Reply-To: <1322434268-25525-1-git-send-email-broonie@opensource.wolfsonmicro.com>

On 11/27/2011 10:51 PM, Mark Brown wrote:
> 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>

Applied this patch.


Thanks,

Florian Tobias Schandinat

> ---
> 
> This is a slightly updated version of the patch, previously I forgot to
> staticise the pm_ops.
> 
>  drivers/video/s3c-fb.c |   75 +-----------------------------------------------
>  1 files changed, 1 insertions(+), 74 deletions(-)
> 
> diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
> index 12eaee0..27971bc 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)
>  
>  	return 0;
>  }
> -
> -static int s3c_fb_runtime_suspend(struct device *dev)
> -{
> -	struct platform_device *pdev = to_platform_device(dev);
> -	struct s3c_fb *sfb = platform_get_drvdata(pdev);
> -	struct s3c_fb_win *win;
> -	int win_no;
> -
> -	for (win_no = S3C_FB_MAX_WIN - 1; win_no >= 0; win_no--) {
> -		win = sfb->windows[win_no];
> -		if (!win)
> -			continue;
> -
> -		/* use the blank function to push into power-down */
> -		s3c_fb_blank(FB_BLANK_POWERDOWN, win->fbinfo);
> -	}
> -
> -	if (!sfb->variant.has_clksel)
> -		clk_disable(sfb->lcd_clk);
> -
> -	clk_disable(sfb->bus_clk);
> -	return 0;
> -}
> -
> -static int s3c_fb_runtime_resume(struct device *dev)
> -{
> -	struct platform_device *pdev = to_platform_device(dev);
> -	struct s3c_fb *sfb = platform_get_drvdata(pdev);
> -	struct s3c_fb_platdata *pd = sfb->pdata;
> -	struct s3c_fb_win *win;
> -	int win_no;
> -
> -	clk_enable(sfb->bus_clk);
> -
> -	if (!sfb->variant.has_clksel)
> -		clk_enable(sfb->lcd_clk);
> -
> -	/* setup gpio and output polarity controls */
> -	pd->setup_gpio();
> -	writel(pd->vidcon1, sfb->regs + VIDCON1);
> -
> -	/* zero all windows before we do anything */
> -	for (win_no = 0; win_no < sfb->variant.nr_windows; win_no++)
> -		s3c_fb_clear_win(sfb, win_no);
> -
> -	for (win_no = 0; win_no < sfb->variant.nr_windows - 1; win_no++) {
> -		void __iomem *regs = sfb->regs + sfb->variant.keycon;
> -
> -		regs += (win_no * 8);
> -		writel(0xffffff, regs + WKEYCON0);
> -		writel(0xffffff, regs + WKEYCON1);
> -	}
> -
> -	/* restore framebuffers */
> -	for (win_no = 0; win_no < S3C_FB_MAX_WIN; win_no++) {
> -		win = sfb->windows[win_no];
> -		if (!win)
> -			continue;
> -
> -		dev_dbg(&pdev->dev, "resuming window %d\n", win_no);
> -		s3c_fb_set_par(win->fbinfo);
> -	}
> -
> -	return 0;
> -}
> -
>  #else
>  #define s3c_fb_suspend NULL
>  #define s3c_fb_resume  NULL
> -#define s3c_fb_runtime_suspend NULL
> -#define s3c_fb_runtime_resume NULL
>  #endif
>  
>  
> @@ -1985,12 +1917,7 @@ static struct platform_device_id s3c_fb_driver_ids[] = {
>  };
>  MODULE_DEVICE_TABLE(platform, s3c_fb_driver_ids);
>  
> -static const struct dev_pm_ops s3cfb_pm_ops = {
> -	.suspend	= s3c_fb_suspend,
> -	.resume		= s3c_fb_resume,
> -	.runtime_suspend	= s3c_fb_runtime_suspend,
> -	.runtime_resume		= s3c_fb_runtime_resume,
> -};
> +static UNIVERSAL_DEV_PM_OPS(s3cfb_pm_ops, s3c_fb_suspend, s3c_fb_resume, NULL);
>  
>  static struct platform_driver s3c_fb_driver = {
>  	.probe		= s3c_fb_probe,


      parent reply	other threads:[~2011-12-04  0:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-27 22:51 [PATCH 1/2] video: s3c-fb: Unify runtime and system PM functions Mark Brown
2011-11-28  7:38 ` Jingoo Han
2011-12-04  0:39 ` Florian Tobias Schandinat [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EDAC13F.4060102@gmx.de \
    --to=florianschandinat@gmx.de \
    --cc=linux-fbdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).