Re: [PATCH v7 11/12] leds: Add common LED binding parsing support to LED class/core

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Again Pavel,

On Sat, 2019-12-21 at 20:37 +0100, Pavel Machek wrote:
> > +static void led_add_props(struct led_classdev *ld, struct
> > led_properties *props)
> > +{
> > +	if (props->default_trigger)
> > +		ld->default_trigger = props->default_trigger;
> > +	/*
> > +	 * According to binding docs the LED is by-default turned OFF
> > unless
> > +	 * default_state is used to indicate it should be ON or that
> > state
> > +	 * should be kept as is
> > +	 */
> > +	if (props->default_state) {
> > +		ld->brightness = LED_OFF;
> > +		if (!strcmp(props->default_state, "on"))
> > +			ld->brightness = LED_FULL;
> 
> Max brightness is not always == LED_FULL these days.

I took another look at this and changed this to:

if (!strcmp(props->default_state, "on")) {
	if (!ld->max_brightness)
		ld->brightness = LED_FULL;
	else
		ld->brightness = ld->max_brightness;
}

I hope this is what you were suggesting. I'll send the v8 (hopefully)
soon(ish).

Best Regards
	Matti




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux