aboutsummaryrefslogtreecommitdiff
path: root/sysconf/99-pwm.rules
blob: 59ba681b2639c38daf798d0254574e06507fe1a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# 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* ; \
'"