Skip to content

main/linux-postmarketos-allwinner: set leds-gpio max_brightness to 1

Administrator requested to merge allwinner-leds-max-brightness into master

Description

LEDs controlled through the leds-gpio driver can only have 2 states: ON or OFF. However, the max_brightness property in the sysfs interface reports a maximum value of 255 indicating that the LED supports PWM which is not true. This patch forces the max_brightness to 1 matching LED_ON in include/linux/leds.h instead of 255 matching LED_FULL.

Applying this patch improves the LED indicator on the PinePhone with feedbackd under Phosh. Feedbackd indicates different notification types by using a different blink interval and makes use of the max_brightness property. max_brightness is used for PWM control, but that's not the case for GPIO controlled LEDs. As a consequence, the LED doesn't follow the blink interval defined in the feedbackd configuration file.

Tested on

Tested on the PinePhone 1.2a pmOS convergence edition.

Note

Input is welcome on improving this patch to make this upstreamable, I used this patch: https://gitlab.com/mobian1/devices/sunxi64-linux/-/commit/6548fe0eb1dcde89612ece6c1a88806110aae260 from Mobian as a baseline. Since PWM capable LEDs are controlled with the leds-pwm driver, leds-gpio driven LEDs can be forced to 1 as done by other LED drivers in the kernel tree.

Edited by Administrator

Merge request reports

Loading