Files
linux/drivers/pwm
Fabrice Gasnier 2469c51d2e pwm: Send a uevent on the pwmchip device upon channel sysfs (un)export
commit 552c02e3e7 upstream.

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*\
'"

This is a replacement patch for commit 7e5d1fd75c ("pwm: Set class for
exported channels in sysfs"), see [1].

basic testing:
$ udevadm monitor --environment &
$ echo 0 > /sys/class/pwm/pwmchip0/export
KERNEL[197.321736] change   /devices/.../pwm/pwmchip0 (pwm)
ACTION=change
DEVPATH=/devices/.../pwm/pwmchip0
EXPORT=pwm0
SEQNUM=2045
SUBSYSTEM=pwm

[1] https://lkml.org/lkml/2018/9/25/713

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Tested-by: Gottfried Haider <gottfried.haider@gmail.com>
Tested-by: Michal Vokáč <michal.vokac@ysoft.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2019-04-02 12:56:05 +01:00
..
2017-07-06 08:29:16 +02:00
2018-08-20 11:36:07 +02:00
2018-03-26 15:57:08 +02:00
2018-04-30 10:40:57 +02:00
2017-04-06 17:45:03 +02:00
2017-11-15 10:38:37 +01:00
2018-07-09 18:59:14 +02:00
2018-08-20 11:32:25 +02:00
2018-07-12 09:03:06 +02:00
2017-01-19 00:38:17 +01:00
2018-04-30 10:40:57 +02:00
2017-08-21 08:11:24 +02:00