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] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LNX.2.00.1004271525330.9849@pobox.suse.cz>
Date:	Tue, 27 Apr 2010 15:28:12 +0200 (CEST)
From:	Jiri Kosina <jkosina@...e.cz>
To:	Bruno Prémont <bonbons@...ux-vserver.org>
Cc:	Oliver Neukum <oliver@...kum.org>,
	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	linux-input@...r.kernel.org, linux-usb@...r.kernel.org,
	linux-kernel@...r.kernel.org, Nicu Pavel <npavel@...ner.com>,
	Jaya Kumar <jayakumar.lkml@...il.com>,
	"Rick L. Vinyard Jr." <rvinyard@...nmsu.edu>
Subject: Re: [PATCH 2/2] hid: add PM support to PicoLCD device

On Sun, 25 Apr 2010, Bruno Prémont wrote:

> Add PM support in order to turn off backlight on suspend, restore
> it on resume and especially restore complete state on reset-resume.
> 
> Signed-off-by: Bruno Prémont <bonbons@...ux-vserver.org>
> ---
>  drivers/hid/hid-picolcd.c |   61 +++++++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 61 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/hid/hid-picolcd.c b/drivers/hid/hid-picolcd.c
> index aa6f2e1..c652390 100644
> --- a/drivers/hid/hid-picolcd.c
> +++ b/drivers/hid/hid-picolcd.c
> @@ -852,6 +852,20 @@ static inline int picolcd_resume_backlight(struct picolcd_data *data)
>  	return picolcd_set_brightness(data->backlight);
>  }
>  
> +#ifdef CONFIG_PM
> +static void picolcd_suspend_backlight(struct picolcd_data *data)
> +{
> +	int bl_power = data->lcd_power;
> +	if (!data->backlight)
> +		return;
> +
> +	data->backlight->props.power = FB_BLANK_POWERDOWN;
> +	picolcd_set_brightness(data->backlight);
> +	data->lcd_power = data->backlight->props.power = bl_power;
> +}
> +#else
> +#define picolcd_suspend_backlight(a)
> +#endif /* CONFIG_PM */

Stylistic thing -- it would be nice if this was actually 

static inline void picolcd_suspend_backlight(struct picolcd_data *data)
{
	return 0;
}

But why do you need to have it defined in !CONFIG_PM situation anyway? 
It's not used otherwise at all.

>  #else
>  static inline int picolcd_init_backlight(struct picolcd_data *data,
>  		struct hid_report *report)
> @@ -865,6 +879,7 @@ static inline int picolcd_resume_backlight(struct picolcd_data *data)
>  {
>  	return 0;
>  }
> +#define picolcd_suspend_backlight(a)

Any why is it defined once more here?

Thanks,

-- 
Jiri Kosina
SUSE Labs, Novell Inc.
--
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