linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	jg1.han@samsung.com,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-sh@vger.kernel.org" <linux-sh@vger.kernel.org>,
	"linux-fbdev@vger.kernel.org" <linux-fbdev@vger.kernel.org>,
	Paul Mundt <lethal@linux-sh.org>,
	Magnus Damm <magnus.damm@gmail.com>,
	Richard Purdie <rpurdie@rpsys.net>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Subject: Re: [PATCH 1/5] backlight: Add GPIO-based backlight driver
Date: Mon, 26 Nov 2012 11:59:10 +0000	[thread overview]
Message-ID: <1701286.svlH7lvIeJ@avalon> (raw)
In-Reply-To: <50B347F4.2080705@metafoo.de>

Hi Lars-Peter,

On Monday 26 November 2012 11:44:04 Lars-Peter Clausen wrote:
> On 11/26/2012 10:49 AM, Jingoo Han wrote:
> > On Saturday, November 24, 2012 1:35 AM, Laurent Pinchart wrote
> 
> [...]
> 
> >> +static int gpio_backlight_check_fb(struct backlight_device *bl,
> >> +				   struct fb_info *info)
> >> +{
> >> +	struct gpio_backlight *gbl = bl_get_data(bl);
> >> +
> >> +	return gbl->fbdev = info->dev;
> 
> I think it makes sense to return true if fbdev is NULL, to provide a simple
> fallback for systems with only one framebuffer device.

Agreed, I'll change that.

> >> +}
> >> +
> 
> [...]
> 
> >> +#ifdef CONFIG_PM
> >> +static int gpio_backlight_suspend(struct device *dev)
> >> +{
> >> +	struct backlight_device *bl = dev_get_drvdata(dev);
> >> +	struct gpio_backlight *gbl = bl_get_data(bl);
> >> +
> >> +	gpio_set_value(gbl->gpio, !gbl->active);
> >> +
> >> +	return 0;
> >> +}
> >> +
> >> +static int gpio_backlight_resume(struct device *dev)
> >> +{
> >> +	struct backlight_device *bl = dev_get_drvdata(dev);
> >> +
> >> +	backlight_update_status(bl);
> >> +	return 0;
> >> +}
> 
> If you use BL_CORE_SUSPENDRESUME you can get rid of the custom
> suspend/resume handlers.

Good point, I'll do that.

> >> +
> >> +static SIMPLE_DEV_PM_OPS(gpio_backlight_pm_ops, gpio_backlight_suspend,
> >> +			 gpio_backlight_resume);
> >> +
> >> +#endif
> >> +

-- 
Regards,

Laurent Pinchart


  reply	other threads:[~2012-11-26 11:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-23 16:35 [PATCH 1/5] backlight: Add GPIO-based backlight driver Laurent Pinchart
2012-11-26  9:49 ` Jingoo Han
2012-11-26 10:25   ` Laurent Pinchart
2012-11-26 10:44   ` Lars-Peter Clausen
2012-11-26 11:59     ` Laurent Pinchart [this message]
2012-11-27  1:10 ` Jingoo Han
2012-11-27 11:54   ` Laurent Pinchart
2012-11-27  1:24 ` Jingoo Han

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=1701286.svlH7lvIeJ@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=akpm@linux-foundation.org \
    --cc=jg1.han@samsung.com \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lars@metafoo.de \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=rpurdie@rpsys.net \
    /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).