diff options
author | Paul Oliver <contact@pauloliver.dev> | 2025-07-02 15:06:35 +0200 |
---|---|---|
committer | Paul Oliver <contact@pauloliver.dev> | 2025-08-13 23:54:10 +0000 |
commit | 8fe62292f18f4577303a868a8557b0486b218bcb (patch) | |
tree | cb9a9108eea479e932f37d03cf399b680e3886b2 /sysconf/99-pwm.rules | |
parent | 0be7f1274e0cb8406bd4262b86d5e2e9dda77d7a (diff) |
Code now uses `effectful` to manage side-effects
Diffstat (limited to 'sysconf/99-pwm.rules')
-rw-r--r-- | sysconf/99-pwm.rules | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sysconf/99-pwm.rules b/sysconf/99-pwm.rules index 8407ebe..59ba681 100644 --- a/sysconf/99-pwm.rules +++ b/sysconf/99-pwm.rules @@ -1,9 +1,11 @@ -# This UDEV rule provides the `pwm` user group with access to PWM devices. -# Note that UDEV operates asynchronously, so there may be a slight delay -# between changes to the directory structure (e.g., when a new PWM channel is -# added) and the corresponding permission updates. To ensure the rule has been -# fully applied, you can use the command `udevadm settle` to wait for the UDEV -# process to complete. +# 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 ; \ |