Skip to content

Commit 6f39291

Browse files
committed
misc: Add ws2812-pio-rp1 driver
ws2812-pio-rp1 is a PIO-based driver for WS2812 LEDS. It creates a character device in /dev, the default name of which is /dev/leds<n>, where <n> is the instance number. The number of LEDS should be set in the DT overlay, as should whether it is RGB or RGBW, and the default brightness. Write data to the /dev/* entry in a 4 bytes-per-pixel format in RGBW order: RR GG BB WW RR GG BB WW ... The white values are ignored unless the rgbw flag is set for the device. To change the brightness, write a single byte to offset 0, 255 being full brightness and 0 being off. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
1 parent d964ab5 commit 6f39291

File tree

3 files changed

+518
-0
lines changed

3 files changed

+518
-0
lines changed

drivers/misc/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@ config RP1_PIO
2525
Driver providing control of the Raspberry Pi PIO block, as found in
2626
RP1.
2727

28+
config WS2812_PIO_RP1
29+
tristate "Raspberry Pi PIO-base WS2812 driver"
30+
depends on RP1_PIO || COMPILE_TEST
31+
default n
32+
help
33+
Driver for the WS2812 (NeoPixel) LEDs using the RP1 PIO hardware.
34+
The driver creates a character device to which rgbw pixels may be
35+
written. Single-byte writes to offset 0 set the brightness at
36+
runtime.
37+
2838
config AD525X_DPOT
2939
tristate "Analog Devices Digital Potentiometers"
3040
depends on (I2C || SPI) && SYSFS

drivers/misc/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ obj-$(CONFIG_RPMB) += rpmb-core.o
2020
obj-$(CONFIG_QCOM_COINCELL) += qcom-coincell.o
2121
obj-$(CONFIG_QCOM_FASTRPC) += fastrpc.o
2222
obj-$(CONFIG_RP1_PIO) += rp1-pio.o
23+
obj-$(CONFIG_WS2812_PIO_RP1) += ws2812-pio-rp1.o
2324
obj-$(CONFIG_SENSORS_BH1770) += bh1770glc.o
2425
obj-$(CONFIG_SENSORS_APDS990X) += apds990x.o
2526
obj-$(CONFIG_ENCLOSURE_SERVICES) += enclosure.o

0 commit comments

Comments
 (0)