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:
@@ -5986,8 +5986,10 @@ Params: brightness Set the initial brightness for the LEDs. The
|
||||
a single byte to offset 0 of the device. Note
|
||||
that brightness is a multiplier for the pixel
|
||||
values, and only white pixels can reach the
|
||||
maximum visible brightness. (range 0-255,
|
||||
default 255)
|
||||
maximum visible brightness. N.B. Setting
|
||||
brightness to 0 acctivates pass-through mode,
|
||||
disabling all brightness and gamma processing.
|
||||
(range 0-255, default 255)
|
||||
dev_name The name for the /dev/ device entry. Note that
|
||||
if the name includes '%d' it will be replaced
|
||||
by the instance number. (default 'leds%d')
|
||||
|
||||
@@ -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