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]
Date:   Thu, 13 May 2021 14:21:32 +0930
From:   "Andrew Jeffery" <andrew@...id.au>
To:     "Eddie James" <eajames@...ux.ibm.com>, linux-leds@...r.kernel.org
Cc:     linux-kernel@...r.kernel.org, "Pavel Machek" <pavel@....cz>,
        "Jacek Anaszewski" <jacek.anaszewski@...il.com>, robh+dt@...nel.or,
        devicetree@...r.kernel.org, vishwa@...ux.ibm.com
Subject: Re: [PATCH 2/5] leds: leds-core: Implement the retain-state-shutdown property



On Fri, 30 Apr 2021, at 06:19, Eddie James wrote:
> Read the retain-state-shutdown device tree property to set the
> existing LED_RETAIN_AT_SHUTDOWN flag. Then check the flag when
> unregistering, and if set, don't set the brightness to OFF. This
> is useful for systems that want to keep the HW state of the LED
> across reboots.
> 
> Signed-off-by: Eddie James <eajames@...ux.ibm.com>
> ---
>  drivers/leds/led-class.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c
> index 2e495ff67856..f2f29318d312 100644
> --- a/drivers/leds/led-class.c
> +++ b/drivers/leds/led-class.c
> @@ -354,10 +354,15 @@ int led_classdev_register_ext(struct device *parent,
>  		if (ret < 0)
>  			return ret;
>  
> -		if (init_data->fwnode)
> +		if (init_data->fwnode) {
>  			fwnode_property_read_string(init_data->fwnode,
>  				"linux,default-trigger",
>  				&led_cdev->default_trigger);
> +
> +			if (fwnode_property_present(init_data->fwnode,
> +						    "retain-state-shutdown"))
> +				led_cdev->flags |= LED_RETAIN_AT_SHUTDOWN;

This is what we need, but I notice the pca955x driver is calling 
through devm_led_classdev_register() which passes NULL through 
init_data. So we won't get the result we want from this series as I 
understand it.

Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ