misc: ws2812-pio-rp1: Add pass-through mode

Pass-through mode disables all gamma and brightness processing, sending
the raw pixel data directly to the LEDs. It is enabled by setting the
brightness to zero, either in Device Tree or using the runtime method of
writing a single byte (in this case 0) to the device.

See: https://github.com/raspberrypi/linux/issues/7108

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
This commit is contained in:
Phil Elwell
2025-10-26 17:05:51 +00:00
committed by Dom Cobley
parent 85d67e5a13
commit 8e34e61626

View File

@@ -142,8 +142,8 @@ static uint8_t ws2812_apply_gamma(uint8_t brightness, uint8_t val)
{
int bright;
if (!val)
return 0;
if (!val || !brightness)
return val;
bright = (val * brightness) / 255;
return ws2812_gamma[bright];
}