Add PWM support for Raspberry Pi 5 (RP1/PIO) #1317
                
     Open
            
            
          
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Add support for GPIO PWM for Raspberry Pi 5 using its RP1/PIO controller.
1 Requires root! Works only for Raspberry Pi 5 or newer if equipped with RP1 controller.
2 Must define LED strip in the overlay first!
echo "dtoverlay=ws2812-pio,gpio=18,num_leds=30,rgbw" | sudo tee -a /boot/firmware/config.txtor edit
/boot/firmware/config.txtmanuallynum_leds: total number of LEDs, must be configured the same in HyperHDRrgbwonly for sk6812 RGBW, otherwise remove itWarning
Requires fixed ws2812 PIO kernel module: raspberrypi/linux#7108
As for 2025-10-29 you need to switch Trixie kernel to testing kernel version and reboot:
sudo rpi-update beb2783757e6aa6c4abe4187dc74da4ce2f451fcIt will be included in the next RPi OS release for kernel > 6.12.55
Testing setup:
Results of testing using fixed kernel module:



Kernel driver hardcoded gamma causing its useless:input 1–6 → 0,
input 7–8 → 1,
…
input 128 → 55 (0x37),
input 224 → 191 (0xBF),
input 255 → 255.
so it makes from LED strip capable of rendering 256x256x256 colors something inferior that is capable of rendering around 120x120x120 even if we would reverse that unfortunate gamma on our side (set: user gamma to 0.4545 in the processing tab) due to the gamma compression