mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
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:
@@ -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];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user