Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion arch/arm/boot/dts/overlays/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,8 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
waveshare-can-fd-hat-mode-a.dtbo \
waveshare-can-fd-hat-mode-b.dtbo \
wittypi.dtbo \
wm8960-soundcard.dtbo
wm8960-soundcard.dtbo \
ws2812-pio.dtbo

targets += dtbs dtbs_install
targets += $(dtbo-y)
Expand Down
22 changes: 22 additions & 0 deletions arch/arm/boot/dts/overlays/README
Original file line number Diff line number Diff line change
Expand Up @@ -5599,6 +5599,28 @@ Params: alsaname Changes the card name in ALSA
compatible Changes the codec compatibility


Name: ws2812-pio
Info: Configures a GPIO pin to drive a string of WS2812 LEDS using pio. It
can be enabled on any RP1 GPIO in bank 0 (0-27). Up to 4 are supported,
assuming nothing else is using PIO. Pi 5 only.
Load: dtoverlay=ws2812-pio,<param>=<val>
Params: brightness Set the initial brightness for the LEDs. The
brightness can be changed at runtime by writing
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)
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')
gpio Output GPIO (0-27, default 4)
num_leds Number of LEDs (default 60)
rgbw 'rgbw=on' (or 'rgbw') indicates that each pixel
includes a white LED as well as the usual red,
green and blue. (default 'off')


Troubleshooting
===============

Expand Down
46 changes: 46 additions & 0 deletions arch/arm/boot/dts/overlays/ws2812-pio-overlay.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// SPDX-License-Identifier: GPL-2.0
// Device tree overlay for RP1 PIO WS2812 driver.
/dts-v1/;
/plugin/;

/ {
compatible = "brcm,bcm2712";

fragment@0 {
target = <&gpio>;
__overlay__ {
ws2812_pio_pins: ws2812_pio_pins@4 {
brcm,pins = <4>; /* gpio 4 */
function = "pio";
bias-disable;
};
};
};

fragment@1 {
target-path = "/";
__overlay__ {
ws2812_pio: ws2812_pio@4 {
compatible = "raspberrypi,ws2812-pio-rp1";
pinctrl-names = "default";
pinctrl-0 = <&ws2812_pio_pins>;
dev-name = "leds%d";
leds-gpios = <&gpio 4 0>;
rpi,num-leds = <60>;
rpi,brightness = <255>;
};
};
};

__overrides__ {
brightness = <&ws2812_pio>, "rpi,brightness:0";
dev_name = <&ws2812_pio>, "dev-name";
gpio = <&ws2812_pio>,"leds-gpios:4",
<&ws2812_pio_pins>,"brcm,pins:0",
/* modify reg values to allow multiple instantiation */
<&ws2812_pio>,"reg:0",
<&ws2812_pio_pins>,"reg:0";
num_leds = <&ws2812_pio>, "rpi,num-leds:0";
rgbw = <&ws2812_pio>, "rpi,rgbw?";
};
};
2 changes: 2 additions & 0 deletions arch/arm64/configs/bcm2711_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
# CONFIG_BRCMSTB_GISB_ARB is not set
CONFIG_RASPBERRYPI_FIRMWARE=y
CONFIG_FIRMWARE_RP1=m
# CONFIG_EFI_VARS_PSTORE is not set
CONFIG_MTD=m
CONFIG_MTD_BLOCK=m
Expand All @@ -475,6 +476,7 @@ CONFIG_BLK_DEV_RBD=m
CONFIG_BLK_DEV_NVME=y
CONFIG_NVME_HWMON=y
CONFIG_RP1_PIO=m
CONFIG_WS2812_PIO_RP1=m
CONFIG_SRAM=y
CONFIG_EEPROM_AT24=m
CONFIG_EEPROM_AT25=m
Expand Down
2 changes: 2 additions & 0 deletions arch/arm64/configs/bcm2712_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@ CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
# CONFIG_BRCMSTB_GISB_ARB is not set
CONFIG_RASPBERRYPI_FIRMWARE=y
CONFIG_FIRMWARE_RP1=m
# CONFIG_EFI_VARS_PSTORE is not set
CONFIG_MTD=m
CONFIG_MTD_BLOCK=m
Expand All @@ -478,6 +479,7 @@ CONFIG_BLK_DEV_RBD=m
CONFIG_BLK_DEV_NVME=y
CONFIG_NVME_HWMON=y
CONFIG_RP1_PIO=m
CONFIG_WS2812_PIO_RP1=m
CONFIG_SRAM=y
CONFIG_EEPROM_AT24=m
CONFIG_EEPROM_AT25=m
Expand Down
12 changes: 11 additions & 1 deletion drivers/misc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,22 @@ config BCM2835_SMI

config RP1_PIO
tristate "Raspberry Pi RP1 PIO driver"
select FIRMWARE_RP1
depends on FIRMWARE_RP1 || COMPILE_TEST
default n
help
Driver providing control of the Raspberry Pi PIO block, as found in
RP1.

config WS2812_PIO_RP1
tristate "Raspberry Pi PIO-base WS2812 driver"
depends on RP1_PIO || COMPILE_TEST
default n
help
Driver for the WS2812 (NeoPixel) LEDs using the RP1 PIO hardware.
The driver creates a character device to which rgbw pixels may be
written. Single-byte writes to offset 0 set the brightness at
runtime.

config AD525X_DPOT
tristate "Analog Devices Digital Potentiometers"
depends on (I2C || SPI) && SYSFS
Expand Down
1 change: 1 addition & 0 deletions drivers/misc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ obj-$(CONFIG_PHANTOM) += phantom.o
obj-$(CONFIG_QCOM_COINCELL) += qcom-coincell.o
obj-$(CONFIG_QCOM_FASTRPC) += fastrpc.o
obj-$(CONFIG_RP1_PIO) += rp1-pio.o
obj-$(CONFIG_WS2812_PIO_RP1) += ws2812-pio-rp1.o
obj-$(CONFIG_SENSORS_BH1770) += bh1770glc.o
obj-$(CONFIG_SENSORS_APDS990X) += apds990x.o
obj-$(CONFIG_ENCLOSURE_SERVICES) += enclosure.o
Expand Down
Loading
Loading