Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pwm: Set class for exported channels in sysfs
Summary: This patch sends a uevent (KOBJ_CHANGE) on the pwmchipN device, everytime a pwmX channel has been exported/unexported via sysfs. This allows udev to implement rules on such events, like: SUBSYSTEM=="pwm*", PROGRAM="/bin/sh -c '\ chown -R root:gpio /sys/class/pwm && chmod -R 770 /sys/class/pwm;\ chown -R root:gpio /sys/devices/platform/soc/*.pwm/pwm/pwmchip* && chmod -R 770 /sys/devices/platform/soc/*.pwm/pwm/pwmchip*\ '" basic testing: $ udevadm monitor --environment & $ echo 0 > /sys/class/pwm/pwmchip0/export KERNEL[68.967366] change /devices/platform/soc/a500d000.pwm/pwm/pwmchip0 (pwm) ACTION=change DEVPATH=/devices/platform/soc/a500d000.pwm/pwm/pwmchip0 SUBSYSTEM=pwm UNEXPORT=pwm0 SEQNUM=2007 Signed-off-by: yaqiang.li <[email protected]>
- Loading branch information