lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1701286.svlH7lvIeJ@avalon>
Date:	Mon, 26 Nov 2012 12:59:10 +0100
From:	Laurent Pinchart <laurent.pinchart@...asonboard.com>
To:	Lars-Peter Clausen <lars@...afoo.de>
Cc:	Laurent Pinchart <laurent.pinchart+renesas@...asonboard.com>,
	jg1.han@...sung.com,
	"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-sh@...r.kernel.org" <linux-sh@...r.kernel.org>,
	"linux-fbdev@...r.kernel.org" <linux-fbdev@...r.kernel.org>,
	Paul Mundt <lethal@...ux-sh.org>,
	Magnus Damm <magnus.damm@...il.com>,
	Richard Purdie <rpurdie@...ys.net>,
	Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>
Subject: Re: [PATCH 1/5] backlight: Add GPIO-based backlight driver

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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ