Commit d8646452 authored by Dylan Van Assche's avatar Dylan Van Assche Committed by Pavel Machek
Browse files

leds: gpio: Set max brightness to 1



GPIO LEDs only know 2 states: ON or OFF and do not have PWM capabilities.
However, the max brightness is reported as 255.

This patch sets the max brightness value of a GPIO controlled LED to 1.

Tested on my PinePhone 1.2.

Signed-off-by: default avatarDylan Van Assche <me@dylanvanassche.be>
Signed-off-by: default avatarPavel Machek <pavel@ucw.cz>
parent 6c3384d8
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -96,7 +96,8 @@ static int create_gpio_led(const struct gpio_led *template,
	} else {
		state = (template->default_state == LEDS_GPIO_DEFSTATE_ON);
	}
	led_dat->cdev.brightness = state ? LED_FULL : LED_OFF;
	led_dat->cdev.brightness = state;
	led_dat->cdev.max_brightness = 1;
	if (!template->retain_state_suspended)
		led_dat->cdev.flags |= LED_CORE_SUSPENDRESUME;
	if (template->panic_indicator)