From: Nicolas Ferre <nicolas.ferre@atmel.com>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/8] video: atmel_lcdfb: introduce atmel_lcdfb_power_control
Date: Tue, 16 Apr 2013 12:35:24 +0000 [thread overview]
Message-ID: <516D458C.8050205@atmel.com> (raw)
In-Reply-To: <1365692422-9565-2-git-send-email-plagnioj@jcrosoft.com>
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@jcrosoft.com>
> Cc: linux-fbdev@vger.kernel.org
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Simple and nice
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> Cc: Andrew Morton <akpm@linux-foundation.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
next prev parent reply other threads:[~2013-04-16 12:35 UTC|newest]
Thread overview: 22+ 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
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
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
2013-05-29 15:01 ` Richard Genoud
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
2013-05-29 14:36 ` Richard Genoud
2013-05-29 17:35 ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-29 17:44 ` Richard Genoud
2013-05-29 19:32 ` Jean-Christophe PLAGNIOL-VILLARD
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@atmel.com \
--cc=linux-arm-kernel@lists.infradead.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).