# Grants 'pwm' group RW access to Raspberry Pi PWM sysfs interfaces # # Handles both: # - Standard /sys/class/pwm paths # - RPi5-specific PCIe PWM controllers (/sys/devices/platform/axi/...) # # Note: For race-free operation, check file writability (not just existence) # using `access(2)` before attempting operations. SUBSYSTEM=="pwm*", PROGRAM="/bin/sh -c ' \ chown -R root:pwm /sys/class/pwm ; \ chmod -R 770 /sys/class/pwm ; \ chown -R root:pwm /sys/devices/platform/axi/1000120000.pcie/*.pwm/pwm/pwmchip* ; \ chmod -R 770 /sys/devices/platform/axi/1000120000.pcie/*.pwm/pwm/pwmchip* ; \ '"