devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Ferre <nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
To: Jean-Christophe PLAGNIOL-VILLARD
	<plagnioj-sclMFOaUSTBWk0Htik3J/w@public.gmane.org>
Cc: Andrew Morton
	<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH 2/8] video: atmel_lcdfb: introduce atmel_lcdfb_power_control
Date: Tue, 16 Apr 2013 14:35:24 +0200	[thread overview]
Message-ID: <516D458C.8050205@atmel.com> (raw)
In-Reply-To: <1365692422-9565-2-git-send-email-plagnioj-sclMFOaUSTBWk0Htik3J/w@public.gmane.org>

On 04/11/2013 05:00 PM, Jean-Christophe PLAGNIOL-VILLARD :
> to simplify the check on the presence of the callback
> 
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj-sclMFOaUSTBWk0Htik3J/w@public.gmane.org>
> Cc: linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Cc: Nicolas Ferre <nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>

Simple and nice

Acked-by: Nicolas Ferre <nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>


> Cc: Andrew Morton <akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
> ---
>  drivers/video/atmel_lcdfb.c |   22 +++++++++++-----------
>  1 file changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
> index 98733cd4..9574c47 100644
> --- a/drivers/video/atmel_lcdfb.c
> +++ b/drivers/video/atmel_lcdfb.c
> @@ -283,6 +283,13 @@ static void init_contrast(struct atmel_lcdfb_info *sinfo)
>  		init_backlight(sinfo);
>  }
>  
> +static inline void atmel_lcdfb_power_control(struct atmel_lcdfb_info *sinfo, int on)
> +{
> +	struct atmel_lcdfb_pdata *pdata = &sinfo->pdata;
> +
> +	if (pdata->atmel_lcdfb_power_control)
> +		pdata->atmel_lcdfb_power_control(on);
> +}
>  
>  static struct fb_fix_screeninfo atmel_lcdfb_fix __initdata = {
>  	.type		= FB_TYPE_PACKED_PIXELS,
> @@ -1114,8 +1121,7 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev)
>  	fb_add_videomode(&fbmode, &info->modelist);
>  
>  	/* Power up the LCDC screen */
> -	if (pdata->atmel_lcdfb_power_control)
> -		pdata->atmel_lcdfb_power_control(1);
> +	atmel_lcdfb_power_control(sinfo, 1);
>  
>  	dev_info(dev, "fb%d: Atmel LCDC at 0x%08lx (mapped at %p), irq %d\n",
>  		       info->node, info->fix.mmio_start, sinfo->mmio, sinfo->irq_base);
> @@ -1169,8 +1175,7 @@ static int __exit atmel_lcdfb_remove(struct platform_device *pdev)
>  
>  	cancel_work_sync(&sinfo->task);
>  	exit_backlight(sinfo);
> -	if (pdata->atmel_lcdfb_power_control)
> -		pdata->atmel_lcdfb_power_control(0);
> +	atmel_lcdfb_power_control(sinfo, 0);
>  	unregister_framebuffer(info);
>  	atmel_lcdfb_stop_clock(sinfo);
>  	clk_put(sinfo->lcdc_clk);
> @@ -1198,7 +1203,6 @@ 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;
> -	struct atmel_lcdfb_pdata *pdata = &sinfo->pdata;
>  
>  	/*
>  	 * We don't want to handle interrupts while the clock is
> @@ -1208,9 +1212,7 @@ static int atmel_lcdfb_suspend(struct platform_device *pdev, pm_message_t mesg)
>  
>  	sinfo->saved_lcdcon = lcdc_readl(sinfo, ATMEL_LCDC_CONTRAST_CTR);
>  	lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, 0);
> -	if (pdata->atmel_lcdfb_power_control)
> -		pdata->atmel_lcdfb_power_control(0);
> -
> +	atmel_lcdfb_power_control(sinfo, 0);
>  	atmel_lcdfb_stop(sinfo);
>  	atmel_lcdfb_stop_clock(sinfo);
>  
> @@ -1221,12 +1223,10 @@ static int atmel_lcdfb_resume(struct platform_device *pdev)
>  {
>  	struct fb_info *info = platform_get_drvdata(pdev);
>  	struct atmel_lcdfb_info *sinfo = info->par;
> -	struct atmel_lcdfb_pdata *pdata = &sinfo->pdata;
>  
>  	atmel_lcdfb_start_clock(sinfo);
>  	atmel_lcdfb_start(sinfo);
> -	if (pdata->atmel_lcdfb_power_control)
> -		pdata->atmel_lcdfb_power_control(1);
> +	atmel_lcdfb_power_control(sinfo, 1);
>  	lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, sinfo->saved_lcdcon);
>  
>  	/* Enable FIFO & DMA errors */
> 


-- 
Nicolas Ferre

  parent reply	other threads:[~2013-04-16 12:35 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-11 14:57 [PATCH 0/8] ARM: at91: atmel_lcdc: add DT support Jean-Christophe PLAGNIOL-VILLARD
2013-04-11 15:00 ` [PATCH 1/8] video: atmel_lcdfb: fix platform data struct Jean-Christophe PLAGNIOL-VILLARD
2013-04-11 15:00   ` [PATCH 2/8] video: atmel_lcdfb: introduce atmel_lcdfb_power_control Jean-Christophe PLAGNIOL-VILLARD
     [not found]     ` <1365692422-9565-2-git-send-email-plagnioj-sclMFOaUSTBWk0Htik3J/w@public.gmane.org>
2013-04-16 12:35       ` Nicolas Ferre [this message]
2013-04-11 15:00   ` [PATCH 3/8] video: atmel_lcdfb: pass the pdata as params Jean-Christophe PLAGNIOL-VILLARD
     [not found]     ` <1365692422-9565-3-git-send-email-plagnioj-sclMFOaUSTBWk0Htik3J/w@public.gmane.org>
2013-04-16 12:38       ` Nicolas Ferre
2013-04-11 15:00   ` [PATCH 4/8] video: atmel_lcdfb: add device tree suport Jean-Christophe PLAGNIOL-VILLARD
2013-04-16 13:42     ` Nicolas Ferre
2013-04-16 13:44       ` Jean-Christophe PLAGNIOL-VILLARD
2013-04-16 15:43         ` Nicolas Ferre
     [not found]     ` <1365692422-9565-4-git-send-email-plagnioj-sclMFOaUSTBWk0Htik3J/w@public.gmane.org>
2013-05-29 15:01       ` Richard Genoud
2013-04-11 15:00   ` [PATCH 5/8] ARM: at91: sam9g45: add lcd support Jean-Christophe PLAGNIOL-VILLARD
2013-04-16 13:57     ` Nicolas Ferre
2013-04-16 14:00     ` Nicolas Ferre
     [not found]       ` <516D5991.8020603-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
2013-04-16 15:12         ` Nicolas Ferre
2013-04-11 15:00   ` [PATCH 6/8] ARM: at91: sam9263: add fb dt support Jean-Christophe PLAGNIOL-VILLARD
2013-04-16 14:11     ` Nicolas Ferre
2013-04-16 14:13       ` Jean-Christophe PLAGNIOL-VILLARD
2013-04-16 15:11         ` Nicolas Ferre
2013-04-16 15:48           ` Jean-Christophe PLAGNIOL-VILLARD
2013-04-11 15:00   ` [PATCH 7/8] ARM: at91: at9sam9m10g45ek: add dt lcd support Jean-Christophe PLAGNIOL-VILLARD
2013-04-16 14:56     ` Nicolas Ferre
2013-04-11 15:00   ` [PATCH 8/8] ARM: at91: sam9263ek: " Jean-Christophe PLAGNIOL-VILLARD
2013-04-16 14:54     ` Nicolas Ferre
2013-04-12  9:52   ` [PATCH 1/8] video: atmel_lcdfb: fix platform data struct Hans-Christian Egtvedt
2013-04-16 12:33   ` Nicolas Ferre
     [not found]   ` <1365692422-9565-1-git-send-email-plagnioj-sclMFOaUSTBWk0Htik3J/w@public.gmane.org>
2013-05-29 14:36     ` Richard Genoud
2013-05-29 17:35       ` Jean-Christophe PLAGNIOL-VILLARD
     [not found]         ` <20130529173538.GC23899-RQcB7r2h9QmfDR2tN2SG5Ni2O/JbrIOy@public.gmane.org>
2013-05-29 17:44           ` Richard Genoud
     [not found]             ` <CACQ1gAhhsMw1-Znd8BC=A0rJBrB4pphCtH9v9qOQR+j2dY3vCw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-05-29 19:32               ` Jean-Christophe PLAGNIOL-VILLARD
     [not found]                 ` <20130529193220.GB19468-RQcB7r2h9QmfDR2tN2SG5Ni2O/JbrIOy@public.gmane.org>
2013-05-30  6:39                   ` Richard Genoud
2013-05-30  7:23                     ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-30 14:05                       ` Hans-Christian Egtvedt
2013-05-30 14:27                       ` Andreas Bießmann
2013-05-30 14:59                         ` Jean-Christophe PLAGNIOL-VILLARD

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=516D458C.8050205@atmel.com \
    --to=nicolas.ferre-aife0yeh4naavxtiumwx3w@public.gmane.org \
    --cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=plagnioj-sclMFOaUSTBWk0Htik3J/w@public.gmane.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).